public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] reconnect_one(): fix a missing error code
@ 2017-06-14  9:30 Dan Carpenter
  2017-06-14 20:34 ` J. Bruce Fields
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2017-06-14  9:30 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: David Howells, NeilBrown, Al Viro, Ingo Molnar, linux-kernel,
	kernel-janitors

I found this bug by reviewing places where we do ERR_PTR(0) (which is
NULL).

We used to return an error pointer if lookup_one_len() failed but we
moved this code into a helper function and accidentally removed that.
NULL is a valid return for this function but it's not what we intended.

Fixes: bbf7a8a3562f ("exportfs: move most of reconnect_path to helper function")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c
index 329a5d103846..451237745689 100644
--- a/fs/exportfs/expfs.c
+++ b/fs/exportfs/expfs.c
@@ -147,6 +147,7 @@ static struct dentry *reconnect_one(struct vfsmount *mnt,
 	tmp = lookup_one_len_unlocked(nbuf, parent, strlen(nbuf));
 	if (IS_ERR(tmp)) {
 		dprintk("%s: lookup failed: %d\n", __func__, PTR_ERR(tmp));
+		err = PTR_ERR(tmp);
 		goto out_err;
 	}
 	if (tmp != dentry) {

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-06-16 13:50 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-14  9:30 [PATCH] reconnect_one(): fix a missing error code Dan Carpenter
2017-06-14 20:34 ` J. Bruce Fields
2017-06-14 21:54   ` NeilBrown
2017-06-15  9:26     ` Dan Carpenter
2017-06-15 21:40     ` J. Bruce Fields
2017-06-15 22:28       ` NeilBrown
2017-06-16 13:50         ` J. Bruce Fields

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox