Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp369648pxa; Fri, 14 Aug 2020 06:39:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2C5QOKf5zPGzBaUnvcUFG8tz+WO5dA4dxaWEw3I+5uit73iwALBVX98zOR1ktveiu+rzs X-Received: by 2002:aa7:df0c:: with SMTP id c12mr2205336edy.60.1597412351541; Fri, 14 Aug 2020 06:39:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597412351; cv=none; d=google.com; s=arc-20160816; b=JFpFhMq+Yt1zIkkCmBc+OxS3vmVfv2CI8JexrAPfaV4Nzmao11TMmed96JMWxCIAWi go5NGZ6Eb/bJemSy4xTsdtFp+KsgeIZi2ZxI1faVeVsxqG15V+OqOkQSc1WwQ4SfyZeA +qlcz4/tczBb9+zW4jPdPwUIgziJaPFC/5ro3nfOLpCD3M3eLu882aoAEZAD46wia+JL GwUrgfM2o5jClH2yEoqxR4Mf8WT3nBQUb0cD4J33y8vu6+WeWkWJ3K61JQLdXTC/kGnw pfQswdLvRmQ0iaXZTLpMd5b+C8T3ZjWgqBZgQIgrpoQeSewFKc/GSFOiJ0cu6d0u0STy +IUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=WZojXpF4CtFVHLmarhLq1h1iKcdgxc2RpfZdaP2LUC8=; b=0qRnqYIR+4SJYxli00mpiotSqFfVNmjDr7CJBQTDqMF/Xb8PWwIZtOAkyAAQAmzIEI d49s/GyDd4EWzopWiRiskxJfEAmu6VkXvK2lCJ2iWT7ASEt8NkhLnvNpVRjSATzyDfzt O2xHJb3XW5KTvLzr23dOGo4G3xCdJaYwhMsqzP4ujp6oH6m6s8OhNaop2OoJ5iiqWNHO ycAOdN+jLRf/kwzpX55jyroN6TzZx3/KXEn3VRMJBReyQbRpRQVO10UR99Z0hASGOWAc /F4nFPFpyuReMrZZnhBKDOfxXTnphmzEP3wn7P6Si0Zv+ts8MTW+jZUzgwqgZO3egwIT Kkew== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linutronix.de header.s=2020 header.b=4hTwEsgl; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si5240889ejb.724.2020.08.14.06.38.49; Fri, 14 Aug 2020 06:39:11 -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; dkim=fail header.i=@linutronix.de header.s=2020 header.b=4hTwEsgl; dkim=neutral (no key) header.i=@linutronix.de; 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; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728519AbgHNNch (ORCPT + 99 others); Fri, 14 Aug 2020 09:32:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57142 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726237AbgHNNch (ORCPT ); Fri, 14 Aug 2020 09:32:37 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09694C061384 for ; Fri, 14 Aug 2020 06:32:36 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1597411955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WZojXpF4CtFVHLmarhLq1h1iKcdgxc2RpfZdaP2LUC8=; b=4hTwEsgl4HcRIxSII5/fwGY8GDZ+WrKb+QiRIB95G4B6ixEAbwfJG+dOxycUIN4bFB2vKo TS5klI4Yh6uw4dSkjjyI2mn7/Sn8orOjYGewGYm6fr3T+7S63HBDN9ZJaWUQJZmSEA9ZNe IIZ6+h89d7ACBO8/WZB4lzrWBqdz6lSIsDUyblT4Kt+QzrgMZySm9F5LdDenFPfE/HnIfU Ff+eE7GC0YOkxK865WapnnLYDfFaStTU47hj7xRDtwSCU7so+lTleqczoN1Lbyget2pldW EqzYt5OKRC1IiJf7BpruQd3zNVkV0gjGPbFY8KK1wJmzDKAjzau3yzTlqBTdsQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1597411955; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WZojXpF4CtFVHLmarhLq1h1iKcdgxc2RpfZdaP2LUC8=; b=kDeKObwQFo5U/wxKAaE1swO/ff/4Gw8C5nGHWBCJCPiOyEqPYR9VJGuoaXpmfhXI71CMWT HGitrbMtHddq2jDA== To: kernel test robot Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org, Theodore Ts'o , Jan Kara , Julia Lawall , Nicolas Palix Subject: Re: fs/ocfs2/suballoc.c:2430:2-8: preceding lock on line 2413 In-Reply-To: <202008141412.mP88ccpD%lkp@intel.com> References: <202008141412.mP88ccpD%lkp@intel.com> Date: Fri, 14 Aug 2020 15:32:35 +0200 Message-ID: <878sehl5e4.fsf@nanos.tec.linutronix.de> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, tglx