Re: [PATCH Version 5 2/5] NFS: Warn when attempting a buffered write or commit with an expired credential

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

 



On Wed, 2013-08-14 at 11:59 -0400, andros@xxxxxxxxxx wrote:
> From: Andy Adamson <andros@xxxxxxxxxx>
> 
> Signed-off-by: Andy Adamson <andros@xxxxxxxxxx>
> ---
>  fs/nfs/write.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/fs/nfs/write.c b/fs/nfs/write.c
> index f1bdb72..7b7d360 100644
> --- a/fs/nfs/write.c
> +++ b/fs/nfs/write.c
> @@ -1330,6 +1330,14 @@ void nfs_writeback_done(struct rpc_task *task, struct nfs_write_data *data)
>  	dprintk("NFS: %5u nfs_writeback_done (status %d)\n",
>  		task->tk_pid, task->tk_status);
>  
> +	if (task->tk_status == -EKEYEXPIRED)
> +		pr_warn_ratelimited("NFS:        write attempt with expired "
> +			"credential req %s/%lld, %u bytes @ offset %llu\n",
> +			inode->i_sb->s_id,
> +			(long long)NFS_FILEID(inode),
> +			data->args.count,
> +			(unsigned long long)data->args.offset);
> +
>  	/*
>  	 * ->write_done will attempt to use post-op attributes to detect
>  	 * conflicting writes by other clients.  A strict interpretation
> @@ -1556,6 +1564,9 @@ static void nfs_commit_done(struct rpc_task *task, void *calldata)
>  
>          dprintk("NFS: %5u nfs_commit_done (status %d)\n",
>                                  task->tk_pid, task->tk_status);
> +	if (task->tk_status == -EKEYEXPIRED)
> +		pr_warn_ratelimited("NFS:       commit attempt with expired "
> +				"credential\n");
>  
>  	/* Call the NFS version-specific code */
>  	NFS_PROTO(data->inode)->commit_done(task, data);

I want to hold on applying this until it is clear that we need it. It
isn't obvious to me why we need to log this information to the console
if we're already returning error values to the application.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com
��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥





[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