projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1383a7e
)
vfs: exit early from zero length remap operations
author
Darrick J. Wong
<darrick.wong@oracle.com>
Mon, 29 Oct 2018 23:40:39 +0000
(10:40 +1100)
committer
Dave Chinner
<david@fromorbit.com>
Mon, 29 Oct 2018 23:40:39 +0000
(10:40 +1100)
If a remap caller asks us to remap to the source file's EOF and the
source file length leaves us with a zero byte request, exit early.
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/read_write.c
patch
|
blob
|
history
diff --git
a/fs/read_write.c
b/fs/read_write.c
index d6e8e242a15fad4f13fd59a688447af3792ffb80..2456da3f8a414f8ec420ed29bf5c79c0925f0ecd 100644
(file)
--- a/
fs/read_write.c
+++ b/
fs/read_write.c
@@
-1748,6
+1748,8
@@
int vfs_clone_file_prep(struct file *file_in, loff_t pos_in,
if (pos_in > isize)
return -EINVAL;
*len = isize - pos_in;
+ if (*len == 0)
+ return 0;
}
/* Check that we don't violate system file offset limits. */