]> www.infradead.org Git - nvme.git/commitdiff
xfs: remove the i_mode check in xfs_release
authorChristoph Hellwig <hch@lst.de>
Tue, 13 Aug 2024 07:39:34 +0000 (09:39 +0200)
committerChandan Babu R <chandanbabu@kernel.org>
Tue, 3 Sep 2024 04:37:37 +0000 (10:07 +0530)
xfs_release is only called from xfs_file_release, which is wired up as
the f_op->release handler for regular files only.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_inode.c

index 9ea7a18f5da1421d7fcfd9a2dea6b0d460adee12..3ec09dc92dfc58da6305c6e280700c5db2a027a4 100644 (file)
@@ -1086,9 +1086,6 @@ xfs_release(
        xfs_mount_t     *mp = ip->i_mount;
        int             error = 0;
 
-       if (!S_ISREG(VFS_I(ip)->i_mode) || (VFS_I(ip)->i_mode == 0))
-               return 0;
-
        /* If this is a read-only mount, don't do this (would generate I/O) */
        if (xfs_is_readonly(mp))
                return 0;