[PATCH 2/2] nvmet: reject enabling a namespace without a device path

Julian Sun sunjunchao at bytedance.com
Wed Sep 9 22:47:34 PDT 2026


On 9/10/26 1:42 PM, Christoph Hellwig wrote:
> On Tue, Sep 08, 2026 at 11:35:19AM +0800, Julian Sun wrote:
>> With buffered I/O enabled, nvmet_bdev_ns_enable() returns -ENOTBLK
>> before validating the device path. Enabling a namespace without setting
>> device_path therefore passes NULL to filp_open() and crashes in
>> getname_kernel().
>>
>> Reject enabling a namespace if no device path has been configured.
> 
> Looks good:
> 
> Reviewed-by: Christoph Hellwig <hch at lst.de>
> 
> Can you add test for this to blktests?

I noticed that this has already been fixed:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=09d0c07bd9ce3b2f2d993f672698d32a17543c32

But sure, I'll add a test to blktests.

Thanks,
-- 
Julian Sun <sunjunchao at bytedance.com>



More information about the Linux-nvme mailing list