All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: David Howells <dhowells@redhat.com>
Cc: hch@infradead.org, viro@ZenIV.linux.org.uk,
	linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 2/3] EXPORTFS: Have fh_to_*() return -ESTALE if the file handle type is unrecognised [try #2]
Date: Thu, 4 Dec 2008 14:31:02 -0500	[thread overview]
Message-ID: <20081204193102.GC7575@fieldses.org> (raw)
In-Reply-To: <20081203183038.2636.74428.stgit@warthog.procyon.org.uk>

On Wed, Dec 03, 2008 at 06:30:38PM +0000, David Howells wrote:
> Make fh_to_dentry() and fh_to_parent() operations return -ESTALE rather than a
> negative dentry if the file handle type is unrecognised.
> 
> Signed-off-by: David Howells <dhowells@redhat.com>
> ---
> 
>  fs/libfs.c                    |    4 ++++
>  fs/xfs/linux-2.6/xfs_export.c |    4 ++++
>  2 files changed, 8 insertions(+), 0 deletions(-)
> 
> 
> diff --git a/fs/libfs.c b/fs/libfs.c
> index 4fe5b5b..47952f2 100644
> --- a/fs/libfs.c
> +++ b/fs/libfs.c
> @@ -758,6 +758,8 @@ struct dentry *generic_fh_to_dentry(struct super_block *sb, struct fid *fid,
>  	case FILEID_INO32_GEN_PARENT:
>  		inode = get_inode(sb, fid->i32.ino, fid->i32.gen);
>  		break;
> +	default:
> +		return ERR_PTR(-ESTALE);
>  	}
>  
>  	return d_obtain_alias(inode);

It looks like d_obtain_alias already returns -ESTALE in this case, not a
negative dentry.

> @@ -791,6 +793,8 @@ struct dentry *generic_fh_to_parent(struct super_block *sb, struct fid *fid,
>  		inode = get_inode(sb, fid->i32.parent_ino,
>  				  (fh_len > 3 ? fid->i32.parent_gen : 0));
>  		break;
> +	default:
> +		return ERR_PTR(-ESTALE);
>  	}
>  
>  	return d_obtain_alias(inode);

Ditto here, and in the other two cases.  I don't understand what you're
doing.

--b.

> diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c
> index f9a51c4..7a4c75f 100644
> --- a/fs/xfs/linux-2.6/xfs_export.c
> +++ b/fs/xfs/linux-2.6/xfs_export.c
> @@ -161,6 +161,8 @@ xfs_fs_fh_to_dentry(struct super_block *sb, struct fid *fid,
>  	case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:
>  		inode = xfs_nfs_get_inode(sb, fid64->ino, fid64->gen);
>  		break;
> +	default:
> +		return ERR_PTR(-ESTALE);
>  	}
>  
>  	return d_obtain_alias(inode);
> @@ -182,6 +184,8 @@ xfs_fs_fh_to_parent(struct super_block *sb, struct fid *fid,
>  		inode = xfs_nfs_get_inode(sb, fid64->parent_ino,
>  					      fid64->parent_gen);
>  		break;
> +	default:
> +		return ERR_PTR(-ESTALE);
>  	}
>  
>  	return d_obtain_alias(inode);
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2008-12-04 19:31 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-03 18:30 [PATCH 1/3] EXPORTFS: Don't return NULL from fh_to_dentry()/fh_to_parent() [try #2] David Howells
2008-12-03 18:30 ` [PATCH 2/3] EXPORTFS: Have fh_to_*() return -ESTALE if the file handle type is unrecognised " David Howells
2008-12-04 19:31   ` J. Bruce Fields [this message]
2008-12-05  9:14     ` David Howells
2008-12-03 18:30 ` [PATCH 3/3] EXPORTFS: Update the documentation and comments and adjust the types used " David Howells
2008-12-04 19:32   ` J. Bruce Fields
2008-12-05  9:09     ` David Howells
2008-12-08 23:59       ` J. Bruce Fields
2008-12-04 19:07 ` [PATCH 1/3] EXPORTFS: Don't return NULL from fh_to_dentry()/fh_to_parent() " J. Bruce Fields
2008-12-05  9:13   ` David Howells

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081204193102.GC7575@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=dhowells@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.