From 176553577d326f4e4acfb2446fc0ad3d7512fe44 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Mon, 18 Feb 2013 21:05:04 -0500 Subject: [PATCH] LU-2824 mds: don't deactivate OSC if osc_create returns -EBUSY During MDS<->OST orphan recovery, osc_create() will likely return -EBUSY while OSCC_FLAG_SYNC_IN_PROGRESS flag is still set due to slow ll_mdt service thread. The __mds_lov_synchronize() will then deactivate the OSC, which will cause mds_create_objects() get -EIO error. This patch fixes the above issue by checking the return value of mds_lov_clear_orphans(). If it's -EBUSY, then do not mark the OSC as inactive. Test-Parameters: envdefinitions=DURATION=14400 clientdistro=el5 serverdistro=el5 clientarch=x86_64 serverarch=x86_64 clientcount=4 osscount=2 mdscount=2 austeroptions=-R failover=true useiscsi=true testlist=recovery-mds-scale Signed-off-by: Niu Yawei Change-Id: I7b3376e3b6087dd35c5f0e33e98b1e538ba711fc Reviewed-on: http://review.whamcloud.com/5462 Tested-by: Hudson Reviewed-by: Jian Yu Tested-by: Maloo Reviewed-by: Oleg Drokin --- lustre/mds/mds_lov.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index ca69f13..af2e13c 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -858,13 +858,14 @@ static int __mds_lov_synchronize(void *data) out: cfs_up_read(&mds->mds_notify_lock); if (rc) { - /* Deactivate it for safety */ - CERROR("%s sync failed %d, deactivating\n", obd_uuid2str(uuid), - rc); - if (!obd->obd_stopping && mds->mds_lov_obd && - !mds->mds_lov_obd->obd_stopping && !watched->obd_stopping) + CERROR("sync %s failed %d\n", obd_uuid2str(uuid), rc); + if (rc != -EBUSY && !obd->obd_stopping && mds->mds_lov_obd && + !mds->mds_lov_obd->obd_stopping && !watched->obd_stopping) { + /* Deactivate it for safety */ + CERROR("deactivating %s\n", obd_uuid2str(uuid)); obd_notify(mds->mds_lov_obd, watched, OBD_NOTIFY_INACTIVE, NULL); + } } class_decref(obd, "mds_lov_synchronize", obd); -- 1.8.3.1