aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDan Streetman <ddstreet@ieee.org>2016-05-20 19:59:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-05-20 20:58:30 -0400
commitd34f615720d17c49b6779f6fcd5cb7eb82231a38 (patch)
tree1aa8c4c9ddaf69452d9fd7042c716b33d17c9bc5 /mm
parent200867af4dedfe7cb707f96773684de1d1fd21e6 (diff)
mm/zsmalloc: don't fail if can't create debugfs info
Change the return type of zs_pool_stat_create() to void, and remove the logic to abort pool creation if the stat debugfs dir/file could not be created. The debugfs stat file is for debugging/information only, and doesn't affect operation of zsmalloc; there is no reason to abort creating the pool if the stat file can't be created. This was seen with zswap, which used the same name for all pool creations, which caused zsmalloc to fail to create a second pool for zswap if CONFIG_ZSMALLOC_STAT was enabled. Signed-off-by: Dan Streetman <ddstreet@ieee.org> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Dan Streetman <dan.streetman@canonical.com> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/zsmalloc.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index aba39a291523..72698db958e7 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -573,17 +573,17 @@ static const struct file_operations zs_stat_size_ops = {
573 .release = single_release, 573 .release = single_release,
574}; 574};
575 575
576static int zs_pool_stat_create(struct zs_pool *pool, const char *name) 576static void zs_pool_stat_create(struct zs_pool *pool, const char *name)
577{ 577{
578 struct dentry *entry; 578 struct dentry *entry;
579 579
580 if (!zs_stat_root) 580 if (!zs_stat_root)
581 return -ENODEV; 581 return;
582 582
583 entry = debugfs_create_dir(name, zs_stat_root); 583 entry = debugfs_create_dir(name, zs_stat_root);
584 if (!entry) { 584 if (!entry) {
585 pr_warn("debugfs dir <%s> creation failed\n", name); 585 pr_warn("debugfs dir <%s> creation failed\n", name);
586 return -ENOMEM; 586 return;
587 } 587 }
588 pool->stat_dentry = entry; 588 pool->stat_dentry = entry;
589 589
@@ -592,10 +592,8 @@ static int zs_pool_stat_create(struct zs_pool *pool, const char *name)
592 if (!entry) { 592 if (!entry) {
593 pr_warn("%s: debugfs file entry <%s> creation failed\n", 593 pr_warn("%s: debugfs file entry <%s> creation failed\n",
594 name, "classes"); 594 name, "classes");
595 return -ENOMEM; 595 return;
596 } 596 }
597
598 return 0;
599} 597}
600 598
601static void zs_pool_stat_destroy(struct zs_pool *pool) 599static void zs_pool_stat_destroy(struct zs_pool *pool)
@@ -613,9 +611,8 @@ static void __exit zs_stat_exit(void)
613{ 611{
614} 612}
615 613
616static inline int zs_pool_stat_create(struct zs_pool *pool, const char *name) 614static inline void zs_pool_stat_create(struct zs_pool *pool, const char *name)
617{ 615{
618 return 0;
619} 616}
620 617
621static inline void zs_pool_stat_destroy(struct zs_pool *pool) 618static inline void zs_pool_stat_destroy(struct zs_pool *pool)
@@ -623,7 +620,6 @@ static inline void zs_pool_stat_destroy(struct zs_pool *pool)
623} 620}
624#endif 621#endif
625 622
626
627/* 623/*
628 * For each size class, zspages are divided into different groups 624 * For each size class, zspages are divided into different groups
629 * depending on how "full" they are. This was done so that we could 625 * depending on how "full" they are. This was done so that we could
@@ -1952,8 +1948,8 @@ struct zs_pool *zs_create_pool(const char *name)
1952 prev_class = class; 1948 prev_class = class;
1953 } 1949 }
1954 1950
1955 if (zs_pool_stat_create(pool, name)) 1951 /* debug only, don't abort if it fails */
1956 goto err; 1952 zs_pool_stat_create(pool, name);
1957 1953
1958 /* 1954 /*
1959 * Not critical, we still can use the pool 1955 * Not critical, we still can use the pool