freeze_bdev: grab active reference to frozen superblocks
authorChristoph Hellwig <hch@lst.de>
Mon, 3 Aug 2009 21:28:35 +0000 (23:28 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 24 Sep 2009 11:47:41 +0000 (07:47 -0400)
commit4504230a71566785a05d3e6b53fa1ee071b864eb
treee73070fcad99b800f0324992c392d44c6dddc97c
parent4fadd7bb20a1e7c774ed88dc703d8fbcd00ff917
freeze_bdev: grab active reference to frozen superblocks

Currently we held s_umount while a filesystem is frozen, despite that we
might return to userspace and unlock it from a different process.  Instead
grab an active reference to keep the file system busy and add an explicit
check for frozen filesystems in remount and reject the remount instead
of blocking on s_umount.

Add a new get_active_super helper to super.c for use by freeze_bdev that
grabs an active reference to a superblock from a given block device.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/block_dev.c
fs/super.c
include/linux/fs.h