Commit a11a7222 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'block-6.15-20250522' of git://git.kernel.dk/linux

Pull block fixes from Jens Axboe:

 - Fix for a regression with setting up loop on a file system
   without ->write_iter()

 - Fix for an nvme sysfs regression

* tag 'block-6.15-20250522' of git://git.kernel.dk/linux:
  nvme: avoid creating multipath sysfs group under namespace path devices
  loop: don't require ->write_iter for writable files in loop_configure
parents ab719cc7 115c011f
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -979,9 +979,6 @@ static int loop_configure(struct loop_device *lo, blk_mode_t mode,
	if (!file)
		return -EBADF;

	if ((mode & BLK_OPEN_WRITE) && !file->f_op->write_iter)
		return -EINVAL;

	error = loop_check_backing_file(file);
	if (error)
		return error;
+28 −0
Original line number Diff line number Diff line
@@ -306,13 +306,41 @@ static const struct attribute_group nvme_ns_attr_group = {
};

#ifdef CONFIG_NVME_MULTIPATH
/*
 * NOTE: The dummy attribute does not appear in sysfs. It exists solely to allow
 * control over the visibility of the multipath sysfs node. Without at least one
 * attribute defined in nvme_ns_mpath_attrs[], the sysfs implementation does not
 * invoke the multipath_sysfs_group_visible() method. As a result, we would not
 * be able to control the visibility of the multipath sysfs node.
 */
static struct attribute dummy_attr = {
	.name = "dummy",
};

static struct attribute *nvme_ns_mpath_attrs[] = {
	&dummy_attr,
	NULL,
};

static bool multipath_sysfs_group_visible(struct kobject *kobj)
{
	struct device *dev = container_of(kobj, struct device, kobj);

	return nvme_disk_is_ns_head(dev_to_disk(dev));
}

static bool multipath_sysfs_attr_visible(struct kobject *kobj,
		struct attribute *attr, int n)
{
	return false;
}

DEFINE_SYSFS_GROUP_VISIBLE(multipath_sysfs)

const struct attribute_group nvme_ns_mpath_attr_group = {
	.name           = "multipath",
	.attrs		= nvme_ns_mpath_attrs,
	.is_visible     = SYSFS_GROUP_VISIBLE(multipath_sysfs),
};
#endif