Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp1831903lqz; Mon, 1 Apr 2024 20:55:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBnJwL9bx7SVo9uePNe7eS4rLFSe4wW9GoSyexIwg9TTmHbzufiE2cILh3RPnNkES1N8PGFM8mbPgUEDwGXPBN6aXwnT2XVg+MXceRzw== X-Google-Smtp-Source: AGHT+IFJXytx/RoFA6m8/7ZXdTNYDimfKPyBYWB7hjjozEmucBSQJ9J6RVAJSuqtKn7jJTbSnRLg X-Received: by 2002:ac8:57d3:0:b0:434:345c:fc03 with SMTP id w19-20020ac857d3000000b00434345cfc03mr876353qta.57.1712030123318; Mon, 01 Apr 2024 20:55:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712030123; cv=pass; d=google.com; s=arc-20160816; b=X2zqqH2oOynJ3LxIYLtqWxDEKaKOaSnrG1HTNCGbe5VlF+LskkTGr19/57DGEW0S1z P14b4bAfuJYq0+kXhku+XfUDiLjtgOh9xw1JeKlunzjIvf+4oX0EftuARkeIySXWEeKx br1c1tuJLHrcQGCsfbE8DvvQ9omvXyds1OlpXZesMCEvDxVOBbkTMKHKjh622w068qFP FFONYrYOhEuGeUlpSNHDfiigVoVZAjtl/wOnJ04mBpKFmqpxvhqwGTOo1e4S4FFfwrcL +/v0r1C6uC+WGu/iVGSoiWwWxcfPrfbqRBZtsZxmIBbaNX9Gw0HPKI7R+TI7QLwkUSyx fhfQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=2FWI5HTUPKIrmfRUocgz+rQZxloeVKb2yYFnmd5HQD4=; fh=2/qP6XTRrrgeiTM31Pq2AsKAteG/zgmNKSGuG6O5gRg=; b=I4DQYN4n5wuXKjZM/ThJuOT9ArPIvOs8x2/kisQ+io2giabFEcvPEo4CupLPndlQpP U0tBLKeE9tgqDG1jsCXJpLqIzBM19VnR5BR8FG8VPmXJvvSrAWnz84WJnFCsp/VTUFsw t8N7zg9MM8d1fPaYuV5HktUST1IQgsP76E+S5RnOSf0LNyg5guObxg+cJtYJc0Nyml+n 76MkebikBw8TxdoVCusQDuuT7oYDp+rRrA7p5QrkVNfZlhxqO+Uez1vEAU8cAQkR2si0 dJa7OklV3umiyW+P2heCHKwfxnXICCh2JOFELh6VqbZ7rPMyLwZpNwWWRdXC3D2vcoXt Vsnw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=SiHqWckA; arc=pass (i=1 spf=pass spfdomain=mit.edu dkim=pass dkdomain=mit.edu dmarc=pass fromdomain=mit.edu); spf=pass (google.com: domain of linux-ext4+bounces-1818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id z16-20020a05622a061000b00432be924686si9284191qta.173.2024.04.01.20.55.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 20:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4+bounces-1818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=SiHqWckA; arc=pass (i=1 spf=pass spfdomain=mit.edu dkim=pass dkdomain=mit.edu dmarc=pass fromdomain=mit.edu); spf=pass (google.com: domain of linux-ext4+bounces-1818-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-ext4+bounces-1818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 111F71C23560 for ; Tue, 2 Apr 2024 03:55:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26C601759E; Tue, 2 Apr 2024 03:55:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="SiHqWckA" X-Original-To: linux-ext4@vger.kernel.org Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E25B1426F for ; Tue, 2 Apr 2024 03:55:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=18.9.28.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712030118; cv=none; b=exuuNVi9LawgH/Q5NCZiZmbrnyu4/j9mShxQhZlTHEStdcD1SQ66zLWMfSc4Susj8DEdW8a9Phag4RfENlGRUkxytwgRXatp0+9Z8GHdXev9olezRz8mbGNwbnAw/nTJL7ysZf6Mw90F21VOxjyDZmLXVtpxmu69lYp2Jeee+l8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712030118; c=relaxed/simple; bh=TxgPK3t8qTIp8s7+dz2T3zXN7rUHW/wGDIy6qjBQd0o=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=utSBqmozjwH5P3x2Nljt0EegBzLaQWQ2m/qo3dQWPDawH6HIRcYEC9iuDjsmbQ2QVL0R0T2XWqVC4viffRF4MQKo0QH8obKogwrLBPbaBc1ciTAm4cQEzDDSa3I/YBuO9iAMnJKL65zG1GZXQYwhZ10aS6w5rD3UcQwW/j1SPn4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu; spf=pass smtp.mailfrom=mit.edu; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b=SiHqWckA; arc=none smtp.client-ip=18.9.28.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mit.edu Received: from cwcc.thunk.org (pool-173-48-113-232.bstnma.fios.verizon.net [173.48.113.232]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 4323t2OM027928 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 1 Apr 2024 23:55:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1712030108; bh=2FWI5HTUPKIrmfRUocgz+rQZxloeVKb2yYFnmd5HQD4=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=SiHqWckAMuuNEzkMnQfSWtSFwVdVl8BRV9TbieE4hqLCGsAcG0PGNH5oP4QHSGZE6 CC0GpcZLuYnK3DNwuB1mdoQXAj26ea+TM51KE4Jz4zYfts6KUG+xC2Vck3+4w1HSDp SGGxlg32stqtdcsjZeTBwmTmoT36WYvGJTlNjoZ1ABIo0JrFhBeZiKH9xXLD4CFqWp jpeiIx/MxAzGaZixyN6Tve0mfPQHEdNWES8B+T3bkf3nfl+dVLujbMyj/IZSwRTRjS QNXt/n16Wh0o1KzqgWMsjy/jJyQsTdiSYO9JqyDUmDVLSDw0zu0DZYxtgIWqXREQTG R+NCIyPQwwyZg== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 62EF015C00DC; Mon, 1 Apr 2024 23:55:02 -0400 (EDT) Date: Mon, 1 Apr 2024 23:55:02 -0400 From: "Theodore Ts'o" To: Li zeming Cc: adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] ext4: extents: =?utf-8?Q?Remov?= =?utf-8?B?ZSB1bm5lY2Vzc2FyeSDigJhOVUxM4oCZ?= values from path Message-ID: <20240402035502.GC1189142@mit.edu> References: <20240402024140.28456-1-zeming@nfschina.com> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240402024140.28456-1-zeming@nfschina.com> On Tue, Apr 02, 2024 at 10:41:40AM +0800, Li zeming wrote: > path is assigned first, so it does not need to initialize the > assignment. That's technically true, but the compiler is perfectly capable of optimizing it out. So it's harmless, and removing it does make the code a bit more fragile, since it needs to be set so that the cleanup code doesn't accidentally dereference an uninitialized pointer: out: up_read(&ei->i_data_sem); ext4_free_ext_path(path); return ret; So if later on, we add code which does a "goto out" on an error, before path gets initialized, that would be bad. So removing the "unnecessary" set has no upside, and it has a potential disadvantage. - Ted