2013-01-04 12:29:32

by Yanchuan Nian

[permalink] [raw]
Subject: [PATCH] pnfs: Increase the refcount when LAYOUTGET fails the first time

From: Yanchuan Nian <[email protected]>

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 <[email protected]>
---
fs/nfs/pnfs.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index e7165d9..d00260b 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);
}

--
1.7.4.4



2013-01-04 15:51:41

by Myklebust, Trond

[permalink] [raw]
Subject: Re: [PATCH] pnfs: Increase the refcount when LAYOUTGET fails the first time

On Fri, 2013-01-04 at 20:19 +-0800, ycnian+AEA-gmail.com wrote:
+AD4- From: Yanchuan Nian +ADw-ycnian+AEA-gmail.com+AD4-
+AD4-
+AD4- The layout will be set unusable if LAYOUTGET fails. Is it reasonable to
+AD4- increase the refcount iff LAYOUTGET fails the first time?
+AD4-
+AD4- Signed-off-by: Yanchuan Nian +ADw-ycnian+AEA-gmail.com+AD4-
+AD4- ---
+AD4- fs/nfs/pnfs.c +AHw- 2 +--
+AD4- 1 files changed, 1 insertions(+-), 1 deletions(-)
+AD4-
+AD4- diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
+AD4- index e7165d9..d00260b 100644
+AD4- --- a/fs/nfs/pnfs.c
+AD4- +-+-+- b/fs/nfs/pnfs.c
+AD4- +AEAAQA- -254,7 +-254,7 +AEAAQA- static void
+AD4- pnfs+AF8-layout+AF8-set+AF8-fail+AF8-bit(struct pnfs+AF8-layout+AF8-hdr +ACo-lo, int fail+AF8-bit)
+AD4- +AHs-
+AD4- lo-+AD4-plh+AF8-retry+AF8-timestamp +AD0- jiffies+ADs-
+AD4- - if (test+AF8-and+AF8-set+AF8-bit(fail+AF8-bit, +ACY-lo-+AD4-plh+AF8-flags))
+AD4- +- if (+ACE-test+AF8-and+AF8-set+AF8-bit(fail+AF8-bit, +ACY-lo-+AD4-plh+AF8-flags))
+AD4- atomic+AF8-inc(+ACY-lo-+AD4-plh+AF8-refcount)+ADs-
+AD4- +AH0-
+AD4-
Thank for spotting this+ACE- Applying to the bugfixes branch...

--
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust+AEA-netapp.com
http://www.netapp.com