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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 7 Jul 2022 11:16:42 +0200
From:   Sergei Shtepa <sergei.shtepa@...am.com>
To:     Christoph Hellwig <hch@...radead.org>
CC:     "axboe@...nel.dk" <axboe@...nel.dk>,
        "linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 15/20] block, blksnap: snapshot image block device


> 
>> +static int snapimage_init_request(struct blk_mq_tag_set *set,
>> +				  struct request *rq, unsigned int hctx_idx,
>> +				  unsigned int numa_node)
>> +{
>> +	struct snapimage_cmd *cmd = blk_mq_rq_to_pdu(rq);
>> +
>> +	kthread_init_work(&cmd->work, snapimage_queue_work);
>> +	return 0;
>> +}
> I'm a little confused on why this both has a blk-mq interface and
> the new bio filter interface.  Whow is going to submit I/O to this
> blk-mq interface?
> 

Sorry, it seems to me that I didn't understand this comment.

The module creates a block device for each snapshot image.
To make a backup of a block device, the backup tool reads snapshot image.
This snapshot image block device allows to mount a file system on it
and perform the necessary preparation. If not for this requirement,
it would be possible to implement reading via an additional ioctl.
But that wouldn't be a good design, I think.

Perhaps I have implemented this block device incorrectly?
Processing requests of the snapshot image block device is started
in the function snapimage_queue_rq(). And ends in the 
snapimage_queue_work() in another kernel thread. Therefore, when
the request is initialized in snapimage_init_request(), a kernel worker
is prepared.

>> +	//.open = snapimage_open,
>> +	//.ioctl = snapimage_ioctl,
>> +	//.release = snapimage_close,
> Please don't leave commented out code around.
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ