From patchwork Tue Feb 27 17:09:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 10245831 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2C3F860211 for ; Tue, 27 Feb 2018 17:09:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DE58289AD for ; Tue, 27 Feb 2018 17:09:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12869289EE; Tue, 27 Feb 2018 17:09:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 842FE289FC for ; Tue, 27 Feb 2018 17:09:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751793AbeB0RJH (ORCPT ); Tue, 27 Feb 2018 12:09:07 -0500 Received: from mail-vk0-f42.google.com ([209.85.213.42]:40246 "EHLO mail-vk0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbeB0RJF (ORCPT ); Tue, 27 Feb 2018 12:09:05 -0500 Received: by mail-vk0-f42.google.com with SMTP id n82so8184606vkf.7 for ; Tue, 27 Feb 2018 09:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:from:date:message-id:subject:to; bh=TuIvdRufzXyEvRkLzKqRVmwNTOi7ZTpWIndJA6mqGaY=; b=PEFXF1uwEdONT0R8XaqgK+NpXLwyV6Axf5dJCFTRrTYhUdEvZh4SO0vfas9EAhUDey kVxaVyMaMYnCwTXpMNn1fmROzJERE7WrGHhu0+4H6igM2mBDCdGO8oVZYgQL/cuZgQmS XDfFtN+zh2KQZFqEIM9+/AikN3LPQH/yityezmNiyRG0rJ9Ey9VUF5/Q5HYFH24wDR4F EnpBCt0RTN14aCkzgXBMHwpH9TokQzeesx8OWjG61BjPZlWoBey8xGK3K8Vpt1HjdFIB 5cJvB+4Ix5d1nFU1JIwDTmEcKSdjv8Y74L4Wtsig6yMfopY0o0dAmN18G8A4RvCxg7K8 AnaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:from:date:message-id:subject :to; bh=TuIvdRufzXyEvRkLzKqRVmwNTOi7ZTpWIndJA6mqGaY=; b=ehcWbV1piy5ARx/RzSYweTEaDmO94r2k6N48Rk13Mxq9VKPSWICiF0PgraklutoBQk uCXStJQ4rLp/abW1rc/yXBG0RjGIrgHocV8KaGkhzdfISFU5h1EG2Y1B0aajPKto0lwR SzKuNDkAg+VnXJfbUMW/47YJTSUi5py8fU/YaO6NbqT8UbpI18wKgS3HOW2mWF7jnj1A JbYSDjnY/qHbuHLvmfm9F4upKtbDbRaAeBH5inU6pToVApVJ/g53KxN1WeJsWAXHyuav TQZOV31TYyqrpCXzudwGZD5iqorguDksJqEjLpAuu06CE+CqYC0B9FC+PJ6+Y3R2oaet bc1w== X-Gm-Message-State: APf1xPCTxG7EYJj6aTBZVZ0mTdN3maMXor8pEGazZS/9B9apnO5r9lKM RAUbbwGmDrsPa5uJudhkwtEkhX3PpjUGAaM6fnwvjg== X-Google-Smtp-Source: AG47ELvHwGVZTMIvcUnydPaC7WUboYpQg3T+eg78Zy14nYhpKgM7U8O+PwuFCJyoVCm9TRTwpwh+btfR2hMQ1ziqdjU= X-Received: by 10.31.223.135 with SMTP id w129mr11708360vkg.48.1519751344787; Tue, 27 Feb 2018 09:09:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.91.65 with HTTP; Tue, 27 Feb 2018 09:09:04 -0800 (PST) From: Olga Kornievskaia Date: Tue, 27 Feb 2018 12:09:04 -0500 X-Google-Sender-Auth: 4tymbIT8NLaIxzMJp6XXlAeLBss Message-ID: Subject: Looping on ERR_OLD_STATEID on LOCK To: linux-nfs Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi folks, I'd like to understand why nfs4_do_handle_exception() for ERR_OLD_STATEID just retries the operation. What happens is that the client resends that same operation with the same stateid over to the server and gets the same ERR_OLD_STATEID back which puts the client in an infinite loop (and a hung state). Shouldn't the client instead treat ERR_OLD_STATEID same as ERR_BAD_STATEID? test_bit(NFS_LOCK_INITIALIZED, &lsp->ls_flags) != 0) --- To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index c8b554a..2e006bc 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -411,6 +411,7 @@ static int nfs4_do_handle_exception(struct nfs_server *server, case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_EXPIRED: case -NFS4ERR_BAD_STATEID: + case -NFS4ERR_OLD_STATEID: if (inode != NULL && stateid != NULL) { nfs_inode_find_state_and_recover(inode, stateid); @@ -477,7 +478,6 @@ static int nfs4_do_handle_exception(struct nfs_server *server, return 0; case -NFS4ERR_RETRY_UNCACHED_REP: - case -NFS4ERR_OLD_STATEID: exception->retry = 1; break; case -NFS4ERR_BADOWNER: Or alternative, for the LOCK it should be: diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index c8b554a..ce846faf 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -6441,6 +6441,7 @@ static void nfs4_handle_setlk_error(struct nfs_server *server, struct nfs4_lock_ case -NFS4ERR_ADMIN_REVOKED: case -NFS4ERR_EXPIRED: case -NFS4ERR_BAD_STATEID: + case -NFS4ERR_OLD_STATEID: lsp->ls_seqid.flags &= ~NFS_SEQID_CONFIRMED; if (new_lock_owner != 0 ||