Blame SOURCES/0093-fs-ntfs3-Forbid-FALLOC_FL_PUNCH_HOLE-for-normal-file.patch
|
Kmods SIG |
d83023 |
From 8241fffae7c8bab5cec5fc8bcaceccd03079e3aa Mon Sep 17 00:00:00 2001
|
|
Kmods SIG |
d83023 |
From: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
|
|
Kmods SIG |
d83023 |
Date: Tue, 28 Sep 2021 20:04:10 +0300
|
|
Kmods SIG |
d83023 |
Subject: [Backport 8241fffae7c8] src: Forbid FALLOC_FL_PUNCH_HOLE for
|
|
Kmods SIG |
d83023 |
normal files
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
FALLOC_FL_PUNCH_HOLE isn't allowed with normal files.
|
|
Kmods SIG |
d83023 |
Filesystem must remember info about hole, but for normal file
|
|
Kmods SIG |
d83023 |
we can only zero it and forget.
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
Fixes: 4342306f0f0d ("src: Add file operations and implementation")
|
|
Kmods SIG |
d83023 |
Now xfstests generic/016 generic/021 generic/022 pass.
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
|
|
Kmods SIG |
d83023 |
---
|
|
Kmods SIG |
d83023 |
src/file.c | 7 +++++--
|
|
Kmods SIG |
d83023 |
1 file changed, 5 insertions(+), 2 deletions(-)
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
diff --git a/src/file.c b/src/file.c
|
|
Kmods SIG |
d83023 |
index 5fb3508e5422cc6654381897d6fdb4a204a543a4..43b1451bff539576cd03c0f624708bf65b959270 100644
|
|
Kmods SIG |
d83023 |
--- a/src/file.c
|
|
Kmods SIG |
d83023 |
+++ b/src/file.c
|
|
Kmods SIG |
d83023 |
@@ -587,8 +587,11 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
|
|
Kmods SIG |
d83023 |
truncate_pagecache(inode, vbo_down);
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
if (!is_sparsed(ni) && !is_compressed(ni)) {
|
|
Kmods SIG |
d83023 |
- /* Normal file. */
|
|
Kmods SIG |
d83023 |
- err = ntfs_zero_range(inode, vbo, end);
|
|
Kmods SIG |
d83023 |
+ /*
|
|
Kmods SIG |
d83023 |
+ * Normal file, can't make hole.
|
|
Kmods SIG |
d83023 |
+ * TODO: Try to find way to save info about hole.
|
|
Kmods SIG |
d83023 |
+ */
|
|
Kmods SIG |
d83023 |
+ err = -EOPNOTSUPP;
|
|
Kmods SIG |
d83023 |
goto out;
|
|
Kmods SIG |
d83023 |
}
|
|
Kmods SIG |
d83023 |
|
|
Kmods SIG |
d83023 |
--
|
|
Kmods SIG |
d83023 |
2.31.1
|
|
Kmods SIG |
d83023 |
|