[PATCH] nfs: Debug bdi registration failure

From: Jan Kara
Date: Tue May 02 2017 - 12:24:57 EST


Debug failure and fixup error code propagation.

Signed-off-by: Jan Kara <jack@xxxxxxx>
---
fs/nfs/super.c | 5 ++++-
mm/backing-dev.c | 2 ++
2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index dc69314d455e..f60a387105ad 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -2344,6 +2344,8 @@ int nfs_fill_super(struct super_block *sb, struct nfs_mount_info *mount_info)

nfs_initialise_sb(sb);

+ printk("Registering bdi %u:%u for server %p\n", MAJOR(server->s_dev), MINOR(server->s_dev), server);
+ dump_stack();
ret = super_setup_bdi_name(sb, "%u:%u", MAJOR(server->s_dev),
MINOR(server->s_dev));
if (ret)
@@ -2607,7 +2609,7 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server,
/* initial superblock/root creation */
error = mount_info->fill_super(s, mount_info);
if (error)
- goto error_splat_super;
+ goto error_splat_super_err;
nfs_get_cache_cookie(s, mount_info->parsed, mount_info->cloned);
}

@@ -2630,6 +2632,7 @@ struct dentry *nfs_fs_mount_common(struct nfs_server *server,

error_splat_root:
dput(mntroot);
+error_splat_super_err:
mntroot = ERR_PTR(error);
error_splat_super:
deactivate_locked_super(s);
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index f028a9a472fd..ac173d06834a 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -923,6 +923,8 @@ static void bdi_remove_from_list(struct backing_dev_info *bdi)

void bdi_unregister(struct backing_dev_info *bdi)
{
+ printk("Unregistering bdi %s\n", dev_name(bdi->dev));
+ dump_stack();
/* make sure nobody finds us on the bdi_list anymore */
bdi_remove_from_list(bdi);
wb_shutdown(&bdi->wb);
--
2.12.0


--tKW2IUtsqtDRztdT--