From patchwork Wed Feb 28 17:57:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christoph Hellwig X-Patchwork-Id: 10249165 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A33360365 for ; Wed, 28 Feb 2018 17:57:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 63338237F1 for ; Wed, 28 Feb 2018 17:57:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 55DF620408; Wed, 28 Feb 2018 17:57:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5250B20408 for ; Wed, 28 Feb 2018 17:57:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934344AbeB1R5u (ORCPT ); Wed, 28 Feb 2018 12:57:50 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:55154 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933992AbeB1R5o (ORCPT ); Wed, 28 Feb 2018 12:57:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=s1J6DerPjLmatGBPiKpJ6+YteHubrj0ozyiuORUk1rE=; b=aVPLivHTZ1rgEKiurBHSy9ON8 pcpzeDF22B5bKa2RfPB9ll/qMXUEM38A+pDnKd5IUjwI0zKz88QYhbKu1n4eU/YplDgzl7CDEezae KiF2KALiUCIEb3r95FQMMBBkAGuKhWuOObpefLbCkbl88cRWcNl0WYD7poPx+mjvrYLqvtnFLDS3D c5ktHDy+1RdJFpv8Yki5xPSlUZbXh4eXlCtRCPNRcTracr+ER8JdcwrPEBrjKH2ya/ah2Q+pWb+pT m0+aIqX0QWDiVWyxkvPzKvOozr046dn390KlQT0NH5IPc2sAVBvemDYU0o8E6sEN1TrWDLHKJDK/O j8+rUwqGg==; Received: from 71-83-125-253.static.reno.nv.charter.com ([71.83.125.253] helo=localhost) by bombadil.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1er5z1-0008S6-5i; Wed, 28 Feb 2018 17:57:39 +0000 From: Christoph Hellwig To: linux-xfs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, "Theodore Ts'o" Subject: [PATCH 1/2] fs: don't clear I_DIRTY_TIME before calling mark_inode_dirty_sync Date: Wed, 28 Feb 2018 09:57:36 -0800 Message-Id: <20180228175737.317-2-hch@lst.de> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20180228175737.317-1-hch@lst.de> References: <20180228175737.317-1-hch@lst.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP __mark_inode_dirty already takes care of that, and for the XFS lazytime implementation we need to know that ->dirty_inode was called because I_DIRTY_TIME was set. Signed-off-by: Christoph Hellwig Reviewed-by: Jan Kara --- fs/inode.c | 1 - fs/sync.c | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/fs/inode.c b/fs/inode.c index ef362364d396..6295f1415761 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -1533,7 +1533,6 @@ void iput(struct inode *inode) if (atomic_dec_and_lock(&inode->i_count, &inode->i_lock)) { if (inode->i_nlink && (inode->i_state & I_DIRTY_TIME)) { atomic_inc(&inode->i_count); - inode->i_state &= ~I_DIRTY_TIME; spin_unlock(&inode->i_lock); trace_writeback_lazytime_iput(inode); mark_inode_dirty_sync(inode); diff --git a/fs/sync.c b/fs/sync.c index 6e0a2cbaf6de..09f0259724ff 100644 --- a/fs/sync.c +++ b/fs/sync.c @@ -187,12 +187,8 @@ int vfs_fsync_range(struct file *file, loff_t start, loff_t end, int datasync) if (!file->f_op->fsync) return -EINVAL; - if (!datasync && (inode->i_state & I_DIRTY_TIME)) { - spin_lock(&inode->i_lock); - inode->i_state &= ~I_DIRTY_TIME; - spin_unlock(&inode->i_lock); + if (!datasync && (inode->i_state & I_DIRTY_TIME)) mark_inode_dirty_sync(inode); - } return file->f_op->fsync(file, start, end, datasync); } EXPORT_SYMBOL(vfs_fsync_range);