diff options
author | Jeff Layton <jlayton@kernel.org> | 2019-05-07 09:20:54 -0400 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2019-05-07 13:43:05 -0400 |
commit | 00abf69dd24f4444d185982379c5cc3bb7b6d1fc (patch) | |
tree | 831e155862349aa631ef1cf0b17bde23fe190eff /fs/ceph | |
parent | 4198aba4f431e2d2c24a11cdb9d53106fda00b43 (diff) |
ceph: flush dirty inodes before proceeding with remount
xfstest generic/452 was triggering a "Busy inodes after umount" warning.
ceph was allowing the mount to go read-only without first flushing out
dirty inodes in the cache. Ensure we sync out the filesystem before
allowing a remount to proceed.
Cc: stable@vger.kernel.org
Link: http://tracker.ceph.com/issues/39571
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'fs/ceph')
-rw-r--r-- | fs/ceph/super.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/ceph/super.c b/fs/ceph/super.c index 6d5bb2f74612..01113c86e469 100644 --- a/fs/ceph/super.c +++ b/fs/ceph/super.c | |||
@@ -845,6 +845,12 @@ static void ceph_umount_begin(struct super_block *sb) | |||
845 | return; | 845 | return; |
846 | } | 846 | } |
847 | 847 | ||
848 | static int ceph_remount(struct super_block *sb, int *flags, char *data) | ||
849 | { | ||
850 | sync_filesystem(sb); | ||
851 | return 0; | ||
852 | } | ||
853 | |||
848 | static const struct super_operations ceph_super_ops = { | 854 | static const struct super_operations ceph_super_ops = { |
849 | .alloc_inode = ceph_alloc_inode, | 855 | .alloc_inode = ceph_alloc_inode, |
850 | .destroy_inode = ceph_destroy_inode, | 856 | .destroy_inode = ceph_destroy_inode, |
@@ -852,6 +858,7 @@ static const struct super_operations ceph_super_ops = { | |||
852 | .drop_inode = ceph_drop_inode, | 858 | .drop_inode = ceph_drop_inode, |
853 | .sync_fs = ceph_sync_fs, | 859 | .sync_fs = ceph_sync_fs, |
854 | .put_super = ceph_put_super, | 860 | .put_super = ceph_put_super, |
861 | .remount_fs = ceph_remount, | ||
855 | .show_options = ceph_show_options, | 862 | .show_options = ceph_show_options, |
856 | .statfs = ceph_statfs, | 863 | .statfs = ceph_statfs, |
857 | .umount_begin = ceph_umount_begin, | 864 | .umount_begin = ceph_umount_begin, |