Message ID | 165230597851.5906.18376771236120628748.stgit@klimt.1015granger.net (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | Fix "sleep while locked" in RELEASE_LOCKOWNER | expand |
On Wed, 2022-05-11 at 17:52 -0400, Chuck Lever wrote: > Ensure the lockdep infrastructure can catch calls to nfsd_file_put() > when spinlocks are held. > > Signed-off-by: Chuck Lever <chuck.lever@oracle.com> > --- > fs/nfsd/filecache.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c > index 8f7ed5dbb003..60a5d82e59b3 100644 > --- a/fs/nfsd/filecache.c > +++ b/fs/nfsd/filecache.c > @@ -301,6 +301,8 @@ nfsd_file_put_noref(struct nfsd_file *nf) > void > nfsd_file_put(struct nfsd_file *nf) > { > + might_sleep(); > + > set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags); > if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags) == 0) { > nfsd_file_flush(nf); > > Reviewed-by: Jeff Layton <jlayton@kernel.org>
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 8f7ed5dbb003..60a5d82e59b3 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -301,6 +301,8 @@ nfsd_file_put_noref(struct nfsd_file *nf) void nfsd_file_put(struct nfsd_file *nf) { + might_sleep(); + set_bit(NFSD_FILE_REFERENCED, &nf->nf_flags); if (test_bit(NFSD_FILE_HASHED, &nf->nf_flags) == 0) { nfsd_file_flush(nf);
Ensure the lockdep infrastructure can catch calls to nfsd_file_put() when spinlocks are held. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> --- fs/nfsd/filecache.c | 2 ++ 1 file changed, 2 insertions(+)