All of lore.kernel.org
 help / color / mirror / Atom feed
From: Trond Myklebust <trondmy@hammerspace.com>
To: "anna.schumaker@netapp.com" <anna.schumaker@netapp.com>,
	"trondmy@kernel.org" <trondmy@kernel.org>
Cc: "linux-nfs@vger.kernel.org" <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH v2 6/8] NFSv4: Support the offline bit
Date: Fri, 7 Jan 2022 14:26:37 +0000	[thread overview]
Message-ID: <91d002bfefa641a8b9d6010dfa4b482343ead6da.camel@hammerspace.com> (raw)
In-Reply-To: <CAFX2JfnXtm90Tn7Y4h04Ca+fxqxjesP1CjOpEHOKBRVPNPum5A@mail.gmail.com>

On Fri, 2022-01-07 at 09:23 -0500, Anna Schumaker wrote:
> Hi Trond,
> 
> On Tue, Dec 28, 2021 at 3:03 AM <trondmy@kernel.org> wrote:
> > 
> > From: Trond Myklebust <trond.myklebust@primarydata.com>
> > 
> > Add tracking of the NFSv4 'offline' attribute.
> > 
> > Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
> > Signed-off-by: Lance Shelton <lance.shelton@hammerspace.com>
> > Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
> > ---
> >  fs/nfs/inode.c          | 11 +++++++++++
> >  fs/nfs/nfs4proc.c       |  6 ++++++
> >  fs/nfs/nfs4trace.h      |  3 ++-
> >  fs/nfs/nfs4xdr.c        | 31 ++++++++++++++++++++++++++++++-
> >  include/linux/nfs4.h    |  1 +
> >  include/linux/nfs_fs.h  |  1 +
> >  include/linux/nfs_xdr.h |  5 ++++-
> >  7 files changed, 55 insertions(+), 3 deletions(-)
> > 
> > diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
> > index 4673b091ea31..33f4410190b6 100644
> > --- a/fs/nfs/inode.c
> > +++ b/fs/nfs/inode.c
> > @@ -528,6 +528,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh
> > *fh, struct nfs_fattr *fattr)
> >                 nfsi->archive = 0;
> >                 nfsi->hidden = 0;
> >                 nfsi->system = 0;
> > +               nfsi->offline = 0;
> >                 inode_set_iversion_raw(inode, 0);
> >                 inode->i_size = 0;
> >                 clear_nlink(inode);
> > @@ -606,6 +607,10 @@ nfs_fhget(struct super_block *sb, struct
> > nfs_fh *fh, struct nfs_fattr *fattr)
> >                 } else if (fattr_supported &
> > NFS_ATTR_FATTR_SPACE_USED &&
> >                            fattr->size != 0)
> >                         nfs_set_cache_invalid(inode,
> > NFS_INO_INVALID_BLOCKS);
> > +               if (fattr->valid & NFS_ATTR_FATTR_OFFLINE)
> > +                       nfsi->offline = (fattr->hsa_flags &
> > NFS_HSA_OFFLINE) ? 1 : 0;
> > +               else if (fattr_supported & NFS_ATTR_FATTR_OFFLINE)
> > +                       nfs_set_cache_invalid(inode,
> > NFS_INO_INVALID_WINATTR);
> > 
> >                 nfs_setsecurity(inode, fattr);
> > 
> > @@ -2274,6 +2279,12 @@ static int nfs_update_inode(struct inode
> > *inode, struct nfs_fattr *fattr)
> >                 nfsi->cache_validity |=
> >                         save_cache_validity &
> > NFS_INO_INVALID_BLOCKS;
> > 
> > +       if (fattr->valid & NFS_ATTR_FATTR_OFFLINE)
> > +               nfsi->offline = (fattr->hsa_flags &
> > NFS_HSA_OFFLINE) ? 1 : 0;
> > +       else if (fattr_supported & NFS_ATTR_FATTR_OFFLINE)
> > +               nfsi->cache_validity |=
> > +                       save_cache_validity &
> > NFS_INO_INVALID_WINATTR;
> > +
> >         /* Update attrtimeo value if we're out of the unstable
> > period */
> >         if (attr_changed) {
> >                 nfs_inc_stats(inode, NFSIOS_ATTRINVALIDATE);
> > diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
> > index 4e6cc54016ba..713a71fb3020 100644
> > --- a/fs/nfs/nfs4proc.c
> > +++ b/fs/nfs/nfs4proc.c
> > @@ -219,6 +219,7 @@ const u32 nfs4_fattr_bitmap[3] = {
> >  #ifdef CONFIG_NFS_V4_SECURITY_LABEL
> >         FATTR4_WORD2_SECURITY_LABEL
> >  #endif
> > +       | FATTR4_WORD2_OFFLINE
> >  };
> 
> This won't compile if CONFIG_NFS_V4_SECURITY_LABEL=n:
> 
> fs/nfs/nfs4proc.c:218:9: error: expected expression before ‘|’ token
>   218 |         | FATTR4_WORD2_OFFLINE

Oh... Can you fix it up by just moving that '|' inside the #ifdef?



-- 
Trond Myklebust
Linux NFS client maintainer, Hammerspace
trond.myklebust@hammerspace.com



  reply	other threads:[~2022-01-07 14:26 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-27 19:04 [PATCH v2 0/8] Support btime and other NFSv4 specific attributes trondmy
2021-12-27 19:04 ` [PATCH v2 1/8] NFS: Expand the type of nfs_fattr->valid trondmy
2021-12-27 19:04   ` [PATCH v2 2/8] nfs: Add timecreate to nfs inode trondmy
2021-12-27 19:04     ` [PATCH v2 3/8] NFS: Return the file btime in the statx results when appropriate trondmy
2021-12-27 19:05       ` [PATCH v2 4/8] nfs: Add 'archive', 'hidden' and 'system' fields to nfs inode trondmy
2021-12-27 19:05         ` [PATCH v2 5/8] nfs: Add 'time backup' " trondmy
2021-12-27 19:05           ` [PATCH v2 6/8] NFSv4: Support the offline bit trondmy
2021-12-27 19:05             ` [PATCH v2 7/8] NFS: Support statx_get and statx_set ioctls trondmy
2021-12-27 19:05               ` [PATCH v2 8/8] NFSv4: Add an ioctl to allow retrieval of the NFS raw ACCESS mask trondmy
2022-01-07 14:23             ` [PATCH v2 6/8] NFSv4: Support the offline bit Anna Schumaker
2022-01-07 14:26               ` Trond Myklebust [this message]
2022-01-07 14:31               ` Anna Schumaker
2022-01-07 14:36                 ` Trond Myklebust
2022-01-07 20:36                   ` Anna Schumaker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=91d002bfefa641a8b9d6010dfa4b482343ead6da.camel@hammerspace.com \
    --to=trondmy@hammerspace.com \
    --cc=anna.schumaker@netapp.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.