Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp826505imu; Tue, 27 Nov 2018 23:33:49 -0800 (PST) X-Google-Smtp-Source: AFSGD/W66N0tucW/ahKnRE9MrEbNSpOMn0KOHQ6NYi8PZwA+qt30AgEf0Ye8GaPTe2vsi2Mxnc2f X-Received: by 2002:a17:902:50e3:: with SMTP id c32mr36129299plj.318.1543390429179; Tue, 27 Nov 2018 23:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543390429; cv=none; d=google.com; s=arc-20160816; b=S7/Ext4+2jXdP+/Ae67C6qvE6pM8+iw11sUWhEBr9p24EsOarx1j1C9hxdJLkwhTtY uDWYPueobDpAL2xZZCudSjo5PVWy72cUpwLkYp0CN7s1dIp7qC/tkeID++2f4Zx8RSR/ i7YRHnXHC9Kn0nmcLhlar+BSXoWLFhzdDZBPErLATeHzxVIXBqxhdTeV0m9zRuk3UHXf ciTKmO3v2SOty9tvVtfBLy39IQIj61QOE6L4pv9v0/Xi6JqGqGi7AgbOeAuRDeMYEkWu +dq9JTbVKdRzkoNFZ7BGv9P3SQDvQDzg/ANrkLWxcq2LBeePx9eUwYGlBp65KVAVZDFK 0JYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=deCkas6LKPp5rFEAEZNyEYSUK5xhGoq54C4DUPaZe6U=; b=W51Jz2gstaWK1xAkSFmqNIrxB6BQtvBlz8/TLMS9ligtDgs9f7CdF2z3MLsPhMV2go n0gGsE7Cg5ulNKjq+Yx3j7FtaiH2uj1Fq5iDIzpcso7DHs8pLfyzOnZ2zbJNmOxj+cw+ h+dLBAJd7Dm8PuGPxvr+j2PfyQkbkKE3HzGsaBmzl1rAkkblBa2kqEaQ3k55Ix7Ztrfg Sddv0k8zoTh3bNdM1BrtHNM56pYA/Np5IGqfABVSyjZdEQfaLh13LOv4ABvTZldHk5EE Zeh62IkH+JG2Zaphmg1Sa1qIrGXRXOq8pACSkA0DXAzVnOvaghhOneDHwe8Bx0JPdnol nFvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HSBlO/iG"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si6088259pgq.275.2018.11.27.23.33.34; Tue, 27 Nov 2018 23:33:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="HSBlO/iG"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727721AbeK1ScI (ORCPT + 99 others); Wed, 28 Nov 2018 13:32:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:34450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727247AbeK1ScI (ORCPT ); Wed, 28 Nov 2018 13:32:08 -0500 Received: from localhost (c-98-234-55-98.hsd1.ca.comcast.net [98.234.55.98]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8AD3C2081C; Wed, 28 Nov 2018 07:31:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1543390287; bh=efG1lFb7OfdNX4ha2wALj6Azj5KdX1EZ/9zicD6jDMY=; h=From:To:Cc:Subject:Date:From; b=HSBlO/iGbb6tyD7CXJyknheK0ylkYvY29uPRRNK/1tjbhGMQy5NWpjUv9wqDP1SJl QfwxKmlMH9rwDx0vEaRV6ZL4LcW4fa7nV+WuK3MWqGbCBazLN0F+VjuXPxA4cFsz/M Vcl9Rq0/WNpPKpHucJOaMNWQWnlxDp5HoFmrfyNE= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH] f2fs: avoid frequent costly fsck triggers Date: Tue, 27 Nov 2018 23:31:25 -0800 Message-Id: <20181128073125.39102-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If we want to re-enable nat_bits, we rely on fsck which requires full scan of directory tree. Let's do that by regular fsck or unclean shutdown. Signed-off-by: Jaegeuk Kim --- fs/f2fs/f2fs.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index c28a9d1cb278..aa500239baf2 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -1621,7 +1621,11 @@ static inline void disable_nat_bits(struct f2fs_sb_info *sbi, bool lock) { unsigned long flags; - set_sbi_flag(sbi, SBI_NEED_FSCK); + /* + * In order to re-enable nat_bits we need to call fsck.f2fs by + * set_sbi_flag(sbi, SBI_NEED_FSCK). But it may give huge cost, + * so let's rely on regular fsck or unclean shutdown. + */ if (lock) spin_lock_irqsave(&sbi->cp_lock, flags); -- 2.19.0.605.g01d371f741-goog