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: <3e42ca95-0fc8-461e-84b3-161a107a22c2@wdc.com>
Date: Thu, 15 Aug 2024 10:55:22 +0000
From: Johannes Thumshirn <Johannes.Thumshirn@....com>
To: Filipe Manana <fdmanana@...nel.org>, Johannes Thumshirn <jth@...nel.org>
CC: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>, David Sterba
	<dsterba@...e.com>, "linux-btrfs@...r.kernel.org"
	<linux-btrfs@...r.kernel.org>, "linux-kernel@...r.kernel.org"
	<linux-kernel@...r.kernel.org>, Filipe Manana <fdmanana@...e.com>
Subject: Re: [PATCH] btrfs: relax dev_replace rwsem usage on scrub with rst

On 14.08.24 16:14, Filipe Manana wrote:
> 
> And, how actually does this patch fixes the double locking problem?
> 
> Isn't the problem that the replace code ends calling btrfs_map_block()
> while holding a read lock on the semaphore and then btrfs_map_block()
> does a read lock on it again?
> 
> I would suggest a different fix:
> 
> Make the device replace code store a pointer (or pid) of to the task
> running device replace, and at btrfs_map_block() don't take the
> semaphore if "current" matches that pointer/pid.
> 
> Wouldn't that work? Seems safe and simple to me.

 From the first test, this seems to work. At least I don't get a lockdep 
splat anymore.

I'll give it some more test time and then I'll submit the patch.

Thanks,
	Johannes

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ