Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB875C433F5 for ; Thu, 6 Jan 2022 14:55:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231788AbiAFOzs (ORCPT ); Thu, 6 Jan 2022 09:55:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34650 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232616AbiAFOzr (ORCPT ); Thu, 6 Jan 2022 09:55:47 -0500 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13C3DC061245 for ; Thu, 6 Jan 2022 06:55:47 -0800 (PST) Received: by fieldses.org (Postfix, from userid 2815) id 7FB5472FB; Thu, 6 Jan 2022 09:55:46 -0500 (EST) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org 7FB5472FB DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1641480946; bh=sbBZE46fw3MdQ2ppXcdRopNUbkctHGBoGHOolPSC7RM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wHtEYQRoRdtOU3u9J2fPc4A+H4O3/AqXYWbrCtsFtZo2zRbfHNcBs+XUqNv4IxCVF wxvIUzTSGwTXYhG5rGCeQc9mk16AtOCmRxml4gio4PIie0GOmIyFh6ql3DVAy2jgkj g7Nm/0Hz8L+LVYLhjguHdOLPVwNpQiYe9WVsDgUA= Date: Thu, 6 Jan 2022 09:55:46 -0500 From: "bfields@fieldses.org" To: Ondrej Valousek Cc: Trond Myklebust , "linux-nfs@vger.kernel.org" , "anna.schumaker@netapp.com" , "trondmy@kernel.org" Subject: Re: [PATCH 0/8] Support btime and other NFSv4 specific attributes Message-ID: <20220106145546.GE7105@fieldses.org> References: <20220105151008.GB24685@fieldses.org> <20220105155451.GA25384@fieldses.org> <20220106142812.GC7105@fieldses.org> <20220106143605.GD7105@fieldses.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Jan 06, 2022 at 02:52:36PM +0000, Ondrej Valousek wrote: > You rather mean bmval1 not bmval0, right? Oops, right.--b. > > -----Original Message----- > From: bfields@fieldses.org > Sent: čtvrtek 6. ledna 2022 15:36 > To: Ondrej Valousek > Cc: Trond Myklebust ; linux-nfs@vger.kernel.org; anna.schumaker@netapp.com; trondmy@kernel.org > Subject: Re: [PATCH 0/8] Support btime and other NFSv4 specific attributes > > On Thu, Jan 06, 2022 at 09:28:12AM -0500, bfields@fieldses.org wrote: > > On Thu, Jan 06, 2022 at 02:19:22PM +0000, Ondrej Valousek wrote: > > > > You also need to update the value of NFSD4_SUPPORTED_ATTRS_WORD1 to reflect the new support for FATTR4_WORD1_TIME_CREATE. > > > > > > Yes, I realized that one shortly after I sent the mail. > > > Just going to try this patch: > > > > Thanks! > > > > Don't we want to vary support depending on the filesystem, though? Is > > there a way to query that? > > Poking around a bit... looks like we need to check stat->result_mask & STATX_BTIME. And use that to adjust the value of bmval0 at the top of encode_fattr, and make the below encoding conditional on it. > > ? > > --b. > > > > > --b. > > > > > > > > [ondrejv@skynet19 /opt/kernel/linux-git/fs/nfsd]$ git diff diff > > > --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index > > > 5a93a5db4fb0..be47e1dd6da5 100644 > > > --- a/fs/nfsd/nfs4xdr.c > > > +++ b/fs/nfsd/nfs4xdr.c > > > @@ -3265,6 +3265,14 @@ nfsd4_encode_fattr(struct xdr_stream *xdr, struct svc_fh *fhp, > > > p = xdr_encode_hyper(p, (s64)stat.mtime.tv_sec); > > > *p++ = cpu_to_be32(stat.mtime.tv_nsec); > > > } > > > + /* support for btime here */ > > > + if (bmval1 & FATTR4_WORD1_TIME_CREATE) { > > > + p = xdr_reserve_space(xdr, 12); > > > + if (!p) > > > + goto out_resource; > > > + p = xdr_encode_hyper(p, (s64)stat.btime.tv_sec); > > > + *p++ = cpu_to_be32(stat.btime.tv_nsec); > > > + } > > > if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) { > > > struct kstat parent_stat; > > > u64 ino = stat.ino; > > > diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index > > > 498e5a489826..5ef056ce7591 100644 > > > --- a/fs/nfsd/nfsd.h > > > +++ b/fs/nfsd/nfsd.h > > > @@ -364,7 +364,7 @@ void nfsd_lockd_shutdown(void); > > > | FATTR4_WORD1_OWNER | FATTR4_WORD1_OWNER_GROUP | FATTR4_WORD1_RAWDEV \ > > > | FATTR4_WORD1_SPACE_AVAIL | FATTR4_WORD1_SPACE_FREE | FATTR4_WORD1_SPACE_TOTAL \ > > > | FATTR4_WORD1_SPACE_USED | FATTR4_WORD1_TIME_ACCESS | FATTR4_WORD1_TIME_ACCESS_SET \ > > > - | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA \ > > > + | FATTR4_WORD1_TIME_DELTA | FATTR4_WORD1_TIME_METADATA | FATTR4_WORD1_TIME_CREATE \ > > > | FATTR4_WORD1_TIME_MODIFY | FATTR4_WORD1_TIME_MODIFY_SET | FATTR4_WORD1_MOUNTED_ON_FILEID) > > > > > > #define NFSD4_SUPPORTED_ATTRS_WORD2 0 > > > > > > > > > ... will see > > > > > > Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful. > Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.