Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3482125imu; Sun, 11 Nov 2018 16:06:21 -0800 (PST) X-Google-Smtp-Source: AJdET5dpmqxlcj91IPPm30zXRx8NwGBi5nJNcJi9RexkLpLHCxy91aq7ZeJx8TW1jM5OuwB8aOmP X-Received: by 2002:a17:902:7e4c:: with SMTP id a12-v6mr17533119pln.149.1541981181164; Sun, 11 Nov 2018 16:06:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981181; cv=none; d=google.com; s=arc-20160816; b=vyFokUujYrjx2LW2ohO4eKeZH6CATgHDMtvrw5OVT8mt0CEbcEz7GTXtsuS+eLXdIK F/C2gRr+ggiE9bSBbpAgQ3k3+MwPSwzsxLhJk0asR59bDRa4GMQQAwXWKq2QEPWwIdq8 119geEf+1QUAMyzxwxAgMrY0dV42Ajy1SOBi8YoPBfCZTrIqtfm/WpqqD2nmWJP0JfjJ 4psE6FxD4EEzgcNMehaDlKjdR1jzgGzsNqkeXTmEFOcoXmUuN97wEom83LfkI0qxHAF/ +NjFYM+ZrCmL9pYpW2oqNB27sTV84pQdNMjZWLCmVOgveyo4MesPq/tctUaJeXmqPUX0 NCoQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7dPnfdzSDbOIDQVXvabtWpwcsmFu4qhKJhcIyrSFrhM=; b=sgsCAx7Adex915XkVgUSH2EE0qojf5boiEihXg3z6GZZIj39qBE8KWVoxe6UDLJphH hKK9RkihK1aOfXktzziJtOVksn0NvSUr8qvLQVFLOZhGN99qAUf1GiCL2gFj9FdhXjkF hC1FQ1HYXh/pujgrEcC/X7psFMDcRm4VYRhNA7T7Ay+slVpqiXOXE/Wj4veTIWjPyxsj RAZzcMwnKdG+gTHCIr6C/3yDrZS2jKQZl3iqLFy1W+8XiX8Esigc14gbwFexShmDOeji kzXeK+661KbFY3N48B8fcJCJE5trEyvnxcIUlqbORh7byYp21/turppT23SJLVYA7QrZ X5Wg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=si6n2FaL; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x87-v6si17600965pfk.54.2018.11.11.16.06.06; Sun, 11 Nov 2018 16:06:21 -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=si6n2FaL; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732035AbeKLIRr (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:34236 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731952AbeKLIRq (ORCPT ); Mon, 12 Nov 2018 03:17:46 -0500 Received: from localhost (unknown [206.108.79.134]) (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 951C121508; Sun, 11 Nov 2018 22:27:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975270; bh=oYnvL0Ggg3BLILL11W8IH8YtSajmxbMSO5mIwFpDyBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=si6n2FaL0j9UwPZuVhW0lT/X3Y1QReeXGXZRnDz2UAjEmkU7654LwHJMis8DGt7hD o683nkr2eT/N0RFaIAUpKf9O5gVH/TCI+Pp3EtkIPS65cI+g7wDTZpNJHw7rTu8ssf AscARD0t6csYWfk6e7HbFT4hwfHgoo+bi2xg1RfU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH 4.19 168/361] f2fs: fix to recover inodes i_flags during POR Date: Sun, 11 Nov 2018 14:18:35 -0800 Message-Id: <20181111221643.921901096@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Chao Yu [ Upstream commit 19c73a691ccf6fb2f12d4e9cf9830023966cec88 ] Testcase to reproduce this bug: 1. mkfs.f2fs /dev/sdd 2. mount -t f2fs /dev/sdd /mnt/f2fs 3. touch /mnt/f2fs/file 4. sync 5. chattr +A /mnt/f2fs/file 6. xfs_io -f /mnt/f2fs/file -c "fsync" 7. godown /mnt/f2fs 8. umount /mnt/f2fs 9. mount -t f2fs /dev/sdd /mnt/f2fs 10. lsattr /mnt/f2fs/file -----------------N- /mnt/f2fs/file But actually, we expect the corrct result is: -------A---------N- /mnt/f2fs/file The reason is we didn't recover inode.i_flags field during mount, fix it. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/recovery.c | 1 + 1 file changed, 1 insertion(+) --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -221,6 +221,7 @@ static void recover_inode(struct inode * inode->i_mtime.tv_nsec = le32_to_cpu(raw->i_mtime_nsec); F2FS_I(inode)->i_advise = raw->i_advise; + F2FS_I(inode)->i_flags = le32_to_cpu(raw->i_flags); recover_inline_flags(inode, raw);