All of lore.kernel.org
 help / color / mirror / Atom feed
From: "J. Bruce Fields" <bfields@fieldses.org>
To: Luo Longjun <luolongjun@huawei.com>
Cc: viro@zeniv.linux.org.uk, jlayton@kernel.org,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	sangyan@huawei.com, luchunhua@huawei.com
Subject: Re: [PATCH v2 02/24] fs/locks: print full locks information
Date: Wed, 24 Feb 2021 09:44:14 -0500	[thread overview]
Message-ID: <20210224144414.GA11591@fieldses.org> (raw)
In-Reply-To: <20210224083544.750887-1-luolongjun@huawei.com>

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.

      reply	other threads:[~2021-02-24 15:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20  6:32 [PATCH] fs/locks: print full locks information Luo Longjun
2021-02-21 16:34 ` Jeff Layton
2021-02-21 16:52 ` Al Viro
2021-02-21 18:43   ` Jeff Layton
2021-02-21 20:10     ` J. Bruce Fields
2021-02-26  3:58       ` [PATCH v3] " Luo Longjun
2021-03-09 13:37         ` Jeff Layton
2021-03-11  3:45           ` Luo Longjun
2021-03-11 13:52             ` Jeff Layton
2021-02-24  8:35   ` [PATCH v2 02/24] " Luo Longjun
2021-02-24 14:44     ` J. Bruce Fields [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210224144414.GA11591@fieldses.org \
    --to=bfields@fieldses.org \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luchunhua@huawei.com \
    --cc=luolongjun@huawei.com \
    --cc=sangyan@huawei.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.