From patchwork Tue Aug 13 14:28:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Trond Myklebust X-Patchwork-Id: 11092347 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 01C8B14F7 for ; Tue, 13 Aug 2019 14:30:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7B3E28681 for ; Tue, 13 Aug 2019 14:30:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DC3AE286A4; Tue, 13 Aug 2019 14:30:18 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 9870C2869F for ; Tue, 13 Aug 2019 14:30:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729167AbfHMOaS (ORCPT ); Tue, 13 Aug 2019 10:30:18 -0400 Received: from mail-ot1-f65.google.com ([209.85.210.65]:45704 "EHLO mail-ot1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729151AbfHMOaR (ORCPT ); Tue, 13 Aug 2019 10:30:17 -0400 Received: by mail-ot1-f65.google.com with SMTP id m24so20201154otp.12 for ; Tue, 13 Aug 2019 07:30:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=POup7bPke7kznuQqaIq7NKUgApio1QYHx8UAmRlyVl8=; b=WePIN+Hk4Gwz71QB16Ruof9OXPbGTs9ort47eBiQCqcsZI7bNG/WYdUYs8zb5e1YCS +A3XmR/BUO2nbxHABBaFqL/+AhnEnBE6m2ChkvAWNcAnzRuV/XXhNwfygS3G2/I7AX2r aiolAQPZLfH/XSOwUYoktbfoGIe6xNqDwych+nhqAXYAulLuyHeToFLL4VYmPXVBkQtJ Oc5YMABkQSJs8c4EEtzEyBluyjao/Jh9NgA8+84gQpl80UIpyGSoofgZpfopr2EbGRrJ 3Tm5g0k68Wcwv96X9CrhMqraYF3SeC/2Yj6sbC7zKDucLRVGE+95/KM3fhJ7APHAtQGr dHmQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=POup7bPke7kznuQqaIq7NKUgApio1QYHx8UAmRlyVl8=; b=VL61iJOqZPPAp9Oo5DkB9SoMi6lfe7e1G/uI5UlcYXkI14p7xR0Exi/lvoubVh4t9X NNpNz/4H6iItSLZYDyIG9BJFrd8uEuqSQx5ov0TQIRJiu3JjPxaA0SAF+fEiYVAV+u9k fKc1tpO1pD/qsa1yL0RCT22xg3yw9eWNrWx2NarBfppVE+ORWdtVsVtXoIsrQbQBq2sN 9Ybzgyd0jyqtM2Dk3qvaMstJk+xJ7VUYO7lZKSsSgcycWxC7ofM41AjLbVSEdtXdnwva dQFaD5iOYTryGzhaeU8r0zPDjQRgYpr0I3P+OfTdBHJ2I32x6vmlmkbW6/8Zq/XJTyzc Y8nw== X-Gm-Message-State: APjAAAXQJs7Ypew6FMKlIx/dtAN48Wc6RNiLsUvNyHaYqE8V1UeasrWU ZCes9MTN7T9fi1FZKVIW/MxLvG4= X-Google-Smtp-Source: APXvYqwhuBJfppnQP8z3p4iPtvGB61iYoybkXdI5TE3MIcml+r3h/Re5iOHYizELO1zONiYW+84O0g== X-Received: by 2002:a6b:7619:: with SMTP id g25mr1510634iom.92.1565706616317; Tue, 13 Aug 2019 07:30:16 -0700 (PDT) Received: from localhost.localdomain (c-68-40-189-247.hsd1.mi.comcast.net. [68.40.189.247]) by smtp.gmail.com with ESMTPSA id o6sm9429161ioh.22.2019.08.13.07.30.15 for (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 13 Aug 2019 07:30:15 -0700 (PDT) From: Trond Myklebust X-Google-Original-From: Trond Myklebust To: linux-nfs@vger.kernel.org Subject: [PATCH 3/5] NFSv4: Fix return value in nfs_finish_open() Date: Tue, 13 Aug 2019 10:28:04 -0400 Message-Id: <20190813142806.123268-3-trond.myklebust@hammerspace.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190813142806.123268-2-trond.myklebust@hammerspace.com> References: <20190813142806.123268-1-trond.myklebust@hammerspace.com> <20190813142806.123268-2-trond.myklebust@hammerspace.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-Virus-Scanned: ClamAV using ClamSMTP If the file turns out to be of the wrong type after opening, we want to revalidate the path and retry, so return EOPENSTALE rather than ESTALE. Signed-off-by: Trond Myklebust --- fs/nfs/dir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 8d501093660f..0adfd8840110 100644 --- a/fs/nfs/dir.c +++ b/fs/nfs/dir.c @@ -1487,7 +1487,7 @@ static int nfs_finish_open(struct nfs_open_context *ctx, if (S_ISREG(file->f_path.dentry->d_inode->i_mode)) nfs_file_set_open_context(file, ctx); else - err = -ESTALE; + err = -EOPENSTALE; out: return err; }