mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + exportfs-handle-null-returns-from-fh_to_dentry-fh_to_parent.patch added to -mm tree
@ 2008-12-09  0:33 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2008-12-09  0:33 UTC (permalink / raw)
  To: mm-commits; +Cc: bfields, dhowells, hch, hugh, neilb, viro


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@citi.umich.edu>

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@citi.umich.edu>
Cc: David Howells <dhowells@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Neil Brown <neilb@suse.de>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 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@citi.umich.edu are

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-12-09  0:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-12-09  0:33 + exportfs-handle-null-returns-from-fh_to_dentry-fh_to_parent.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).