summaryrefslogtreecommitdiff
path: root/fs/gfs2
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2022-03-24 23:13:26 +0100
committerAndreas Gruenbacher <agruenba@redhat.com>2022-03-24 23:40:43 +0100
commit3bde4c48586074202044456285a97ccdf9048988 (patch)
tree473c22c835a05f8177016a401c82749b041f37c4 /fs/gfs2
parent11661835f90153bdfc5325e550d2b72d0f47cb3e (diff)
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>
Diffstat (limited to 'fs/gfs2')
-rw-r--r--fs/gfs2/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index edc588465a4b..22b41acfbbc3 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -1069,7 +1069,7 @@ retry_under_glock:
from->count = min(from->count, window_size - leftover);
if (gfs2_holder_queued(gh))
goto retry_under_glock;
- if (read)
+ if (read && !(iocb->ki_flags & IOCB_DIRECT))
goto out_uninit;
goto retry;
}