Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp620816pxp; Fri, 11 Mar 2022 10:53:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJygEf2mP0JK1zkDaKzba2VQoSWJs1c1GHRBZlyml29j1EttJjEs5nylRp7PpcD+qFbIMDTr X-Received: by 2002:a17:907:2d90:b0:6db:729e:7f25 with SMTP id gt16-20020a1709072d9000b006db729e7f25mr9782378ejc.203.1647024829954; Fri, 11 Mar 2022 10:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1647024829; cv=none; d=google.com; s=arc-20160816; b=ObalKPoLdJajwRK3rwpaFE1UmsmYveAEN2Hu4m/4cpkEIRtPUmiMaAwuDcESZ6oXPe E2tTgZ87sIDXb2DmgA7cYfLjgSiKHAmx5FA9wk2B8OfPfHLzjMzFeDiK1tUmBrWXDelD qQybgqHjVTOWNZHlIqmGXJQMfZIlIeLVkaUbxyPYNNnvtlXuRix6A9dY2fno3XPUKMRm A1RfhNpr7RItMh6NYOpwekgXBhHmHEdPsksdmtYL/lh6mr1HXJ+ZgqkrrncnfUBjk0X3 0a+9x/PmngQ6aM6urNOH+9CpbczhMpmE9/uMVoKhIG0co5wdlGAb4KT+r06sd4v3N3aJ uiTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=+wzT8zoxzQUK2WEeSQssoFnxlwncxeJI+pT8W14ygBQ=; b=Gc92bc7uwY1YBQl1eO5UM06WRHp7U7UugBarq8CuLd6lJMFlliHdpDkmVDKTvb6kVu DGChVlDrHNH2CCs5fdbhe3hNIwJDNOPt4tE/bbT70S+Kd7TrGV6sOBvFmIM9DJAWMHsB iVS1HY+B0MOgKcZX8l8XbqzggDK8x+mvQDbU4C6jZt/0EN4za3TR82ewoB1pKUjNywgf CC8rN79HeNWDgAmoLBfDwN68j+vF3d3088rfENE7kA6UmnKmvelVOTRELa6nFIiVl6Fq +nlhFtU6s2pL+475DV2i7VY73QFRDRRjhDVoAyeSjcUEV3bx7Lpwl/KluwEXzHmDWmz2 pnRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WvHlh/FM"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q3-20020a50aa83000000b004163b429163si5418180edc.375.2022.03.11.10.53.03; Fri, 11 Mar 2022 10:53:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b="WvHlh/FM"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S242937AbiCKEST (ORCPT + 99 others); Thu, 10 Mar 2022 23:18:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1346195AbiCKESP (ORCPT ); Thu, 10 Mar 2022 23:18:15 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 867211A274A for ; Thu, 10 Mar 2022 20:17:13 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id b15so5368324edn.4 for ; Thu, 10 Mar 2022 20:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+wzT8zoxzQUK2WEeSQssoFnxlwncxeJI+pT8W14ygBQ=; b=WvHlh/FM5NvwvVqiHSkm5EZzfTE13jGMzBQwHAvrDbuoSr5HdU6X9XBdckNDWivOQC 6Qy6E4yLQyg1KH9yuNtPA0RI3AwpuDXwPn8UXVEWiIcVTODUGXW9P60nR3RvtUQM6JjD oN9bg6SLFKO3JWQJjFdYKdRnXBv4gADCKjXrwx0u9JJtkIcworaKcpozc6M4rwGOV5y9 PnJfMS7IMBUs6y6ahG3j9B7s46MshHHJro49ID0e3ZBnhf2WxRY7b11P8QgRTUWLroL2 Vg5YE20CKFV87iiHwGFcUb+ENlTe4Fwi4mmnHOVVAzEv5x6hH73C/hRGBe/9QjR3x4FL u/dw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+wzT8zoxzQUK2WEeSQssoFnxlwncxeJI+pT8W14ygBQ=; b=4vo/nWUtEuxSC6yE+P1qmyXAljdS73wdVyxQIdaBiUYqgegAsNiI+ZN0UxZYgZaRVR CugrqrQ8Sk4PsP5xfj+zs5ccr85r/RJi+aasKrURhkwg+Ox7BWgpRSwDtzyK10Q/cuQS siNuIrNWfDJ2Zk7tBgfX3cezbjx4sO9P/LM7dl+QUzbBpwEOcdOHD+OhpmwtJmGHbPCF owpjwcWTdodFe9jvmTDDE9UHpoNjGNHDnxFU5yD4c7EwFEOGP8ZEeiJGhOsipSPDacqs U6Xi8PksNY7jIRtk0X2Tj4gZBXFb81iUTJlEyQxX+idQQpiOOMZzraD4NZzA/tNENVkR kk6A== X-Gm-Message-State: AOAM532ofZvzGsrC6RbspRbNS5MObEGJkyCNsd1H0FD+WSP7JnXjIvGr E6THDoLR/dqU1RN37eaQ6ZW0jj/71LQmdA3jXak= X-Received: by 2002:a05:6402:1c1e:b0:416:5b93:eacf with SMTP id ck30-20020a0564021c1e00b004165b93eacfmr7153195edb.302.1646972231932; Thu, 10 Mar 2022 20:17:11 -0800 (PST) MIME-Version: 1.0 References: <20220308163319.1183625-1-harshads@google.com> <20220308163319.1183625-3-harshads@google.com> <20220309101426.qumxztpd4weqzrcs@quack3.lan> In-Reply-To: <20220309101426.qumxztpd4weqzrcs@quack3.lan> From: harshad shirwadkar Date: Thu, 10 Mar 2022 20:17:00 -0800 Message-ID: Subject: Re: [PATCH v2 2/5] ext4: for committing inode, make ext4_fc_track_inode wait To: Jan Kara Cc: Ext4 Developers List , Ritesh Harjani , "Theodore Y. Ts'o" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-ext4@vger.kernel.org Thanks for the reviews Jan! I'll update inline.c as you mentioned in the next version. - Harshad On Wed, 9 Mar 2022 at 02:14, Jan Kara wrote: > > On Tue 08-03-22 08:33:16, Harshad Shirwadkar wrote: > > From: Harshad Shirwadkar > > > > If the inode that's being requested to track using ext4_fc_track_inode > > is being committed, then wait until the inode finishes the commit. > > > > Signed-off-by: Harshad Shirwadkar > > One comment below... > > > --- a/fs/ext4/ext4_jbd2.c > > +++ b/fs/ext4/ext4_jbd2.c > > @@ -106,6 +106,18 @@ handle_t *__ext4_journal_start_sb(struct super_block *sb, unsigned int line, > > GFP_NOFS, type, line); > > } > > > > +handle_t *__ext4_journal_start(struct inode *inode, unsigned int line, > > + int type, int blocks, int rsv_blocks, > > + int revoke_creds) > > +{ > > + handle_t *handle = __ext4_journal_start_sb(inode->i_sb, line, > > + type, blocks, rsv_blocks, > > + revoke_creds); > > + if (ext4_handle_valid(handle) && !IS_ERR(handle)) > > + ext4_fc_track_inode(handle, inode); > > + return handle; > > +} > > + > > Please fix fs/ext4/inline.c rather than papering over the problem like > this. Because it is just a landmine waiting to explode in some strange > cornercase when someone does not call ext4_journal_start() but other handle > starting function. > > Honza > -- > Jan Kara > SUSE Labs, CR