From a1ad73f14e42cb2cf538661d659512d9fd12fd47 Mon Sep 17 00:00:00 2001 From: Yu Jian Date: Mon, 10 Sep 2012 12:02:31 +0800 Subject: [PATCH] LU-1824 obdfilter: reset lnb[n].rc in filter_grant_check() After patch http://review.whamcloud.com/3446 was committed, filter_grant_check() would be called a second time if there was no grant space for the write operation in the first time it was called. The issue was that all of the lnb[n].rc values were set to -ENOSPC inside filter_grant_check() the first time it was called, but at the second time, although there was some space and the function returned 0 not -ENOSPC, the lnb[n].rc values were not reset, all of them were still -ENOSPC, which caused the assertion failure inside filter_commitrw_write(). This patch fixes the above issue. Test-Parameters: envdefinitions=SLOW=yes testlist=obdfilter-survey Signed-off-by: Yu Jian Change-Id: Ia0ec57a7d329136b4e1f2f82a337c6cf43f7f66c Reviewed-on: http://review.whamcloud.com/3913 Tested-by: Hudson Reviewed-by: hongchao.zhang Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- lustre/obdfilter/filter_io.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lustre/obdfilter/filter_io.c b/lustre/obdfilter/filter_io.c index 23947d5..a946d90 100644 --- a/lustre/obdfilter/filter_io.c +++ b/lustre/obdfilter/filter_io.c @@ -540,6 +540,7 @@ static int filter_grant_check(struct obd_export *exp, struct obdo *oa, if (tmp) bytes += blocksize - tmp; + lnb[n].rc = 0; if ((lnb[n].flags & OBD_BRW_FROM_GRANT) && (oa->o_valid & OBD_MD_FLGRANT)) { if (resend) { -- 1.8.3.1