From daf84a7f8eb76356285b7af5d88fb9e5e73335d3 Mon Sep 17 00:00:00 2001 From: Jian Yu Date: Sun, 17 Feb 2013 19:03:15 +0800 Subject: [PATCH] LU-2824 mds: do not 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=21600 \ 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: Jian Yu Change-Id: I7e04648524714999bbd72d730d1d618239b630e6 Reviewed-on: http://review.whamcloud.com/5450 Reviewed-by: Johann Lombardi Tested-by: Hudson --- lustre/mds/mds_lov.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 9494e4c..7e1151e 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -1015,14 +1015,18 @@ static int __mds_lov_synchronize(void *data) EXIT; out: - 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) - obd_notify(mds->mds_lov_obd, watched, - OBD_NOTIFY_INACTIVE, NULL); + if (rc != 0) { + CERROR("%s sync failed: %d\n", obd_uuid2str(uuid), rc); + + if (rc != -EBUSY) { + /* Deactivate it for safety */ + CERROR("deactivating %s\n", obd_uuid2str(uuid)); + if (!obd->obd_stopping && mds->mds_lov_obd && + !mds->mds_lov_obd->obd_stopping && + !watched->obd_stopping) + obd_notify(mds->mds_lov_obd, watched, + OBD_NOTIFY_INACTIVE, NULL); + } } else { /* We've successfully synced at least 1 OST and are ready to handle client requests */ -- 1.8.3.1