summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2022-04-27 00:31:06 +0300
committerAndreas Gruenbacher <agruenba@redhat.com>2022-05-24 22:29:14 +0300
commit53bb540fd591f6fdd4cb5c9a785d9790ac33862d (patch)
tree6fce7c67fcb582ed83cc46d26024ea563bce5f8e
parentb846f2d7e2d28ebfa112ac595bde2ef87693d8d9 (diff)
downloadlinux-53bb540fd591f6fdd4cb5c9a785d9790ac33862d.tar.xz
gfs2: Explain some direct I/O oddities
Add some comments explaining the oddities of partial direct I/O reads and writes. Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
-rw-r--r--fs/gfs2/file.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/gfs2/file.c b/fs/gfs2/file.c
index 2556ae1f92ea..f1d2f4d74b89 100644
--- a/fs/gfs2/file.c
+++ b/fs/gfs2/file.c
@@ -840,6 +840,7 @@ retry:
pagefault_enable();
if (ret <= 0 && ret != -EFAULT)
goto out_unlock;
+ /* No increment (+=) because iomap_dio_rw returns a cumulative value. */
if (ret > 0)
read = ret;
@@ -854,6 +855,7 @@ out_unlock:
gfs2_glock_dq(gh);
out_uninit:
gfs2_holder_uninit(gh);
+ /* User space doesn't expect partial success. */
if (ret < 0)
return ret;
return read;
@@ -906,6 +908,7 @@ retry:
if (ret != -EFAULT)
goto out_unlock;
}
+ /* No increment (+=) because iomap_dio_rw returns a cumulative value. */
if (ret > 0)
written = ret;
@@ -920,6 +923,7 @@ out_unlock:
gfs2_glock_dq(gh);
out_uninit:
gfs2_holder_uninit(gh);
+ /* User space doesn't expect partial success. */
if (ret < 0)
return ret;
return written;