Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp692121ybv; Thu, 13 Feb 2020 07:51:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzF1tBRwCJVg/AAcmQrIMXicyKcSf/YDImj4rbHJxBiGQqgwdL6IljE680J8aIrzv2HksSZ X-Received: by 2002:aca:4f8e:: with SMTP id d136mr3274654oib.61.1581609112959; Thu, 13 Feb 2020 07:51:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581609112; cv=none; d=google.com; s=arc-20160816; b=CndbSUlqXpaPZoD6tA5HquSlDgafK9QT51r+7MnnxpFD8rjyZlnqJyutaBF7XJsk5L E7c0vow2GB34GY0qFR+YZzZ6PsB/YMl1YjLaeg/djI+y5xyQiufHmHOvfwOFUM2MRth7 Uus+V1Us5/vIogndB1WEkJjXsdGTh77/yZ3JHLSnKw7ndsPj7DPcA2ypY/wDp3nbL5Bh P8STSfES/t0IM2Skr27sH6ad/2T2/RyYxw9oKNIk61l049hMWrheRPVaq5HKTydEKYVj YW415qW3I3DARyZOHO4QMLfeMVPNL8RDmb0RfYVOTLgxUkMGnrM0kLzjgmFcipwp9yZc 4tmw== 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 :dkim-signature; bh=3YsWsylZ4489Gb3tnUr9kkkeFg/lh1zGRWfBEejFiwA=; b=UmMSA9Z6nT5/AAWq/qQXNsEVfGXx5mzW3oSAd6FLaKvSllPseavbuDYjCdb7sTfO4k +kutyKayptGEy20N2G1QDRbsBkq5ei+JRMwIlZPTYbucBxSFJx07Ivy+KXjP4a193Rwn ZaZejRMO2swoe4lrDXznZFDGMGKM2MW3OTGUOy28NjJNUwfsmPc1InMItZGlouxtpPX5 A1GjJQPOUS0MIH/u5gIZDn9gSdnaapEFlOAozuPawqmSkZ/Z9JRLdziCHeHNCfMJQrvV V/CZTYa40o6NnyHAwVd7BujfM4Zm2rIFszuc2NFOojgVOhUCmT9kzYwekZUkSKft7UI0 Beqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CdYnWy14; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e7si1407190oti.301.2020.02.13.07.51.38; Thu, 13 Feb 2020 07:51:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CdYnWy14; spf=pass (google.com: best guess record for domain of linux-ext4-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387579AbgBMPu3 (ORCPT + 99 others); Thu, 13 Feb 2020 10:50:29 -0500 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41772 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387560AbgBMP02 (ORCPT ); Thu, 13 Feb 2020 10:26:28 -0500 Received: by mail-pf1-f194.google.com with SMTP id j9so3231088pfa.8; Thu, 13 Feb 2020 07:26:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=3YsWsylZ4489Gb3tnUr9kkkeFg/lh1zGRWfBEejFiwA=; b=CdYnWy14vgKMDE8saobSvrpuwdjIw7BGvH3RroVir3x/MBhrWIMYWQXHeaV5pbj1a+ bLeq+kKlKdPsWosW3KD3WQrSBY2/ToqH8gIsQMljOcMAj4NIMIEMYVyki1iYe38Lm9zn jEb9voFR6JAun43lFlu0Sn2B/uEnHoMryDTh/BWQdOirvc6eez1/JumX8NtoxfdZen+r 6wcKFEooJ47FjLHBDddTPHoXeun6W1qEMYCpPHFKiglaClnP6iBBwg5BBSO0wG/TzsgL 3MFtjslnEKVUBdcAhUb0yw34mCgVSg/S1/E7RIlCciQRkNczx1/+V7HglHxTi70Ehwjm s+5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=3YsWsylZ4489Gb3tnUr9kkkeFg/lh1zGRWfBEejFiwA=; b=PkTOaVxRg69dHD+e3WcyRT0YEsQnmU5fZ3burjFRYhgR2ulOmEUabaGh4p0TG+6gsS LTeu3aaA6lLsfNp+V9Fvxb8eVpQEdWJNzAw2rkemXZxj1i0R1pM6VrV1FnnyfI+cRDXZ mx5CD9otTryQ3Fp39OtsJVedkxjClq9lH+rPtf+KeF+IEQ4VnOGVZ0LdHHHr4kiBCg45 QHXmpnH7jnQKs4FGd7h641yj1+I6OI6JOAusHVbzit99v8gPeKw1g97K9Tiv8bUg8uWP oC95LyvpNEbXcmF+8sg+HuUlTy7naMK2OeeeMuCTyWhg/tJmPD7hYvKfHDQvjh0xJRNf 822A== X-Gm-Message-State: APjAAAUQVupEqTPmDOg0bi5dGYW4xZGwFA/p7tIvd+FMSZneOjh7zVw3 LBLDY+EqqaK88eKAYLMJRw== X-Received: by 2002:a62:e91a:: with SMTP id j26mr14805034pfh.189.1581607587813; Thu, 13 Feb 2020 07:26:27 -0800 (PST) Received: from madhuparna-HP-Notebook.nitk.ac.in ([2402:3a80:1ee8:f65a:fc5b:5bfd:1ab4:4848]) by smtp.gmail.com with ESMTPSA id z3sm3609082pfz.155.2020.02.13.07.26.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Feb 2020 07:26:27 -0800 (PST) From: madhuparnabhowmik10@gmail.com To: tytso@mit.edu, adilger.kernel@dilger.ca Cc: linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, joel@joelfernandes.org, frextrite@gmail.com, linux-kernel-mentees@lists.linuxfoundation.org, paulmck@kernel.org, Madhuparna Bhowmik Subject: [PATCH] fs: ext4: mballoc.c: Use built-in RCU list checking Date: Thu, 13 Feb 2020 20:55:58 +0530 Message-Id: <20200213152558.7070-1-madhuparnabhowmik10@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org From: Madhuparna Bhowmik list_for_each_entry_rcu() has built-in RCU and lock checking. Pass cond argument to list_for_each_entry_rcu() to silence false lockdep warning when CONFIG_PROVE_RCU_LIST is enabled by default. Signed-off-by: Madhuparna Bhowmik --- fs/ext4/mballoc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index a3e2767bdf2f..70418e13e9e8 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -4280,7 +4280,7 @@ ext4_mb_discard_lg_preallocations(struct super_block *sb, spin_lock(&lg->lg_prealloc_lock); list_for_each_entry_rcu(pa, &lg->lg_prealloc_list[order], - pa_inode_list) { + pa_inode_list, lockdep_is_held(&lg->lg_prealloc_lock)) { spin_lock(&pa->pa_lock); if (atomic_read(&pa->pa_count)) { /* @@ -4363,7 +4363,7 @@ static void ext4_mb_add_n_trim(struct ext4_allocation_context *ac) /* Add the prealloc space to lg */ spin_lock(&lg->lg_prealloc_lock); list_for_each_entry_rcu(tmp_pa, &lg->lg_prealloc_list[order], - pa_inode_list) { + pa_inode_list, lockdep_is_held(&lg->lg_prealloc_lock)) { spin_lock(&tmp_pa->pa_lock); if (tmp_pa->pa_deleted) { spin_unlock(&tmp_pa->pa_lock); -- 2.17.1