From: Greg Kroah-Hartman Date: Mon, 29 Jul 2024 11:20:45 +0000 (+0200) Subject: drop queue-6.1/jbd2-avoid-infinite-transaction-commit-loop.patch X-Git-Tag: v6.1.103~69 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47c8cac5e0a59e60731a18bb941038df8024ea2d;p=thirdparty%2Fkernel%2Fstable-queue.git drop queue-6.1/jbd2-avoid-infinite-transaction-commit-loop.patch Breaks the build --- diff --git a/queue-5.15/series b/queue-5.15/series index 64d6d3e3110..7ee456302c3 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -191,3 +191,9 @@ m68k-amiga-turn-off-warp1260-interrupts-during-boot.patch ext4-check-dot-and-dotdot-of-dx_root-before-making-dir-indexed.patch ext4-make-sure-the-first-directory-block-is-not-a-hole.patch io_uring-tighten-task-exit-cancellations.patch +selftests-landlock-add-cred_transfer-test.patch +wifi-mwifiex-fix-interface-type-change.patch +leds-ss4200-convert-pcibios_-return-codes-to-errnos.patch +jbd2-make-jbd2_journal_get_max_txn_bufs-internal.patch +media-uvcvideo-fix-integer-overflow-calculating-timestamp.patch +kvm-vmx-split-out-the-non-virtualization-part-of-vmx_interrupt_blocked.patch diff --git a/queue-6.1/jbd2-avoid-infinite-transaction-commit-loop.patch b/queue-6.1/jbd2-avoid-infinite-transaction-commit-loop.patch deleted file mode 100644 index fec5b48ebd1..00000000000 --- a/queue-6.1/jbd2-avoid-infinite-transaction-commit-loop.patch +++ /dev/null @@ -1,101 +0,0 @@ -From 27ba5b67312a944576addc4df44ac3b709aabede Mon Sep 17 00:00:00 2001 -From: Jan Kara -Date: Mon, 24 Jun 2024 19:01:19 +0200 -Subject: jbd2: avoid infinite transaction commit loop - -From: Jan Kara - -commit 27ba5b67312a944576addc4df44ac3b709aabede upstream. - -Commit 9f356e5a4f12 ("jbd2: Account descriptor blocks into -t_outstanding_credits") started to account descriptor blocks into -transactions outstanding credits. However it didn't appropriately -decrease the maximum amount of credits available to userspace. Thus if -the filesystem requests a transaction smaller than -j_max_transaction_buffers but large enough that when descriptor blocks -are added the size exceeds j_max_transaction_buffers, we confuse -add_transaction_credits() into thinking previous handles have grown the -transaction too much and enter infinite journal commit loop in -start_this_handle() -> add_transaction_credits() trying to create -transaction with enough credits available. - -Fix the problem by properly accounting for transaction space reserved -for descriptor blocks when verifying requested transaction handle size. - -CC: stable@vger.kernel.org -Fixes: 9f356e5a4f12 ("jbd2: Account descriptor blocks into t_outstanding_credits") -Reported-by: Alexander Coffin -Link: https://lore.kernel.org/all/CA+hUFcuGs04JHZ_WzA1zGN57+ehL2qmHOt5a7RMpo+rv6Vyxtw@mail.gmail.com -Signed-off-by: Jan Kara -Reviewed-by: Zhang Yi -Link: https://patch.msgid.link/20240624170127.3253-3-jack@suse.cz -Signed-off-by: Theodore Ts'o -Signed-off-by: Greg Kroah-Hartman ---- - fs/jbd2/transaction.c | 21 ++++++++++++++------- - 1 file changed, 14 insertions(+), 7 deletions(-) - ---- a/fs/jbd2/transaction.c -+++ b/fs/jbd2/transaction.c -@@ -213,6 +213,13 @@ static void sub_reserved_credits(journal - wake_up(&journal->j_wait_reserved); - } - -+/* Maximum number of blocks for user transaction payload */ -+static int jbd2_max_user_trans_buffers(journal_t *journal) -+{ -+ return journal->j_max_transaction_buffers - -+ journal->j_transaction_overhead_buffers; -+} -+ - /* - * Wait until we can add credits for handle to the running transaction. Called - * with j_state_lock held for reading. Returns 0 if handle joined the running -@@ -262,12 +269,12 @@ __must_hold(&journal->j_state_lock) - * big to fit this handle? Wait until reserved credits are freed. - */ - if (atomic_read(&journal->j_reserved_credits) + total > -- journal->j_max_transaction_buffers) { -+ jbd2_max_user_trans_buffers(journal)) { - read_unlock(&journal->j_state_lock); - jbd2_might_wait_for_commit(journal); - wait_event(journal->j_wait_reserved, - atomic_read(&journal->j_reserved_credits) + total <= -- journal->j_max_transaction_buffers); -+ jbd2_max_user_trans_buffers(journal)); - __acquire(&journal->j_state_lock); /* fake out sparse */ - return 1; - } -@@ -307,14 +314,14 @@ __must_hold(&journal->j_state_lock) - - needed = atomic_add_return(rsv_blocks, &journal->j_reserved_credits); - /* We allow at most half of a transaction to be reserved */ -- if (needed > journal->j_max_transaction_buffers / 2) { -+ if (needed > jbd2_max_user_trans_buffers(journal) / 2) { - sub_reserved_credits(journal, rsv_blocks); - atomic_sub(total, &t->t_outstanding_credits); - read_unlock(&journal->j_state_lock); - jbd2_might_wait_for_commit(journal); - wait_event(journal->j_wait_reserved, - atomic_read(&journal->j_reserved_credits) + rsv_blocks -- <= journal->j_max_transaction_buffers / 2); -+ <= jbd2_max_user_trans_buffers(journal) / 2); - __acquire(&journal->j_state_lock); /* fake out sparse */ - return 1; - } -@@ -344,12 +351,12 @@ static int start_this_handle(journal_t * - * size and limit the number of total credits to not exceed maximum - * transaction size per operation. - */ -- if ((rsv_blocks > journal->j_max_transaction_buffers / 2) || -- (rsv_blocks + blocks > journal->j_max_transaction_buffers)) { -+ if (rsv_blocks > jbd2_max_user_trans_buffers(journal) / 2 || -+ rsv_blocks + blocks > jbd2_max_user_trans_buffers(journal)) { - printk(KERN_ERR "JBD2: %s wants too many credits " - "credits:%d rsv_credits:%d max:%d\n", - current->comm, blocks, rsv_blocks, -- journal->j_max_transaction_buffers); -+ jbd2_max_user_trans_buffers(journal)); - WARN_ON(1); - return -ENOSPC; - } diff --git a/queue-6.1/series b/queue-6.1/series index 5365102e49f..5a4f21d4392 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -311,7 +311,6 @@ drivers-soc-xilinx-check-return-status-of-get_api_version.patch leds-ss4200-convert-pcibios_-return-codes-to-errnos.patch leds-mt6360-fix-memory-leak-in-mt6360_init_isnk_properties.patch jbd2-make-jbd2_journal_get_max_txn_bufs-internal.patch -jbd2-avoid-infinite-transaction-commit-loop.patch media-uvcvideo-fix-integer-overflow-calculating-timestamp.patch kvm-vmx-split-out-the-non-virtualization-part-of-vmx_interrupt_blocked.patch kvm-nvmx-request-immediate-exit-iff-pending-nested-event-needs-injection.patch