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: <4215351e-89ac-4969-1d52-e2ff5c064d7d@windriver.com>
Date:   Tue, 17 Mar 2020 16:50:11 +0800
From:   He Zhe <zhe.he@...driver.com>
To:     Christoph Hellwig <hch@....de>
Cc:     jack@...e.cz, Jens Axboe <axboe@...nel.dk>,
        viro@...iv.linux.org.uk, bvanassche@....org, keith.busch@...el.com,
        tglx@...utronix.de, mwilck@...e.com, yuyufen@...wei.com,
        linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: disk revalidation updates and OOM



On 3/16/20 7:37 PM, Christoph Hellwig wrote:
> On Mon, Mar 16, 2020 at 07:01:09PM +0800, He Zhe wrote:
>>> Do 142fe8f and 979c690d work with the build fix applied? (f0b870d
>>> shouldn't be interesting for this case).
>> Sorry for slow reply.
>>
>> With my build fix applied, the issue is triggered since 142fe8f.
>> And I can see the endless loop of invalidate and revalidate...
> Thanks.  Can you test the patch below that restores the previous
> rather odd behavior of not clearing the capacity to 0 if partition
> scanning is not enabled?

This fixes the issue. I also validated it on v5.6-rc6.

Thank you very much.

Zhe

>
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 69bf2fb6f7cd..daac27f4b821 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1520,10 +1520,13 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)
>  	if (ret)
>  		return ret;
>  
> -	if (invalidate)
> -		set_capacity(disk, 0);
> -	else if (disk->fops->revalidate_disk)
> -		disk->fops->revalidate_disk(disk);
> +	if (invalidate) {
> +		if (disk_part_scan_enabled(disk))
> +			set_capacity(disk, 0);
> +	} else {
> +		if (disk->fops->revalidate_disk)
> +			disk->fops->revalidate_disk(disk);
> +	}
>  
>  	check_disk_size_change(disk, bdev, !invalidate);
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ