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:
ce397d2
)
vfs: limit size of dedupe
author
Miklos Szeredi
<mszeredi@redhat.com>
Fri, 6 Jul 2018 21:57:02 +0000
(23:57 +0200)
committer
Miklos Szeredi
<mszeredi@redhat.com>
Fri, 6 Jul 2018 21:57:02 +0000
(23:57 +0200)
Suggested-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
fs/read_write.c
patch
|
blob
|
history
diff --git
a/fs/read_write.c
b/fs/read_write.c
index 153f8f690490771208dbff66f458caaa9ec57d22..f43bb12b4759c70f13df896b18916be67e68df16 100644
(file)
--- a/
fs/read_write.c
+++ b/
fs/read_write.c
@@
-2003,6
+2003,9
@@
int vfs_dedupe_file_range(struct file *file, struct file_dedupe_range *same)
if (off + len > i_size_read(src))
return -EINVAL;
+ /* Arbitrary 1G limit on a single dedupe request, can be raised. */
+ len = min_t(u64, len, 1 << 30);
+
/* pre-format output fields to sane values */
for (i = 0; i < count; i++) {
same->info[i].bytes_deduped = 0ULL;