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>] [day] [month] [year] [list]
Date:   Fri, 21 Aug 2020 09:32:10 +0800
From:   Jacob Wen <jian.w.wen@...cle.com>
To:     linux-fsdevel@...r.kernel.org,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        linux-block@...r.kernel.org
Subject: Re: [PATCH 1/2] block: use DEFINE_WAIT_BIT instead of DEFINE_WAIT for
 bit wait queue

Can I have a review?

On 8/13/20 1:05 PM, Jacob Wen wrote:
> DEFINE_WAIT_BIT uses wake_bit_function() which is able to avoid
> false-wakeups due to possible hash collisions in the bit wait table.
>
> Signed-off-by: Jacob Wen <jian.w.wen@...cle.com>
> ---
>   fs/block_dev.c | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 0ae656e022fd..ba4fad08cdaf 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1062,12 +1062,12 @@ static int bd_prepare_to_claim(struct block_device *bdev,
>   	/* if claiming is already in progress, wait for it to finish */
>   	if (whole->bd_claiming) {
>   		wait_queue_head_t *wq = bit_waitqueue(&whole->bd_claiming, 0);
> -		DEFINE_WAIT(wait);
> +		DEFINE_WAIT_BIT(wait, &whole->bd_claiming, 0);
>   
> -		prepare_to_wait(wq, &wait, TASK_UNINTERRUPTIBLE);
> +		prepare_to_wait(wq, &wait.wq_entry, TASK_UNINTERRUPTIBLE);
>   		spin_unlock(&bdev_lock);
>   		schedule();
> -		finish_wait(wq, &wait);
> +		finish_wait(wq, &wait.wq_entry);
>   		spin_lock(&bdev_lock);
>   		goto retry;
>   	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ