Commit 03fb0bce authored by Miklos Szeredi's avatar Miklos Szeredi Committed by Linus Torvalds

fuse: fix bdi naming conflict

Fuse allocates a separate bdi for each filesystem, and registers them
in sysfs with "MAJOR:MINOR" of sb->s_dev (st_dev).  This works fine for
anon devices normally used by fuse, but can conflict with an already
registered BDI for "fuseblk" filesystems, where sb->s_dev represents a
real block device.  In particularl this happens if a non-partitioned
device is being mounted.

Fix by registering with a different name for "fuseblk" filesystems.

Thanks to Ioan Ionita for the bug report.
Signed-off-by: default avatarMiklos Szeredi <mszeredi@suse.cz>
Reported-by: default avatarIoan Ionita <opslynx@gmail.com>
Tested-by: default avatarIoan Ionita <opslynx@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 42172d75
...@@ -14,6 +14,10 @@ MAJOR:MINOR ...@@ -14,6 +14,10 @@ MAJOR:MINOR
non-block filesystems which provide their own BDI, such as NFS non-block filesystems which provide their own BDI, such as NFS
and FUSE. and FUSE.
MAJOR:MINOR-fuseblk
Value of st_dev on fuseblk filesystems.
default default
The default backing dev, used for non-block device backed The default backing dev, used for non-block device backed
......
...@@ -488,7 +488,12 @@ static struct fuse_conn *new_conn(struct super_block *sb) ...@@ -488,7 +488,12 @@ static struct fuse_conn *new_conn(struct super_block *sb)
err = bdi_init(&fc->bdi); err = bdi_init(&fc->bdi);
if (err) if (err)
goto error_kfree; goto error_kfree;
err = bdi_register_dev(&fc->bdi, fc->dev); if (sb->s_bdev) {
err = bdi_register(&fc->bdi, NULL, "%u:%u-fuseblk",
MAJOR(fc->dev), MINOR(fc->dev));
} else {
err = bdi_register_dev(&fc->bdi, fc->dev);
}
if (err) if (err)
goto error_bdi_destroy; goto error_bdi_destroy;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment