Skip to content

Commit

Permalink
xfs: don't call xfs_file_open from xfs_dir_open
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Christian Brauner committed Apr 24, 2024
1 parent f508057 commit 652efde
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion fs/xfs/xfs_file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 652efde

Please sign in to comment.