linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
@ 2025-07-15  3:15 chuguangqing
  2025-07-15  3:15 ` [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the " chuguangqing
  2025-07-15  4:37 ` [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to " chuguangqing
  0 siblings, 2 replies; 14+ messages in thread
From: chuguangqing @ 2025-07-15  3:15 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel, chuguangqing

Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags.
This change improves code clarity and maintains by explicitly showing 
this flag in the supported flags mask.

chuguangqing (1):
  ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask

 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.43.5


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

* [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the supported flags mask.
  2025-07-15  3:15 [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask chuguangqing
@ 2025-07-15  3:15 ` chuguangqing
  2025-07-15 14:08   ` kernel test robot
  2025-07-15  4:37 ` [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to " chuguangqing
  1 sibling, 1 reply; 14+ messages in thread
From: chuguangqing @ 2025-07-15  3:15 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel, chuguangqing

Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
has no functional modifications.

Signed-off-by: chuguangqing <chuguangqing@inspur.com>
---
 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b43aa82c1b39..f0f9363fd9fd 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4784,9 +4784,9 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 		return -EOPNOTSUPP;
 
 	/* Return error if mode is not supported */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
-		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
-		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
+	if (mode & ~(FALL_C_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
+		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
+		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE))
 		return -EOPNOTSUPP;
 
 	inode_lock(inode);
-- 
2.43.5


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

* [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15  3:15 [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask chuguangqing
  2025-07-15  3:15 ` [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the " chuguangqing
@ 2025-07-15  4:37 ` chuguangqing
  2025-07-15  4:37   ` [PATCH 1/1] " chuguangqing
  1 sibling, 1 reply; 14+ messages in thread
From: chuguangqing @ 2025-07-15  4:37 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel, chuguangqing

Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags.
This change improves code clarity and maintains by explicitly showing 
this flag in the supported flags mask.

chuguangqing (1):
  ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask

 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.43.5


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

* [PATCH 1/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15  4:37 ` [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to " chuguangqing
@ 2025-07-15  4:37   ` chuguangqing
  2025-07-15  6:45     ` chuguangqing
  0 siblings, 1 reply; 14+ messages in thread
From: chuguangqing @ 2025-07-15  4:37 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel, chuguangqing

Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
has no functional modifications.

Signed-off-by: chuguangqing <chuguangqing@inspur.com>
---
 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b43aa82c1b39..f0f9363fd9fd 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4784,9 +4784,9 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 		return -EOPNOTSUPP;
 
 	/* Return error if mode is not supported */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
-		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
-		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
+	if (mode & ~(FALL_C_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
+		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
+		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE))
 		return -EOPNOTSUPP;
 
 	inode_lock(inode);
-- 
2.43.5


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

* [PATCH 1/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15  4:37   ` [PATCH 1/1] " chuguangqing
@ 2025-07-15  6:45     ` chuguangqing
  2025-07-15 12:34       ` Theodore Ts'o
  2025-07-15 12:50       ` Zhang Yi
  0 siblings, 2 replies; 14+ messages in thread
From: chuguangqing @ 2025-07-15  6:45 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel, chuguangqing

Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
has no functional modifications.

Signed-off-by: chuguangqing <chuguangqing@inspur.com>
---
 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b43aa82c1b39..f0f9363fd9fd 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4784,9 +4784,9 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 		return -EOPNOTSUPP;
 
 	/* Return error if mode is not supported */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
-		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
-		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
+	if (mode & ~(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
+		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
+		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE))
 		return -EOPNOTSUPP;
 
 	inode_lock(inode);
-- 
2.43.5


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

* Re: [PATCH 1/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15  6:45     ` chuguangqing
@ 2025-07-15 12:34       ` Theodore Ts'o
  2025-07-16  2:28         ` [PATCH v2 0/1] " chuguangqing
  2025-07-16  2:44         ` Re: [PATCH " chuguangqing
  2025-07-15 12:50       ` Zhang Yi
  1 sibling, 2 replies; 14+ messages in thread
From: Theodore Ts'o @ 2025-07-15 12:34 UTC (permalink / raw)
  To: chuguangqing; +Cc: Andreas Dilger, linux-ext4, linux-kernel

On Tue, Jul 15, 2025 at 02:45:18PM +0800, chuguangqing wrote:
> Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
> has no functional modifications.
> 
> Signed-off-by: chuguangqing <chuguangqing@inspur.com>

I'll note that this isn't something which any of the other file
systems (btrfs, xfs, etc.) is doing.

				- Ted
				

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

* Re: [PATCH 1/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15  6:45     ` chuguangqing
  2025-07-15 12:34       ` Theodore Ts'o
@ 2025-07-15 12:50       ` Zhang Yi
  2025-07-16  3:04         ` [PATCH v3 0/1] Re: " chuguangqing
  1 sibling, 1 reply; 14+ messages in thread
From: Zhang Yi @ 2025-07-15 12:50 UTC (permalink / raw)
  To: chuguangqing; +Cc: linux-ext4, linux-kernel, Theodore Ts'o, Andreas Dilger

On 2025/7/15 14:45, chuguangqing wrote:
> Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
> has no functional modifications.
> 
> Signed-off-by: chuguangqing <chuguangqing@inspur.com>
> ---
>  fs/ext4/extents.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index b43aa82c1b39..f0f9363fd9fd 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4784,9 +4784,9 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
>  		return -EOPNOTSUPP;
>  
>  	/* Return error if mode is not supported */
> -	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
> -		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
> -		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
> +	if (mode & ~(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
> +		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
> +		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE))
>  		return -EOPNOTSUPP;
>  
>  	inode_lock(inode);

Why did you remove the FALLOC_FL_WRITE_ZEROES support?

Regards,
Yi.

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

* Re: [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the supported flags mask.
  2025-07-15  3:15 ` [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the " chuguangqing
@ 2025-07-15 14:08   ` kernel test robot
  0 siblings, 0 replies; 14+ messages in thread
From: kernel test robot @ 2025-07-15 14:08 UTC (permalink / raw)
  To: chuguangqing, Theodore Ts'o, Andreas Dilger
  Cc: oe-kbuild-all, linux-ext4, linux-kernel, chuguangqing

Hi chuguangqing,

kernel test robot noticed the following build errors:

[auto build test ERROR on next-20250714]
[cannot apply to tytso-ext4/dev v6.16-rc6 v6.16-rc5 v6.16-rc4 linus/master v6.16-rc6]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/chuguangqing/Add-FALLOC_FL_ALLOCATE_RANGE-to-the-set-of-supported-fallocate-mode-flags-This-change-improves-code-clarity-and-maintain/20250715-111753
base:   next-20250714
patch link:    https://lore.kernel.org/r/20250715031531.1693-2-chuguangqing%40inspur.com
patch subject: [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the supported flags mask.
config: arc-randconfig-002-20250715 (https://download.01.org/0day-ci/archive/20250715/202507152101.0vyIZZfK-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 11.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250715/202507152101.0vyIZZfK-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202507152101.0vyIZZfK-lkp@intel.com/

All errors (new ones prefixed by >>):

   fs/ext4/extents.c: In function 'ext4_fallocate':
>> fs/ext4/extents.c:4787:22: error: 'FALL_C_FL_ALLOCATE_RANGE' undeclared (first use in this function); did you mean 'FALLOC_FL_ALLOCATE_RANGE'?
    4787 |         if (mode & ~(FALL_C_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
         |                      ^~~~~~~~~~~~~~~~~~~~~~~~
         |                      FALLOC_FL_ALLOCATE_RANGE
   fs/ext4/extents.c:4787:22: note: each undeclared identifier is reported only once for each function it appears in


vim +4787 fs/ext4/extents.c

  4755	
  4756	/*
  4757	 * preallocate space for a file. This implements ext4's fallocate file
  4758	 * operation, which gets called from sys_fallocate system call.
  4759	 * For block-mapped files, posix_fallocate should fall back to the method
  4760	 * of writing zeroes to the required new blocks (the same behavior which is
  4761	 * expected for file systems which do not support fallocate() system call).
  4762	 */
  4763	long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
  4764	{
  4765		struct inode *inode = file_inode(file);
  4766		struct address_space *mapping = file->f_mapping;
  4767		int ret;
  4768	
  4769		/*
  4770		 * Encrypted inodes can't handle collapse range or insert
  4771		 * range since we would need to re-encrypt blocks with a
  4772		 * different IV or XTS tweak (which are based on the logical
  4773		 * block number).
  4774		 */
  4775		if (IS_ENCRYPTED(inode) &&
  4776		    (mode & (FALLOC_FL_COLLAPSE_RANGE | FALLOC_FL_INSERT_RANGE)))
  4777			return -EOPNOTSUPP;
  4778		/*
  4779		 * Don't allow writing zeroes if the underlying device does not
  4780		 * enable the unmap write zeroes operation.
  4781		 */
  4782		if ((mode & FALLOC_FL_WRITE_ZEROES) &&
  4783		    !bdev_write_zeroes_unmap_sectors(inode->i_sb->s_bdev))
  4784			return -EOPNOTSUPP;
  4785	
  4786		/* Return error if mode is not supported */
> 4787		if (mode & ~(FALL_C_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
  4788			     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
  4789			     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE))
  4790			return -EOPNOTSUPP;
  4791	
  4792		inode_lock(inode);
  4793		ret = ext4_convert_inline_data(inode);
  4794		if (ret)
  4795			goto out_inode_lock;
  4796	
  4797		/* Wait all existing dio workers, newcomers will block on i_rwsem */
  4798		inode_dio_wait(inode);
  4799	
  4800		ret = file_modified(file);
  4801		if (ret)
  4802			goto out_inode_lock;
  4803	
  4804		if ((mode & FALLOC_FL_MODE_MASK) == FALLOC_FL_ALLOCATE_RANGE) {
  4805			ret = ext4_do_fallocate(file, offset, len, mode);
  4806			goto out_inode_lock;
  4807		}
  4808	
  4809		/*
  4810		 * Follow-up operations will drop page cache, hold invalidate lock
  4811		 * to prevent page faults from reinstantiating pages we have
  4812		 * released from page cache.
  4813		 */
  4814		filemap_invalidate_lock(mapping);
  4815	
  4816		ret = ext4_break_layouts(inode);
  4817		if (ret)
  4818			goto out_invalidate_lock;
  4819	
  4820		switch (mode & FALLOC_FL_MODE_MASK) {
  4821		case FALLOC_FL_PUNCH_HOLE:
  4822			ret = ext4_punch_hole(file, offset, len);
  4823			break;
  4824		case FALLOC_FL_COLLAPSE_RANGE:
  4825			ret = ext4_collapse_range(file, offset, len);
  4826			break;
  4827		case FALLOC_FL_INSERT_RANGE:
  4828			ret = ext4_insert_range(file, offset, len);
  4829			break;
  4830		case FALLOC_FL_ZERO_RANGE:
  4831		case FALLOC_FL_WRITE_ZEROES:
  4832			ret = ext4_zero_range(file, offset, len, mode);
  4833			break;
  4834		default:
  4835			ret = -EOPNOTSUPP;
  4836		}
  4837	
  4838	out_invalidate_lock:
  4839		filemap_invalidate_unlock(mapping);
  4840	out_inode_lock:
  4841		inode_unlock(inode);
  4842		return ret;
  4843	}
  4844	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

* [PATCH v2 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15 12:34       ` Theodore Ts'o
@ 2025-07-16  2:28         ` chuguangqing
  2025-07-16  2:28           ` [PATCH v2 1/1] " chuguangqing
  2025-07-16  2:44         ` Re: [PATCH " chuguangqing
  1 sibling, 1 reply; 14+ messages in thread
From: chuguangqing @ 2025-07-16  2:28 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel, chuguangqing

The original patch had a spelling mistake. I re-sent a new version (V2) earlier, but perhaps you missed it. 
I encountered a compilation error today.
[auto build test ERROR on next-20250714] [cannot apply to tytso-ext4/dev v6.16-rc6 v6.16-rc5 v6.16-rc4 linus/master v6.16-rc6]
Here's the updated patch marked as V2 for clarity.

chuguangqing (1):
  ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask

 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.43.5


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

* [PATCH v2 1/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-16  2:28         ` [PATCH v2 0/1] " chuguangqing
@ 2025-07-16  2:28           ` chuguangqing
  0 siblings, 0 replies; 14+ messages in thread
From: chuguangqing @ 2025-07-16  2:28 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel, chuguangqing

Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags.
This change improves code clarity and maintains by explicitly showing
this flag in the supported flags mask.

Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
has no functional modifications.

Signed-off-by: chuguangqing <chuguangqing@inspur.com>
---
 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b43aa82c1b39..411223c10553 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4784,9 +4784,9 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 		return -EOPNOTSUPP;
 
 	/* Return error if mode is not supported */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
-		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
-		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
+	if (mode & ~(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
+		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
+		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE))
 		return -EOPNOTSUPP;
 
 	inode_lock(inode);
-- 
2.43.5


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

* Re: Re: [PATCH 1/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15 12:34       ` Theodore Ts'o
  2025-07-16  2:28         ` [PATCH v2 0/1] " chuguangqing
@ 2025-07-16  2:44         ` chuguangqing
  1 sibling, 0 replies; 14+ messages in thread
From: chuguangqing @ 2025-07-16  2:44 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger; +Cc: linux-ext4, linux-kernel

The patch for XFS is here: https://lore.kernel.org/linux-xfs/aGIxIx6XZM-qu0iY@infradead.org/T/#t

Applied to for-next, thanks!

[1/1] xfs: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
      commit: 9e9b46672b1daac814b384286c21fb8332a87392


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

* [PATCH v3 0/1] Re: Re: [PATCH 1/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-15 12:50       ` Zhang Yi
@ 2025-07-16  3:04         ` chuguangqing
  2025-07-16  3:04           ` [PATCH v3] " chuguangqing
  0 siblings, 1 reply; 14+ messages in thread
From: chuguangqing @ 2025-07-16  3:04 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, Zhang Yi
  Cc: linux-ext4, linux-kernel, chuguangqing

> Why did you remove the FALLOC_FL_WRITE_ZEROES support?

It's missing FALLOC_FL_WRITE_ZEROES. tks for a lot.

chuguangqing (1):
  ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask

 fs/ext4/extents.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

-- 
2.43.5


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

* [PATCH v3] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-16  3:04         ` [PATCH v3 0/1] Re: " chuguangqing
@ 2025-07-16  3:04           ` chuguangqing
  2025-07-16  7:05             ` Zhang Yi
  0 siblings, 1 reply; 14+ messages in thread
From: chuguangqing @ 2025-07-16  3:04 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, Zhang Yi
  Cc: linux-ext4, linux-kernel, chuguangqing

Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags.
This change improves code clarity and maintains by explicitly showing
this flag in the supported flags mask.

Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
has no functional modifications.

Signed-off-by: chuguangqing <chuguangqing@inspur.com>
---
 fs/ext4/extents.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index b43aa82c1b39..46cbb8697252 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -4784,9 +4784,10 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
 		return -EOPNOTSUPP;
 
 	/* Return error if mode is not supported */
-	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
-		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
-		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
+	if (mode & ~(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
+		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
+		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE |
+		     FALLOC_FL_WRITE_ZEROES))
 		return -EOPNOTSUPP;
 
 	inode_lock(inode);
-- 
2.43.5


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

* Re: [PATCH v3] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask
  2025-07-16  3:04           ` [PATCH v3] " chuguangqing
@ 2025-07-16  7:05             ` Zhang Yi
  0 siblings, 0 replies; 14+ messages in thread
From: Zhang Yi @ 2025-07-16  7:05 UTC (permalink / raw)
  To: chuguangqing; +Cc: linux-ext4, linux-kernel, Theodore Ts'o, Andreas Dilger

On 2025/7/16 11:04, chuguangqing wrote:
> Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags.
> This change improves code clarity and maintains by explicitly showing
> this flag in the supported flags mask.
> 
> Note that since FALLOC_FL_ALLOCATE_RANGE is defined as 0x00, this addition
> has no functional modifications.
> 
> Signed-off-by: chuguangqing <chuguangqing@inspur.com>

OK, now it looks good to me. Feel free to add:

Reviewed-by: Zhang Yi <yi.zhang@huawei.com>

> ---
>  fs/ext4/extents.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index b43aa82c1b39..46cbb8697252 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -4784,9 +4784,10 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
>  		return -EOPNOTSUPP;
>  
>  	/* Return error if mode is not supported */
> -	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE |
> -		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_COLLAPSE_RANGE |
> -		     FALLOC_FL_INSERT_RANGE | FALLOC_FL_WRITE_ZEROES))
> +	if (mode & ~(FALLOC_FL_ALLOCATE_RANGE | FALLOC_FL_KEEP_SIZE |
> +		     FALLOC_FL_PUNCH_HOLE | FALLOC_FL_COLLAPSE_RANGE |
> +		     FALLOC_FL_ZERO_RANGE | FALLOC_FL_INSERT_RANGE |
> +		     FALLOC_FL_WRITE_ZEROES))
>  		return -EOPNOTSUPP;
>  
>  	inode_lock(inode);


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

end of thread, other threads:[~2025-07-16  7:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-15  3:15 [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to supported flags mask chuguangqing
2025-07-15  3:15 ` [PATCH 1/1] Add FALLOC_FL_ALLOCATE_RANGE to the set of supported fallocate mode flags. This change improves code clarity and maintains by explicitly showing this flag in the " chuguangqing
2025-07-15 14:08   ` kernel test robot
2025-07-15  4:37 ` [PATCH 0/1] ext4: add FALLOC_FL_ALLOCATE_RANGE to " chuguangqing
2025-07-15  4:37   ` [PATCH 1/1] " chuguangqing
2025-07-15  6:45     ` chuguangqing
2025-07-15 12:34       ` Theodore Ts'o
2025-07-16  2:28         ` [PATCH v2 0/1] " chuguangqing
2025-07-16  2:28           ` [PATCH v2 1/1] " chuguangqing
2025-07-16  2:44         ` Re: [PATCH " chuguangqing
2025-07-15 12:50       ` Zhang Yi
2025-07-16  3:04         ` [PATCH v3 0/1] Re: " chuguangqing
2025-07-16  3:04           ` [PATCH v3] " chuguangqing
2025-07-16  7:05             ` Zhang Yi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).