diff options
author | Dave Wysochanski <dwysocha@redhat.com> | 2021-10-10 18:23:13 -0400 |
---|---|---|
committer | Trond Myklebust <trond.myklebust@hammerspace.com> | 2021-10-20 18:09:54 -0400 |
commit | 0ebeebcf59601bcfa0284f4bb7abdec051eb856d (patch) | |
tree | 9510c4ff8c914ab8eb489631bcb953d34ae99c27 /include/linux/nfs_fs.h | |
parent | 6e176d47160cec8bcaa28d9aa06926d72d54237c (diff) |
NFS: Fix WARN_ON due to unionization of nfs_inode.nrequests
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>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'include/linux/nfs_fs.h')
-rw-r--r-- | include/linux/nfs_fs.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index e58b78da7a98..457b866a2d9e 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h @@ -573,7 +573,9 @@ bool nfs_commit_end(struct nfs_mds_commit_info *cinfo); 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; } /* |