Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3481399imu; Sun, 11 Nov 2018 16:05:24 -0800 (PST) X-Google-Smtp-Source: AJdET5e72MMHmCZ3TK6oJ8M7wfTnqvTZObHF8MuJ93O/qQNVVbKy9GsP+bt9ctJ3kzze9Nxm6NOj X-Received: by 2002:a63:f047:: with SMTP id s7mr15444823pgj.441.1541981124849; Sun, 11 Nov 2018 16:05:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981124; cv=none; d=google.com; s=arc-20160816; b=bE1QDRJBfjaBpLemCG3hnRzVFgQo/kJrVOpXHDPxNjIeEgw8F55IeRHcdDtDvJt8J2 TQP08sp4LzJTzbEFngQNrBzK7OjiJCYkoXkuUvMBU/3JcR5ip2AxFOEVDf2Zz8zWzirF N93vFHYyb8h0jSATQSC0dFaTj7PXW6pCfBcPdq7iwi+DKst7/VOhwceJzimJIg9K3dPX mhL2Pdtkhxe2+Gicy5Lu3HWujXhb6IVrhLNl6HI/5b3w/qNvZYG3WvlRSCc8GTBCjNUf KTbflV5hI/WWlRJXzjxvlU/d2Lmxv8ndFH1/Icbj4zdpDQe6Q7THBmMwsv4J3Mv6q3Qn X3GQ== 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=n8MBJVimQ3Szjx0e6mfvoKpIrwJ8zx552z2YO12kkFI=; b=DmtzSfC828DQKnynmCZMFIGo6J+LPMd8ugHfknhafRYfNHNA02sRUlQLNLsM7p9kwi j4ibKk7oq+0aiNBntE+inSk7nk2XOYms2GvFQcxORe6Lenf1B11Wz8W471PRvthQZjai yMP06hXHOxEPKxTm1pu3qN6JQqR3EcIb/Xez+I8bmfz+CIy3WyQm/d4p0BLH7GFp0uPa UX1ntkdWCvBgsi4+mSdXBBPpcN7G/NROV3tEN9WCtGNSt/iqvZZS/2Mzo0VBo/RM+27B cWljP3CB7Y1vzuNeggtWNyaO0U0vWh1zVOcbPaZW9K/v7bV62rhKe6h059ZkYXpfuAsj +oOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="YDH+2HW/"; 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 u9si15003711pgu.570.2018.11.11.16.05.09; Sun, 11 Nov 2018 16:05:24 -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="YDH+2HW/"; 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 S1732063AbeKLIRs (ORCPT + 99 others); Mon, 12 Nov 2018 03:17:48 -0500 Received: from mail.kernel.org ([198.145.29.99]:34452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732005AbeKLIRq (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 45629208A3; 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=x+FNQHUsIZUt3lHb6Hyi05wqnu4tWjTP9DbKEX+Yx+Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YDH+2HW/yr/qbrQrjoHVuraEPnF5H2wPRQ8JoHMCyGaopmMaiamtDbSTRzKyO+dGD 3X0LFta9+j9zLQa2jUsNRleYgI5BA8IE/kAR83xcxGoppqsaOiC0BwljyAsSU1bVj3 HtEFWBHcVix1tYT4SL6iX6l6tdN6XWBm2/ODjg8A= 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 167/361] f2fs: fix to recover inodes crtime during POR Date: Sun, 11 Nov 2018 14:18:34 -0800 Message-Id: <20181111221643.822421928@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 5cd1f387a13b5188b4edb4c834310302a85a6ea2 ] Testcase to reproduce this bug: 1. mkfs.f2fs -O extra_attr -O inode_crtime /dev/sdd 2. mount -t f2fs /dev/sdd /mnt/f2fs 3. touch /mnt/f2fs/file 4. xfs_io -f /mnt/f2fs/file -c "fsync" 5. godown /mnt/f2fs 6. umount /mnt/f2fs 7. mount -t f2fs /dev/sdd /mnt/f2fs 8. xfs_io -f /mnt/f2fs/file -c "statx -r" stat.btime.tv_sec = 0 stat.btime.tv_nsec = 0 This patch fixes to recover inode creation time fields during mount. Signed-off-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/node.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2560,6 +2560,13 @@ retry: F2FS_FITS_IN_INODE(src, le16_to_cpu(src->i_extra_isize), i_projid)) dst->i_projid = src->i_projid; + + if (f2fs_sb_has_inode_crtime(sbi->sb) && + F2FS_FITS_IN_INODE(src, le16_to_cpu(src->i_extra_isize), + i_crtime_nsec)) { + dst->i_crtime = src->i_crtime; + dst->i_crtime_nsec = src->i_crtime_nsec; + } } new_ni = old_ni;