aboutsummaryrefslogtreecommitdiff
path: root/block/bio.c
diff options
context:
space:
mode:
authorLinus Torvalds2024-07-22 11:04:09 -0700
committerLinus Torvalds2024-07-22 11:04:09 -0700
commit0256994887d7c89c2a41d872aac67605bda8f115 (patch)
tree2eb9062a07d84b6027a7ef139fa82ab207428d0e /block/bio.c
parentdd018c238b8489b6dd8c06f6b962ea75d79115ff (diff)
parent74cc150282e41c6c0704cd305c9a4392dc64ef4d (diff)
Merge tag 'for-6.11/block-post-20240722' of git://git.kernel.dk/linux
Pull block integrity mapping updates from Jens Axboe: "A set of cleanups and fixes for the block integrity support. Sent separately from the main block changes from last week, as they depended on later fixes in the 6.10-rc cycle" * tag 'for-6.11/block-post-20240722' of git://git.kernel.dk/linux: block: don't free the integrity payload in bio_integrity_unmap_free_user block: don't free submitter owned integrity payload on I/O completion block: call bio_integrity_unmap_free_user from blk_rq_unmap_user block: don't call bio_uninit from bio_endio block: also return bio_integrity_payload * from stubs block: split integrity support out of bio.h
Diffstat (limited to 'block/bio.c')
-rw-r--r--block/bio.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/block/bio.c b/block/bio.c
index a3b1b2266c50..c4053d49679a 100644
--- a/block/bio.c
+++ b/block/bio.c
@@ -4,7 +4,7 @@
*/
#include <linux/mm.h>
#include <linux/swap.h>
-#include <linux/bio.h>
+#include <linux/bio-integrity.h>
#include <linux/blkdev.h>
#include <linux/uio.h>
#include <linux/iocontext.h>
@@ -1630,8 +1630,18 @@ again:
goto again;
}
- /* release cgroup info */
- bio_uninit(bio);
+#ifdef CONFIG_BLK_CGROUP
+ /*
+ * Release cgroup info. We shouldn't have to do this here, but quite
+ * a few callers of bio_init fail to call bio_uninit, so we cover up
+ * for that here at least for now.
+ */
+ if (bio->bi_blkg) {
+ blkg_put(bio->bi_blkg);
+ bio->bi_blkg = NULL;
+ }
+#endif
+
if (bio->bi_end_io)
bio->bi_end_io(bio);
}