From b806a81070940ce13e6257aa99de18a71f08706b Mon Sep 17 00:00:00 2001 From: Li Dongyang Date: Tue, 11 Sep 2018 14:42:26 +1000 Subject: [PATCH] LU-11360 osd-ldiskfs: hold s_umount before calling sync_fs 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 Change-Id: Icda84eebe0d6261e9e374fb2a005bb66e586bba8 Reviewed-on: https://review.whamcloud.com/33135 Reviewed-by: Wang Shilong Reviewed-by: Gu Zheng Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/osd-ldiskfs/osd_handler.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 2ca791a..a93f4f6 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -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. */ -- 1.8.3.1