Whamcloud - gitweb
b=22299 do not set lustre read_only device when server umount and keep client records...
authorFan Yong <Yong.Fan@sun.com>
Thu, 1 Apr 2010 22:40:41 +0000 (15:40 -0700)
committerRobert Read <rread@sun.com>
Thu, 1 Apr 2010 22:40:41 +0000 (15:40 -0700)
1) do not set lustre read_only device when server umount
2) keep client records for recoverable ones under failover mode
3) do not ignore "WRITE_SYNC" (which is used by kmmpd block updating) for "dev_check_rdonly()" checking

i=andreas.dilger
i=tappro

lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch
lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch
lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch
lustre/mdt/mdt_handler.c
lustre/obdclass/obd_config.c
lustre/obdfilter/filter.c

index c5ceee0..19cfce6 100644 (file)
@@ -17,7 +17,7 @@ Index: linux-2.6.16.i686/block/ll_rw_blk.c
                        goto end_io;
 
 +               /* this is cfs's dev_rdonly check */
-+               if (bio->bi_rw == WRITE && dev_check_rdonly(bio->bi_bdev)) {
++               if (bio_rw(bio) == WRITE && dev_check_rdonly(bio->bi_bdev)) {
 +                       struct block_device *bdev = bio->bi_bdev;
 +
 +                       printk(KERN_WARNING "Write to readonly device %s (%#x) "
index 06ae8e7..7da8a71 100644 (file)
@@ -17,7 +17,7 @@ Index: linux-2.6.18.1/block/ll_rw_blk.c
                        goto end_io;
 
 +               /* this is cfs's dev_rdonly check */
-+               if (bio->bi_rw == WRITE && dev_check_rdonly(bio->bi_bdev)) {
++               if (bio_rw(bio) == WRITE && dev_check_rdonly(bio->bi_bdev)) {
 +                       struct block_device *bdev = bio->bi_bdev;
 +
 +                       printk(KERN_WARNING "Write to readonly device %s (%#x) "
index 399f04d..d666236 100644 (file)
@@ -17,7 +17,7 @@ Index: linux-2.6.27.21-0.1/block/blk-core.c
                        goto end_io;
 
 +               /* this is cfs's dev_rdonly check */
-+               if (bio->bi_rw == WRITE && dev_check_rdonly(bio->bi_bdev)) {
++               if (bio_rw(bio) == WRITE && dev_check_rdonly(bio->bi_bdev)) {
 +                       struct block_device *bdev = bio->bi_bdev;
 +
 +                       printk(KERN_WARNING "Write to readonly device %s (%#x) "
index bba5347..63856b9 100644 (file)
@@ -5149,7 +5149,9 @@ out_cookie:
 out_lmm:
         info->mti_mdt = NULL;
         /* cleanup client slot early */
-        mdt_client_del(&env, mdt);
+        /* Do not erase record for recoverable client. */
+        if (!obd->obd_fail || exp->exp_failed)
+                mdt_client_del(&env, mdt);
         lu_env_fini(&env);
 
         RETURN(rc);
index 8a6766f..93e9ab8 100644 (file)
@@ -493,10 +493,6 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                         obd_iocontrol(OBD_IOC_SYNC,
                                                       obd->obd_self_export,
                                                       0, NULL, NULL);
-                                        /* Set the obd readonly if we can */
-                                        obd_iocontrol(OBD_IOC_SET_READONLY,
-                                                      obd->obd_self_export,
-                                                      0, NULL, NULL);
                                 }
                                 break;
                         default:
index 2e5806c..4169e19 100644 (file)
@@ -3054,7 +3054,8 @@ static int filter_disconnect(struct obd_export *exp)
 
         rc = server_disconnect_export(exp);
 
-        if (exp->exp_obd->obd_replayable)
+        /* Do not erase record for recoverable client. */
+        if (obd->obd_replayable && (!obd->obd_fail || exp->exp_failed))
                 filter_client_del(exp);
         else
                 fsfilt_sync(obd, obd->u.obt.obt_sb);