On Tue, Apr 21, 2015 at 04:22:14PM -0400, J. Bruce Fields wrote:
> From: "J. Bruce Fields" <bfie...@redhat.com>
> 
> If the client uses a special stateid then we'll pass a NULL file to
> vfs_llseek.

By the way, Christoph has also pointed out that it's probably worth
fixing nfsd4_preprocess_stateid_op() to do a temporary open itself in
the special stateid case.

If we wanted to get nfsd4_preprocess_stateid_op() to the point where it
also returned a file (if requested) on success, then there'd also be the
possible NULL returns from find_{read|write}able_file() to handle.

I haven't figured that out yet.

--b.

> 
> Fixes: 24bab491220f " NFSD: Implement SEEK"
> Cc: Anna Schumaker <anna.schuma...@netapp.com>
> Cc: stable@vger.kernel.org
> Reported-by: Christoph Hellwig <h...@infradead.org>
> Signed-off-by: J. Bruce Fields <bfie...@redhat.com>
> ---
>  fs/nfsd/nfs4proc.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index d0848fc6529e..4a8314f08a0e 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -1071,6 +1071,8 @@ nfsd4_seek(struct svc_rqst *rqstp, struct 
> nfsd4_compound_state *cstate,
>               dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n");
>               return status;
>       }
> +     if (!file)
> +             return nfserr_bad_stateid;
>  
>       switch (seek->seek_whence) {
>       case NFS4_CONTENT_DATA:
> -- 
> 1.9.3
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majord...@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to