RE: [PATCH 1/2] block: prevent block device lookups at the beginning of del_gendisk

From
Gulam Mohamed <hidden>
Date
2021-05-20 17:37:29
Reply to
Ming Lei, 2021-05-15

-----Original Message-----
From: Ming Lei <redacted> 
Sent: Saturday, May 15, 2021 12:05 PM
To: Christoph Hellwig <hch@lst.de>
Cc: axboe@kernel.dk; Gulam Mohamed <redacted>; <redacted>
Subject: Re: [PATCH 1/2] block: prevent block device lookups at the beginning of del_gendisk

On Fri, May 14, 2021 at 03:18:41PM +0200, Christoph Hellwig wrote:
As an artifact of how gendisk lookup used to work in earlier kernels, 
GENHD_FL_UP is only cleared very late in del_gendisk, and a global 
lock is used to prevent opens from succeeding while del_gendisk is 
tearing down the gendisk.  Switch to clearing the flag early and under 
bd_mutex so that callers can use bd_mutex to stabilize the flag, which 
removes the need for the global mutex.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <redacted>

I have tested these patches on latest kernel in our environment and didn't find any issue. The fix is working fine.

Tested-by: Gulam Mohamed <redacted>

--
Ming
Thread (9 messages) 9 messages, 4 authors, last reply 2021-05-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help