1 fs: prevent doing FALLOC_FL_ZERO_RANGE on append only file
3 From: Lukas Czerner <lczerner@redhat.com>
5 Currently punch hole and collapse range fallocate operation are not
6 allowed on append only file. This should be case for zero range as well.
9 Signed-off-by: Lukas Czerner <lczerner@redhat.com>
10 Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
13 1 file changed, 4 insertions(+), 3 deletions(-)
15 diff --git a/fs/open.c b/fs/open.c
16 index 631aea81..7882ff5 100644
19 @@ -254,10 +254,11 @@ int do_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
23 - * It's not possible to punch hole or perform collapse range
24 - * on append only file
25 + * It's not possible to punch hole, perform collapse range
26 + * or zero range on append only file
28 - if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE)
29 + if (mode & (FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
30 + FALLOC_FL_ZERO_RANGE)
38 To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
39 the body of a message to majordomo@vger.kernel.org
40 More majordomo info at http://vger.kernel.org/majordomo-info.html