From: Dave Wysochanski <dwysocha@redhat.com>
To: Trond Myklebust <trondmy@hammerspace.com>
Cc: linux-nfs@vger.kernel.org
Subject: [PATCH] NFS: Fix WARN_ON due to unionization of nfs_inode.nrequests
Date: Sun, 10 Oct 2021 18:23:13 -0400 [thread overview]
Message-ID: <1633904593-31940-1-git-send-email-dwysocha@redhat.com> (raw)
Fixes the following WARN_ON
WARNING: CPU: 2 PID: 18678 at fs/nfs/inode.c:123 nfs_clear_inode+0x3b/0x50 [nfs]
...
Call Trace:
nfs4_evict_inode+0x57/0x70 [nfsv4]
evict+0xd1/0x180
dispose_list+0x48/0x60
evict_inodes+0x156/0x190
generic_shutdown_super+0x37/0x110
nfs_kill_super+0x1d/0x40 [nfs]
deactivate_locked_super+0x36/0xa0
Signed-off-by: Dave Wysochanski <dwysocha@redhat.com>
---
include/linux/nfs_fs.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index a5aef2cbe4ee..5a110ecf2d85 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -579,7 +579,9 @@ extern int nfs_access_get_cached(struct inode *inode, const struct cred *cred, s
static inline int
nfs_have_writebacks(struct inode *inode)
{
- return atomic_long_read(&NFS_I(inode)->nrequests) != 0;
+ if (S_ISREG(inode->i_mode))
+ return atomic_long_read(&NFS_I(inode)->nrequests) != 0;
+ return 0;
}
/*
--
1.8.3.1
reply other threads:[~2021-10-10 22:23 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1633904593-31940-1-git-send-email-dwysocha@redhat.com \
--to=dwysocha@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@hammerspace.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).