Whamcloud - gitweb
LU-11360 osd-ldiskfs: hold s_umount before calling sync_fs
[fs/lustre-release.git] / 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. */