Whamcloud - gitweb
LU-11020 osd: use right sync 66/32866/6
authorAlexey Lyashkov <c17817@cray.com>
Wed, 1 Aug 2018 15:52:28 +0000 (18:52 +0300)
committerOleg Drokin <green@whamcloud.com>
Mon, 1 Oct 2018 14:00:34 +0000 (14:00 +0000)
use a sync_fs instead of journal flush only.
ext4 commit with similar change

commit 06a407f13daf9e48f0ef7189c7e54082b53940c7
Author: Dmitry Monakhov <dmonakhov@openvz.org>
Date:   Wed Jun 12 22:25:07 2013 -0400

ext4: fix data integrity for ext4_sync_fs

Inode's data or non journaled quota may be written w/o jounral so we
 _must_ send a barrier at the end of ext4_sync_fs. But it can be
skipped if journal commit will do it for us.

Cray-bug-id: LUS-5993
Signed-off-by: Alexey Lyashkov <c17817@cray.com>
Change-Id: Ie242b48d0b8ad61cf4d38ac0fb173176193716d9
Reviewed-on: https://review.whamcloud.com/32866
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 006995f..2ca791a 100644 (file)
@@ -2340,10 +2340,12 @@ static void osd_conf_get(const struct lu_env *env,
 static int osd_sync(const struct lu_env *env, struct dt_device *d)
 {
        int rc;
+       struct super_block *s = osd_sb(osd_dt_dev(d));
+       ENTRY;
 
-       CDEBUG(D_CACHE, "%s: syncing OSD\n", osd_dt_dev(d)->od_svname);
-
-       rc = ldiskfs_force_commit(osd_sb(osd_dt_dev(d)));
+       down_read(&s->s_umount);
+       rc = s->s_op->sync_fs(s, 1);
+       up_read(&s->s_umount);
 
        CDEBUG(D_CACHE, "%s: synced OSD: rc = %d\n", osd_dt_dev(d)->od_svname,
               rc);