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] [day] [month] [year] [list]
Message-ID: <683bb62a-9667-d2c7-0437-7a6343819382@virtuozzo.com>
Date:   Fri, 31 Jan 2020 12:15:17 +0300
From:   Kirill Tkhai <ktkhai@...tuozzo.com>
To:     Christoph Hellwig <hch@...radead.org>,
        "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        axboe@...nel.dk, tytso@....edu, adilger.kernel@...ger.ca,
        Chaitanya.Kulkarni@....com, darrick.wong@...cle.com,
        ming.lei@...hat.com, osandov@...com, jthumshirn@...e.de,
        minwoo.im.dev@...il.com, damien.lemoal@....com,
        andrea.parri@...rulasolutions.com, hare@...e.com, tj@...nel.org,
        ajay.joshi@....com, sagi@...mberg.me, dsterba@...e.com,
        bvanassche@....org, dhowells@...hat.com, asml.silence@...il.com
Subject: Re: [PATCH block v2 2/3] block: Add support for REQ_NOZERO flag

Hi, Christoph,

On 31.01.2020 09:23, Christoph Hellwig wrote:
> On Tue, Jan 21, 2020 at 01:14:05AM -0500, Martin K. Petersen wrote:
>> I find there is some dissonance between using BLKDEV_ZERO_ALLOCATE to
>> describe this operation in one case and REQ_NOZERO in the other.
>>
>> I understand why not zeroing is important in your case. However, I think
>> the allocation aspect is semantically more important. Also, in the case
>> of SCSI, the allocated blocks will typically appear zeroed. So from that
>> perspective REQ_NOZERO doesn't really make sense. I would really prefer
>> to use REQ_ALLOCATE to describe this operation. I agree that "do not
>> write every block" is important too. I just don't have a good suggestion
>> for how to express that as an additional qualifier to REQ_ALLOCATE_?.
> 
> Agreed.  Nevermind the problem of a REQ_OP_WRITE_ZEROES operations with
> a NOZERO flag causing a massive confusion to the reader.
> 
>> Also, adding to the confusion: In the context of SCSI, ANCHOR requires
>> UNMAP. So my head hurts a bit when I read REQ_NOZERO|REQ_NOUNMAP and
>> have to translate that into ANCHOR|UNMAP.
>>
>> Longer term, I think we should consider introducing REQ_OP_SINGLE_RANGE
>> or something like that as an umbrella operation that can be used to
>> describe zeroing, allocating, and other things that operate on a single
>> LBA range with no payload. Thus removing both the writiness and the
>> zeroness from the existing REQ_OP_WRITE_ZEROES conduit.
> 
> What is the benefit of a multipler there?  Given all this flags
> confusion I'm almost tempted to just split up REQ_OP_WRITE_ZEROES into
> REQ_OP_ALLOCATE ("cheap") and REQ_OP_WRITE_ZEROES ("potentially
> expensive") and just let the caller handle the difference.  Everytime
> we try to encode semantic differences into flags we're eventually
> running into trouble.  Sais the person that added REQ_UNMAP..

We started from separated REQ_OP_ASSIGN_RANGE in v1, but then we decided
to use a modifier because this looks better and scatters less over
I/O stack. See "[PATCH RFC 0/3] block,ext4: Introduce REQ_OP_ASSIGN_RANGE
to reflect extents allocation in block device internals" series for the details.
(https://lkml.org/lkml/2020/1/7/1616 and neighbouring messages).

Last version of the patchset is v5 and it's here: https://lkml.org/lkml/2020/1/22/643

Kirill

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ