diff options
author | Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp> | 2012-07-30 14:42:05 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-30 17:25:19 -0700 |
commit | fe0627e7b3d32a41c16fac6e0af091991545865e (patch) | |
tree | d2b358827dff033691a5ce145334f7e3f7b0c5bf /fs/nilfs2/ioctl.c | |
parent | 278038ac53c6c4f53d1d34f978beb9aba1410b2c (diff) | |
download | op-kernel-dev-fe0627e7b3d32a41c16fac6e0af091991545865e.zip op-kernel-dev-fe0627e7b3d32a41c16fac6e0af091991545865e.tar.gz |
nilfs2: fix timing issue between rmcp and chcp ioctls
The checkpoint deletion ioctl (rmcp ioctl) has potential for breaking
snapshot because it is not fully exclusive with checkpoint mode change
ioctl (chcp ioctl).
The rmcp ioctl first tests if the specified checkpoint is a snapshot or
not within nilfs_cpfile_delete_checkpoint function, and then calls
nilfs_cpfile_delete_checkpoints function to actually invalidate the
checkpoint only if it's not a snapshot. However, the checkpoint can be
changed into a snapshot by the chcp ioctl between these two operations.
In that case, calling nilfs_cpfile_delete_checkpoints() wrongly
invalidates the snapshot, which leads to snapshot list corruption and
snapshot count mismatch.
This fixes the issue by changing nilfs_cpfile_delete_checkpoints() so
that it reconfirms the target checkpoints are snapshot or not.
This second check is exclusive with the chcp operation since it is
protected by an existing semaphore.
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: Fernando Luis Vazquez Cao <fernando@oss.ntt.co.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/nilfs2/ioctl.c')
0 files changed, 0 insertions, 0 deletions