mirror of
https://github.com/torvalds/linux.git
synced 2024-11-26 06:02:05 +00:00
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>
This commit is contained in:
parent
b846f2d7e2
commit
53bb540fd5
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user