xfs: don't call xfs_file_open from xfs_dir_open
authorChristoph Hellwig <hch@lst.de>
Tue, 23 Apr 2024 12:46:08 +0000 (14:46 +0200)
committerChristian Brauner <brauner@kernel.org>
Wed, 24 Apr 2024 12:46:51 +0000 (14:46 +0200)
Directories do not support direct I/O and thus no non-blocking direct
I/O either.  Open code the shutdown check and call to generic_file_open
instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20240423124608.537794-4-hch@lst.de
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/xfs/xfs_file.c

index 4415d0f3bbc51ba437bc95f9d2bfe7b605b00a12..2ce302b4885f53b9e69d21a63f8897e4c7e4b022 100644 (file)
@@ -1243,7 +1243,9 @@ xfs_dir_open(
        unsigned int    mode;
        int             error;
 
-       error = xfs_file_open(inode, file);
+       if (xfs_is_shutdown(ip->i_mount))
+               return -EIO;
+       error = generic_file_open(inode, file);
        if (error)
                return error;