Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp5412584yba; Tue, 30 Apr 2019 14:27:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqyCvGjN9MEMX1pXYzqqdllcFWZswBMMuvDHLcgAurpSWejRYpPyKwS8VFAXkkR/9RWSANu9 X-Received: by 2002:a63:1055:: with SMTP id 21mr50088571pgq.200.1556659679350; Tue, 30 Apr 2019 14:27:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556659679; cv=none; d=google.com; s=arc-20160816; b=hseie1El1L7eDU4d10swlj2m7Gi1d2cCGcRSoKc3ms7Htsorfu6mjAHnFPngXKQPlh Kmuu34ODmd3OFAp4k3yozvfSUjzJQrwIhm+qwudccm3VYWCYJR8DgBLXBO2AP4SQqz1d q3P8sA2BKPwyBDFs2r22WkIdEvE8UmW/50TsyYLo9F+DT6GOzmjA/94jnE1BnA7Gsjcq MNinQ9ShwfUDvPTUpHEKxd6V1+4WksWgMFnYxSNmbpEWXZwbnJSc6uu9Rvvhb9CXaVny 7FMLFKEtc6SPnIjhIEEloHH9vs5akbkgCelO+0XqCh7tp4CMncd1/eTLJd083U6E/Ks6 8LqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=4xyXUYxnTFwy4NPFFIT+bS8lIfPyDn2kW+V+8jRdIQ0=; b=KX+TtSAn4dp4MdVSYtWQrX01Lp3IUmd2iijZVDYu3Bq9k/+YkItdb2ztSguZjy1fLv OloCG6J8N2Z+cZ96PWRW5zy2P1oxHM7KTFe7rF7rbsGlIotvutjlLWDbjdngs1WYq+xC uyQZLE/6OvLgCEV8A4CuG4ps8W7LXV1V5PNsEpBP3RjbDmJtW0jQRHgoAil0B5P1kxc2 igs+ZGlxnROs3Z9ESw54zBoQ5Kc6y1qXgmv/fAxeIvt2/zsTqGyZIR9PSFiVppjU5amA FpnZXzcScl1ApNOOlhC3RwJqIcRm79IpRSOnD4ZxvVRa54NKRgcIskFpoSvU2jiLkrYZ 7o4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=shBzugE8; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t69si38638829pfa.7.2019.04.30.14.27.33; Tue, 30 Apr 2019 14:27:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=shBzugE8; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726049AbfD3VZq (ORCPT + 99 others); Tue, 30 Apr 2019 17:25:46 -0400 Received: from mail-vk1-f176.google.com ([209.85.221.176]:35046 "EHLO mail-vk1-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726048AbfD3VZq (ORCPT ); Tue, 30 Apr 2019 17:25:46 -0400 Received: by mail-vk1-f176.google.com with SMTP id t74so3460124vke.2 for ; Tue, 30 Apr 2019 14:25:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=mime-version:from:date:message-id:subject:to:cc; bh=4xyXUYxnTFwy4NPFFIT+bS8lIfPyDn2kW+V+8jRdIQ0=; b=shBzugE8hMf8XoJlATvVlkK8JRwYYjt/nCiOjdjcyOZ6fsk9qZ+rohJTta0mNGIwTH owBzT0Ym/89tN+1TVrCwNjyM4AZCogwTE+AhcRsX6DJaWD6QmrtrH5xA7HXsKeVSFRsF owoFzsAWtNCeMH531f+4nsF35BWUoqFdyX3gAuWziTevWhGjTff+ACh5jf8ncQJOveGf Gk5oqfPXA7HWFjGVfcAusuerPwqkUT5Ph7SDo8/PlLjlXx41kws7wqA6pyTUzDxfGNE3 yrXslyn+DbHY+43Vjh5RsFaeDhep4FP8w2cGfv03kWIdpj23yYFeiyZDpgwLXpMa0dB/ Svrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=4xyXUYxnTFwy4NPFFIT+bS8lIfPyDn2kW+V+8jRdIQ0=; b=DMVWtO3GA2hPQMiDuj3x7i+F+XXRyl2IINwXCNI1clK01+H7fbgmorIsALjJDV1ESJ Ym/KcaPPgbXn773NDZ3TwNsQCfT6j72y5c9gg1RVevh5CnzxTXGlfrra/hdk/iLkr0qk 393LQM0dGlXInYEdEVhkdiCMtOba02jbgdauk1U6DKEVXPsxzhmQJBUTgs7rBNwipD/A zY73rapIceMbfo8Gu/LKUmY+I4OnEJTVtFUWllWqPyHXykx/K+I3ALKupYxYptxkYej+ /A6OWuRI2ZWBpCt+PxUQPcJehpH3lmAQBxXo3EoJqeJ8++ed6fqXvVrMVm5VgsnEPnb9 IptQ== X-Gm-Message-State: APjAAAUIuk+exxXO57zU7nDyfWt5BbScbAD1rqKSFgmDVqawZt6If/ic ZgKQGX3zGrrm3JNS3wfT+fACY+3Cs4ZxxDPrsvcr4NF+ X-Received: by 2002:a1f:17cd:: with SMTP id 196mr2527671vkx.83.1556659545015; Tue, 30 Apr 2019 14:25:45 -0700 (PDT) MIME-Version: 1.0 From: Olga Kornievskaia Date: Tue, 30 Apr 2019 17:25:33 -0400 Message-ID: Subject: question about pnfs logic To: Trond Myklebust Cc: linux-nfs Content-Type: text/plain; charset="UTF-8" Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Hi Trond, I'm trying to figure existing code in order to fix a problem. Can you please help? Say there was an IO to the DS and it timeouts. Pnfs code in the filelayout_async_handle_error() marks the device unavailable and marks the layout to be returned. Timed out IO is retried against the MDS. The new IO tries to do the pnfs and because the device is marked unavailable (returning EINVAL) it propagates back all the way to the pg_init setup and fails the IO with EINVAL. But IO shouldn't fail. My question is why are we returning the status of the filelayout_check_deviceid(), I propose that instead we at that point set lseg=NULL and then the IO would be redirected to the MDS. Or maybe I'm missing something else? My proposed fix would be: diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelayout.c index 61f46facb39c..b3e8ba3bd654 100644 --- a/fs/nfs/filelayout/filelayout.c +++ b/fs/nfs/filelayout/filelayout.c @@ -904,7 +904,7 @@ fl_pnfs_update_layout(struct inode *ino, status = filelayout_check_deviceid(lo, fl, gfp_flags); if (status) { pnfs_put_lseg(lseg); - lseg = ERR_PTR(status); + lseg = NULL; } out: return lseg;