Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3436440imu; Sun, 11 Nov 2018 15:04:13 -0800 (PST) X-Google-Smtp-Source: AJdET5d4pAxzxAuFRuef//m9zbhPfmeqAd+hCIb/XC9H7tIPi2CgCDHZECL8EmGURSvugTnbdsK+ X-Received: by 2002:a63:b54f:: with SMTP id u15mr15291709pgo.420.1541977453604; Sun, 11 Nov 2018 15:04:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977453; cv=none; d=google.com; s=arc-20160816; b=is1yBg3pdWHp2qN2c1Dlu5KwJwz6ItihmY16HTEXZ7cXvMUdb/++NO2lNoql3T+8sP Zl+aokX9dqUhaaVAk3786W/0gnO/89kKY4zJVkjx4gB2JIzfgmCKALa9MRrgq013mdEu dELC5h6MmZ30/WEyUg+8rJhnZqQeuHXeWD7I2heNU1Qx/amEngBbLf5rSiAA5t3++o6K umZltATfQ/0Paj1lrfsh4/7U5t8TeQpoACdhzBusF8WXdzB1rDk8Fc4fd2/MX/3oD2Dk JekCGzoTHoCC3N7yja+H51zJGBv2Hh3+M4Jla62KeU7oyYOK8g9nFywzdVzq3koom8ED 4xfw== 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=BW/rHT0FyvNnfshGSgthD+u1fOYZy/QrW3EQ+03pmUU=; b=jQdinURp6j9IAGswzS3ndq816usF4HdCpAs9agbtM+yWA8qihPToIPUbWFW2eDSxP/ mQh3Y6E6WPwqAtzGU2dUrE77TrwPNagSumHnztoUrHb8WrBG8eVghwo6xGN+2Q05hUEJ 3TteePvbrZ0YmtilpRks1wzEdaw8uXozOo5ezlT9D69Rhu7m6rEBcTVzaPfQfQ2RtNLy 0o9uaiUnypBZgz649uS7S66stF0Yxcd4hzXoonu6rQOUJuzUwIACjA06fOD+rXb0E7X0 U2VjKhmikcciaVwQRoOZcj5J3O9Y/a5XxjhUu3J7t0DLXRZiNLj5mCJFmVVyeg1nEHZW bk9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WVkgmfqc; 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 1-v6si16130204plj.146.2018.11.11.15.03.58; Sun, 11 Nov 2018 15:04:13 -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=WVkgmfqc; 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 S2390696AbeKLIw2 (ORCPT + 99 others); Mon, 12 Nov 2018 03:52:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:52394 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389403AbeKLIW2 (ORCPT ); Mon, 12 Nov 2018 03:22:28 -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 99A35224E3; Sun, 11 Nov 2018 22:32:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975551; bh=G7omjYAKFF+bTEhHApHteOZyeMnY1nwPex4/QGCA+vg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WVkgmfqcHmMe+6JvRwkIq07Z9kCKkvNrGZB4Hy/teUCl2KJnAIs6dag3/1WbX1gFc rBAWLZyT883Wnex5o4Yza/ENruTY1BxbYr/G9TpqXnH8Z8cmJesEV47joAoiL8jkMO WAEC66jKX6y27RBZpaQD1cx7UPKKaTHPvt2C3XzE= 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.14 093/222] f2fs: fix to recover inodes i_flags during POR Date: Sun, 11 Nov 2018 14:23:10 -0800 Message-Id: <20181111221656.282701351@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -210,6 +210,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); if (file_enc_name(inode)) name = "";