summaryrefslogtreecommitdiff
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorYanchuan Nian <ycnian@gmail.com>2013-01-04 20:19:49 +0800
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-01-04 10:50:42 -0500
commit39e88fcfb1d5c6c4b1ff76ca2ab76cf449b850e8 (patch)
tree4cd9e5897b1ee6b22941b4640de5f28f261ed022 /fs/nfs/pnfs.c
parentf8d9a897d4384b77f13781ea813156568f68b83e (diff)
downloadkernel-common-39e88fcfb1d5c6c4b1ff76ca2ab76cf449b850e8.tar.gz
kernel-common-39e88fcfb1d5c6c4b1ff76ca2ab76cf449b850e8.tar.bz2
kernel-common-39e88fcfb1d5c6c4b1ff76ca2ab76cf449b850e8.zip
pnfs: Increase the refcount when LAYOUTGET fails the first time
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 <ycnian@gmail.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: stable@vger.kernel.org [>= 3.7]
Diffstat (limited to 'fs/nfs/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index e7165d915362..d00260b08103 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);
}