]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.1-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Apr 2025 14:11:10 +0000 (16:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Apr 2025 14:11:10 +0000 (16:11 +0200)
added patches:
btrfs-fix-the-length-of-reserved-qgroup-to-free.patch

queue-6.1/btrfs-fix-the-length-of-reserved-qgroup-to-free.patch [new file with mode: 0644]
queue-6.1/md-md-bitmap-fix-stats-collection-for-external-bitma.patch
queue-6.1/series

diff --git a/queue-6.1/btrfs-fix-the-length-of-reserved-qgroup-to-free.patch b/queue-6.1/btrfs-fix-the-length-of-reserved-qgroup-to-free.patch
new file mode 100644 (file)
index 0000000..03d7cb4
--- /dev/null
@@ -0,0 +1,38 @@
+From 2b084d8205949dd804e279df8e68531da78be1e8 Mon Sep 17 00:00:00 2001
+From: Haisu Wang <haisuwang@tencent.com>
+Date: Fri, 25 Oct 2024 14:54:40 +0800
+Subject: btrfs: fix the length of reserved qgroup to free
+
+From: Haisu Wang <haisuwang@tencent.com>
+
+commit 2b084d8205949dd804e279df8e68531da78be1e8 upstream.
+
+The dealloc flag may be cleared and the extent won't reach the disk in
+cow_file_range when errors path. The reserved qgroup space is freed in
+commit 30479f31d44d ("btrfs: fix qgroup reserve leaks in
+cow_file_range"). However, the length of untouched region to free needs
+to be adjusted with the correct remaining region size.
+
+Fixes: 30479f31d44d ("btrfs: fix qgroup reserve leaks in cow_file_range")
+CC: stable@vger.kernel.org # 6.11+
+Reviewed-by: Qu Wenruo <wqu@suse.com>
+Reviewed-by: Boris Burkov <boris@bur.io>
+Signed-off-by: Haisu Wang <haisuwang@tencent.com>
+Reviewed-by: David Sterba <dsterba@suse.com>
+Signed-off-by: David Sterba <dsterba@suse.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/btrfs/inode.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/btrfs/inode.c
++++ b/fs/btrfs/inode.c
+@@ -1442,7 +1442,7 @@ out_unlock:
+               clear_bits |= EXTENT_CLEAR_DATA_RESV;
+               extent_clear_unlock_delalloc(inode, start, end, locked_page,
+                                            clear_bits, page_ops);
+-              btrfs_qgroup_free_data(inode, NULL, start, cur_alloc_size, NULL);
++              btrfs_qgroup_free_data(inode, NULL, start, end - start + 1, NULL);
+       }
+       return ret;
+ }
index 99644d43ce413f0e0762705dd36bc1ce2073fb74..1098113f1a1fbaf9bf3098156e26cc3a830e7ef7 100644 (file)
@@ -25,14 +25,12 @@ Link: https://lore.kernel.org/linux-raid/20250403015322.2873369-1-zhengqixing@hu
 Signed-off-by: Yu Kuai <yukuai3@huawei.com>
 Signed-off-by: Sasha Levin <sashal@kernel.org>
 ---
- drivers/md/md-bitmap.c | 5 ++---
+ drivers/md/md-bitmap.c |    5 ++---
  1 file changed, 2 insertions(+), 3 deletions(-)
 
-diff --git a/drivers/md/md-bitmap.c b/drivers/md/md-bitmap.c
-index e18e21b24210d..02629516748e4 100644
 --- a/drivers/md/md-bitmap.c
 +++ b/drivers/md/md-bitmap.c
-@@ -2029,9 +2029,8 @@ int md_bitmap_get_stats(struct bitmap *bitmap, struct md_bitmap_stats *stats)
+@@ -2029,9 +2029,8 @@ int md_bitmap_get_stats(struct bitmap *b
  
        if (!bitmap)
                return -ENOENT;
@@ -44,6 +42,3 @@ index e18e21b24210d..02629516748e4 100644
                return -EINVAL;
        sb = kmap_local_page(bitmap->storage.sb_page);
        stats->sync_size = le64_to_cpu(sb->sync_size);
--- 
-2.39.5
-
index 9feeebfa31fb8091e4edc865d9e7e3d267bf3a40..3e0ed1630f1505e6096408b4d3ca20ac7dc3ed13 100644 (file)
@@ -169,8 +169,6 @@ wifi-mac80211-purge-vif-txq-in-ieee80211_do_stop.patch
 wifi-wl1251-fix-memory-leak-in-wl1251_tx_work.patch
 scsi-iscsi-fix-missing-scsi_host_put-in-error-path.patch
 md-raid10-fix-missing-discard-io-accounting.patch
-md-use-separate-work_struct-for-md_start_sync.patch
-md-factor-out-a-helper-from-mddev_put.patch
 md-md-bitmap-fix-stats-collection-for-external-bitma.patch
 rdma-usnic-fix-passing-zero-to-ptr_err-in-usnic_ib_p.patch
 rdma-hns-fix-wrong-maximum-dma-segment-size.patch
@@ -279,6 +277,7 @@ nvmet-fc-remove-unused-functions.patch
 smb-server-fix-potential-null-ptr-deref-of-lease_ctx_info-in-smb2_open.patch
 cifs-use-origin-fullpath-for-automounts.patch
 net-sched-act_mirred-don-t-override-retval-if-we-already-lost-the-skb.patch
+btrfs-fix-the-length-of-reserved-qgroup-to-free.patch
 bpf-avoid-holding-freeze_mutex-during-mmap-operation.patch
 bpf-prevent-tail-call-between-progs-attached-to-different-hooks.patch
 blk-cgroup-support-to-track-if-policy-is-online.patch