From patchwork Mon Sep 30 03:17:39 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sunnyZhang X-Patchwork-Id: 11165971 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CFB761709 for ; Mon, 30 Sep 2019 03:19:19 +0000 (UTC) Received: from userp2130.oracle.com (userp2130.oracle.com [156.151.31.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 96FC92082F for ; Mon, 30 Sep 2019 03:19:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="PUXszXHo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96FC92082F Authentication-Results: mail.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=ocfs2-devel-bounces@oss.oracle.com Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8U39RI9152491; Mon, 30 Sep 2019 03:18:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : date : message-id : subject : list-id : list-unsubscribe : list-archive : list-post : list-help : list-subscribe : mime-version : content-type : content-transfer-encoding : sender; s=corp-2019-08-05; bh=W6KicujMJSPmhyI7mSSKry+mR8OtnUmNKFHdo+JOh74=; b=PUXszXHo8E5XTiYUpl6oF4nLQlerZngW6vOTN1Vl/4olO7MKEAjKn+OeIi94E6PPczeO oR+7QQvwJ/og7YxZjy26yIr03LZwzUtYvqVq0WpxYorAggoeu0Bk/wXEzIAj4lW1lN31 y9lODNWEFkXmJGVGjeHQwexcU4tTH51V92YHlIhw13Hfa3HUIXQqVtfuaJ7cGObWV1oe dKpxExxgW3Dr/elLSQmYbl7edcaLfZNkOp/S1UfJt/bJR37vLflYiryZHOJmq49vsadY t/e6EikefVc43TUM1KzRsU2OQwmWzhknVHchx7dCO4i9aNTtI6DVOfddxhGFOZ8PgqIL dw== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by userp2130.oracle.com with ESMTP id 2v9xxuc3kd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 30 Sep 2019 03:18:47 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8U38hvA093232; Mon, 30 Sep 2019 03:18:47 GMT Received: from oss.oracle.com (oss-old-reserved.oracle.com [137.254.22.2]) by userp3030.oracle.com with ESMTP id 2vah07ahcp-1 (version=TLSv1 cipher=AES256-SHA bits=256 verify=NO); Mon, 30 Sep 2019 03:18:46 +0000 Received: from localhost ([127.0.0.1] helo=lb-oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1iEmCz-0004U5-TR; Sun, 29 Sep 2019 20:18:45 -0700 Received: from userp3020.oracle.com ([156.151.31.79]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1iEmCC-0004Sl-S5 for ocfs2-devel@oss.oracle.com; Sun, 29 Sep 2019 20:17:56 -0700 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x8U38nFA108376 for ; Mon, 30 Sep 2019 03:17:56 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2vahnfq5vb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Mon, 30 Sep 2019 03:17:56 +0000 Received: from abhmp0016.oracle.com (abhmp0016.oracle.com [141.146.116.22]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x8U3HtJ2002592 for ; Mon, 30 Sep 2019 03:17:55 GMT Received: from ol6u9ext3.cn.oracle.com (/10.182.71.225) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 29 Sep 2019 20:17:55 -0700 From: Shuning Zhang To: ocfs2-devel@oss.oracle.com Date: Mon, 30 Sep 2019 11:17:39 +0800 Message-Id: <1569813459-8601-1-git-send-email-sunny.s.zhang@oracle.com> X-Mailer: git-send-email 1.7.1 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9395 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909300033 Subject: [Ocfs2-devel] [PATCH] ocfs2: move the mlog from the spinlock to outside X-BeenThere: ocfs2-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: ocfs2-devel-bounces@oss.oracle.com Errors-To: ocfs2-devel-bounces@oss.oracle.com X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9395 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909300033 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9395 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1908290000 definitions=main-1909300033 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. Signed-off-by: Shuning Zhang --- fs/ocfs2/dlmglue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 1420723..9960e61 100644 --- 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; }