diff mbox series

[RFC,2/2] NFSD: nfsd_file_put() can sleep

Message ID 165230597851.5906.18376771236120628748.stgit@klimt.1015granger.net (mailing list archive)
State New
Headers show
Series Fix "sleep while locked" in RELEASE_LOCKOWNER | expand

Commit Message

Chuck Lever III May 11, 2022, 9:52 p.m. UTC
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(+)

Comments

Jeff Layton May 12, 2022, 10:08 a.m. UTC | #1
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 mbox series

Patch

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);