diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2021-09-28 19:04:10 +0200 |
---|---|---|
committer | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2021-10-05 16:01:55 +0200 |
commit | 8241fffae7c8bab5cec5fc8bcaceccd03079e3aa (patch) | |
tree | 5379f6cf172138d2cba9bf568c6275879a39fd9d /fs | |
parent | fs/ntfs3: Refactoring of ntfs_set_ea (diff) | |
download | linux-8241fffae7c8bab5cec5fc8bcaceccd03079e3aa.tar.xz linux-8241fffae7c8bab5cec5fc8bcaceccd03079e3aa.zip |
fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files
FALLOC_FL_PUNCH_HOLE isn't allowed with normal files.
Filesystem must remember info about hole, but for normal file
we can only zero it and forget.
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")
Now xfstests generic/016 generic/021 generic/022 pass.
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ntfs3/file.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 5fb3508e5422..43b1451bff53 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -587,8 +587,11 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len) truncate_pagecache(inode, vbo_down); if (!is_sparsed(ni) && !is_compressed(ni)) { - /* Normal file. */ - err = ntfs_zero_range(inode, vbo, end); + /* + * Normal file, can't make hole. + * TODO: Try to find way to save info about hole. + */ + err = -EOPNOTSUPP; goto out; } |