* [Cluster-devel] [PATCH] gfs2: Prevent direct-I/O write fallback errors from getting lost
@ 2021-05-11 13:47 Andreas Gruenbacher
0 siblings, 0 replies; only message in thread
From: Andreas Gruenbacher @ 2021-05-11 13:47 UTC (permalink / raw)
To: cluster-devel.redhat.com
When a direct I/O write falls entirely and falls back to buffered I/O and the
buffered I/O fails, the write failed with return value 0 instead of the error
number reported by the buffered I/O. Fix that.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
---
fs/gfs2/file.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index a0b542d84cd9..3ebc9af39a04 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -911,7 +911,9 @@ static ssize_t gfs2_file_write_iter(struct kiocb *iocb, struct iov_iter *from)
current->backing_dev_info = inode_to_bdi(inode);
buffered = iomap_file_buffered_write(iocb, from, &gfs2_iomap_ops);
current->backing_dev_info = NULL;
- if (unlikely(buffered <= 0))
+ if (unlikely(buffered <= 0)) {
+ if (!ret)
+ ret = buffered;
goto out_unlock;
/*
--
2.26.3
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-11 13:47 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-11 13:47 [Cluster-devel] [PATCH] gfs2: Prevent direct-I/O write fallback errors from getting lost Andreas Gruenbacher
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).