All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amir Goldstein <amir73il@gmail.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: syzbot+3ef5c0d1a5cb0b21e6be@syzkaller.appspotmail.com,
	linux-kernel <linux-kernel@vger.kernel.org>,
	overlayfs <linux-unionfs@vger.kernel.org>,
	syzkaller-bugs@googlegroups.com
Subject: Re: possible deadlock in ovl_copy_up_start
Date: Thu, 18 Oct 2018 13:40:14 +0300	[thread overview]
Message-ID: <CAOQ4uxhw5ewvH6_x3oSU67Z+zLB28BUWijq7kM_h1+Jt66T1LA@mail.gmail.com> (raw)
In-Reply-To: <CAJfpegsDfJMsT8OJVYuUFpNz94ex0fm5Z-e2Gp=cUgXsb_L-Jg@mail.gmail.com>

On Thu, Oct 18, 2018 at 11:41 AM Miklos Szeredi <miklos@szeredi.hu> wrote:
>
> On Thu, Oct 18, 2018 at 8:26 AM, Amir Goldstein <amir73il@gmail.com> wrote:
>
> > Can someone tell me what the expected behavior of a nested
> > mutex_lock_interruptible(&lock); ?
> >
> > Why does the reproducer only warn and not really deadlock.
> > It is because that is considered the lesser evil?
> > and obviously, then inner unlock releases the outer lock?
>
> No, it's not the same lock, just the same lock class (first one is
> OVL_I(d_inode(old))->lock, the other is
> OVL_I(d_inode(new->d_parent)))->lock).

Doh! of course.

>
> So we could possibly get away with annotating with
> mutex_lock_nested().  Is this the only place that ovl_i_lock is
> nested?
>

As far as I can see it is.
But how would we annotate it for consistent and clear locking order?
NLINK/COPYUP?
if we want this annotation to maintain locking order we need to patch
I posted (does copyup of new->parent prior to nlink_start), so then
we don't need nested annotations anymore.

Nah, I don't think we need to add nested annotations.

FYI, I am working on a small cleanup series for ovl_nlink_start/end
and ovl_inode_lock/unlock, but it is independent of the fix patch I posted
for this bug.

Thanks,
Amir.

      reply	other threads:[~2018-10-18 10:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-18  4:47 possible deadlock in ovl_copy_up_start syzbot
2018-10-18  6:26 ` Amir Goldstein
2018-10-18  8:41   ` Miklos Szeredi
2018-10-18 10:40     ` Amir Goldstein [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=CAOQ4uxhw5ewvH6_x3oSU67Z+zLB28BUWijq7kM_h1+Jt66T1LA@mail.gmail.com \
    --to=amir73il@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-unionfs@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=syzbot+3ef5c0d1a5cb0b21e6be@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    /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.