Hi,
在 2025/05/13 14:48, Christoph Hellwig 写道:
On Tue, May 13, 2025 at 02:32:04PM +0800, Yu Kuai wrote:
However, for bitmap file case, bio is issued from submit_bh(), I'll have
to change buffer_head code and I'm not sure if we want to do that.
Don't bother with the old code, I'm still hoping we can replace it with
your new code ASAP.
Agreed :)
+ BIO_STACKED_META, /* bio is metadata from stacked device */
I don't think that is the right name and description. The whole point
of the recursion avoidance is to to supported stacked devices by
reducing the stack depth. So we clearly need to document why that
is not desirable for some very specific cases like reading in metadata
needed to process a write I/O. We should also ensure it doesn't
propagate to lover stacked devices.
In fact I wonder if a better interfaces would be one to stash away
current->bio_list and then restore it after the call, as that would
enforce all that.
Yes, following change can work as well.
Just wonder, if the array is created by another array, and which is
created by another array ... In this case, the stack depth can be
huge. :( This is super weird case, however, should we keep the old code
in this case?
Thanks,
Kuai
static void bitmap_unplug(struct mddev *mddev, bool sync)
{
struct bitmap *bitmap = mddev->bitmap;
+ struct bio_list *bio_list = NULL;
if (!bitmap)
return;
- if (sync)
- __bitmap_unplug(bitmap);
- else
- bitmap_unplug_async(bitmap);
+ if (current->bio_list) {
+ bio_list = current->bio_list;
+ current->bio_list = NULL;
+ }
+
+ __bitmap_unplug(bitmap);
+
+ current->bio_list = bio_list;
}
.