Re: [PATCH 1/2] nvmet: avoid recursive configfs open for file-backed namespaces

From: Christoph Hellwig

Date: Wed Aug 19 2026 - 01:48:55 EST


> + 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 (!strcmp(path.dentry->d_sb->s_type->name, "configfs")) {
> + pr_err("configfs paths cannot back namespace %s\n",
> + ns->device_path);
> + path_put(&path);
> + return -EINVAL;
> + }

String comparisons are a bit weird, checking the actual file_system_type
is a lot cheaper and more safe. And please move this into a helper
in configfs as I bet there are tons of other users like this and they'd
benefit fro ma common helper.