enforce ->sync_fs is only called for rw superblock
authorChristoph Hellwig <hch@lst.de>
Tue, 5 May 2009 13:41:25 +0000 (15:41 +0200)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 12 Jun 2009 01:36:06 +0000 (21:36 -0400)
commit5af7926ff33b68b3ba46531471c6e0564b285efc
treea25266f9db482ce9dd8e663148ffb0f1a524bd83
parente5004753388dcf5e1b8a52ac0ab807d232340fbb
enforce ->sync_fs is only called for rw superblock

Make sure a superblock really is writeable by checking MS_RDONLY
under s_umount.  sync_filesystems needed some re-arragement for
that, but all but one sync_filesystem caller had the correct locking
already so that we could add that check there.  cachefiles grew
s_umount locking.

I've also added a WARN_ON to sync_filesystem to assert this for
future callers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/btrfs/super.c
fs/cachefiles/interface.c
fs/reiserfs/super.c
fs/sync.c
fs/ubifs/super.c