lkml.org 
[lkml]   [2016]   [Apr]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -tip 3/3] locking/pvqspinlock: Robustify init_qspinlock_stat()
On Sun, 17 Apr 2016, Davidlohr Bueso wrote:

>diff --git a/kernel/locking/qspinlock_stat.h b/kernel/locking/qspinlock_stat.h
>index 72722334237a..ddcd653c942c 100644
>--- a/kernel/locking/qspinlock_stat.h
>+++ b/kernel/locking/qspinlock_stat.h
>@@ -225,12 +225,18 @@ static int __init init_qspinlock_stat(void)
> * performance.
> */
> for (i = 0; i < qstat_num; i++)
>- debugfs_create_file(qstat_names[i], 0400, d_qstat,
>- (void *)(long)i, &fops_qstat);
>+ if (!debugfs_create_file(qstat_names[i], 0400, d_qstat,
>+ (void *)(long)i, &fops_qstat))
>+ goto fail;
>+
>+ if (!debugfs_create_file(qstat_names[qstat_reset_cnts], 0200, d_qstat,
>+ (void *)(long)qstat_reset_cnts, &fops_qstat))
>+ goto fail;
>
>- debugfs_create_file(qstat_names[qstat_reset_cnts], 0200, d_qstat,
>- (void *)(long)qstat_reset_cnts, &fops_qstat);
> return 0;
>+fail:
>+ debugfs_remove_recursive(d_qstat);
>+ return 1;

Hmm actually if debugfs_create_dir() fails firstly, we still return 0, Waiman, did
you mean 1 there, no?

Thanks,
Davidlohr

\
 
 \ /
  Last update: 2016-04-18 18:41    [W:0.141 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site