From: Fan Yong Date: Fri, 7 May 2010 14:10:02 +0000 (+0800) Subject: b=22299 do not set lustre read_only device when server umount and keep client records... X-Git-Tag: v1_8_3_51~59 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=213512764874122337e02028e003a4bec0033ac0;p=fs%2Flustre-release.git b=22299 do not set lustre read_only device when server umount and keep client records for recoverable ones 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 --- diff --git a/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch b/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch index 8969f25..ddc13f0 100644 --- a/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch +++ b/lustre/kernel_patches/patches/dev_read_only-2.6-fc5.patch @@ -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; diff --git a/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch b/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch index b4704a5..ab5432c 100644 --- a/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch +++ b/lustre/kernel_patches/patches/dev_read_only-2.6.18-vanilla.patch @@ -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; diff --git a/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch b/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch index 579614f..24a79fe 100644 --- a/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch +++ b/lustre/kernel_patches/patches/dev_read_only-2.6.27-vanilla.patch @@ -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; diff --git a/lustre/mds/mds_fs.c b/lustre/mds/mds_fs.c index 5374670..def0c6e 100644 --- a/lustre/mds/mds_fs.c +++ b/lustre/mds/mds_fs.c @@ -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); diff --git a/lustre/obdclass/obd_config.c b/lustre/obdclass/obd_config.c index 2aefafb..b7d853c 100644 --- a/lustre/obdclass/obd_config.c +++ b/lustre/obdclass/obd_config.c @@ -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", diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 6d8558b..0990f53 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -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);