Skip to contentSkip to conversation

pnfsd: Fix unlock bug on error path

PATCH In review [email protected] 2 participants 2 messages Jan 15, 2013 – Jan 21, 2013

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

PATCH 1/1 pnfsd: Fix unlock bug on error path

From: Yanchuan Nian <[email protected]>

LAYOUTGET procedure fails if the layout requested conflicts with the recalled. It needs to put the reference and unlock the state before exiting.

---
 fs/nfsd/nfs4pnfsd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4pnfsd.c +1 -1
index dd7856c..4a1e17b 100644
@@ -760,7 +760,7 @@ nfs4_pnfs_get_layout(struct nfsd4_pnfs_layoutget *lgp,
 
 	if (is_layout_recalled(clp, lgp->lg_fhp, &lgp->lg_seg)) {
 		nfserr = nfserr_recallconflict;
-		goto out;
+		goto out_unlock;
 	}
 
 	/* pre-alloc layout in case we can't merge after we call
Signature · 1 line
1.7.4.4
#1 lore raw
Quoted 6 lines · On 2013-01-15 05:07, [email protected] wrote:

From: Yanchuan Nian <[email protected]>

LAYOUTGET procedure fails if the layout requested conflicts with the recalled. It needs to put the reference and unlock the state before exiting.

Good catch. Thanks.
Committing for pnfs-all-3.7 and latest.

Benny

Quoted 18 lines
---
 fs/nfsd/nfs4pnfsd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
fs/nfsd/nfs4pnfsd.c +1 -1
index dd7856c..4a1e17b 100644
@@ -760,7 +760,7 @@ nfs4_pnfs_get_layout(struct nfsd4_pnfs_layoutget *lgp,
 
 	if (is_layout_recalled(clp, lgp->lg_fhp, &lgp->lg_seg)) {
 		nfserr = nfserr_recallconflict;
-		goto out;
+		goto out_unlock;
 	}
 
 	/* pre-alloc layout in case we can't merge after we call