]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
xfs: use ENOTBLK for direct I/O to buffered I/O fallback
authorChristoph Hellwig <hch@lst.de>
Fri, 24 Jul 2020 05:45:58 +0000 (22:45 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 5 Aug 2020 16:24:16 +0000 (09:24 -0700)
This is what the classic fs/direct-io.c implementation and thuse other
file systems use.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
fs/xfs/xfs_file.c

index 00db81eac80d6cf2ca42c0e5dc51d5b953adcf38..a6ef90457abf974b30f9ad56890baa7504096845 100644 (file)
@@ -505,7 +505,7 @@ xfs_file_dio_aio_write(
                 */
                if (xfs_is_cow_inode(ip)) {
                        trace_xfs_reflink_bounce_dio_write(ip, iocb->ki_pos, count);
-                       return -EREMCHG;
+                       return -ENOTBLK;
                }
                iolock = XFS_IOLOCK_EXCL;
        } else {
@@ -714,7 +714,7 @@ xfs_file_write_iter(
                 * allow an operation to fall back to buffered mode.
                 */
                ret = xfs_file_dio_aio_write(iocb, from);
-               if (ret != -EREMCHG)
+               if (ret != -ENOTBLK)
                        return ret;
        }