OSDN Git Service
(root)
/
uclinux-h8
/
linux.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
153f8f6
..
f43bb12
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;