Skip to contentSkip to conversation

pnfs: Increase the refcount when LAYOUTGET fails the first time

PATCH In review [email protected] 2 participants 2 messages Jan 4, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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?

---
 fs/nfs/pnfs.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfs/pnfs.c +1 -1
index e7165d9..d00260b 100644
@@ -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);
 }
 
Signature · 1 line
1.7.4.4
#1 lore raw
Quoted 18 lines · On Fri, 2013-01-04 at 20:19 +-0800, [email protected] wrote:

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?

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

fs/nfs/pnfs.c static void · line 259

Quoted 5 lines
fs/nfs/pnfs.c +1 -1
 	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);
 }

Thank for spotting this! Applying to the bugfixes branch...

Signature · 6 lines
Trond Myklebust
Linux NFS client maintainer

NetApp
[email protected]
www.netapp.com