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]
Message-ID: <9384e8e2-dd4a-4b49-88a8-f15a9193c872@oracle.com>
Date: Thu, 16 Jan 2025 13:03:54 +0000
From: John Garry <john.g.garry@...cle.com>
To: Mikulas Patocka <mpatocka@...hat.com>
Cc: Mike Snitzer <snitzer@...merspace.com>, axboe@...nel.dk, agk@...hat.com,
        hch@....de, martin.petersen@...cle.com, linux-block@...r.kernel.org,
        dm-devel@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH RFC 0/5] device mapper atomic write support

On 16/01/2025 12:59, Mikulas Patocka wrote:
>>> dm-mirror uses dm-io to perform the writes on multiple mirror legs (see
>>> the function do_write() -> dm_io()), I looked at the code and it seems
>>> that the support for atomic writes in dm-mirror and dm-io would be
>>> straightforward.
>> I tried this out, and it seems to work ok.
>>
>> However, I need to set DM_TARGET_ATOMIC_WRITES in the mirror_target.features
>> member, like:
>>
>> diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
>> index 9511dae5b556..913a92c55904 100644
>> --- a/drivers/md/dm-raid1.c
>> +++ b/drivers/md/dm-raid1.c
>> @@ -1485,6 +1485,7 @@ static struct target_type mirror_target = {
>> 	.name    = "mirror",
>> 	.version = {1, 14, 0},
>> 	.module  = THIS_MODULE,
>> +	.features = DM_TARGET_ATOMIC_WRITES,
>> 	.ctr     = mirror_ctr,
>> 	.dtr     = mirror_dtr,
>> 	.map     = mirror_map,
>>
>>
>> Is this the right thing to do? I ask, as none of the other DM_TARGET* flags
>> are set already, which makes me suspicious.
>>
>> Thanks,
>> John
> Yes - that's right. I suggest that you verify that the atomic flag is
> really passed through the dm-raid1.c and dm-io.c stack. Add a printk that
> tests if REQ_ATOMIC is set to the function do_region in dm-io.c just
> before "submit_bio(bio)".
> 
> Alternatively, you can use blktrace to test if the REQ_ATOMIC is passed
> through correctly.

Yes, it is passed ok.

JFYI, I can also verify proper atomic write functionality on /dev/dmX 
with fio in verify mode.

Thanks,
John

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ