Received: by 2002:ab2:6991:0:b0:1f7:f6c3:9cb1 with SMTP id v17csp664947lqo; Wed, 8 May 2024 10:52:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXwDIp/t7TbyynmKZ+nfsXMFPUqB3f38WCMY8a31kJZsFFJdf4+KYWv/UlyTVIzMsOd2pHEqZ5QnQAJ/131Unmz8DLRz+LnH4AU13K1Yg== X-Google-Smtp-Source: AGHT+IHipu0JuBQlJprWg/nzb+1pjlopJLvXhuLN5SJVVPbbZt3QzNIgq4Ej8UEpTvAOzVEuFfNa X-Received: by 2002:a05:6a21:1505:b0:1af:d033:d66d with SMTP id adf61e73a8af0-1afd033d823mr1281423637.9.1715190774923; Wed, 08 May 2024 10:52:54 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715190774; cv=pass; d=google.com; s=arc-20160816; b=Bb4HgkZvlEBtnLuwcehQqJ9WH2pO2fuBOd3jgGF+2H7iO69xf6WOB3TxHNsxBzu38w OQDI/Cpn25fBrKUvV9iK6GajxP/PqeaFvAKgUPMqvPlKEAWB9pP0D2wKdzcbfZg/muwI 2fyN3ZTnUn+xx9fACBdmAIAqqSuJ0JDQ15fuuv+Ct3QTk3GmsyYvif5/0ROCrnjfQkXZ BUPdLM7tr4j2Qo+y9yEYyhwm758Iv1Dx7mfetcZOgpRd7Gs+JE6pCsIJXojhlq8N3mFc ETinUQ9vJoI8rVoc1R0cLT8Mc0I01KXCxJm4MTl/KZk1qEf8ksbo82Ou6gVFGgTK5VVI 3UAw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=GyuNEHBhOHu2lFnfyz/EA6MNfXhMRJo+SsdaFvfKi/M=; fh=Kf4AR+B8Zajtk9JLh0TnO1AzU/qyyrC1vz0WtQdoFrs=; b=rFtTA0kBZ79rnleHVEuZS+f9bQdVjp9+/e/PjzP1jiQtNStAgPvvU7Yy5WcYx8iq7S woCW2UDjGMMMlZy6lN4K2NSlNBR26hQOZbmkN1TM+JRTlEBPkH+BdSUtPcGcxoGnmUkH DK7lfxvKqzq10s5X+azHfCe9H72lxNWcOWMjDYd+p/YqRCwAt92zNkfcOxGJN3Rmjti1 ZMlTKencs908K1uSeaXWztBOUIhrKyqP2pTyIYti2vyM5jQ5AXXTdSjFI2RKrVR00xDO 7VwbDQgi8WdprR0g4tM98zkeScZIg2vMZ7vPuoBSyx7Eh3SH7fUCiumSZNC2hcK9ohxy yiVA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="DyPAbQ1/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-nfs+bounces-3212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3212-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id bq7-20020a056a000e0700b006f4837608bcsi5750207pfb.297.2024.05.08.10.52.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 May 2024 10:52:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="DyPAbQ1/"; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-nfs+bounces-3212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3212-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 64AE828521B for ; Wed, 8 May 2024 17:52:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A825812BEB6; Wed, 8 May 2024 17:52:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DyPAbQ1/" X-Original-To: linux-nfs@vger.kernel.org Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ED8988BEE for ; Wed, 8 May 2024 17:52:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715190741; cv=none; b=S5dCnBpFSPc0Sk7xDEPzqE6GG/GDYXc8PRmVJlf16tsCegdro/iO14rikBdwNgOoLg3tfgnStOnvCWbd135+G9aB73e+vtxIfR/F0NgH8Gk/JCPEDjA2rAjoY8o/mrhm3RVVEkZ2Ck/viGs6sxVRCWwW/bDr5NFJW8cfPBrVNHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715190741; c=relaxed/simple; bh=Eq0b7iFJq0mTCZkGQVFPub5gh/92dITPA0z1Wn+MpZ4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=XKvyA1aN8jcTbLNbMT19vSSa4t4eb7o/n6xiW8FLgbC1SkHq4z5wTe8gJ/Y+qf20ZHAd5L7hlxRD8Kb6ftAMXwUFt0TeDzR/TRAbfigmTJ+oCwfeVEHeOWi0Wz2fww9iiKjMnup6CvXp5ZQ/i7UrRLqSeyKW7vnL6hnxN3WV6XM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DyPAbQ1/; arc=none smtp.client-ip=209.85.167.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-lf1-f54.google.com with SMTP id 2adb3069b0e04-51faf2325f4so809062e87.1 for ; Wed, 08 May 2024 10:52:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715190738; x=1715795538; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=GyuNEHBhOHu2lFnfyz/EA6MNfXhMRJo+SsdaFvfKi/M=; b=DyPAbQ1/lHQVTJhhgg/ZVlT56dNtx8DphETk/ZTprka48CoepuPHrGp5LILCknUYjr i1Myu4PKVTv3+SBl55Wiq9RNpDiUHyub2JWQfxHt5GA/bi48Hg1W6CqWFywKbJHnGDtx n4ea204xkvxCDDy41cqK2aAXIBKvzyGOAvMcqCmzLVzJCf8TuLrS4kFQXKOASawsc4+B fVv0PD3zW+9UTwCOhVnOCS/5zDuoW4gpv+ayTIZcXM93T5MmZS5puf85VUdpmQU1/Dg1 y/h/YogVFgH+t7XVdOfo4gLP2wl9px5xxw0w7E2LCEqR5FQB9wOdBThsSIDjiDFqTLzp xR4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715190738; x=1715795538; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GyuNEHBhOHu2lFnfyz/EA6MNfXhMRJo+SsdaFvfKi/M=; b=j9EZyhMkyErsrrEuiEaraRhYSZLQDU4j3K5YXUXEselj6LYRGYcTcDa75Ufcxd23g1 kAo19a69GPm98nitsiFPJarUTnfsk+lVtaKcH2W+yEiivVWXh4qvEHE8n9pOsPMxuZRs +w+qY2PZiKnJkueKVy1eSSD9EY50AEbYXcoFsNEDuFYKAgjMhpUlhijvND0RonEkVfc5 j7I8VjqJButulongR2CT21pKlP7jhKp0OT2RVYXXXZiw1WRd+lh2BMxznoyBNzX2wIMi KssmgW4WVSSPMrY/kS97EjfWGOqOEck0RmkRCvf2j4+5XhawsHsSQNB6B+sK1AdZstNi YSLg== X-Forwarded-Encrypted: i=1; AJvYcCUR55cI5sZPAbVvB9gbeIEHJ6WAkCJWnEnhiyGxgmqZnWxQYHu9K9EOuoHMeEE1GBA4PiXJQEwDXeTo6Yho7ddxmHJ02pc4p9mN X-Gm-Message-State: AOJu0YxyAz6Lsa//M0aawG/w1s23EAYIFWVmNonEhL6OiqQ5h8/M0zIi sqHScxB6w/0MoJZP5HWpSxVtjil5lflMZ50IMJXuBoNUR6mZf53n4IVzt0PE1uQOfbLTsiwcJpq hDGkglK+bK1ArwXiYze1Pbt75ayo= X-Received: by 2002:a2e:a715:0:b0:2de:1457:9d22 with SMTP id 38308e7fff4ca-2e445f80bccmr19699621fa.0.1715190737927; Wed, 08 May 2024 10:52:17 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240507195933.45683-1-olga.kornievskaia@gmail.com> <9D9DB9E5-E772-462B-BD38-7F703459A0FC@redhat.com> In-Reply-To: <9D9DB9E5-E772-462B-BD38-7F703459A0FC@redhat.com> From: Olga Kornievskaia Date: Wed, 8 May 2024 13:52:06 -0400 Message-ID: Subject: Re: [PATCH 1/1] pNFS/filelayout: check layout segment range To: Benjamin Coddington Cc: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com, linux-nfs@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 8, 2024 at 10:50=E2=80=AFAM Benjamin Coddington wrote: > > On 7 May 2024, at 15:59, Olga Kornievskaia wrote: > > > From: Olga Kornievskaia > > > > Before doing the IO, check that we have the layout covering the range o= f > > IO. > > > > Signed-off-by: Olga Kornievskaia > > --- > > fs/nfs/filelayout/filelayout.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/fs/nfs/filelayout/filelayout.c b/fs/nfs/filelayout/filelay= out.c > > index 85d2dc9bc212..bf3ba2e98f33 100644 > > --- a/fs/nfs/filelayout/filelayout.c > > +++ b/fs/nfs/filelayout/filelayout.c > > @@ -868,6 +868,7 @@ filelayout_pg_init_read(struct nfs_pageio_descripto= r *pgio, > > struct nfs_page *req) > > { > > pnfs_generic_pg_check_layout(pgio); > > + pnfs_generic_pg_check_range(pgio, req); > > if (!pgio->pg_lseg) { > > pgio->pg_lseg =3D fl_pnfs_update_layout(pgio->pg_inode, > > nfs_req_openctx(req= ), > > @@ -892,6 +893,7 @@ filelayout_pg_init_write(struct nfs_pageio_descript= or *pgio, > > struct nfs_page *req) > > { > > pnfs_generic_pg_check_layout(pgio); > > + pnfs_generic_pg_check_range(pgio, req); > > if (!pgio->pg_lseg) { > > pgio->pg_lseg =3D fl_pnfs_update_layout(pgio->pg_inode, > > nfs_req_openctx(req= ), > > -- > > 2.39.1 > > Looks right, less duplication to just call pnfs_generic_pg_check_range() > from pnfs_generic_pg_check_layout() now. filelayout.c is not the only caller of pnfs_generic_pg_check_layout(). flexfilelayout has a wrapper around those 2 functions and calls that. however, the argument about duplicated code frustrates me because currently the code has 4lines. but if we were to re-write the same with a function, it would be more lines used in total (flexfiles has 8 lines for it). > > Reviewed-by: Benjamin Coddington > > Ben >