From patchwork Tue Jan 16 21:38:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Mkrtchyan, Tigran" X-Patchwork-Id: 10168133 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 D555F60325 for ; Tue, 16 Jan 2018 21:39:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C562F22A6B for ; Tue, 16 Jan 2018 21:39:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA08D2623C; Tue, 16 Jan 2018 21:39:30 +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, HK_RANDOM_FROM, 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 A195722A6B for ; Tue, 16 Jan 2018 21:39:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751430AbeAPVj0 (ORCPT ); Tue, 16 Jan 2018 16:39:26 -0500 Received: from smtp-o-3.desy.de ([131.169.56.156]:60653 "EHLO smtp-o-3.desy.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751090AbeAPVjZ (ORCPT ); Tue, 16 Jan 2018 16:39:25 -0500 X-Clacks-Overhead: GNU Terry Pratchett DKIM-Filter: OpenDKIM Filter v2.11.0 smtp-o-3.desy.de B7FD0280885 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=desy.de; s=default; t=1516138763; bh=CKke715ip0AwdwS5jzPxWH+gFeveErwsWATIc3/Pycs=; h=From:To:Cc:Subject:Date:From; b=S/SbRIqxxqBHkLiYcREe1lwhKmr1Ei1h2t6hqPDPjso2eZeBTEqbEaDs0dpgJLMLy Llnab0aC5sbVyVrhPA4dSxfCAF7xvYSM38nxLzXvuGHRdGdedifB+R1k55PsORvY1N 1ZivvYdZcMJYIGEUUE3dsnFGcpUj4bsVaojq5s84= Received: from smtp-map-3.desy.de (smtp-map-3.desy.de [131.169.56.68]) by smtp-o-3.desy.de (DESY-O-3) with ESMTP id B7FD0280885 for ; Tue, 16 Jan 2018 22:39:23 +0100 (CET) X-Virus-Scanned: amavisd-new at desy.de Received: from anahit.desy.de (anahit.desy.de [131.169.185.68]) by smtp-intra-3.desy.de (DESY-INTRA-3) with ESMTP id 767251406; Tue, 16 Jan 2018 22:39:22 +0100 (MET) From: Tigran Mkrtchyan To: linux-nfs@vger.kernel.org Cc: trond.myklebust@primarydata.com, Anna.Schumaker@Netapp.com, Tigran Mkrtchyan Subject: [PATCH] nfs41: do not return ENOMEM on LAYOUTUNAVAILABLE Date: Tue, 16 Jan 2018 22:38:50 +0100 Message-Id: <20180116213850.10323-1-tigran.mkrtchyan@desy.de> X-Mailer: git-send-email 2.14.3 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 A pNFS server may return LAYOUTUNAVAILABLE error on LAYOUTGET for files which don't have any layout. In this situation pnfs_update_layout currently returns NULL. As this NULL is converted into ENOMEM, IO requests fails instead of falling back to MDS. Do not return ENOMEM on LAYOUTUNAVAILABLE and let client retry through MDS. Fixes 8d40b0f14846f. I will suggest to backport this fix to affected stable branches. Signed-off-by: Tigran Mkrtchyan --- fs/nfs/filelayout/filelayout.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 28b72285711e..94f8fc02ea4e 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -895,9 +895,7 @@ fl_pnfs_update_layout(struct inode *ino, lseg = pnfs_update_layout(ino, ctx, pos, count, iomode, strict_iomode, gfp_flags); - if (!lseg) - lseg = ERR_PTR(-ENOMEM); - if (IS_ERR(lseg)) + if (!lseg || IS_ERR(lseg)) goto out; lo = NFS_I(ino)->layout;