xfs: fix an error code in xfs_fs_fill_super()
authorDan Carpenter <dan.carpenter@oracle.com>
Sun, 18 Oct 2015 21:42:47 +0000 (08:42 +1100)
committerDave Chinner <david@fromorbit.com>
Sun, 18 Oct 2015 21:42:47 +0000 (08:42 +1100)
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 <dan.carpenter@oracle.com>
Reviewed-by: Bill O'Donnell <billodo@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
fs/xfs/xfs_super.c

index 368c55adee9d2aa97e96f2eec1c5b805e32a5f24..b2c252cd71729e16d7bf993dca56f98d49283240 100644 (file)
@@ -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;
        }