gfs2: Use iomap for stuffed direct I/O reads
authorAndreas Gruenbacher <agruenba@redhat.com>
Wed, 27 Jun 2018 00:59:18 +0000 (01:59 +0100)
committerAndreas Gruenbacher <agruenba@redhat.com>
Tue, 24 Jul 2018 22:08:40 +0000 (00:08 +0200)
Remove the fallback code from direct to buffered I/O for stuffed reads.

For stuffed writes, we must keep the fallback code: the deferred glock
we are holding under direct I/O doesn't allow to write to the inode or
change the file size.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Reviewed-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/file.c

index 6d895d39158ac0268ebffaa8eb95969cfb243cfb..08369c6cd127a4fee6a301babe1fea80d475d2a3 100644 (file)
@@ -706,14 +706,8 @@ static ssize_t gfs2_file_direct_read(struct kiocb *iocb, struct iov_iter *to)
        if (ret)
                goto out_uninit;
 
-       /* fall back to buffered I/O for stuffed files */
-       ret = -ENOTBLK;
-       if (gfs2_is_stuffed(ip))
-               goto out;
-
        ret = iomap_dio_rw(iocb, to, &gfs2_iomap_ops, NULL);
 
-out:
        gfs2_glock_dq(&gh);
 out_uninit:
        gfs2_holder_uninit(&gh);