Whamcloud - gitweb
LU-699 tests: replay-dual test_1 failure
authorJinshan Xiong <jay@whamcloud.com>
Wed, 19 Oct 2011 23:54:26 +0000 (16:54 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 20 Oct 2011 22:06:30 +0000 (18:06 -0400)
The root cause of this problem is due to data corruption on lustre_disk_data.
In ldd_write(), it just waits for log to be committed but NOT data to actually
write to disk. So in this test case, if the data is not written into disk when
we mark the device as readonly, the data will be lost and cause remount mdt
failed.

Change-Id: I8c46a925ce2df3d2db69b1e7fd8813eb0668401d
Signed-off-by: Jinshan Xiong <jay@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/1557
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
lustre/obdclass/obd_mount.c

index 15f50c4..4a8b91f 100644 (file)
@@ -355,7 +355,7 @@ static int ldd_write(struct lvfs_run_ctxt *mount_ctxt,
 
         push_ctxt(&saved, mount_ctxt, NULL);
 
 
         push_ctxt(&saved, mount_ctxt, NULL);
 
-        file = filp_open(MOUNT_DATA_FILE, O_RDWR, 0644);
+        file = filp_open(MOUNT_DATA_FILE, O_RDWR|O_SYNC, 0644);
         if (IS_ERR(file)) {
                 rc = PTR_ERR(file);
                 CERROR("cannot open %s: rc = %d\n", MOUNT_DATA_FILE, rc);
         if (IS_ERR(file)) {
                 rc = PTR_ERR(file);
                 CERROR("cannot open %s: rc = %d\n", MOUNT_DATA_FILE, rc);