[PATCH 04/16] nfsd: make exp_rootfh handle exp_parent errors
J. Bruce Fields
bfields at fieldses.org
Fri Dec 1 14:40:37 EST 2006
From: J. Bruce Fields <bfields at fieldses.org>
Since exp_parent can fail by returning an error in addition to by returning
NULL, we should check for that case in exp_rootfh.
(TODO: we should check that userland handles these errors too.)
Signed-off-by: J. Bruce Fields <bfields at citi.umich.edu>
---
fs/nfsd/export.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index f37df46..0747bb5 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -1104,6 +1104,10 @@ exp_rootfh(svc_client *clp, char *path, struct knfsd_fh *f, int maxsize)
path, nd.dentry, clp->name,
inode->i_sb->s_id, inode->i_ino);
exp = exp_parent(clp, nd.mnt, nd.dentry, NULL);
+ if (IS_ERR(exp)) {
+ err = PTR_ERR(exp);
+ goto out;
+ }
if (!exp) {
dprintk("nfsd: exp_rootfh export not found.\n");
goto out;
More information about the NFSv4
mailing list