[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250320052929.GA12560@lst.de>
Date: Thu, 20 Mar 2025 06:29:29 +0100
From: Christoph Hellwig <hch@....de>
To: John Garry <john.g.garry@...cle.com>
Cc: Christoph Hellwig <hch@....de>, brauner@...nel.org, djwong@...nel.org,
cem@...nel.org, dchinner@...hat.com, linux-xfs@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
ojaswin@...ux.ibm.com, ritesh.list@...il.com,
martin.petersen@...cle.com, tytso@....edu,
linux-ext4@...r.kernel.org
Subject: Re: [PATCH v6 10/13] xfs: iomap COW-based atomic write support
On Wed, Mar 19, 2025 at 10:24:55AM +0000, John Garry wrote:
> it seems to work ok, cheers
Better test it very well, this was really just intended as a sketch..
>> + count_fsb = end_fsb - offset_fsb;
>> + resaligned = xfs_aligned_fsb_count(offset_fsb, count_fsb,
>> + xfs_get_cowextsz_hint(ip));
>> + xfs_iunlock(ip, XFS_ILOCK_EXCL);
>> +
>> + error = xfs_trans_alloc_inode(ip, &M_RES(mp)->tr_write,
>> + XFS_DIOSTRAT_SPACE_RES(mp, resaligned), 0, false, &tp);
>> if (error)
>> return error;
>> - error = xfs_bmapi_read(ip, offset_fsb, end_fsb - offset_fsb, &imap,
>> - &nimaps, 0);
>> - if (error)
>> - goto out_unlock;
>> + if (!xfs_iext_lookup_extent(ip, ip->i_cowfp, offset_fsb, &icur, &cmap))
>> + cmap.br_startoff = end_fsb;
>
> Do we really need this logic?
>
> offset_fsb does not change, and logically cmap.br_startoff == end_fsb
> already, right?
Afte unlocking and relocking the ilock the extent layout could have
changed.
Powered by blists - more mailing lists