Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp179346pxv; Wed, 30 Jun 2021 03:05:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwsRn52CU4rDt6L7QEXRucohhZ3RadCjWVzZC+qFiIMODfedsu9X+28TEdokXwbyYx9Cd6P X-Received: by 2002:aa7:c50d:: with SMTP id o13mr45058789edq.9.1625047547839; Wed, 30 Jun 2021 03:05:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625047547; cv=none; d=google.com; s=arc-20160816; b=ySxHQGj+8puYxm8T3tRDzZ3Jpt3LDM2n7CFSLlhhQNRoL03Udmc/eN0S2iHHRIbO9N HUQNzyShrb7T8Frp/LoKfi7yShU+q3MW2Mkx5sdkQHIlRPDs52fCLUzUTJ/AxmSs4IV7 uxbNBtZUNhZfSAladluAfRP7Fq43H6aBz78AF6Nr5oB7V6qbcl5C8Bx1bKcWxo5nYqHZ zmDQid52KVX/qX1uiIGVzPbTN5MmgQJGKgKLpZLmiD/Bo8O6O9yK/fm+QJXljYiAhhTx TahRjwhxdzBVDBZFBM1bwGfwByL88X9wbOnwYhvjkt23oV6zMU6hlmFtzxDgLh2c2Dov sVxg== 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=oEaqOwNKhLBYQYGwrJ2xjFd6h5j+BZiGEF8gCH4qcxo=; b=lpBTJQ3mkRN2tsJ/dP2f1YZLnWugM+K9j6tzjIfODtfmtTATglwNyuGeDH4ET0uDcV BVe4TwvuCX0hqU3M0NOWpRgY2Eis3VHSwrCvljM7F3bxiPAFHEWSunQjY9OomEnuUAgW RjKoifQD2P45kJ+i7yG1Wkjjkl3XGKiFoXcr9Vyayte1imftO7tOabqPJmUHOyuFLGxl UBwdRDBLZDPtOo9HzhdpDNRWhUNN+xNhLGX324oZH7SdbLx0jPYyW0ioACPSC6sORmgz y3UH3KoeB8kWHEEi7hG1EWbuaU7dP2bzq25MziC7cb0KrAuWb8JBxJ8M18/8l1WZCLxZ 13Bw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=s0EZRUJJ; dkim=neutral (no key) header.i=@suse.cz header.b=G06LDiu6; 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 p23si19880198edw.135.2021.06.30.03.05.23; Wed, 30 Jun 2021 03:05:47 -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=pass header.i=@suse.cz header.s=susede2_rsa header.b=s0EZRUJJ; dkim=neutral (no key) header.i=@suse.cz header.b=G06LDiu6; 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 S234111AbhF3KEY (ORCPT + 99 others); Wed, 30 Jun 2021 06:04:24 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:50792 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234150AbhF3KEX (ORCPT ); Wed, 30 Jun 2021 06:04:23 -0400 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 169EF226A6; Wed, 30 Jun 2021 10:01:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1625047314; 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=oEaqOwNKhLBYQYGwrJ2xjFd6h5j+BZiGEF8gCH4qcxo=; b=s0EZRUJJbcIudsbIuaAqxWseq93rzjbXGMlgvkBwQ2UagpILzlLhZctv2ENdbGMHN6BAG2 xb0Np6nEmH1W+Wk6BiApcVl/FAXVuP8QLpNfDTwOTRl1UCFoe7kRW/G/k6XOE0uoMf0Qvr 8tl+pv0k/1KU0QoAdGb1e66Dqki3TLo= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1625047314; 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=oEaqOwNKhLBYQYGwrJ2xjFd6h5j+BZiGEF8gCH4qcxo=; b=G06LDiu6vW031ghZytUvS3eGZtumrxr1Ulxe8q44AFRJmkKMJ6zzr2B1MSPSpY5SBdoRcO PS+DES4eRHi+XOCQ== Received: from ds.suse.cz (ds.suse.cz [10.100.12.205]) by relay2.suse.de (Postfix) with ESMTP id 8F8F3A3B8A; Wed, 30 Jun 2021 10:01:53 +0000 (UTC) Received: by ds.suse.cz (Postfix, from userid 10065) id A06C3DA7A2; Wed, 30 Jun 2021 11:59:23 +0200 (CEST) Date: Wed, 30 Jun 2021 11:59:23 +0200 From: David Sterba To: Johannes Thumshirn Cc: "lijian_8010a29@163.com" , "clm@fb.com" , "josef@toxicpanda.com" , "dsterba@suse.com" , "linux-btrfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" , lijian Subject: Re: [PATCH] fs: btrfs: extent_map: removed unneeded variable Message-ID: <20210630095923.GH2610@twin.jikos.cz> Reply-To: dsterba@suse.cz Mail-Followup-To: dsterba@suse.cz, Johannes Thumshirn , "lijian_8010a29@163.com" , "clm@fb.com" , "josef@toxicpanda.com" , "dsterba@suse.com" , "linux-btrfs@vger.kernel.org" , "linux-kernel@vger.kernel.org" , lijian References: <20210629085025.98437-1-lijian_8010a29@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23.1-rc1 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 29, 2021 at 09:04:40AM +0000, Johannes Thumshirn wrote: > On 29/06/2021 10:51, lijian_8010a29@163.com wrote: > > From: lijian > > > > removed unneeded variable 'ret'. > > Wouldn't it make more sense to return an error (-ENOENT??) in case > the em lookup fails and handle the error in btrfs_finish_ordered_io() > as this is the only caller of unpin_extent_cache()? > > I've actually tripped over this a couple of times already when > investigating extent map and ordered extent splitting problems > on zoned filesystems: > > em = lookup_extent_mapping(tree, start, len); > WARN_ON(!em || em->start != start); > > Maybe even turn this WARN_ON() into an ASSERT() when introducing proper > error handling, as we shouldn't really get there unless we have a logical > error. If you have real workloads hitting the warning then it really should be proper error handling, not even an assert.