Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2487455pxx; Sun, 1 Nov 2020 00:10:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7QsCHft9Ilf8PjR7uvZlPKRfsr6mS4aVXqyAGwxu74/tVZCwf2gPYzdyKzP79ql57P6ly X-Received: by 2002:a17:906:bb14:: with SMTP id jz20mr10338324ejb.424.1604214624289; Sun, 01 Nov 2020 00:10:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604214624; cv=none; d=google.com; s=arc-20160816; b=cdnDn4fG82wa4zCIex1+3Yt2awd92e00gEuXVocJO61/k2AUKM8ehoYqTkj0iO6E/r N4Lw4qmdbc3L/eYHds/rQi+BsabbkZT2DiGSzztW/6F/Qrn/vJAoYozFC5R39zLuQtnW ePbt2LvQetsxEWejF6Hj2kthnVhRtlC8fBbRwIIoYxy6/bMLj1n588qwtX8sEeGNXWNU axWVasNWBvCsl8ahUUbgZBhoy3YRcbMd5lASGX8kbmXWaiLb2Mks7WgdXopbctNwQTfl 1Jasvhir50CvDG+fGCDucBSjp7vorCn3c2QjBEaICoolS09gRxGDAR+Okox+BE7u7dNA wY3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=KEF81+W/RDv8uEWz0hWR7cCQN57HgriMw8kAcFsgqaM=; b=aSpcgaP4mlT0AuNEteKOZK1+BK7eOAbgL2Mqvvs1hG8kkWZYeK+MuvcvI1+JD52ove shRxoihfxmvPEroehIGEs14dv/Yf4cXIbZkMaF4FPXaOaA3DW1iOLwseMczgKZ6MYbYL bhPnoIz12QloFfV+SH+tw/ZCJpJ09m5city//KAXbj8AxPH7fWRQfGroaX/3p1YWON6M JbdKTGPX7jBSeIgmobOSbmv1BcQ1xgwyiT53WpivZN3PkjV+SYTfnVTB7AynOQP5jAO0 b0g7o4AZjr+BS6Y1qe7YjlyGerKko8H7AyhldKSDo3BjYtw4YB6hN5INBbh4lrdKoGCz hMxw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f23si8002821ejb.6.2020.11.01.00.09.39; Sun, 01 Nov 2020 00:10:24 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725907AbgKAHJg (ORCPT + 99 others); Sun, 1 Nov 2020 02:09:36 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:37228 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725877AbgKAHJf (ORCPT ); Sun, 1 Nov 2020 02:09:35 -0500 Received: from mail-wr1-f69.google.com ([209.85.221.69]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1kZ7Ua-0002Xi-Qj for linux-ext4@vger.kernel.org; Sun, 01 Nov 2020 07:09:32 +0000 Received: by mail-wr1-f69.google.com with SMTP id 33so4855602wrf.22 for ; Sun, 01 Nov 2020 00:09:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=KEF81+W/RDv8uEWz0hWR7cCQN57HgriMw8kAcFsgqaM=; b=pInjIp6ch5yaUIAVhPYqPcEryYkAUjS15JK+/oYsFftzpwz03hMEyQb5gLZhqov/L+ WPFQ+6EpxiUEvjgC97Zn2p+cAQm82HNV2PLq0PEWR28Vk+oLvuHXHq2zHSoqY8uz0BkT zAt3snO96qMP2eBN04lTaVk8ib0/r+ZAyDlR1gqRqoq64IFifuKzNkm0RLpcVZ0tlGMg +uowLqaWMNo3xFRr2mWZdobI70p2fKykSE60l88opvF5IYleRzmWaGSeWFpazmB61em4 QaMREOHGF4vDsMyD+75WuGDSawDftLvIX04YkkWmH2D1owQ49kNHzWfBJ4TNs+R2UxCb d9Ow== X-Gm-Message-State: AOAM530spH4WEA2d/1PenP1uMztJJl2bdYs8D4+TAs+ldfZ4v9y+Iqde IV0nU5mz32WpOtzEb98Bx1f9hz8dOzDoYRGhyRquxZdPL02LRvCvnW2IdEC1R3WEO/Vvar+x7Jd AmUx4MxHRK93xY8d241ijKJUZedAXFvxYvhBo2RU= X-Received: by 2002:a7b:c055:: with SMTP id u21mr11257293wmc.27.1604214572164; Sun, 01 Nov 2020 00:09:32 -0700 (PDT) X-Received: by 2002:a7b:c055:: with SMTP id u21mr11257271wmc.27.1604214571934; Sun, 01 Nov 2020 00:09:31 -0700 (PDT) Received: from localhost (host-79-33-123-6.retail.telecomitalia.it. [79.33.123.6]) by smtp.gmail.com with ESMTPSA id p4sm18089355wrf.67.2020.11.01.00.09.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Nov 2020 00:09:31 -0700 (PDT) Date: Sun, 1 Nov 2020 08:09:29 +0100 From: Andrea Righi To: Harshad Shirwadkar Cc: linux-ext4@vger.kernel.org, tytso@mit.edu, jack@suse.cz Subject: Re: [PATCH 08/10] ext4: fix inode dirty check in case of fast commits Message-ID: <20201101070929.GA3989@xps-13-7390> References: <20201031200518.4178786-1-harshadshirwadkar@gmail.com> <20201031200518.4178786-9-harshadshirwadkar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201031200518.4178786-9-harshadshirwadkar@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Sat, Oct 31, 2020 at 01:05:16PM -0700, Harshad Shirwadkar wrote: > In case of fast commits, determine if the inode is dirty by checking > if the inode is on fast commit list. This also helps us get rid of > ext4_inode_info.i_fc_committed_subtid field. > > Reported-by: Andrea Righi > Signed-off-by: Harshad Shirwadkar Tested and looks good to me. Thanks Harshad! Tested-by: Andrea Righi > --- > fs/ext4/ext4.h | 3 --- > fs/ext4/fast_commit.c | 3 --- > fs/ext4/inode.c | 3 +-- > 3 files changed, 1 insertion(+), 8 deletions(-) > > diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h > index 573db158382f..7222a9ba5d66 100644 > --- a/fs/ext4/ext4.h > +++ b/fs/ext4/ext4.h > @@ -1028,9 +1028,6 @@ struct ext4_inode_info { > * protected by sbi->s_fc_lock. > */ > > - /* Fast commit subtid when this inode was committed */ > - unsigned int i_fc_committed_subtid; > - > /* Start of lblk range that needs to be committed in this fast commit */ > ext4_lblk_t i_fc_lblk_start; > > diff --git a/fs/ext4/fast_commit.c b/fs/ext4/fast_commit.c > index b7b1fe6dbb24..4c0a3e858ea3 100644 > --- a/fs/ext4/fast_commit.c > +++ b/fs/ext4/fast_commit.c > @@ -152,7 +152,6 @@ void ext4_fc_init_inode(struct inode *inode) > INIT_LIST_HEAD(&ei->i_fc_list); > init_waitqueue_head(&ei->i_fc_wait); > atomic_set(&ei->i_fc_updates, 0); > - ei->i_fc_committed_subtid = 0; > } > > static void ext4_fc_wait_committing_inode(struct inode *inode) > @@ -1026,8 +1025,6 @@ static int ext4_fc_perform_commit(journal_t *journal) > if (ret) > goto out; > spin_lock(&sbi->s_fc_lock); > - EXT4_I(inode)->i_fc_committed_subtid = > - atomic_read(&sbi->s_fc_subtid); > } > spin_unlock(&sbi->s_fc_lock); > > diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c > index 7f6af784e74f..d36c3908272f 100644 > --- a/fs/ext4/inode.c > +++ b/fs/ext4/inode.c > @@ -3311,8 +3311,7 @@ static bool ext4_inode_datasync_dirty(struct inode *inode) > EXT4_I(inode)->i_datasync_tid)) > return false; > if (test_opt2(inode->i_sb, JOURNAL_FAST_COMMIT)) > - return atomic_read(&EXT4_SB(inode->i_sb)->s_fc_subtid) < > - EXT4_I(inode)->i_fc_committed_subtid; > + return !list_empty(&EXT4_I(inode)->i_fc_list); > return true; > } > > -- > 2.29.1.341.ge80a0c044ae-goog