Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1524835
| From | Cong Wang <xiyou.wangcong@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: net: BUG still has locks held in unix_stream_splice_read |
| Date | 2016-11-17 22:50 +0100 |
| Message-ID | <sECJc-6f6-37@gated-at.bofh.it> (permalink) |
| References | <sqjdo-2Q9-45@gated-at.bofh.it> <sqjdo-2Q9-43@gated-at.bofh.it> <sqyP7-3YV-3@gated-at.bofh.it> <sqzia-4ns-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Sun, Oct 9, 2016 at 8:14 PM, Al Viro <viro@zeniv.linux.org.uk> wrote:
> E.g what will happen if some code does a read on AF_UNIX socket with
> some local mutex held? AFAICS, there are exactly two callers of
> freezable_schedule_timeout() - this one and one in XFS; the latter is
> in a kernel thread where we do have good warranties about the locking
> environment, but here it's in the bleeding ->recvmsg/->splice_read and
> for those assumption that caller doesn't hold any locks is pretty
> strong, especially since it's not documented anywhere.
>
> What's going on there?
Commit 2b15af6f95 ("af_unix: use freezable blocking calls in read")
converts schedule_timeout() to its freezable version, it was probably correct
at that time, but later, commit 2b514574f7e88c8498027ee366
("net: af_unix: implement splice for stream af_unix sockets") breaks its
requirement for a freezable sleep:
commit 0f9548ca10916dec166eaf74c816bded7d8e611d
lockdep: check that no locks held at freeze time
We shouldn't try_to_freeze if locks are held. Holding a lock can cause a
deadlock if the lock is later acquired in the suspend or hibernate path
(e.g. by dpm). Holding a lock can also cause a deadlock in the case of
cgroup_freezer if a lock is held inside a frozen cgroup that is later
acquired by a process outside that group.
So probably we just need to revert commit 2b15af6f95 now.
I am going to send a revert for at least -net and -stable, since Dmitry
saw this warning again.
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: net: BUG still has locks held in unix_stream_splice_read Cong Wang <xiyou.wangcong@gmail.com> - 2016-11-17 22:50 +0100 Re: net: BUG still has locks held in unix_stream_splice_read Hannes Frederic Sowa <hannes@stressinduktion.org> - 2016-11-17 23:30 +0100
csiph-web