From: Yanchuan Nian Date: Fri, 4 Jan 2013 12:19:49 +0000 (+0800) Subject: pnfs: Increase the refcount when LAYOUTGET fails the first time X-Git-Tag: v3.7.2~73 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b7d74eb80d06be3b5792cbdd2c77d1ccb05cc4b;p=thirdparty%2Fkernel%2Fstable.git pnfs: Increase the refcount when LAYOUTGET fails the first time commit 39e88fcfb1d5c6c4b1ff76ca2ab76cf449b850e8 upstream. The layout will be set unusable if LAYOUTGET fails. Is it reasonable to increase the refcount iff LAYOUTGET fails the first time? Signed-off-by: Yanchuan Nian Signed-off-by: Trond Myklebust Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 2878f97bd78d5..b7f7538a4c9cd 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -254,7 +254,7 @@ static void pnfs_layout_set_fail_bit(struct pnfs_layout_hdr *lo, int fail_bit) { lo->plh_retry_timestamp = jiffies; - if (test_and_set_bit(fail_bit, &lo->plh_flags)) + if (!test_and_set_bit(fail_bit, &lo->plh_flags)) atomic_inc(&lo->plh_refcount); }