Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp169950imd; Wed, 31 Oct 2018 16:43:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5e4vuJGzQ3EHZNNMR+MGYdudTJ8wDhqtR5YZJhr0Jf6bfxDd4QEfQyZytUkhsKRVSYpi0Es X-Received: by 2002:a65:6542:: with SMTP id a2mr4970865pgw.389.1541029428687; Wed, 31 Oct 2018 16:43:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029428; cv=none; d=google.com; s=arc-20160816; b=Vsvfku7P2Vg6FJXRiAnw815Spl9Mtxa0LrQgN5kI6LjbI735wSvrOo4FhdWxwMgc1q frHzO0XlyZZmvQFdpQAXAnuFfI02TiiXuNGSMs8GNzlbsRL196A2NGEo3msBAvMvw+CZ y72UHuCURAm88bJWLLuW/zCOiakXsXUgIZhDIfn9S8OXfKl9pfQpA55ZkSo4JfPJphjv 6tZnAjPJK0IRWZPxKIOOW0Qsm0muYjW8q1LJkjuWdcIIO/ewZLA24yceUOlpIPePdFJw 60H7KxiPPHS08wSB0lnloewJ1BtJOyVsGXo9gQHjncvhrhrZHmxNha4ebr4gqo9i6pER TXRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=yPjmuPBqr9dVaK9UqBUo+xqpmIUbNXnqRiO3EVkNxp4=; b=obCLPvXNF98AK/ZZ/Eo9CeuRig4tunTVEORV63nRa+TOH9gjtcFCju1DH/Xs6MAqwt nFDkyvvWjuxkZhIHL9mO/Xltu6Hb//XLU+By3OXqCh0LstvbVyOJJQHxLABwm5q8rDCI WX6MB+JSGv3fWaS0uHsx0A64eo8PFNrQKuXvhyOxJC5WsaIN9L3Vn5iNfAn1L1Gz2RfK UGLdlKGTRKPDhTVmM2Ga09nYZO/R5sYRT7qqMPvGBrd2vpr4x6NgqqIQYanKyaEcJqcd jApQVmefv+fP443UOdXfKAei/4Zoy7bzWjmsGKMt6q4X6752VaDVfMonuITrfMICRNra 2s9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=x6djUV58; 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 p13-v6si28996660pgj.399.2018.10.31.16.43.33; Wed, 31 Oct 2018 16:43:48 -0700 (PDT) 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=x6djUV58; 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 S1729148AbeKAIHp (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:55804 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729065AbeKAIHo (ORCPT ); Thu, 1 Nov 2018 04:07:44 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7700220854; Wed, 31 Oct 2018 23:07:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027254; bh=WEppRg14yI03jxShUlyc81xYYi3YbLXktbPkIeibCNo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x6djUV58x5GAVtNubmCcQrwv7gbqlGooIaIo4ThZ6uHQEUYjLOFo0U1pUm9MwVBJ8 gJxQ51XCt8XS13fvhoct3BTN1b9hEzGltBibgIgJc61jVhYGlFNcyvO6Sp7lePZqw6 JmNyQ1hAhQIeX1akizKn9lxNTvlNpjRXtqCnyOac= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Chao Yu , Jaegeuk Kim , Sasha Levin Subject: [PATCH AUTOSEL 4.19 124/146] f2fs: fix to recover inode's i_flags during POR Date: Wed, 31 Oct 2018 19:05:19 -0400 Message-Id: <20181031230541.28822-124-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- fs/f2fs/recovery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/recovery.c b/fs/f2fs/recovery.c index 95511ed11a22..12a3293bcbc9 100644 --- a/fs/f2fs/recovery.c +++ b/fs/f2fs/recovery.c @@ -221,6 +221,7 @@ static void recover_inode(struct inode *inode, struct page *page) 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); -- 2.17.1