Message ID | 20240129033637.2133-9-neilb@suse.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | nfsd: support admin-revocation of v4 state | expand |
On Mon, 2024-01-29 at 14:29 +1100, NeilBrown wrote: > Add "admin-revoked" to the status information for any states that have > been admin-revoked. This can be useful for confirming correct > behaviour. > > Signed-off-by: NeilBrown <neilb@suse.de> > --- > fs/nfsd/nfs4state.c | 10 +++++++++- > 1 file changed, 9 insertions(+), 1 deletion(-) > > diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c > index ef4ec23f7c0d..e1492ca7c75c 100644 > --- a/fs/nfsd/nfs4state.c > +++ b/fs/nfsd/nfs4state.c > @@ -2717,6 +2717,8 @@ static int nfs4_show_open(struct seq_file *s, struct nfs4_stid *st) > } > spin_unlock(&nf->fi_lock); > nfs4_show_owner(s, oo); > + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) > + seq_puts(s, ", admin-revoked"); > seq_puts(s, " }\n"); > return 0; > } > @@ -2753,6 +2755,8 @@ static int nfs4_show_lock(struct seq_file *s, struct nfs4_stid *st) > seq_puts(s, ", "); > } > nfs4_show_owner(s, oo); > + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) > + seq_puts(s, ", admin-revoked"); > seq_puts(s, " }\n"); > spin_unlock(&nf->fi_lock); > return 0; > @@ -2784,8 +2788,10 @@ static int nfs4_show_deleg(struct seq_file *s, struct nfs4_stid *st) > seq_puts(s, ", "); > nfs4_show_fname(s, file); > } > - seq_puts(s, " }\n"); > spin_unlock(&nf->fi_lock); > + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) > + seq_puts(s, ", admin-revoked"); > + seq_puts(s, " }\n"); > return 0; > } > > @@ -2809,6 +2815,8 @@ static int nfs4_show_layout(struct seq_file *s, struct nfs4_stid *st) > seq_puts(s, ", "); > nfs4_show_fname(s, file); > } > + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) > + seq_puts(s, ", admin-revoked"); > seq_puts(s, " }\n"); > > return 0; Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index ef4ec23f7c0d..e1492ca7c75c 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -2717,6 +2717,8 @@ static int nfs4_show_open(struct seq_file *s, struct nfs4_stid *st) } spin_unlock(&nf->fi_lock); nfs4_show_owner(s, oo); + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) + seq_puts(s, ", admin-revoked"); seq_puts(s, " }\n"); return 0; } @@ -2753,6 +2755,8 @@ static int nfs4_show_lock(struct seq_file *s, struct nfs4_stid *st) seq_puts(s, ", "); } nfs4_show_owner(s, oo); + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) + seq_puts(s, ", admin-revoked"); seq_puts(s, " }\n"); spin_unlock(&nf->fi_lock); return 0; @@ -2784,8 +2788,10 @@ static int nfs4_show_deleg(struct seq_file *s, struct nfs4_stid *st) seq_puts(s, ", "); nfs4_show_fname(s, file); } - seq_puts(s, " }\n"); spin_unlock(&nf->fi_lock); + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) + seq_puts(s, ", admin-revoked"); + seq_puts(s, " }\n"); return 0; } @@ -2809,6 +2815,8 @@ static int nfs4_show_layout(struct seq_file *s, struct nfs4_stid *st) seq_puts(s, ", "); nfs4_show_fname(s, file); } + if (st->sc_status & SC_STATUS_ADMIN_REVOKED) + seq_puts(s, ", admin-revoked"); seq_puts(s, " }\n"); return 0;
Add "admin-revoked" to the status information for any states that have been admin-revoked. This can be useful for confirming correct behaviour. Signed-off-by: NeilBrown <neilb@suse.de> --- fs/nfsd/nfs4state.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)