Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1761864pxb; Wed, 9 Feb 2022 04:04:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJywOv+aYShyORdVq5BfbbrjbSt3GVneqC2KF8LgrXgDY1ts5D0J/72Ns0aGNlqQA0eL8iqE X-Received: by 2002:a63:5a64:: with SMTP id k36mr1589159pgm.408.1644408245659; Wed, 09 Feb 2022 04:04:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644408245; cv=none; d=google.com; s=arc-20160816; b=VJ7naHN6zX/Em8BWzEfQzEsuuhWhg+9ZxqRmlEWIXrJk/1pz1BUW3htHdcc8OcqrWS 63Z1BKnB3BRuieBjjaCyv09fqJMDI+Ts/KYNhAc79R4gqOr6q1DkhlJyEL3wD3JE+NrJ KbJCQ+T904RYE3JCabxWUBh6jhBwTkIuaSG7yp5T4Vk3InAGjB7S5CXuik8XMnZsHIJh 6NQc1owXHbk0Yd1eC4abuJE9dSSfNMqA69JHbKIovPgURKhxCGe2KGrk+cs7pgzQh2UA 1+ccnkJJJ54Il0z/T2H2GCf7463pvcf3mqU3/F5JYkKNj1F5nMrOnc4OZi3HtZJv92/a Z+GQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:mail-followup-to:reply-to:message-id :subject:cc:to:from:date:dkim-signature:dkim-signature; bh=uuczzsLerYxf5+rv4LqJaLUqY8prQZza42JsJ9r52vw=; b=E5N0/SWSp4Ia0u+kDtPTv9KSNJ2vitVsnxjnc5enjti7EHStHh8QHN0he+YJQqYxZ4 9oD+4dLi1Hd6h6YYZ0hPEfD+aJcGSKwsODjAzhICL6oczDMvsAWCrhJ7V7i2p1UR7Cdb gmnmh9gtIExjP/8bczGumZTB/36+DuFDa1d4NRC/VHmINidGsynF4cyhnxSjwso9jzB/ dfyEJ4hyj8qhyJeY8+rQUz9WhvCx6DsTzWd34gb2ShynxAW/4WJteTpgiHvVHRk2z5oW VWrsWk+J3wFH64tBTGGoyA04sT1jxvUnWB9Az8Hd5jMq0C6CSqqqGN9aSL/6CjBzs0Kk MFLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=aSx5mvQq; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=KaSdzSjT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id k15si17508298plk.517.2022.02.09.04.04.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 04:04:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=aSx5mvQq; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=KaSdzSjT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id C3E4CE0F4B7A; Wed, 9 Feb 2022 02:04:52 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1385824AbiBHTGt (ORCPT + 99 others); Tue, 8 Feb 2022 14:06:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55718 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352581AbiBHTGs (ORCPT ); Tue, 8 Feb 2022 14:06:48 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F19A4C0613CB; Tue, 8 Feb 2022 11:06:47 -0800 (PST) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 85DA8210F5; Tue, 8 Feb 2022 19:06:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1644347206; h=from:from:reply-to:reply-to: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=uuczzsLerYxf5+rv4LqJaLUqY8prQZza42JsJ9r52vw=; b=aSx5mvQqEJxFgLpdX14GPITrKNOUKdehmtwf/lK4cXBI0v8TKIXlJLz1Yw8LPPGqez/MZU 5iZYaEVxHsz7fcZUJDAW0vZZDqWcRzlUjZPi6C7aaFUACoI4w87g5buWuE6AxhAS8sQoUS Zt9U1CaviNefBLTvd5gjvwlv1mUS7CQ= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1644347206; h=from:from:reply-to:reply-to: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=uuczzsLerYxf5+rv4LqJaLUqY8prQZza42JsJ9r52vw=; b=KaSdzSjTi4kfq97LsEmnuANFm+twdm3rbN8Wt0Ll0wZfFJtOQJetofYIJG9PuIAyFHy49E V0GY3kgOtU5CyaAA== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 08A0CA3B88; Tue, 8 Feb 2022 19:06:41 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id 8528EDAB3F; Tue, 8 Feb 2022 20:03:01 +0100 (CET) Date: Tue, 8 Feb 2022 20:03:01 +0100 From: David Sterba To: Namhyung Kim Cc: Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , LKML , Thomas Gleixner , Steven Rostedt , Byungchul Park , "Paul E. McKenney" , Mathieu Desnoyers , Radoslaw Burny , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org Subject: Re: [PATCH 06/12] btrfs: change lockdep class size check using ks->names Message-ID: <20220208190301.GF12643@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Namhyung Kim , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Boqun Feng , LKML , Thomas Gleixner , Steven Rostedt , Byungchul Park , "Paul E. McKenney" , Mathieu Desnoyers , Radoslaw Burny , Chris Mason , Josef Bacik , David Sterba , linux-btrfs@vger.kernel.org References: <20220208184208.79303-1-namhyung@kernel.org> <20220208184208.79303-7-namhyung@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220208184208.79303-7-namhyung@kernel.org> User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 08, 2022 at 10:42:02AM -0800, Namhyung Kim wrote: > With upcoming lock tracepoints config, it'd allow some lockdep > annotation code without enabling CONFIG_LOCKDEP actually. In that > config, size of the struct lock_class_key would be 0. > > But it'd cause divide-by-zero in btrfs_set_buffer_lockdep_class() due > to ARRAY_SIZE macro. Let's change it to use ks->names[] instead. It > should have the same size as with ks->keys[]. > > Cc: Chris Mason > Cc: Josef Bacik > Cc: David Sterba > Cc: linux-btrfs@vger.kernel.org > Signed-off-by: Namhyung Kim Acked-by: David Sterba