commit:     74d0366e3c6bc166d44d782e2f233740da1a9a16
Author:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
AuthorDate: Tue Feb 18 11:26:15 2025 +0000
Commit:     Mike Pagano <mpagano <AT> gentoo <DOT> org>
CommitDate: Tue Feb 18 11:26:15 2025 +0000
URL:        https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=74d0366e

Linux patch 6.12.15

Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>

 0000_README              |   4 ++
 1014_linux-6.12.15.patch | 142 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 146 insertions(+)

diff --git a/0000_README b/0000_README
index 8a136823..f6cd3204 100644
--- a/0000_README
+++ b/0000_README
@@ -99,6 +99,10 @@ Patch:  1013_linux-6.12.14.patch
 From:   https://www.kernel.org
 Desc:   Linux 6.12.14
 
+Patch:  1014_linux-6.12.15.patch
+From:   https://www.kernel.org
+Desc:   Linux 6.12.15
+
 Patch:  1500_fortify-copy-size-value-range-tracking-fix.patch
 From:   https://git.kernel.org/
 Desc:   fortify: Hide run-time copy size from value range tracking

diff --git a/1014_linux-6.12.15.patch b/1014_linux-6.12.15.patch
new file mode 100644
index 00000000..8fb3146b
--- /dev/null
+++ b/1014_linux-6.12.15.patch
@@ -0,0 +1,142 @@
+diff --git a/Makefile b/Makefile
+index 26a471dbed62a5..c6918c620bc368 100644
+--- a/Makefile
++++ b/Makefile
+@@ -1,7 +1,7 @@
+ # SPDX-License-Identifier: GPL-2.0
+ VERSION = 6
+ PATCHLEVEL = 12
+-SUBLEVEL = 14
++SUBLEVEL = 15
+ EXTRAVERSION =
+ NAME = Baby Opossum Posse
+ 
+diff --git a/fs/xfs/xfs_quota.h b/fs/xfs/xfs_quota.h
+index 23d71a55bbc006..032f3a70f21ddd 100644
+--- a/fs/xfs/xfs_quota.h
++++ b/fs/xfs/xfs_quota.h
+@@ -96,7 +96,8 @@ extern void xfs_trans_free_dqinfo(struct xfs_trans *);
+ extern void xfs_trans_mod_dquot_byino(struct xfs_trans *, struct xfs_inode *,
+               uint, int64_t);
+ extern void xfs_trans_apply_dquot_deltas(struct xfs_trans *);
+-extern void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *);
++void xfs_trans_unreserve_and_mod_dquots(struct xfs_trans *tp,
++              bool already_locked);
+ int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp, struct xfs_inode *ip,
+               int64_t dblocks, int64_t rblocks, bool force);
+ extern int xfs_trans_reserve_quota_bydquots(struct xfs_trans *,
+@@ -166,7 +167,7 @@ static inline void xfs_trans_mod_dquot_byino(struct 
xfs_trans *tp,
+ {
+ }
+ #define xfs_trans_apply_dquot_deltas(tp)
+-#define xfs_trans_unreserve_and_mod_dquots(tp)
++#define xfs_trans_unreserve_and_mod_dquots(tp, a)
+ static inline int xfs_trans_reserve_quota_nblks(struct xfs_trans *tp,
+               struct xfs_inode *ip, int64_t dblocks, int64_t rblocks,
+               bool force)
+diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c
+index ee46051db12dde..39cd11cbe21fcb 100644
+--- a/fs/xfs/xfs_trans.c
++++ b/fs/xfs/xfs_trans.c
+@@ -840,6 +840,7 @@ __xfs_trans_commit(
+        */
+       if (tp->t_flags & XFS_TRANS_SB_DIRTY)
+               xfs_trans_apply_sb_deltas(tp);
++      xfs_trans_apply_dquot_deltas(tp);
+ 
+       error = xfs_trans_run_precommits(tp);
+       if (error)
+@@ -868,11 +869,6 @@ __xfs_trans_commit(
+ 
+       ASSERT(tp->t_ticket != NULL);
+ 
+-      /*
+-       * If we need to update the superblock, then do it now.
+-       */
+-      xfs_trans_apply_dquot_deltas(tp);
+-
+       xlog_cil_commit(log, tp, &commit_seq, regrant);
+ 
+       xfs_trans_free(tp);
+@@ -898,7 +894,7 @@ __xfs_trans_commit(
+        * the dqinfo portion to be.  All that means is that we have some
+        * (non-persistent) quota reservations that need to be unreserved.
+        */
+-      xfs_trans_unreserve_and_mod_dquots(tp);
++      xfs_trans_unreserve_and_mod_dquots(tp, true);
+       if (tp->t_ticket) {
+               if (regrant && !xlog_is_shutdown(log))
+                       xfs_log_ticket_regrant(log, tp->t_ticket);
+@@ -992,7 +988,7 @@ xfs_trans_cancel(
+       }
+ #endif
+       xfs_trans_unreserve_and_mod_sb(tp);
+-      xfs_trans_unreserve_and_mod_dquots(tp);
++      xfs_trans_unreserve_and_mod_dquots(tp, false);
+ 
+       if (tp->t_ticket) {
+               xfs_log_ticket_ungrant(log, tp->t_ticket);
+diff --git a/fs/xfs/xfs_trans_dquot.c b/fs/xfs/xfs_trans_dquot.c
+index b368e13424c4f4..b92eeaa1a2a9e7 100644
+--- a/fs/xfs/xfs_trans_dquot.c
++++ b/fs/xfs/xfs_trans_dquot.c
+@@ -602,6 +602,24 @@ xfs_trans_apply_dquot_deltas(
+                       ASSERT(dqp->q_blk.reserved >= dqp->q_blk.count);
+                       ASSERT(dqp->q_ino.reserved >= dqp->q_ino.count);
+                       ASSERT(dqp->q_rtb.reserved >= dqp->q_rtb.count);
++
++                      /*
++                       * We've applied the count changes and given back
++                       * whatever reservation we didn't use.  Zero out the
++                       * dqtrx fields.
++                       */
++                      qtrx->qt_blk_res = 0;
++                      qtrx->qt_bcount_delta = 0;
++                      qtrx->qt_delbcnt_delta = 0;
++
++                      qtrx->qt_rtblk_res = 0;
++                      qtrx->qt_rtblk_res_used = 0;
++                      qtrx->qt_rtbcount_delta = 0;
++                      qtrx->qt_delrtb_delta = 0;
++
++                      qtrx->qt_ino_res = 0;
++                      qtrx->qt_ino_res_used = 0;
++                      qtrx->qt_icount_delta = 0;
+               }
+       }
+ }
+@@ -638,7 +656,8 @@ xfs_trans_unreserve_and_mod_dquots_hook(
+  */
+ void
+ xfs_trans_unreserve_and_mod_dquots(
+-      struct xfs_trans        *tp)
++      struct xfs_trans        *tp,
++      bool                    already_locked)
+ {
+       int                     i, j;
+       struct xfs_dquot        *dqp;
+@@ -667,10 +686,12 @@ xfs_trans_unreserve_and_mod_dquots(
+                        * about the number of blocks used field, or deltas.
+                        * Also we don't bother to zero the fields.
+                        */
+-                      locked = false;
++                      locked = already_locked;
+                       if (qtrx->qt_blk_res) {
+-                              xfs_dqlock(dqp);
+-                              locked = true;
++                              if (!locked) {
++                                      xfs_dqlock(dqp);
++                                      locked = true;
++                              }
+                               dqp->q_blk.reserved -=
+                                       (xfs_qcnt_t)qtrx->qt_blk_res;
+                       }
+@@ -691,7 +712,7 @@ xfs_trans_unreserve_and_mod_dquots(
+                               dqp->q_rtb.reserved -=
+                                       (xfs_qcnt_t)qtrx->qt_rtblk_res;
+                       }
+-                      if (locked)
++                      if (locked && !already_locked)
+                               xfs_dqunlock(dqp);
+ 
+               }

Reply via email to