[PATCH 008 of 14] knfsd: nfsd: fix misplaced fh_unlock() in nfsd_link()

From: NeilBrown
Date: Tue Jun 27 2006 - 03:21:57 EST



From: David M. Richter <richterd@xxxxxxxxxxxxxx>

In the event that lookup_one_len() fails in nfsd_link(), fh_unlock() is
skipped and locks are held overlong.

Patch was tested on 2.6.17-rc2 by causing lookup_one_len() to fail and
verifying that fh_unlock() gets called appropriately.

Signed-off-by: David M. Richter <richterd@xxxxxxxxxxxxxx>
Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>

### Diffstat output
./fs/nfsd/vfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff .prev/fs/nfsd/vfs.c ./fs/nfsd/vfs.c
--- .prev/fs/nfsd/vfs.c 2006-06-27 12:15:21.000000000 +1000
+++ ./fs/nfsd/vfs.c 2006-06-27 14:44:27.000000000 +1000
@@ -1520,14 +1520,15 @@ nfsd_link(struct svc_rqst *rqstp, struct
err = nfserrno(err);
}

- fh_unlock(ffhp);
dput(dnew);
+out_unlock:
+ fh_unlock(ffhp);
out:
return err;

out_nfserr:
err = nfserrno(err);
- goto out;
+ goto out_unlock;
}

/*
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/