All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files
@ 2021-09-28 17:25 Konstantin Komarov
  2021-09-28 18:32 ` Kari Argillander
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Komarov @ 2021-09-28 17:25 UTC (permalink / raw)
  To: ntfs3; +Cc: linux-kernel, linux-fsdevel

FALLOC_FL_PUNCH_HOLE isn't allowed with normal files.
Fixes xfstest generic/016 021 022

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
---
 fs/ntfs3/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index 5fb3508e5422..02ca665baa5f 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -587,8 +587,8 @@ 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. */
+			err = -EOPNOTSUPP;
 			goto out;
 		}
 
-- 
2.33.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files
  2021-09-28 17:25 [PATCH] fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files Konstantin Komarov
@ 2021-09-28 18:32 ` Kari Argillander
  0 siblings, 0 replies; 2+ messages in thread
From: Kari Argillander @ 2021-09-28 18:32 UTC (permalink / raw)
  To: Konstantin Komarov; +Cc: ntfs3, linux-kernel, linux-fsdevel

On Tue, Sep 28, 2021 at 08:25:58PM +0300, Konstantin Komarov wrote:
> FALLOC_FL_PUNCH_HOLE isn't allowed with normal files.

But is this absolute or just for now it can't? In my mind this can be
done, but you are expert here. Please write about it here. This will
help who ever will implement this in future. Example why ntfs_zero_range
did not punch a hole for normal file. You did actually implement that
function for this purpose right?

> Fixes xfstest generic/016 021 022

Lot of grepping is done with these so use full format generic/xxx with
each of these.

Also this affects also to these, but I did not look if there is other
problems than punching.

  generic/012
  generic/177
  generic/255
  generic/316


Add fixes tag here.
> Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>

> ---
>  fs/ntfs3/file.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
> index 5fb3508e5422..02ca665baa5f 100644
> --- a/fs/ntfs3/file.c
> +++ b/fs/ntfs3/file.c
> @@ -587,8 +587,8 @@ 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. */

If this is just for now plese write example
			/* TODO: Can't make hole to normal files yet. */

> +			err = -EOPNOTSUPP;
>  			goto out;
>  		}
>  
> -- 
> 2.33.0
> 

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-28 18:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-28 17:25 [PATCH] fs/ntfs3: Forbid FALLOC_FL_PUNCH_HOLE for normal files Konstantin Komarov
2021-09-28 18:32 ` Kari Argillander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.