Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2588019rdg; Mon, 16 Oct 2023 08:45:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGmQCQ01HpjQYN/lb6v+LLyWdrzpZN4BdMlyqADOrP+zHA4vGWMvgw26en/bdrLGHTHLyMD X-Received: by 2002:a17:902:ec88:b0:1c9:e2ed:66fe with SMTP id x8-20020a170902ec8800b001c9e2ed66femr11895507plg.52.1697471131447; Mon, 16 Oct 2023 08:45:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697471131; cv=none; d=google.com; s=arc-20160816; b=HDBOZ1bd7wK55GiWpK0lKTwcGtinsHHawJiJf3hMknMfFKJpDgWP4DUFgAqV/7i5CW HMldIKZk+8vVUyzKvqnOM6NHexGCnJH9XZ35Fb7tJ6XS/Aj+goblWBfOZnrjwha/lvWR P4ofFaHVER2Ru04i3wNUpMlK4tvZWNA6ixlYs3xtE8xx8/yvNPwaWyHppB5DBGffOeW/ ku2lBnoUU8ldExwnrpLpPYZXT4u75AUHpbI+bk/SWXeE6ti22Pasem36UZ4GrTqlEsXi P+xQwYQHfZluqP7avitteSn7pErjoyZ+O/KvaSXS3vXEavh4or8I1hh1ZH6S8pEpXwJH z9JQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=qLFJ6I/gwdue4jINf+DgjzrwjIHoB+fOVo8KsAWvSrY=; fh=ACX46T2NolIk8TH6znf5W+o7zSUjpf1IduZbKEcdypk=; b=cUNrJJk62iV7U7NMbwEMnFjCI8KZesY5hhly/70L3Gl3eTAIu8PuU7ETEIPf+0suCp hgKPQ/5lb5W+cEIUHfyZg5K0vLcfQKYjGwTREtd2VRhkt2iMOEe/uXv3cToc8vpb94uZ S73Vj19AmYhuNFEHAWdNDiJEDpeR2in5a1QuBwPf4J7AyioxGPTd4uRILJdgnVP+wxYM jeuVF4C8oS051LKuDu8+H35IDJT28nxAwBrWlWVyQeGDXR7dnyWrUJDn/6UhQenO8fL/ 2QwnYdYvRcaJUxzg01Qxkp82V9Fr1R7gGGv6n+l239wjBrKLsD7t8WTNaxR96OlHjq3F KIZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=guJwgvZh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id k4-20020a170902d58400b001b8c824e826si11174717plh.533.2023.10.16.08.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 08:45:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=guJwgvZh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 5AAF2807C5DB; Mon, 16 Oct 2023 08:45:15 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233913AbjJPPpE (ORCPT + 99 others); Mon, 16 Oct 2023 11:45:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233750AbjJPPo7 (ORCPT ); Mon, 16 Oct 2023 11:44:59 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3428EE; Mon, 16 Oct 2023 08:44:57 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6D9AC433C9; Mon, 16 Oct 2023 15:44:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697471097; bh=9uoP06owwVRPrncswrsWLKQbhdyottu9QKK6JcK20LE=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=guJwgvZhq0+Zrw5QhtmZPfW4yFn8mNZ3GKIUOfnH3zVXd6BdPrVmytwdm6n34W6H+ uih7zQPbYtKSkKjvX12X1J6ek6B8zzyXJmn5eqCg4IwuAOyGQx0jYQm2qMdPvM8/h/ okldncECKsUqeuslP3yRlKRpYtmuaVcKD5u1KKqN2qwhjDfbBPvqTsK/ImpYNzfBlg PwVq3fw8lT9Q+P+Xe/3V3jnUzY1Z8OYfP7nIEisoCu/s7myl43v1Xj0uocnCQRhAOa YW7F5nUwox2yNFVjc7qjLqmSSl+50CYdhXz3UikmW97Uk9eWg86Lnbks1taiDu1Lou AzOuWKDg8Q4fA== Message-ID: Subject: Re: [RFC PATCH 03/53] netfs: Note nonblockingness in the netfs_io_request struct From: Jeff Layton To: David Howells , Steve French Cc: Matthew Wilcox , Marc Dionne , Paulo Alcantara , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Dominique Martinet , Ilya Dryomov , Christian Brauner , linux-afs@lists.infradead.org, linux-cifs@vger.kernel.org, linux-nfs@vger.kernel.org, ceph-devel@vger.kernel.org, v9fs@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cachefs@redhat.com Date: Mon, 16 Oct 2023 11:44:54 -0400 In-Reply-To: <20231013155727.2217781-4-dhowells@redhat.com> References: <20231013155727.2217781-1-dhowells@redhat.com> <20231013155727.2217781-4-dhowells@redhat.com> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Mon, 16 Oct 2023 08:45:15 -0700 (PDT) On Fri, 2023-10-13 at 16:56 +0100, David Howells wrote: > Allow O_NONBLOCK to be noted in the netfs_io_request struct. Also add a > flag, NETFS_RREQ_BLOCKED to record if we did block. >=20 > Signed-off-by: David Howells > cc: Jeff Layton > cc: linux-cachefs@redhat.com > cc: linux-fsdevel@vger.kernel.org > cc: linux-mm@kvack.org > --- > fs/netfs/objects.c | 2 ++ > include/linux/netfs.h | 2 ++ > 2 files changed, 4 insertions(+) >=20 > diff --git a/fs/netfs/objects.c b/fs/netfs/objects.c > index 85f428fc52e6..e41f9fc9bdd2 100644 > --- a/fs/netfs/objects.c > +++ b/fs/netfs/objects.c > @@ -37,6 +37,8 @@ struct netfs_io_request *netfs_alloc_request(struct add= ress_space *mapping, > INIT_LIST_HEAD(&rreq->subrequests); > refcount_set(&rreq->ref, 1); > __set_bit(NETFS_RREQ_IN_PROGRESS, &rreq->flags); > + if (file && file->f_flags & O_NONBLOCK) > + __set_bit(NETFS_RREQ_NONBLOCK, &rreq->flags); > if (rreq->netfs_ops->init_request) { > ret =3D rreq->netfs_ops->init_request(rreq, file); > if (ret < 0) { > diff --git a/include/linux/netfs.h b/include/linux/netfs.h > index 282511090ead..b92e982ac4a0 100644 > --- a/include/linux/netfs.h > +++ b/include/linux/netfs.h > @@ -205,6 +205,8 @@ struct netfs_io_request { > #define NETFS_RREQ_DONT_UNLOCK_FOLIOS 3 /* Don't unlock the folios on co= mpletion */ > #define NETFS_RREQ_FAILED 4 /* The request failed */ > #define NETFS_RREQ_IN_PROGRESS 5 /* Unlocked when the request completes= */ > +#define NETFS_RREQ_NONBLOCK 6 /* Don't block if possible (O_NONBLOCK) *= / > +#define NETFS_RREQ_BLOCKED 7 /* We blocked */ > const struct netfs_request_ops *netfs_ops; > }; > =20 >=20 I'd prefer to see this patch squashed in with the first patches that actually check for these flags. I can't look at this patch alone and tell how it'll be used. --=20 Jeff Layton