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: <f9386314-f95b-5c66-32f7-0e6be42030b8@suse.de>
Date:   Fri, 2 Oct 2020 21:35:01 +0800
From:   Coly Li <colyli@...e.de>
To:     "Martin K. Petersen" <martin.petersen@...cle.com>
Cc:     linux-mmc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-block@...r.kernel.org, Vicente Bergas <vicencb@...il.com>,
        Adrian Hunter <adrian.hunter@...el.com>,
        Ulf Hansson <ulf.hansson@...aro.org>
Subject: Re: [PATCH v4] mmc: core: don't set limits.discard_granularity as 0

On 2020/10/2 20:57, Martin K. Petersen wrote:
> 
> Coly,
> 
>> diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
>> index 6c022ef0f84d..350d0cc4ee62 100644
>> --- a/drivers/mmc/core/queue.c
>> +++ b/drivers/mmc/core/queue.c
>> @@ -190,7 +190,7 @@ static void mmc_queue_setup_discard(struct request_queue *q,
>>  	q->limits.discard_granularity = card->pref_erase << 9;
>>  	/* granularity must not be greater than max. discard */
>>  	if (card->pref_erase > max_discard)
>> -		q->limits.discard_granularity = 0;
>> +		q->limits.discard_granularity = SECTOR_SIZE;
>>  	if (mmc_can_secure_erase_trim(card))
>>  		blk_queue_flag_set(QUEUE_FLAG_SECERASE, q);
>>  }
> 

Hi Martin,

> The granularity should probably be set to the logical block size instead
> of SECTOR_SIZE. However, looking at mmc_setup_queue() it doesn't appear
> the logical block size is read from the CSD until after discard has been
> configured. So that will require a bit of code shuffling.
> 

Copied, then let me try to modify mmc_setup_queue() too, and set the
discard_granularity from SECTOR_SIZE to logical block size.

Thanks for the hint.

Coly Li


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ