From: shadow Date: Tue, 8 Sep 2009 08:02:31 +0000 (+0000) Subject: resolve race with saving updates into lov_objid file. X-Git-Tag: v1_8_2_01~1^2~129 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=d87204c77c629362885d2ea3795664ae3282e384;p=fs%2Flustre-release.git resolve race with saving updates into lov_objid file. Branch b1_8 b=20464 i=adilger i=green --- diff --git a/lustre/mds/mds_lov.c b/lustre/mds/mds_lov.c index 1004d3d..7e640c8 100644 --- a/lustre/mds/mds_lov.c +++ b/lustre/mds/mds_lov.c @@ -436,6 +436,9 @@ int mds_lov_write_objids(struct obd_device *obd) LASSERT(data != NULL); + if (!cfs_bitmap_test_and_clear(mds->mds_lov_page_dirty, i)) + continue; + /* check for particaly filled last page */ if (i == mds->mds_lov_objid_lastpage) size = (mds->mds_lov_objid_lastidx + 1) * sizeof(obd_id); @@ -443,9 +446,10 @@ int mds_lov_write_objids(struct obd_device *obd) CDEBUG(D_INFO,"write %lld - %u\n", off, size); rc = fsfilt_write_record(obd, mds->mds_lov_objid_filp, data, size, &off, 0); - if (rc < 0) + if (rc < 0) { + cfs_bitmap_set(mds->mds_lov_page_dirty, i); break; - cfs_bitmap_clear(mds->mds_lov_page_dirty, i); + } } if (rc >= 0) rc = 0;