Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp187011imm; Sun, 8 Jul 2018 23:09:26 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeVz9RJ8xoHpW8iA8AgPo6iKK+ELhLzVa0PE99WsZUWmAHhShRoxGOt4mB0yM1kqSd6W303 X-Received: by 2002:a17:902:5a3:: with SMTP id f32-v6mr19083614plf.109.1531116566451; Sun, 08 Jul 2018 23:09:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531116566; cv=none; d=google.com; s=arc-20160816; b=FOHVtuaUsUqWcIzKbR1FMItmjt+BYaeNNtY1kUjNR+tERULfZUGSUwaPiRdGwTZwCd 2cFcdAU7j2zXgrAcZ4FKQHVRXWo/7GiWXruu7F2RL+FXK+/YgZz2oRWuq0mYR/5F3bhj q6uVJPqnHIpjzjsmBsLWlLl9pyFX66SZEyu6EFgqL7dQ7QNa9Yomjlv8FFivT1hx5f1R 47XggHZTHmXdRBwy87b1d4Buy4uFUtHxJzHHUyYdCR6hdNU/Z6GwZojlLX7GEazqCwso y52u6gaKFeG9vAgEuxBZ22I+uz0yTmTuZOX+GOskIUTTQG8TiYgBRtnSexh5kS0g7Pcj OxDw== 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=roXurYSueMH2gbK2H5gmCL2r13UXMLPmNhq0yS3YYos=; b=mfP8+wBfD5iC6MxYPEPmTOg7qRdXZP3PS9WPzV5BBGy2yMoLkmlHV6f2qVryjQClZ9 Ai9kyUaBLb0Zhok18vrRZfnKTwbcQk9ZQYWBxz2HXS757LmF4Y+uU3WIfEmhQr3R3qUn StahCp+spLyToTKWIIJR3F7v/GUtkXGS+cGz1Zy3AtvZleR/L6jECd7iRW0kQYV7gmcn 9ODhs+MTU86LLVdn6aaac/Uiu2ValsFc33I1vrj4aapXoby4dZ2MioWm/LpHo3izapQb 1poy+xG+wOnM2fE0FT8amAExCREpkBSdqjC6J8vTvmYQWkNPTb9SpTo1TVtoWG2u+Kxj m+Fg== 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 f2-v6si435322pgg.552.2018.07.08.23.09.12; Sun, 08 Jul 2018 23:09:26 -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 S1754583AbeGIGIV (ORCPT + 99 others); Mon, 9 Jul 2018 02:08:21 -0400 Received: from lgeamrelo12.lge.com ([156.147.23.52]:34771 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750846AbeGIGIU (ORCPT ); Mon, 9 Jul 2018 02:08:20 -0400 Received: from unknown (HELO lgeamrelo01.lge.com) (156.147.1.125) by 156.147.23.52 with ESMTP; 9 Jul 2018 15:08:16 +0900 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: junil0814.lee@lge.com Received: from unknown (HELO localhost.localdomain) (10.168.178.207) by 156.147.1.125 with ESMTP; 9 Jul 2018 15:08:16 +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@lge.com Subject: [PATCH] ext4: remove abnormal set for I_DATA_SEM subclass Date: Mon, 9 Jul 2018 15:08:14 +0900 Message-Id: <1531116494-156102-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 comlaint: 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..f16c92d 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 != -EBUSY) lockdep_set_quota_inode(qf_inode, I_DATA_SEM_NORMAL); return err; -- 2.6.2