summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruenba@redhat.com>2025-11-30 21:19:52 +0000
committerAndreas Gruenbacher <agruenba@redhat.com>2025-12-02 16:44:54 +0000
commit8a157e0a0aa5143b5d94201508c0ca1bb8cfb941 (patch)
tree6a465885d4b7eff1f1b4ac885632f56d8ac330bd /fs
parent83348905e4137742c93bfd8104ce71c637121d38 (diff)
gfs2: Fix use of bio_chain
In gfs2_chain_bio(), the call to bio_chain() has its arguments swapped. The result is leaked bios and incorrect synchronization (only the last bio will actually be waited for). This code is only used during mount and filesystem thaw, so the bug normally won't be noticeable. Reported-by: Stephen Zhang <starzhangzsd@gmail.com> Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/gfs2/lops.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c
index d27a0b1080a9..97ebe457c00a 100644
--- a/fs/gfs2/lops.c
+++ b/fs/gfs2/lops.c
@@ -484,7 +484,7 @@ static struct bio *gfs2_chain_bio(struct bio *prev, unsigned int nr_iovecs)
new = bio_alloc(prev->bi_bdev, nr_iovecs, prev->bi_opf, GFP_NOIO);
bio_clone_blkg_association(new, prev);
new->bi_iter.bi_sector = bio_end_sector(prev);
- bio_chain(new, prev);
+ bio_chain(prev, new);
submit_bio(prev);
return new;
}