1
0
Fork 0
alistair23-linux/fs/nilfs2
Ryusuke Konishi e59399d010 nilfs2: correct exclusion control in nilfs_remount function
nilfs_remount() changes mount state of a superblock instance.  Even
though nilfs accesses other superblock instances during mount or
remount, the mount state was not properly protected in
nilfs_remount().

Moreover, nilfs_remount() has a lock order reversal problem;
nilfs_get_sb() holds:

  1. bdev->bd_mount_sem
  2. sb->s_umount  (sget acquires)

and nilfs_remount() holds:

  1. sb->s_umount  (locked by the caller in vfs)
  2. bdev->bd_mount_sem

To avoid these problems, this patch divides a semaphore protecting
super block instances from nilfs->ns_sem, and applies it to the mount
state protection in nilfs_remount().

With this change, bd_mount_sem use is removed from nilfs_remount() and
the lock order reversal will be resolved.  And the new rw-semaphore,
nilfs->ns_super_sem will properly protect the mount state except the
modification from nilfs_error function.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2009-06-11 21:36:18 -04:00
..
Makefile nilfs2: update makefile and Kconfig 2009-04-07 08:31:16 -07:00
alloc.c nilfs2: persistent object allocator 2009-04-07 08:31:13 -07:00
alloc.h nilfs2: persistent object allocator 2009-04-07 08:31:13 -07:00
bmap.c nilfs2: fix lockdep recursive locking warning on bmap 2009-04-13 09:53:49 +09:00
bmap.h nilfs2: integrated block mapping 2009-04-07 08:31:13 -07:00
bmap_union.h nilfs2: integrated block mapping 2009-04-07 08:31:13 -07:00
btnode.c nilfs2: B-tree node cache 2009-04-07 08:31:13 -07:00
btnode.h nilfs2: B-tree node cache 2009-04-07 08:31:13 -07:00
btree.c nilfs2: replace BUG_ON and BUG calls triggerable from ioctl 2009-04-07 08:31:19 -07:00
btree.h nilfs2: B-tree based block mapping 2009-04-07 08:31:13 -07:00
cpfile.c nilfs2: fix bh leak in nilfs_cpfile_delete_checkpoints function 2009-05-30 22:07:50 +09:00
cpfile.h nilfs2: fix gc failure on volumes keeping numerous snapshots 2009-04-07 08:31:17 -07:00
dat.c nilfs2: replace BUG_ON and BUG calls triggerable from ioctl 2009-04-07 08:31:19 -07:00
dat.h nilfs2: disk address translator 2009-04-07 08:31:14 -07:00
dir.c nilfs2: use unlocked_ioctl 2009-04-07 08:31:19 -07:00
direct.c nilfs2: replace BUG_ON and BUG calls triggerable from ioctl 2009-04-07 08:31:19 -07:00
direct.h nilfs2: direct block mapping 2009-04-07 08:31:13 -07:00
file.c nilfs2: use unlocked_ioctl 2009-04-07 08:31:19 -07:00
gcdat.c nilfs2: another dat for garbage collection 2009-04-07 08:31:16 -07:00
gcinode.c nilfs2: support nanosecond timestamp 2009-04-07 08:31:20 -07:00
ifile.c nilfs2: inode map file 2009-04-07 08:31:14 -07:00
ifile.h nilfs2: inode map file 2009-04-07 08:31:14 -07:00
inode.c nilfs2: support nanosecond timestamp 2009-04-07 08:31:20 -07:00
ioctl.c nilfs2: fix memory leak in nilfs_ioctl_clean_segments 2009-05-22 20:49:04 +09:00
mdt.c nilfs2: ensure to clear dirty state when deleting metadata file block 2009-05-10 17:04:42 +09:00
mdt.h nilfs2: meta data file 2009-04-07 08:31:13 -07:00
namei.c nilfs2: avoid double error caused by nilfs_transaction_end 2009-04-07 08:31:17 -07:00
nilfs.h nilfs2: fix lock order reversal in nilfs_clean_segments ioctl 2009-05-11 14:54:41 +09:00
page.c nilfs2: ensure to clear dirty state when deleting metadata file block 2009-05-10 17:04:42 +09:00
page.h nilfs2: buffer and page operations 2009-04-07 08:31:13 -07:00
recovery.c nilfs2: fix possible recovery failure due to block creation without writer 2009-05-09 13:36:56 +09:00
sb.h nilfs2: simplify remaining sget() use 2009-06-11 21:36:18 -04:00
segbuf.c nilfs2: simplify handling of active state of segments 2009-04-07 08:31:20 -07:00
segbuf.h nilfs2: simplify handling of active state of segments 2009-04-07 08:31:20 -07:00
seglist.h nilfs2: segment constructor 2009-04-07 08:31:15 -07:00
segment.c nilfs2: fix lock order reversal in nilfs_clean_segments ioctl 2009-05-11 14:54:41 +09:00
segment.h nilfs2: fix lock order reversal in nilfs_clean_segments ioctl 2009-05-11 14:54:41 +09:00
sufile.c nilfs2: fix possible mismatch of sufile counters on recovery 2009-04-13 09:53:52 +09:00
sufile.h nilfs2: fix possible mismatch of sufile counters on recovery 2009-04-13 09:53:52 +09:00
super.c nilfs2: correct exclusion control in nilfs_remount function 2009-06-11 21:36:18 -04:00
the_nilfs.c nilfs2: correct exclusion control in nilfs_remount function 2009-06-11 21:36:18 -04:00
the_nilfs.h nilfs2: correct exclusion control in nilfs_remount function 2009-06-11 21:36:18 -04:00