Skip to content

Commit 3bde4c4

Browse files
author
Andreas Gruenbacher
committed
gfs2: Make sure not to return short direct writes
When direct writes fail with -ENOTBLK because we're writing into a hole (gfs2_iomap_begin()) or because of a page invalidation failure (iomap_dio_rw()), we're falling back to buffered writes. In that case, when we lose the inode glock in gfs2_file_buffered_write(), we want to re-acquire it instead of returning a short write. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
1 parent 1166183 commit 3bde4c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/gfs2/file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1069,7 +1069,7 @@ static ssize_t gfs2_file_buffered_write(struct kiocb *iocb,
10691069
from->count = min(from->count, window_size - leftover);
10701070
if (gfs2_holder_queued(gh))
10711071
goto retry_under_glock;
1072-
if (read)
1072+
if (read && !(iocb->ki_flags & IOCB_DIRECT))
10731073
goto out_uninit;
10741074
goto retry;
10751075
}

0 commit comments

Comments
 (0)