Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp648334pxa; Fri, 14 Aug 2020 14:01:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKw/xcrpeIEltljNE0Ya4r+oCoIDeYweFQ7wThVUpZhMUKqOj8qoHMWxef01c2YJFqVmRp X-Received: by 2002:a50:fd83:: with SMTP id o3mr3962593edt.170.1597438898969; Fri, 14 Aug 2020 14:01:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597438898; cv=none; d=google.com; s=arc-20160816; b=F+oUIGtQkI2cWM68c5fr7auFIKvln/BrinVCutUfICjVungs6VsCSgDUE4flff21hn xiqpIEzMnBV8xUme06vHS3H9RM4K7MhVoBx6NZtDniA58sKUn/xVGXvuzTJK3Sd7DRk+ NxngqePgn1+ZL156F00TvdG+ILmuVw7GCIPrCmS+oS0BsTz2Rst+0LldeptzGxendeFh TUXr2GVXAjzWHe0c+taEGS/OZsMgnr1kODzLo+pRAw4NuhUKyR2NEcHU3k7pVMMWWoxG yIjWe7dkARa+8im1pMk3laUxGG4Tm4qM/4Oe3Cv1YP0j3IPp67Hm5l9S4xPiqwODSmc4 dK7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=i4ivehdJflvWptfFyJNMdZziBnuJzFFj6pYYH+EojSw=; b=Z/NAi5fKjSY/pXXjWkqnpKBEBNnEVaud0FPE6TxRdRobewNRVRPboYnJ+GECmFD+x8 twdIDs5pfD6fLT6DjSQ8Gn0EpeMsRfc2ocrk6/1aISiWgxTR7Jz5wyeZXuSk8rGpI3nO xkTGn9Il3VWfvypYjffriz4epRmCdQMSYqKgogI7r/+SMK51P2P4f5BHfxotWGdez6w3 fBDhevXz+jFMk3kUONou5ZfgfOmKqRnMiWTdPsgC9I8TREgT6uZEslfMgM6VUdZi+cKT 7megyITqXmmBIyw8MsocoNFwDsApnYyBGp4KpAE+mUpcHeXgrob5G1UdkRZCtfxRCYdw iFOQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c89si6943102edf.596.2020.08.14.14.01.16; Fri, 14 Aug 2020 14:01:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727885AbgHNTA0 (ORCPT + 99 others); Fri, 14 Aug 2020 15:00:26 -0400 Received: from mail3-relais-sop.national.inria.fr ([192.134.164.104]:1152 "EHLO mail3-relais-sop.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726285AbgHNTAZ (ORCPT ); Fri, 14 Aug 2020 15:00:25 -0400 X-IronPort-AV: E=Sophos;i="5.76,313,1592863200"; d="scan'208";a="356565336" Received: from abo-173-121-68.mrs.modulonet.fr (HELO hadrien) ([85.68.121.173]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2020 21:00:21 +0200 Date: Fri, 14 Aug 2020 21:00:20 +0200 (CEST) From: Julia Lawall X-X-Sender: jll@hadrien To: Thomas Gleixner cc: kernel test robot , kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Theodore Ts'o , Jan Kara , Nicolas Palix Subject: Re: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413 In-Reply-To: <878sehl5e4.fsf@nanos.tec.linutronix.de> Message-ID: References: <202008141412.mP88ccpD%lkp@intel.com> <878sehl5e4.fsf@nanos.tec.linutronix.de> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 14 Aug 2020, Thomas Gleixner wrote: > On Fri, Aug 14 2020 at 14:11, kernel test robot wrote: > > > > coccinelle warnings: (new ones prefixed by >>) > > > >>> fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413 > > > > vim +2430 fs/ocfs2/suballoc.c > > > > 415cb800375cc4 Mark Fasheh 2007-09-16 2379 > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2380 static int ocfs2_block_group_clear_bits(handle_t *handle, > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2381 struct inode *alloc_inode, > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2382 struct ocfs2_group_desc *bg, > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2383 struct buffer_head *group_bh, > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2384 unsigned int bit_off, > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2385 unsigned int num_bits, > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2386 void (*undo_fn)(unsigned int bit, > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2387 unsigned long *bmap)) > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2388 { > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2389 int status; > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2390 unsigned int tmp; > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2391 struct ocfs2_group_desc *undo_bg = NULL; > > 464170647b5648 Thomas Gleixner 2019-08-09 2392 struct journal_head *jh; > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2393 > > 42035306132802 Joel Becker 2008-11-13 2394 /* The caller got this descriptor from > > 42035306132802 Joel Becker 2008-11-13 2395 * ocfs2_read_group_descriptor(). Any corruption is a code bug. */ > > 42035306132802 Joel Becker 2008-11-13 2396 BUG_ON(!OCFS2_IS_VALID_GROUP_DESC(bg)); > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2397 > > 2f73e135b83c50 Tao Ma 2011-02-22 2398 trace_ocfs2_block_group_clear_bits(bit_off, num_bits); > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2399 > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2400 BUG_ON(undo_fn && !ocfs2_is_cluster_bitmap(alloc_inode)); > > 0cf2f7632b1789 Joel Becker 2009-02-12 2401 status = ocfs2_journal_access_gd(handle, INODE_CACHE(alloc_inode), > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2402 group_bh, > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2403 undo_fn ? > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2404 OCFS2_JOURNAL_ACCESS_UNDO : > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2405 OCFS2_JOURNAL_ACCESS_WRITE); > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2406 if (status < 0) { > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2407 mlog_errno(status); > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2408 goto bail; > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2409 } > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2410 > > 464170647b5648 Thomas Gleixner 2019-08-09 2411 jh = bh2jh(group_bh); > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2412 if (undo_fn) { > > 464170647b5648 Thomas Gleixner 2019-08-09 @2413 spin_lock(&jh->b_state_lock); > > 464170647b5648 Thomas Gleixner 2019-08-09 2414 undo_bg = (struct ocfs2_group_desc *) jh->b_committed_data; > > 94e41ecfe0f202 Sunil Mushran 2009-06-19 2415 BUG_ON(!undo_bg); > > 94e41ecfe0f202 Sunil Mushran 2009-06-19 2416 } > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2417 > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2418 tmp = num_bits; > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2419 while(tmp--) { > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2420 ocfs2_clear_bit((bit_off + tmp), > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2421 (unsigned long *) bg->bg_bitmap); > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2422 if (undo_fn) > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2423 undo_fn(bit_off + tmp, > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2424 (unsigned long *) undo_bg->bg_bitmap); > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2425 } > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2426 le16_add_cpu(&bg->bg_free_bits_count, num_bits); > > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2427 if (le16_to_cpu(bg->bg_free_bits_count) > le16_to_cpu(bg->bg_bits)) { > > e75ed71be4f2f7 Changwei Ge 2018-01-31 2428 if (undo_fn) > > 464170647b5648 Thomas Gleixner 2019-08-09 2429 spin_unlock(&jh->b_state_lock); > > 7ecef14ab1db96 Joe Perches 2015-09-04 @2430 return ocfs2_error(alloc_inode->i_sb, "Group descriptor # %llu has bit count %u but claims %u are freed. num_bits %d\n", > > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2431 (unsigned long long)le64_to_cpu(bg->bg_blkno), > > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2432 le16_to_cpu(bg->bg_bits), > > 7ecef14ab1db96 Joe Perches 2015-09-04 2433 le16_to_cpu(bg->bg_free_bits_count), > > 7ecef14ab1db96 Joe Perches 2015-09-04 2434 num_bits); > > 9b5cd10e4c14a1 Srinivas Eeda 2010-10-05 2435 } > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2436 > > b4414eea0e7b9c Mark Fasheh 2010-03-11 2437 if (undo_fn) > > 464170647b5648 Thomas Gleixner 2019-08-09 2438 spin_unlock(&jh->b_state_lock); > > 94e41ecfe0f202 Sunil Mushran 2009-06-19 2439 > > ec20cec7a35158 Joel Becker 2010-03-19 2440 ocfs2_journal_dirty(handle, group_bh); > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2441 bail: > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2442 return status; > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2443 } > > ccd979bdbce9fb Mark Fasheh 2005-12-15 2444 > > That's clearly a false positive. Is there anything what can be done to > help that cocci script here? I have a better version that needs to get pushed. But normally these pass through me. Did you get it directly from kbuild? julia