Whamcloud - gitweb
LU-11360 osd-ldiskfs: hold s_umount before calling sync_fs 35/33135/3
authorLi Dongyang <dongyangli@ddn.com>
Tue, 11 Sep 2018 04:42:26 +0000 (14:42 +1000)
committerOleg Drokin <green@whamcloud.com>
Fri, 5 Oct 2018 22:27:24 +0000 (22:27 +0000)
ldiskfs_sync_fs() calls dquot_writeback_dquots(), which expects
we are holding s_umount since kernel 4.10
Linux-commit: 9d1ccbe70e0b14545caad12dc73adb3605447df0

Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Change-Id: Icda84eebe0d6261e9e374fb2a005bb66e586bba8
Reviewed-on: https://review.whamcloud.com/33135
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 2ca791a..a93f4f6 100644 (file)
@@ -2369,11 +2369,16 @@ static int osd_commit_async(const struct lu_env *env,
                            struct dt_device *d)
 {
        struct super_block *s = osd_sb(osd_dt_dev(d));
+       int rc;
 
        ENTRY;
 
        CDEBUG(D_HA, "%s: async commit OSD\n", osd_dt_dev(d)->od_svname);
-       RETURN(s->s_op->sync_fs(s, 0));
+       down_read(&s->s_umount);
+       rc = s->s_op->sync_fs(s, 0);
+       up_read(&s->s_umount);
+
+       RETURN(rc);
 }
 
 /* Our own copy of the set readonly functions if present, or NU if not. */