[PATCH v2 2/3] nvmet: avoid recursive configfs open for file-backed namespaces
Christoph Hellwig
hch at lst.de
Wed Sep 2 03:32:02 PDT 2026
> + ret = kern_path(ns->device_path, LOOKUP_FOLLOW, &path);
> + if (ret) {
> + pr_err("failed to open file %s: (%d)\n",
> + ns->device_path, ret);
> + return ret;
> + }
> +
> + if (configfs_path_is_configfs(&path)) {
> + pr_err("configfs paths cannot back namespace %s\n",
> + ns->device_path);
> + path_put(&path);
> + return -EINVAL;
> + }
> +
> + ns->file = dentry_open(&path, flags, current_cred());
This section of code really should have a helper in configfs. And should
also be used in other callers like the SCSI target patches you also sent
out.
More information about the Linux-nvme
mailing list