Add some comments explaining the oddities of partial direct I/O reads
and writes.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
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;
gfs2_glock_dq(gh);
out_uninit:
gfs2_holder_uninit(gh);
+ /* User space doesn't expect partial success. */
if (ret < 0)
return ret;
return read;
if (ret != -EFAULT)
goto out_unlock;
}
+ /* No increment (+=) because iomap_dio_rw returns a cumulative value. */
if (ret > 0)
written = ret;
gfs2_glock_dq(gh);
out_uninit:
gfs2_holder_uninit(gh);
+ /* User space doesn't expect partial success. */
if (ret < 0)
return ret;
return written;