diff options
author | Christoph Hellwig <hch@lst.de> | 2009-05-05 09:41:25 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2009-06-11 21:36:06 -0400 |
commit | 5af7926ff33b68b3ba46531471c6e0564b285efc (patch) | |
tree | a25266f9db482ce9dd8e663148ffb0f1a524bd83 /fs/cachefiles/interface.c | |
parent | e5004753388dcf5e1b8a52ac0ab807d232340fbb (diff) |
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>
Diffstat (limited to 'fs/cachefiles/interface.c')
-rw-r--r-- | fs/cachefiles/interface.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/cachefiles/interface.c b/fs/cachefiles/interface.c index dafd484d7bda..431accd475a7 100644 --- a/fs/cachefiles/interface.c +++ b/fs/cachefiles/interface.c | |||
@@ -354,7 +354,9 @@ static void cachefiles_sync_cache(struct fscache_cache *_cache) | |||
354 | /* make sure all pages pinned by operations on behalf of the netfs are | 354 | /* make sure all pages pinned by operations on behalf of the netfs are |
355 | * written to disc */ | 355 | * written to disc */ |
356 | cachefiles_begin_secure(cache, &saved_cred); | 356 | cachefiles_begin_secure(cache, &saved_cred); |
357 | down_read(&cache->mnt->mnt_sb->s_umount); | ||
357 | ret = sync_filesystem(cache->mnt->mnt_sb); | 358 | ret = sync_filesystem(cache->mnt->mnt_sb); |
359 | up_read(&cache->mnt->mnt_sb->s_umount); | ||
358 | cachefiles_end_secure(cache, saved_cred); | 360 | cachefiles_end_secure(cache, saved_cred); |
359 | 361 | ||
360 | if (ret == -EIO) | 362 | if (ret == -EIO) |