From patchwork Thu Jul 18 19:35:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Adamson X-Patchwork-Id: 2829783 Return-Path: X-Original-To: patchwork-linux-nfs@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 801F29FA38 for ; Thu, 18 Jul 2013 19:35:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 82DA32011E for ; Thu, 18 Jul 2013 19:35:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9916D2013D for ; Thu, 18 Jul 2013 19:35:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759355Ab3GRTfo (ORCPT ); Thu, 18 Jul 2013 15:35:44 -0400 Received: from mx11.netapp.com ([216.240.18.76]:41089 "EHLO mx11.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759348Ab3GRTfn (ORCPT ); Thu, 18 Jul 2013 15:35:43 -0400 X-IronPort-AV: E=Sophos;i="4.89,696,1367996400"; d="scan'208";a="34773127" Received: from vmwexceht01-prd.hq.netapp.com ([10.106.76.239]) by mx11-out.netapp.com with ESMTP; 18 Jul 2013 12:35:40 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCEHT01-PRD.hq.netapp.com (10.106.76.239) with Microsoft SMTP Server id 14.3.123.3; Thu, 18 Jul 2013 12:35:40 -0700 Received: from fc19.androsad.fake (vpn2ntap-178991.vpn.netapp.com [10.55.73.80]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id r6IJZbRI021126; Thu, 18 Jul 2013 12:35:39 -0700 (PDT) From: To: CC: , Andy Adamson 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 Message-ID: <1374176130-11657-3-git-send-email-andros@netapp.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1374176130-11657-1-git-send-email-andros@netapp.com> References: <1374176130-11657-1-git-send-email-andros@netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Andy Adamson Signed-off-by: Andy Adamson --- 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);