Patch "jdb2: Don't refuse invalidation of already invalidated buffers" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    jdb2: Don't refuse invalidation of already invalidated buffers

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     jdb2-don-t-refuse-invalidation-of-already-invalidate.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2d42c8a434f8b74a0015b2d42bfda823d4e32a62
Author: Jan Kara <jack@xxxxxxx>
Date:   Wed Mar 29 17:49:32 2023 +0200

    jdb2: Don't refuse invalidation of already invalidated buffers
    
    [ Upstream commit bd159398a2d2234de07d310132865706964aaaa7 ]
    
    When invalidating buffers under the partial tail page,
    jbd2_journal_invalidate_folio() returns -EBUSY if the buffer is part of
    the committing transaction as we cannot safely modify buffer state.
    However if the buffer is already invalidated (due to previous
    invalidation attempts from ext4_wait_for_tail_page_commit()), there's
    nothing to do and there's no point in returning -EBUSY. This fixes
    occasional warnings from ext4_journalled_invalidate_folio() triggered by
    generic/051 fstest when blocksize < pagesize.
    
    Fixes: 53e872681fed ("ext4: fix deadlock in journal_unmap_buffer()")
    Signed-off-by: Jan Kara <jack@xxxxxxx>
    Link: https://lore.kernel.org/r/20230329154950.19720-1-jack@xxxxxxx
    Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 55232064cab21..ce4a5ccadeff4 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -2378,6 +2378,9 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh,
 			spin_unlock(&jh->b_state_lock);
 			write_unlock(&journal->j_state_lock);
 			jbd2_journal_put_journal_head(jh);
+			/* Already zapped buffer? Nothing to do... */
+			if (!bh->b_bdev)
+				return 0;
 			return -EBUSY;
 		}
 		/*



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux