diff options
author | LOLi <[email protected]> | 2017-05-25 18:55:55 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2017-05-25 09:55:55 -0700 |
commit | 3e6c9433474f0b6fc4880549c851bfb151c8c719 (patch) | |
tree | eaa7418721238ebc568ada37564d309efbee401a /include/linux | |
parent | 4358afa0f2cd7629de9916ce69c5e7cdd85f6803 (diff) |
Linux 4.12 compat: fix super_setup_bdi_name() call
Provide a format parameter to super_setup_bdi_name() so we don't
create duplicate names in '/devices/virtual/bdi' sysfs namespace which
would prevent us from mounting more than one ZFS filesystem at a time.
Reviewed-by: Chunwei Chen <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: loli10K <[email protected]>
Closes #6147
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/vfs_compat.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/vfs_compat.h b/include/linux/vfs_compat.h index 0085aa850..6111f0afc 100644 --- a/include/linux/vfs_compat.h +++ b/include/linux/vfs_compat.h @@ -74,10 +74,13 @@ truncate_setsize(struct inode *ip, loff_t new) * 4.12 - x.y, super_setup_bdi_name() new interface. */ #if defined(HAVE_SUPER_SETUP_BDI_NAME) +extern atomic_long_t zfs_bdi_seq; + static inline int zpl_bdi_setup(struct super_block *sb, char *name) { - return (super_setup_bdi_name(sb, name)); + return super_setup_bdi_name(sb, "%.28s-%ld", name, + atomic_long_inc_return(&zfs_bdi_seq)); } static inline void zpl_bdi_destroy(struct super_block *sb) @@ -144,7 +147,6 @@ static inline int zpl_bdi_setup(struct super_block *sb, char *name) { struct backing_dev_info *bdi; - char tmp[32]; int error; bdi = kmem_zalloc(sizeof (struct backing_dev_info), KM_SLEEP); @@ -157,8 +159,7 @@ zpl_bdi_setup(struct super_block *sb, char *name) return (error); } - sprintf(tmp, "%.28s%s", name, "-%d"); - error = bdi_register(bdi, NULL, tmp, + error = bdi_register(bdi, NULL, "%.28s-%ld", name, atomic_long_inc_return(&zfs_bdi_seq)); if (error) { bdi_destroy(bdi); |