Skip to contentSkip to conversation

xfs: lock dquot buffer before detaching dquot from b_li_list

PATCH Applied Darrick J. Wong 3 participants 8 messages Jan 9, 2025 – Jan 14, 2025 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: lock dquot buffer before detaching dquot from b_li_list

From: Darrick J. Wong <[email protected]>

We have to lock the buffer before we can delete the dquot log item from the buffer's log item list.

Cc <[email protected]> # v6.13-rc3
Fixes acc8f8628c3737 ("xfs: attach dquot buffer to dquot log item buffer")
---
 fs/xfs/xfs_dquot.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
fs/xfs/xfs_dquot.c +2 -1
index 576b7755b1f1fc..84b69f686ba82e 100644
@@ -87,8 +87,9 @@ xfs_dquot_detach_buf(
 	}
 	spin_unlock(&qlip->qli_lock);
 	if (bp) {
+		xfs_buf_lock(bp);
 		list_del_init(&qlip->qli_item.li_bio_list);
-		xfs_buf_rele(bp);
+		xfs_buf_relse(bp);
 	}
 }
 
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

We have to lock the buffer before we can delete the dquot log item from the buffer's log item list.

Looks good:

I did look a bit over how the inode items handles the equivalent functionality, and AFAICS there is no direct one. xfs_qm_dquot_isolate is for shrinking the dquot LRU, which is handled through the VFS for inodes. xfs_qm_dqpurge tries to write back dirty dquots, which I thought is dead code as all dirty dquots should have log items and thus be handled through the log and AIL, but it seems like xfs_qm_quotacheck_dqadjust dirties dquots without logging them. So we'll need that for now, but I wonder if we should convert this last bit of meatada to also go through our normal log mechanism eventually?

#2 lore raw
Quoted 10 lines · Christoph Hellwig
Quoted 4 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

We have to lock the buffer before we can delete the dquot log item from the buffer's log item list.

Looks good:

Quoted 10 lines

I did look a bit over how the inode items handles the equivalent functionality, and AFAICS there is no direct one. xfs_qm_dquot_isolate is for shrinking the dquot LRU, which is handled through the VFS for inodes. xfs_qm_dqpurge tries to write back dirty dquots, which I thought is dead code as all dirty dquots should have log items and thus be handled through the log and AIL, but it seems like xfs_qm_quotacheck_dqadjust dirties dquots without logging them. So we'll need that for now, but I wonder if we should convert this last bit of meatada to also go through our normal log mechanism eventually?

What if we replace it with the one in scrub/repair_quotacheck.c? :)

--D

#3 lore raw
Quoted 11 lines · Darrick J. Wong
Quoted 10 lines

I did look a bit over how the inode items handles the equivalent functionality, and AFAICS there is no direct one. xfs_qm_dquot_isolate is for shrinking the dquot LRU, which is handled through the VFS for inodes. xfs_qm_dqpurge tries to write back dirty dquots, which I thought is dead code as all dirty dquots should have log items and thus be handled through the log and AIL, but it seems like xfs_qm_quotacheck_dqadjust dirties dquots without logging them. So we'll need that for now, but I wonder if we should convert this last bit of meatada to also go through our normal log mechanism eventually?

Quoted 1 line

What if we replace it with the one in scrub/repair_quotacheck.c? :)

Yes, that's a much better implementation. It will probably be a while until we can get everyone convinced to actually build the online repair code into their kernels, though and I'm not sure if it's feasibable to have a subset just for quotacheck.

maintainer Applied
#4 lore raw
In reply to Darrick J. Wong
Quoted 4 lines · Darrick J. Wong

We have to lock the buffer before we can delete the dquot log item from the buffer's log item list.

Applied to next-rc, thanks!

[1/1] xfs: lock dquot buffer before detaching dquot from b_li_list

      commit: 4e7dfb45fe08b2b54d7fe2499fab0eeaa42004ad

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>
#5 lore raw
Quoted 10 lines · Carlos Maiolino
Quoted 4 lines · Darrick J. Wong

We have to lock the buffer before we can delete the dquot log item from the buffer's log item list.

Applied to next-rc, thanks!

[1/1] xfs: lock dquot buffer before detaching dquot from b_li_list

      commit: 4e7dfb45fe08b2b54d7fe2499fab0eeaa42004ad

Um... you already pushed this to Linus, why is it queued again? (albeit with the same commit id so I don't think it matters)

--D

Quoted 5 lines

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>
maintainer
#6 lore raw
Quoted 7 lines · Darrick J. Wong
Quoted 6 lines · Carlos Maiolino
Quoted 4 lines · Darrick J. Wong

We have to lock the buffer before we can delete the dquot log item from the buffer's log item list.

Quoted 7 lines
Quoted 4 lines

Applied to next-rc, thanks!

[1/1] xfs: lock dquot buffer before detaching dquot from b_li_list

      commit: 4e7dfb45fe08b2b54d7fe2499fab0eeaa42004ad

Um... you already pushed this to Linus, why is it queued again? (albeit with the same commit id so I don't think it matters)

I rushed to push this patch to -rc7 so I didn't end up sending a TY message to it. It was still on my b4 stack when I sent the last TY batch.

Which reminds me I should update the message, as the TY is going after I push to for-next, no to next-rc :).

Quoted 9 lines

--D

Quoted 5 lines

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>
#7 lore raw
Quoted 13 lines · Carlos Maiolino
Quoted 12 lines · Darrick J. Wong
Quoted 10 lines · Carlos Maiolino
Quoted 4 lines · Darrick J. Wong

We have to lock the buffer before we can delete the dquot log item from the buffer's log item list.

Applied to next-rc, thanks!

[1/1] xfs: lock dquot buffer before detaching dquot from b_li_list

      commit: 4e7dfb45fe08b2b54d7fe2499fab0eeaa42004ad
Quoted 8 lines
Quoted 2 lines

Um... you already pushed this to Linus, why is it queued again? (albeit with the same commit id so I don't think it matters)

I rushed to push this patch to -rc7 so I didn't end up sending a TY message to it. It was still on my b4 stack when I sent the last TY batch.

Which reminds me I should update the message, as the TY is going after I push to for-next, no to next-rc :).

Ah, ok. Carry on! :)

--D

Quoted 11 lines
Quoted 10 lines

--D

Quoted 5 lines

Best regards,

Signature · 1 line
Carlos Maiolino <[email protected]>