Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp261476imm; Mon, 9 Jul 2018 00:59:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe+1nkPrnk+fAtLlN8UCN4IdTTDkKhsnYYeIJzxNsUSn+Af3wGEuQCZERE26sik5OenD4yn X-Received: by 2002:a17:902:143:: with SMTP id 61-v6mr19404449plb.171.1531123167939; Mon, 09 Jul 2018 00:59:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531123167; cv=none; d=google.com; s=arc-20160816; b=TK6Q/VjK70ji3dEKGEt9W2A1hIeq1vxcpGs57ENSXz9K52kLfayT/x/9PUOnZd+AjG DU16ZlY86QaOyRv46isxllzarqHR9DJs54Crb+y2vxWJEG0z8gMhXyjSOMKf4YamEQ70 wyxR0fxRehkievBbksV8GA13yGVv4VseRJle9CYz4QFF7qQjcrCYfqhpulNYlMH8vlMT 5tYPOZCoz78Ve+o6dc7Y/z/8OW4V562TMksoOBcUc31csRxDLL15erUagf3e+WlT+Q2Z MwBFLeM4Mq5PP1Bm3l74hjQQo4N2etFU1Hw8oI+ZjYR5fY4ohNFSYxUf5Boh92weVrd8 jsow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=3f83cFsituuibA0ag3RqWlKvzp/2bh/5wAprmUbNHHQ=; b=B5pycz9QDdt/xxTj6PhniIFh1h/hpENTl/RtkkF+p+0QhGKGW9k9p1m+KDw99DhCaq 89RqYjF/KguJ/OL6Ku+vW6+/Ek5eofYfVzJkNC/zkmg3AA3nITnlUIDFH+kXnqXeEcq/ NVwUiO0WSmuRQyz4Zk/cJC28ELL9D0MRg6fM8O+bd+g1L7JHWgQWwGaHZ5lWptWd0VMu d40MFfitP5EdX9tbo+QCx+nhbjKJBbS8pP5uqCcWfeB7LQnBTRbezco34shtPZrjuiL9 nT9edHIQ2zId1Mb6hvD+TXxhO+H2PPzORro+6DAc7AJ1FCjg5GLy58MGYwoIYuMfpDJc cJig== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a31-v6si1852833pla.503.2018.07.09.00.59.13; Mon, 09 Jul 2018 00:59:27 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754183AbeGIH6e (ORCPT + 99 others); Mon, 9 Jul 2018 03:58:34 -0400 Received: from lgeamrelo12.lge.com ([156.147.23.52]:57678 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750996AbeGIH6d (ORCPT ); Mon, 9 Jul 2018 03:58:33 -0400 Received: from unknown (HELO lgemrelse6q.lge.com) (156.147.1.121) by 156.147.23.52 with ESMTP; 9 Jul 2018 16:58:30 +0900 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: junil0814.lee@lge.com Received: from unknown (HELO localhost.localdomain) (10.168.178.207) by 156.147.1.121 with ESMTP; 9 Jul 2018 16:58:30 +0900 X-Original-SENDERIP: 10.168.178.207 X-Original-MAILFROM: junil0814.lee@lge.com From: Junil Lee To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, junil0814.lee@vger.kernel.org, Junil Lee Subject: [PATCH] ext4: remove abnormal set for I_DATA_SEM subclass Date: Mon, 9 Jul 2018 16:58:28 +0900 Message-Id: <1531123108-45918-1-git-send-email-junil0814.lee@lge.com> X-Mailer: git-send-email 2.6.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The -EBUSY return value of dquot_enable() function means that just want to update flags. If some users make a duplicate request to update flags, lockdep could catch the false positive casued by needing to allocate a quota block from inside ext4_map_blocks(), while holding i_data_sem for a data inode. This results in this complaint: CPU0 CPU1 ---- ---- lock(&s->s_dquot.dqio_mutex); lock(&ei->i_data_sem); lock(&s->s_dquot.dqio_mutex); lock(&ei->i_data_sem); Signed-off-by: Junil Lee --- fs/ext4/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 13d2706..0757c9a 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -5637,7 +5637,7 @@ static int ext4_quota_enable(struct super_block *sb, int type, int format_id, lockdep_set_quota_inode(qf_inode, I_DATA_SEM_QUOTA); err = dquot_enable(qf_inode, type, format_id, flags); iput(qf_inode); - if (err) + if (err && err != -EBUSY) lockdep_set_quota_inode(qf_inode, I_DATA_SEM_NORMAL); return err; -- 2.6.2