Re: [PATCH RFC 8/9] NFSD: Clean up nfs4_preprocess_stateid_op() call sites

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

 



On Wed, 2022-10-05 at 10:56 -0400, Chuck Lever wrote:
> Remove the lame-duck dprintk()s around nfs4_preprocess_stateid_op()
> call sites.
> 
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> ---
>  fs/nfsd/nfs4proc.c |   31 +++++++------------------------
>  1 file changed, 7 insertions(+), 24 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
> index d0d976f847ca..42b81e88ea14 100644
> --- a/fs/nfsd/nfs4proc.c
> +++ b/fs/nfsd/nfs4proc.c
> @@ -951,12 +951,7 @@ nfsd4_read(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  	status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh,
>  					&read->rd_stateid, RD_STATE,
>  					&read->rd_nf, NULL);
> -	if (status) {
> -		dprintk("NFSD: nfsd4_read: couldn't process stateid!\n");
> -		goto out;
> -	}
> -	status = nfs_ok;
> -out:
> +
>  	read->rd_rqstp = rqstp;
>  	read->rd_fhp = &cstate->current_fh;
>  	return status;
> @@ -1125,10 +1120,8 @@ nfsd4_setattr(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  		status = nfs4_preprocess_stateid_op(rqstp, cstate,
>  				&cstate->current_fh, &setattr->sa_stateid,
>  				WR_STATE, NULL, NULL);
> -		if (status) {
> -			dprintk("NFSD: nfsd4_setattr: couldn't process stateid!\n");
> +		if (status)
>  			return status;
> -		}
>  	}
>  	err = fh_want_write(&cstate->current_fh);
>  	if (err)
> @@ -1176,10 +1169,8 @@ nfsd4_write(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  			       write->wr_offset, cnt);
>  	status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh,
>  						stateid, WR_STATE, &nf, NULL);
> -	if (status) {
> -		dprintk("NFSD: nfsd4_write: couldn't process stateid!\n");
> +	if (status)
>  		return status;
> -	}
>  
>  	write->wr_how_written = write->wr_stable_how;
>  
> @@ -1210,17 +1201,13 @@ nfsd4_verify_copy(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  
>  	status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->save_fh,
>  					    src_stateid, RD_STATE, src, NULL);
> -	if (status) {
> -		dprintk("NFSD: %s: couldn't process src stateid!\n", __func__);
> +	if (status)
>  		goto out;
> -	}
>  
>  	status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh,
>  					    dst_stateid, WR_STATE, dst, NULL);
> -	if (status) {
> -		dprintk("NFSD: %s: couldn't process dst stateid!\n", __func__);
> +	if (status)
>  		goto out_put_src;
> -	}
>  
>  	/* fix up for NFS-specific error code */
>  	if (!S_ISREG(file_inode((*src)->nf_file)->i_mode) ||
> @@ -1955,10 +1942,8 @@ nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  	status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh,
>  					    &fallocate->falloc_stateid,
>  					    WR_STATE, &nf, NULL);
> -	if (status != nfs_ok) {
> -		dprintk("NFSD: nfsd4_fallocate: couldn't process stateid!\n");
> +	if (status != nfs_ok)
>  		return status;
> -	}
>  
>  	status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, nf->nf_file,
>  				     fallocate->falloc_offset,
> @@ -2014,10 +1999,8 @@ nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
>  	status = nfs4_preprocess_stateid_op(rqstp, cstate, &cstate->current_fh,
>  					    &seek->seek_stateid,
>  					    RD_STATE, &nf, NULL);
> -	if (status) {
> -		dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n");
> +	if (status)
>  		return status;
> -	}
>  
>  	switch (seek->seek_whence) {
>  	case NFS4_CONTENT_DATA:
> 
> 

I agree that these are not particularly helpful. It might be a good idea
to add a conditional tracepoint in nfs4_preprocess_stateid_op though,
for when it returns an error, but I don't care enough to stand in the
way of this decluttering.

Reviewed-by: Jeff Layton <jlayton@xxxxxxxxxx>




[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux