Whamcloud - gitweb
b=22299 do not set lustre read_only device when server umount and keep client records...
authorFan Yong <Yong.Fan@Sun.COM>
Fri, 7 May 2010 14:10:02 +0000 (22:10 +0800)
committerjohann <johann@granier.local>
Fri, 7 May 2010 21:22:28 +0000 (23:22 +0200)
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=johann
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/mds/mds_fs.c
lustre/obdclass/obd_config.c
lustre/obdfilter/filter.c

index 8969f25..ddc13f0 100644 (file)
@@ -16,7 +16,7 @@ Index: linux-2.6.16.i686/block/ll_rw_blk.c
                if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)))
                        goto end_io;
 +              /* this is cfs's dev_rdonly check */
-+              if (bio->bi_rw == WRITE &&
++              if (bio_rw(bio) == WRITE &&
 +                              dev_check_rdonly(bio->bi_bdev)) {
 +                      bio_endio(bio, bio->bi_size, 0);
 +                      break;
index b4704a5..ab5432c 100644 (file)
@@ -16,7 +16,7 @@ Index: linux-2.6.18.1/block/ll_rw_blk.c
                if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)))
                        goto end_io;
 +              /* this is cfs's dev_rdonly check */
-+              if (bio->bi_rw == WRITE &&
++              if (bio_rw(bio) == WRITE &&
 +                              dev_check_rdonly(bio->bi_bdev)) {
 +                      bio_endio(bio, bio->bi_size, 0);
 +                      break;
index 579614f..24a79fe 100644 (file)
@@ -16,7 +16,7 @@ Index: linux-2.6.27.21-0.1/block/blk-core.c
                if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags)))
                        goto end_io;
 +              /* this is cfs's dev_rdonly check */
-+              if (bio->bi_rw == WRITE &&
++              if (bio_rw(bio) == WRITE &&
 +                              dev_check_rdonly(bio->bi_bdev)) {
 +                      bio_endio(bio, 0);
 +                      break;
index 5374670..def0c6e 100644 (file)
@@ -283,6 +283,10 @@ int mds_client_free(struct obd_export *exp)
         if (!med->med_lcd)
                 RETURN(0);
 
+        /* Do not erase record for recoverable client. */
+        if (obd->obd_fail && !exp->exp_failed)
+                GOTO(free, 0);
+
         /* XXX if lcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
         if (!strcmp(med->med_lcd->lcd_uuid, obd->obd_uuid.uuid))
                 GOTO(free, 0);
index 2aefafb..b7d853c 100644 (file)
@@ -466,11 +466,11 @@ int class_cleanup(struct obd_device *obd, struct lustre_cfg *lcfg)
                                 obd->obd_fail = 1;
                                 obd->obd_no_transno = 1;
                                 obd->obd_no_recov = 1;
-                                /* Set the obd readonly if we can */
-                                if (OBP(obd, iocontrol))
-                                        obd_iocontrol(OBD_IOC_SET_READONLY,
+                                if (OBP(obd, iocontrol)) {
+                                        obd_iocontrol(OBD_IOC_SYNC,
                                                       obd->obd_self_export,
                                                       0, NULL, NULL);
+                                }
                                 break;
                         default:
                                 CERROR("unrecognised flag '%c'\n",
index 6d8558b..0990f53 100644 (file)
@@ -470,6 +470,10 @@ static int filter_client_free(struct obd_export *exp)
         if (fed->fed_lcd == NULL)
                 RETURN(0);
 
+        /* Do not erase record for recoverable client. */
+        if (obd->obd_fail && !exp->exp_failed)
+                GOTO(free, 0);
+
         /* XXX if lcd_uuid were a real obd_uuid, I could use obd_uuid_equals */
         if (strcmp(fed->fed_lcd->lcd_uuid, obd->obd_uuid.uuid ) == 0)
                 GOTO(free, 0);