All of lore.kernel.org
 help / color / mirror / Atom feed
From: <andros@netapp.com>
To: <trond.myklebust@netapp.com>
Cc: <linux-nfs@vger.kernel.org>, Andy Adamson <andros@netapp.com>
Subject: [PATCH Version 4 2/5] NFS: Warn when attempting a buffered write or commit with an expired credential
Date: Thu, 18 Jul 2013 15:35:27 -0400	[thread overview]
Message-ID: <1374176130-11657-3-git-send-email-andros@netapp.com> (raw)
In-Reply-To: <1374176130-11657-1-git-send-email-andros@netapp.com>

From: Andy Adamson <andros@netapp.com>

Signed-off-by: Andy Adamson <andros@netapp.com>
---
 fs/nfs/write.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index f1bdb72..724c845 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("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,8 @@ 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("NFS: commit attempt with expired credential\n");
 
 	/* Call the NFS version-specific code */
 	NFS_PROTO(data->inode)->commit_done(task, data);
-- 
1.8.3.1


  parent reply	other threads:[~2013-07-18 19:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 19:35 [PATCH Version 4 0/5] Avoid expired credential keys for buffered writes andros
2013-07-18 19:35 ` [PATCH Version 4 1/5] SUNRPC: don't map EKEYEXPIRED to EACCES in call_refreshresult andros
2013-07-18 19:35 ` andros [this message]
2013-08-07 18:54   ` [PATCH Version 4 2/5] NFS: Warn when attempting a buffered write or commit with an expired credential Myklebust, Trond
2013-07-18 19:35 ` [PATCH Version 4 3/5] SUNRPC new rpc_credops to test credential expiry andros
2013-08-07 19:05   ` Myklebust, Trond
2013-07-18 19:35 ` [PATCH Version 4 4/5] NFS avoid expired credential keys for buffered writes andros
2013-08-07 18:55   ` Myklebust, Trond
2013-07-18 19:35 ` [PATCH Version 4 5/5] SUNRPC refactor rpcauth_checkverf error returns andros
2013-08-07 19:07   ` Myklebust, Trond

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=1374176130-11657-3-git-send-email-andros@netapp.com \
    --to=andros@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trond.myklebust@netapp.com \
    /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.