Skip to contentSkip to conversation

iomap infrastructure and multipage writes V5

DISCUSSION [email protected] 1 participant 1 message Feb 13, 2017

lore
Share & tools
lore
#0 lore raw

This list has been closed. Please subscribe to the [email protected] mailing list and send any future messages there. You can subscribe to the linux-xfs list at
http://vger.kernel.org/vger-lists.html#linux-xfs

For any questions please post to the new list.

Quoted 24 lines · Dave Chinner
Quoted 23 lines · Christoph Hellwig

Now after spending this much time I've started wondering why we even reserve blocks in xfs_iomap_write_allocate - after all we've reserved space for the actual data blocks and the indlen worst case in xfs_bmapi_reserve_delalloc. And in fact a little hack to drop that reservation seems to solve both the root cause (depleted reserved pool) and the cleanup mess. I just haven't spend enought time to convince myself that it's actually safe, and in fact looking at the allocator makes me thing it only works by accident currently despite generally postive test results.

Here is the quick patch if anyone wants to chime in:

fs/xfs/xfs_iomap.c +1 -1
index 620fc91..67c317f 100644
@@ -717,7 +717,7 @@ xfs_iomap_write_allocate(
 
 		nimaps = 0;
 		while (nimaps == 0) {
-			nres = XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK);
+			nres = 0; // XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK);
 
Quoted 6 lines

fs/xfs/xfs_iomap.c xfs_iomap_write_allocate( · line 723

Quoted 3 lines
fs/xfs/xfs_iomap.c +0 -0
 			error = xfs_trans_alloc(mp, &M_RES(mp)->tr_write, nres,
 					0, XFS_TRANS_RESERVE, &tp);

This solves the problem for me, and from history appears to be the right thing to do. Christoph, can you send a proper patch for this?

Did anything ever come of this? I don't think I saw a patch, and it looks like it is not upstream.

Thanks,
-Eric

Quoted 4 lines

Cheers,

Dave.