Re: [PATCH v3 0/8] block: first batch of add_disk() error handling conversions
From: Christoph Hellwig <hch@infradead.org>
Date: 2021-09-01 05:31:39
From: Christoph Hellwig <hch@infradead.org>
Date: 2021-09-01 05:31:39
On Wed, Sep 01, 2021 at 01:19:44PM +0900, Tetsuo Handa wrote:
Are the changes by add_disk() made atomically against the caller? If there is a moment where "struct block_device_operations"->open can be called when add_disk() might still fail, how is it protected from the kfree() path?
The new add_disk is structured so tht it won't fail after the block device inode is hashed. That is, the last possible failure is before ->open can be called.