From: J.Bruce Fields Date: Wed, 13 Dec 2006 08:35:21 +0000 (-0800) Subject: [PATCH] knfsd: nfsd: make exp_rootfh handle exp_parent errors X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4b41bd85d5f93af37c2730df172aeb54280be7c3;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git [PATCH] knfsd: nfsd: make exp_rootfh handle exp_parent errors Since exp_parent can fail by returning an error (-EAGAIN) 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 Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index f37df46d2eaa..0747bb5ffcf1 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;