linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH] f2fs: recovery missing dot dentries in root directory
@ 2016-02-26  6:39 Liu Xue
  2016-02-26 11:37 ` Chao Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Xue @ 2016-02-26  6:39 UTC (permalink / raw)
  To: linux-f2fs-devel, jaegeuk

If f2fs was corrupted with missing dot dentries in root dirctory,
it needs to recover them after fsck.f2fs set F2FS_INLINE_DOTS flag
in directory inode when fsck.f2fs detects missing dot dentries.

Signed-off-by: Xue Liu <liuxueliu.liu@huawei.com>
Signed-off-by: Yong Sheng <shengyong1@huawei.com>
---
 fs/f2fs/namei.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/f2fs/namei.c b/fs/f2fs/namei.c
index 55a7362..7b07a47 100644
--- a/fs/f2fs/namei.c
+++ b/fs/f2fs/namei.c
@@ -260,6 +260,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 	struct page *page;
 	nid_t ino;
 	int err = 0;
+	unsigned int root_ino = F2FS_ROOT_INO(F2FS_I_SB(dir));
 
 	if (f2fs_encrypted_inode(dir)) {
 		int res = fscrypt_get_encryption_info(dir);
@@ -291,6 +292,12 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 	if (IS_ERR(inode))
 		return ERR_CAST(inode);
 
+	if ((dir->i_ino == root_ino) && f2fs_has_inline_dots(dir)) {
+		err = __recover_dot_dentries(dir, root_ino);
+		if (err)
+			goto err_out;
+	}
+
 	if (f2fs_has_inline_dots(inode)) {
 		err = __recover_dot_dentries(inode, dir->i_ino);
 		if (err)
-- 
1.8.5.2


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [RFC PATCH] f2fs: recovery missing dot dentries in root directory
  2016-02-26  6:39 [RFC PATCH] f2fs: recovery missing dot dentries in root directory Liu Xue
@ 2016-02-26 11:37 ` Chao Yu
  0 siblings, 0 replies; 2+ messages in thread
From: Chao Yu @ 2016-02-26 11:37 UTC (permalink / raw)
  To: 'Liu Xue', linux-f2fs-devel, jaegeuk

> -----Original Message-----
> From: Liu Xue [mailto:liuxueliu.liu@huawei.com]
> Sent: Friday, February 26, 2016 2:39 PM
> To: linux-f2fs-devel@lists.sourceforge.net; jaegeuk@kernel.org
> Subject: [f2fs-dev] [RFC PATCH] f2fs: recovery missing dot dentries in root directory
> 
> If f2fs was corrupted with missing dot dentries in root dirctory,
> it needs to recover them after fsck.f2fs set F2FS_INLINE_DOTS flag
> in directory inode when fsck.f2fs detects missing dot dentries.
> 
> Signed-off-by: Xue Liu <liuxueliu.liu@huawei.com>
> Signed-off-by: Yong Sheng <shengyong1@huawei.com>

Reviewed-by: Chao Yu <chao2.yu@samsung.com>


------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-26 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-02-26  6:39 [RFC PATCH] f2fs: recovery missing dot dentries in root directory Liu Xue
2016-02-26 11:37 ` Chao Yu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).