Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4275540ybz; Mon, 20 Apr 2020 20:02:57 -0700 (PDT) X-Google-Smtp-Source: APiQypLVI/Mh0RjSYWqSGuxqDgu5Y/cpCcXNolhyCL8tUizYR6UUJBjGwdePcYyjZ0ioxrYT2SsR X-Received: by 2002:aa7:d745:: with SMTP id a5mr17487719eds.43.1587438177529; Mon, 20 Apr 2020 20:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587438177; cv=none; d=google.com; s=arc-20160816; b=Lf+xeUVeHaBdBICAcptEiz89siD1l6RhFGoDhHcVCkGCODLXPwoK1ad2Mu2Sf6NKtt JJLhPwhl/YNEPKyKTok7OwBmArjgGr7erTQQoOANpnTIkV9ETKnjqEzmQSGiSG4TF2tx IA3ILqHw25NfVcre25KuunCyE55eG0K223ZRBJ+bvpc5UBRva3snVJEE9AfcZiX+W75z 6vt98gK97n3QDsBfc+tq9H6yYXHItS8zVfzx3gvTwUZEokRBcmmp9ElY15iNQLJ43dA/ Sa6VBjuXlgWyXsZ44Dr/PtH6kWKqjjz6yPmNPV43pz2LWFkQUIi7+jHtEW6+eAuaNhGA ocNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=HMy0dCH6YyQhrin4Dzk1pRAf6VOOeshobzC6QtTdbtw=; b=lt2FVsJL2ruH8VFH9L08voDJqiKhwzZHdIyNeXt5GhrXEaNx/oAqqTOOA5gO5M+w4M ja+6W7xXX3jCbUK2pDZSivJdKKsA8s9kzjsy4US3Vuo5aNy9izpgP+QMcpZH9ydwliPp g+x6f8B5esk+Xxl6mohuUPXLpecSCl0msoFzgm2u3OXR5bkZzHJr54w8m21l79DCW49+ TWLjD4lG7T8cLpZkFFedWmG+mJLKNlYZLKATMB41+cvdnz305pDOBBJ5Xk7k3hS+VcUZ j+6eCNpYzeIJ9K3W/YGjFly45ok0wewVECyav+suYX4dk2jhiSBpZaDRlPH6uc/YZfxw YSFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TFfGXmiJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cf13si819901ejb.78.2020.04.20.20.02.28; Mon, 20 Apr 2020 20:02:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-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=@gmail.com header.s=20161025 header.b=TFfGXmiJ; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726389AbgDUDCQ (ORCPT + 99 others); Mon, 20 Apr 2020 23:02:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726325AbgDUDCQ (ORCPT ); Mon, 20 Apr 2020 23:02:16 -0400 Received: from mail-oi1-x241.google.com (mail-oi1-x241.google.com [IPv6:2607:f8b0:4864:20::241]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46175C061A0E for ; Mon, 20 Apr 2020 20:02:16 -0700 (PDT) Received: by mail-oi1-x241.google.com with SMTP id t199so10843484oif.7 for ; Mon, 20 Apr 2020 20:02:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=HMy0dCH6YyQhrin4Dzk1pRAf6VOOeshobzC6QtTdbtw=; b=TFfGXmiJK/UvExVJm7sK7PvdbvX6yqWBuXEH/CWArzig4+LuMusBDub2emoqVAG64/ HxGl5G7TcG31i2Kgg40o75SdTfyKbOyDYuQ4yTke56ahiRIJcof84jWWqzrr29ePDSFW fTSDUwCpiFbO6+U7tzGDm3SFIeEsM4pHDjje8mwQdyhDHm3MXPY4vMFxpHE7UMZeXvJA oph7wjVI9M150lHMKa5l71AB8DEpkxbzA102EtsFKZyoj4b5WhlCLqZoeea5ka7PlQmc jKEfDsKQC/c9tn2xbdC2/y1VSyzJ7QBSGC17g463hvq0xuTVX/XsFrd1bnTFcIXsrfgX pdhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=HMy0dCH6YyQhrin4Dzk1pRAf6VOOeshobzC6QtTdbtw=; b=NH2W7B0O9RxRpGG+2lwxBwdj0gsMNLgOKvbD7h1TBuba++JHcybIPZOXctO5hyUs7h pL3FoT1tqC8tnKJtZLiVKD1wGmhtXDpKIKvrNr2nNhl9EwwwWNhRLnmKItYzgHf8OVNV JtMGcg+eH8vU9NTnJfDY5tKs0fvRAx9B695UlB8gQbA6Dlt4wfUEO8rGj75V/ZDzy+dx YO9lB0ytsKEQeVLLXXgzdGMQ166plxZYDKmrPlWn7y0siJpNBDkVFMe9hv9vvPGeKcIk APtGBoqaDrrrKlSbQAr6o1JzZ0ipIxjC54dHhh7+i4oc9Kx3i41uHzawAc35+JrBHRUp 8ARg== X-Gm-Message-State: AGi0PuYCn7JmagwYAvIcANREXCRsjfaPX5UeH1AKiXUxTKGHyxqcpbH0 zmycyx6F2bNjRUzvhg4yPvPcS1rAgGlrhRudovTUG0uE X-Received: by 2002:aca:4155:: with SMTP id o82mr1855754oia.16.1587438135033; Mon, 20 Apr 2020 20:02:15 -0700 (PDT) MIME-Version: 1.0 References: <20200421023959.20879-1-harshadshirwadkar@gmail.com> In-Reply-To: <20200421023959.20879-1-harshadshirwadkar@gmail.com> From: harshad shirwadkar Date: Mon, 20 Apr 2020 20:02:03 -0700 Message-ID: Subject: Re: [PATCH] ext4: don't ignore return values from ext4_ext_dirty() To: Ext4 Developers List Content-Type: text/plain; charset="UTF-8" Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Mon, Apr 20, 2020 at 7:40 PM Harshad Shirwadkar wrote: > > Don't ignore return values from ext4_ext_dirty, since the errors > indicate valid failures below Ext4. In all of the other instances of > ext4_ext_dirty calls, the error return value is handled in some > way. This patch makes those remaining couple of places to handle > ext4_ext_dirty errors as well. In the longer run, we probably should > make sure that errors from other mark_dirty routines are handled as > well. > > Ran gce-xfstests smoke tests and verified that there were no > regressions. > > Signed-off-by: Harshad Shirwadkar > --- > fs/ext4/extents.c | 5 ++--- > 1 file changed, 2 insertions(+), 3 deletions(-) > > diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c > index f2b577b315a0..f62f55a16fe3 100644 > --- a/fs/ext4/extents.c > +++ b/fs/ext4/extents.c > @@ -3244,8 +3244,7 @@ static int ext4_split_extent_at(handle_t *handle, > > fix_extent_len: > ex->ee_len = orig_ex.ee_len; > - ext4_ext_dirty(handle, inode, path + path->p_depth); > - return err; > + return ext4_ext_dirty(handle, inode, path + path->p_depth); > } I realized that this is not correct. That's because fix_extent_len is an error path and this change would make ext4_split_extent_at() return success if ext4_ext_dirty succeeds in this path. I think instead I should be adding a comment here explaining why we are not handling ext4_ext_dirty(). Sorry for that. - Harshad > > /* > @@ -3503,7 +3502,7 @@ static int ext4_ext_convert_to_initialized(handle_t *handle, > } > if (allocated) { > /* Mark the block containing both extents as dirty */ > - ext4_ext_dirty(handle, inode, path + depth); > + err = ext4_ext_dirty(handle, inode, path + depth); > > /* Update path to point to the right extent */ > path[depth].p_ext = abut_ex; > -- > 2.26.1.301.g55bc3eb7cb9-goog >