lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 23 Mar 2023 16:50:49 +0100
From:   Pankaj Raghav <p.raghav@...sung.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     <senozhatsky@...omium.org>, <viro@...iv.linux.org.uk>,
        <axboe@...nel.dk>, <willy@...radead.org>, <brauner@...nel.org>,
        <akpm@...ux-foundation.org>, <minchan@...nel.org>,
        <hubcap@...ibond.com>, <martin@...ibond.com>, <mcgrof@...nel.org>,
        <devel@...ts.orangefs.org>, <linux-mm@...ck.org>,
        <linux-kernel@...r.kernel.org>, <linux-fsdevel@...r.kernel.org>,
        <linux-block@...r.kernel.org>, <gost.dev@...sung.com>
Subject: Re: [RFC v2 1/5] zram: remove zram_page_end_io function

On 2023-03-23 11:35, Christoph Hellwig wrote:
> On Wed, Mar 22, 2023 at 02:50:09PM +0100, Pankaj Raghav wrote:
>> -	if (!parent)
>> -		bio->bi_end_io = zram_page_end_io;
>> -	else
>> +	if (parent)
> 
> I don't think a non-chained bio without and end_io handler can work.

Hmm. Is it because in the case of non-chained bio, zram driver owns the bio,
and it is the responsibility of the driver to call bio_put in the end_io handler?

> This !parent case seems to come from writeback_store, and as far as
> I can tell is broken already in the current code as it just fires
> off an async read without ever waiting for it, using an on-stack bio
> just to make things complicated.
> 
> The bvec reading code in zram is a mess, but I have an idea how
> to clean it up with a little series that should also help with
> this issue.
Sounds good.

As a part of this series, should I just have an end_io which has a
call to bio_put then?

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index b7bb52f8dfbd..faa78fce327e 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -608,10 +608,6 @@ static void free_block_bdev(struct zram *zram, unsigned long blk_idx)

 static void zram_page_end_io(struct bio *bio)
 {
-       struct page *page = bio_first_page_all(bio);
-
-       page_endio(page, op_is_write(bio_op(bio)),
-                       blk_status_to_errno(bio->bi_status));
        bio_put(bio);
 }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ