[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZxjHdDbAkiHpbTC8@li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com>
Date: Wed, 23 Oct 2024 15:23:44 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: linux-xfs@...r.kernel.org
Cc: Ritesh Harjani <ritesh.list@...il.com>, linux-kernel@...r.kernel.org,
"Darrick J . Wong" <djwong@...nel.org>, dchinner@...hat.com,
Christoph Hellwig <hch@....de>, nirjhar@...ux.ibm.com,
John Garry <john.g.garry@...cle.com>
Subject: Re: [PATCH v4] xfs: Check for delayed allocations before setting
extsize
On Tue, Oct 15, 2024 at 03:15:09PM +0530, Ojaswin Mujoo wrote:
> Extsize should only be allowed to be set on files with no data in it.
> For this, we check if the files have extents but miss to check if
> delayed extents are present. This patch adds that check.
>
> While we are at it, also refactor this check into a helper since
> it's used in some other places as well like xfs_inactive() or
> xfs_ioctl_setattr_xflags()
>
> **Without the patch (SUCCEEDS)**
>
> $ xfs_io -c 'open -f testfile' -c 'pwrite 0 1024' -c 'extsize 65536'
>
> wrote 1024/1024 bytes at offset 0
> 1 KiB, 1 ops; 0.0002 sec (4.628 MiB/sec and 4739.3365 ops/sec)
>
> **With the patch (FAILS as expected)**
>
> $ xfs_io -c 'open -f testfile' -c 'pwrite 0 1024' -c 'extsize 65536'
>
> wrote 1024/1024 bytes at offset 0
> 1 KiB, 1 ops; 0.0002 sec (4.628 MiB/sec and 4739.3365 ops/sec)
> xfs_io: FS_IOC_FSSETXATTR testfile: Invalid argument
>
> Fixes: e94af02a9cd7 ("[XFS] fix old xfs_setattr mis-merge from irix; mostly harmless esp if not using xfs rt")
> Reviewed-by: Christoph Hellwig <hch@....de>
> Reviewed-by: Darrick J. Wong <djwong@...nel.org>
> Reviewed-by: John Garry <john.g.garry@...cle.com>
> Signed-off-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
> ---
>
The initial set of tests have been posted by Nirjhar here:
https://lore.kernel.org/fstests/cover.1729624806.git.nirjhar@linux.ibm.com/T/#t
Regards,
ojaswin
Powered by blists - more mailing lists