linux/fs/nilfs2
Ryusuke Konishi fe0627e7b3 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>
2012-07-30 17:25:19 -07:00
..
alloc.c
alloc.h
bmap.c
bmap.h
btnode.c
btnode.h
btree.c
btree.h
cpfile.c nilfs2: fix timing issue between rmcp and chcp ioctls 2012-07-30 17:25:19 -07:00
cpfile.h
dat.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
dat.h
dir.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
direct.c
direct.h
export.h
file.c nilfs2: flush disk caches in syncing 2012-05-31 17:49:27 -07:00
gcinode.c nilfs2: ensure proper cache clearing for gc-inodes 2012-06-20 14:39:35 -07:00
ifile.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
ifile.h
inode.c vfs: Rename end_writeback() to clear_inode() 2012-05-06 13:43:41 +08:00
ioctl.c nilfs2: flush disk caches in syncing 2012-05-31 17:49:27 -07:00
Kconfig
Makefile
mdt.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
mdt.h
namei.c don't pass nameidata to ->create() 2012-07-14 16:34:47 +04:00
nilfs.h
page.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
page.h
recovery.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
segbuf.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
segbuf.h
segment.c nilfs2: ensure proper cache clearing for gc-inodes 2012-06-20 14:39:35 -07:00
segment.h
sufile.c nilfs2: remove the second argument of k[un]map_atomic() 2012-03-20 21:48:24 +08:00
sufile.h
super.c nilfs2: remove references to long gone super operations 2012-07-30 17:25:19 -07:00
the_nilfs.c nilfs2: fix NULL pointer dereference in nilfs_load_super_block() 2012-03-16 17:14:44 -07:00
the_nilfs.h nilfs2: add omitted comment for ns_mount_state field of the_nilfs structure 2012-07-30 17:25:19 -07:00