Skip to content

Commit

Permalink
Linux 4.12 compat: fix super_setup_bdi_name() call
Browse files Browse the repository at this point in the history
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.

Signed-off-by: loli10K <[email protected]>
  • Loading branch information
loli10K committed May 22, 2017
1 parent 4358afa commit 11a370a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 7 additions & 1 deletion include/linux/vfs_compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,16 @@ 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));
char tmp[32];

sprintf(tmp, "%.28s%s", name, "-%d");
return super_setup_bdi_name(sb, tmp,
atomic_long_inc_return(&zfs_bdi_seq));
}
static inline void
zpl_bdi_destroy(struct super_block *sb)
Expand Down
3 changes: 1 addition & 2 deletions module/zfs/zfs_vfsops.c
Original file line number Diff line number Diff line change
Expand Up @@ -1568,8 +1568,7 @@ zfsvfs_teardown(zfsvfs_t *zfsvfs, boolean_t unmounting)
return (0);
}

#if !defined(HAVE_SUPER_SETUP_BDI_NAME) && \
!defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER) && \
#if !defined(HAVE_2ARGS_BDI_SETUP_AND_REGISTER) && \
!defined(HAVE_3ARGS_BDI_SETUP_AND_REGISTER)
atomic_long_t zfs_bdi_seq = ATOMIC_LONG_INIT(0);
#endif
Expand Down

0 comments on commit 11a370a

Please sign in to comment.