From 985ef4dcf94ac0113e2b32ef86bdd5bc47c016b3 Mon Sep 17 00:00:00 2001 From: Dave Chinner Date: Mon, 19 Oct 2015 08:42:46 +1100 Subject: xfs: stats are no longer dependent on CONFIG_PROC_FS So we need to fix the makefile to understand this, otherwise build errors with CONFIG_PROC_FS=n occur. Reported-and-tested-by: Jim Davis Signed-off-by: Dave Chinner Signed-off-by: Dave Chinner --- fs/xfs/Makefile | 2 +- fs/xfs/xfs_stats.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'fs/xfs') diff --git a/fs/xfs/Makefile b/fs/xfs/Makefile index a096841bd06c..f64639176670 100644 --- a/fs/xfs/Makefile +++ b/fs/xfs/Makefile @@ -84,6 +84,7 @@ xfs-y += xfs_aops.o \ xfs_message.o \ xfs_mount.o \ xfs_mru_cache.o \ + xfs_stats.o \ xfs_super.o \ xfs_symlink.o \ xfs_sysfs.o \ @@ -118,7 +119,6 @@ xfs-$(CONFIG_XFS_QUOTA) += xfs_dquot.o \ xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o -xfs-$(CONFIG_PROC_FS) += xfs_stats.o xfs-$(CONFIG_SYSCTL) += xfs_sysctl.o xfs-$(CONFIG_COMPAT) += xfs_ioctl32.o xfs-$(CONFIG_NFSD_PNFS) += xfs_pnfs.o diff --git a/fs/xfs/xfs_stats.c b/fs/xfs/xfs_stats.c index bd50619fa8c9..8686df6c7609 100644 --- a/fs/xfs/xfs_stats.c +++ b/fs/xfs/xfs_stats.c @@ -161,6 +161,7 @@ static const struct file_operations xqmstat_proc_fops = { }; #endif /* CONFIG_XFS_QUOTA */ +#ifdef CONFIG_PROC_FS int xfs_init_procfs(void) { @@ -191,3 +192,4 @@ xfs_cleanup_procfs(void) { remove_proc_subtree("fs/xfs", NULL); } +#endif /* CONFIG_PROC_FS */ -- cgit v1.2.3 From f9d460b341f23a9bb7df8868975fdfcc2e71aa9b Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 19 Oct 2015 08:42:47 +1100 Subject: xfs: fix an error code in xfs_fs_fill_super() If alloc_percpu() fails, we accidentally return PTR_ERR(NULL), which means success, but we intended to return -ENOMEM. Fixes: 225e4635580c ('xfs: per-filesystem stats in sysfs') Signed-off-by: Dan Carpenter Reviewed-by: Bill O'Donnell Signed-off-by: Dave Chinner --- fs/xfs/xfs_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'fs/xfs') diff --git a/fs/xfs/xfs_super.c b/fs/xfs/xfs_super.c index 368c55adee9d..b2c252cd7172 100644 --- a/fs/xfs/xfs_super.c +++ b/fs/xfs/xfs_super.c @@ -1477,7 +1477,7 @@ xfs_fs_fill_super( /* Allocate stats memory before we do operations that might use it */ mp->m_stats.xs_stats = alloc_percpu(struct xfsstats); if (!mp->m_stats.xs_stats) { - error = PTR_ERR(mp->m_stats.xs_stats); + error = -ENOMEM; goto out_destroy_counters; } -- cgit v1.2.3