lkml.org 
[lkml]   [2021]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 02/24] fs/locks: print full locks information
On Wed, Feb 24, 2021 at 03:35:44AM -0500, Luo Longjun wrote:
> @@ -2912,17 +2922,66 @@ static int locks_show(struct seq_file *f, void *v)
> struct file_lock *fl, *bfl;
> struct pid_namespace *proc_pidns = proc_pid_ns(file_inode(f->file)->i_sb);
>
> + struct list_head root;
> + struct list_head *tail = &root;
> + struct list_head *pos, *tmp;
> + struct locks_traverse_list *node, *node_child;
> +
> + int ret = 0;
> +
> fl = hlist_entry(v, struct file_lock, fl_link);
>
> if (locks_translate_pid(fl, proc_pidns) == 0)
> - return 0;
> + return ret;
> +
> + INIT_LIST_HEAD(&root);
>
> - lock_get_status(f, fl, iter->li_pos, "");
> + node = kmalloc(sizeof(struct locks_traverse_list), GFP_KERNEL);

Is it safe to allocate here? I thought this was under the
blocked_lock_lock spinlock.

And I still don't think you need a stack. Have you tried the suggestion
in my previous mail?

--b.

\
 
 \ /
  Last update: 2021-02-24 16:30    [W:0.079 / U:2.384 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site