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]
Message-ID: <3e965865.5946.17541447519.Coremail.sh_def@163.com>
Date:   Mon, 19 Oct 2020 22:30:06 +0800 (CST)
From:   苏辉 <sh_def@....com>
To:     "Johannes Thumshirn" <Johannes.Thumshirn@....com>
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:Re: [PATCH] blk: use REQ_OP_WRITE instead of hard code

Yeah, you are right, thanks for your explanation<br/><br/>Maybe we should define a MASK to do this?
At 2020-10-19 22:09:40, "Johannes Thumshirn" <Johannes.Thumshirn@....com> wrote:
>On 19/10/2020 16:06, Hui Su wrote:
>> use REQ_OP_WRITE instead of hard code in
>> op_is_write().
>> 
>> Signed-off-by: Hui Su <sh_def@....com>
>> ---
>>  include/linux/blk_types.h | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>> diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
>> index 7d7c13238fdb..7b9b02378c24 100644
>> --- a/include/linux/blk_types.h
>> +++ b/include/linux/blk_types.h
>> @@ -440,7 +440,7 @@ static inline void bio_set_op_attrs(struct bio *bio, unsigned op,
>>  
>>  static inline bool op_is_write(unsigned int op)
>>  {
>> -	return (op & 1);
>> +	return (op & REQ_OP_WRITE);
>
>op_is_write() returns true for every req_op that writes to a device (they all have 
>the lowest bit set), while REQ_OP_WRITE means a WRITE. You'll change the semantics
>with this patch.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ