All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [PATCH] ocfs2: move the mlog from the spinlock to outside
Date: Mon, 7 Oct 2019 15:11:21 -0700	[thread overview]
Message-ID: <20191007151121.c0acdfe0eda4a18e1c24e141@linux-foundation.org> (raw)
In-Reply-To: <1569813459-8601-1-git-send-email-sunny.s.zhang@oracle.com>

On Mon, 30 Sep 2019 11:17:39 +0800 Shuning Zhang <sunny.s.zhang@oracle.com> wrote:

> There is a potential task of deadlock. Because the mask
> is 0, the deadlock does not occur now. But There is a
> potential task. If someone change the mask of mlog, but
> forget to modify the order of the mlog and spin_unlock,
> There will be a potential deadlock.So I move the mlog
> from the spinlock to outsize.
> 
> ...
>
> --- a/fs/ocfs2/dlmglue.c
> +++ b/fs/ocfs2/dlmglue.c
> @@ -2315,10 +2315,10 @@ static int ocfs2_inode_lock_update(struct inode *inode,
>  
>  	spin_lock(&oi->ip_lock);
>  	if (oi->ip_flags & OCFS2_INODE_DELETED) {
> +		spin_unlock(&oi->ip_lock);
>  		mlog(0, "Orphaned inode %llu was deleted while we "
>  		     "were waiting on a lock. ip_flags = 0x%x\n",
>  		     (unsigned long long)oi->ip_blkno, oi->ip_flags);
> -		spin_unlock(&oi->ip_lock);
>  		status = -ENOENT;
>  		goto bail;
>  	}

The patch is obviously OK but I don't see any deadlock.  mlog() doesn't
take any locks?

  reply	other threads:[~2019-10-07 22:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-30  3:17 [Ocfs2-devel] [PATCH] ocfs2: move the mlog from the spinlock to outside Shuning Zhang
2019-10-07 22:11 ` Andrew Morton [this message]
2019-10-08  1:14   ` Joseph Qi
2019-10-08  5:00     ` sunnyZhang
2019-10-08  9:51       ` Joseph Qi
2019-10-09  7:39         ` sunnyZhang

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=20191007151121.c0acdfe0eda4a18e1c24e141@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=ocfs2-devel@oss.oracle.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.