+ exportfs-handle-null-returns-from-fh_to_dentry-fh_to_parent.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     exportfs: handle NULL returns from fh_to_dentry()/fh_to_parent()
has been added to the -mm tree.  Its filename is
     exportfs-handle-null-returns-from-fh_to_dentry-fh_to_parent.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: exportfs: handle NULL returns from fh_to_dentry()/fh_to_parent()
From: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>

While 440037287c5 "[PATCH] switch all filesystems over to d_obtain_alias"
removed some cases where fh_to_dentry() and fh_to_parent() could return
NULL, there are still a few NULL returns left in individual filesystems. 
Thus it was a mistake for that commit to remove the handling of NULL
returns in the callers.

Revert those parts of 440037287c5 which removed the NULL handling.

(We could, alternatively, modify all implementations to return -ESTALE
instead of NULL, but that proves to require fixing a number of
filesystems, and in some cases it's arguably more natural to return NULL.)

Thanks to David for original patch and Linus, Christoph, and Hugh for
review.

Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx>
Cc: David Howells <dhowells@xxxxxxxxxx>
Cc: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Cc: Hugh Dickins <hugh@xxxxxxxxxxx>
Cc: Neil Brown <neilb@xxxxxxx>
Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 fs/exportfs/expfs.c |    4 ++++
 1 file changed, 4 insertions(+)

diff -puN fs/exportfs/expfs.c~exportfs-handle-null-returns-from-fh_to_dentry-fh_to_parent fs/exportfs/expfs.c
--- a/fs/exportfs/expfs.c~exportfs-handle-null-returns-from-fh_to_dentry-fh_to_parent
+++ a/fs/exportfs/expfs.c
@@ -369,6 +369,8 @@ struct dentry *exportfs_decode_fh(struct
 	 * Try to get any dentry for the given file handle from the filesystem.
 	 */
 	result = nop->fh_to_dentry(mnt->mnt_sb, fid, fh_len, fileid_type);
+	if (!result)
+		result = ERR_PTR(-ESTALE);
 	if (IS_ERR(result))
 		return result;
 
@@ -422,6 +424,8 @@ struct dentry *exportfs_decode_fh(struct
 
 		target_dir = nop->fh_to_parent(mnt->mnt_sb, fid,
 				fh_len, fileid_type);
+		if (!target_dir)
+			goto err_result;
 		err = PTR_ERR(target_dir);
 		if (IS_ERR(target_dir))
 			goto err_result;
_

Patches currently in -mm which might be from bfields@xxxxxxxxxxxxxx are

origin.patch
linux-next.patch
exportfs-handle-null-returns-from-fh_to_dentry-fh_to_parent.patch
reiser4.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux