From: David Miller <davem@davemloft.net>
To: mszeredi@redhat.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
hannes@stressinduktion.org, kernel@kyup.com
Subject: Re: [PATCH] af_unix: fix garbage collect vs. MSG_PEEK
Date: Mon, 03 Oct 2016 21:51:03 -0400 (EDT) [thread overview]
Message-ID: <20161003.215103.2267442887041931968.davem@davemloft.net> (raw)
In-Reply-To: <1475150954-10152-1-git-send-email-mszeredi@redhat.com>
From: Miklos Szeredi <mszeredi@redhat.com>
Date: Thu, 29 Sep 2016 14:09:14 +0200
> @@ -1550,6 +1550,17 @@ static int unix_attach_fds(struct scm_cookie *scm, struct sk_buff *skb)
> return max_level;
> }
>
> +static void unix_peek_fds(struct scm_cookie *scm, struct sk_buff *skb)
> +{
> + scm->fp = scm_fp_dup(UNIXCB(skb).fp);
> + /*
> + * During garbage collection it is assumed that in-flight sockets don't
> + * get a new external reference. So we need to wait until current run
> + * finishes.
> + */
> + unix_gc_barrier();
> +}
...
> @@ -266,6 +266,11 @@ void wait_for_unix_gc(void)
> wait_event(unix_gc_wait, gc_in_progress == false);
> }
>
> +void unix_gc_barrier(void)
> +{
> + spin_unlock_wait(&unix_gc_lock);
> +}
Can you explain why wait_for_unix_gc() isn't appropriate? I'm a little
bit uncomfortable with a spinlock wait like this, and would rather see
something like the existing helper used.
Thanks.
next prev parent reply other threads:[~2016-10-04 1:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 12:09 [PATCH] af_unix: fix garbage collect vs. MSG_PEEK Miklos Szeredi
2016-10-04 1:51 ` David Miller [this message]
2016-12-19 11:21 ` Miklos Szeredi
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=20161003.215103.2267442887041931968.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=hannes@stressinduktion.org \
--cc=kernel@kyup.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mszeredi@redhat.com \
--cc=netdev@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).