Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'xfs-6.10-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux

Pull xfs fix from Chandan Babu:

- Fix assertion failure due to a race between unlink and cluster buffer
instantiation.

* tag 'xfs-6.10-fixes-4' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
xfs: fix unlink vs cluster buffer instantiation race

+19 -4
+19 -4
fs/xfs/xfs_inode.c
··· 2548 2548 * This buffer may not have been correctly initialised as we 2549 2549 * didn't read it from disk. That's not important because we are 2550 2550 * only using to mark the buffer as stale in the log, and to 2551 - * attach stale cached inodes on it. That means it will never be 2552 - * dispatched for IO. If it is, we want to know about it, and we 2553 - * want it to fail. We can acheive this by adding a write 2554 - * verifier to the buffer. 2551 + * attach stale cached inodes on it. 2552 + * 2553 + * For the inode that triggered the cluster freeing, this 2554 + * attachment may occur in xfs_inode_item_precommit() after we 2555 + * have marked this buffer stale. If this buffer was not in 2556 + * memory before xfs_ifree_cluster() started, it will not be 2557 + * marked XBF_DONE and this will cause problems later in 2558 + * xfs_inode_item_precommit() when we trip over a (stale, !done) 2559 + * buffer to attached to the transaction. 2560 + * 2561 + * Hence we have to mark the buffer as XFS_DONE here. This is 2562 + * safe because we are also marking the buffer as XBF_STALE and 2563 + * XFS_BLI_STALE. That means it will never be dispatched for 2564 + * IO and it won't be unlocked until the cluster freeing has 2565 + * been committed to the journal and the buffer unpinned. If it 2566 + * is written, we want to know about it, and we want it to 2567 + * fail. We can acheive this by adding a write verifier to the 2568 + * buffer. 2555 2569 */ 2570 + bp->b_flags |= XBF_DONE; 2556 2571 bp->b_ops = &xfs_inode_buf_ops; 2557 2572 2558 2573 /*