Skip to contentSkip to conversation

f2fs: fix to stop recovering dot dentries in a readonly fs

PATCH Superseded Chao Yu 2 participants 4 messages Dec 28, 2015 – Dec 30, 2015 F2FS file system

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Chao Yu

author
#0 lore raw

PATCH 1/1 f2fs: fix to stop recovering dot dentries in a readonly fs

If filesystem is readonly, don't recover inline dot inode.

---
 fs/f2fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/namei.c +1 -1
index 5cc4128..b4a5836 100644
@@ -269,7 +269,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 	if (IS_ERR(inode))
 		return ERR_CAST(inode);
 
-	if (f2fs_has_inline_dots(inode)) {
+	if (f2fs_has_inline_dots(inode) && !f2fs_readonly(dir->i_sb)) {
 		err = __recover_dot_dentries(inode, dir->i_ino);
 		if (err)
 			goto err_out;
Signature · 1 line
2.6.3
maintainer
#1 lore raw

Hi Chao,

Quoted 12 lines · Chao Yu

If filesystem is readonly, don't recover inline dot inode.

---
 fs/f2fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/namei.c +0 -0
index 5cc4128..b4a5836 100644

fs/f2fs/namei.c static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, · line 272

Quoted 5 lines
fs/f2fs/namei.c +1 -1
@@ -269,7 +269,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 	if (IS_ERR(inode))
 		return ERR_CAST(inode);
 
-	if (f2fs_has_inline_dots(inode)) {
+	if (f2fs_has_inline_dots(inode) && !f2fs_readonly(dir->i_sb)) {

We need to return -EROFS if f2fs is readonly?

Thanks,

Quoted 6 lines
fs/f2fs/namei.c +0 -0
 		err = __recover_dot_dentries(inode, dir->i_ino);
 		if (err)
 			goto err_out;
Signature · 1 line
2.6.3
author
#2 lore raw

Hi Jaegeuk,

Quoted 25 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Tuesday, December 29, 2015 6:54 AM
To: Chao Yu
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] f2fs: fix to stop recovering dot dentries in a readonly fs

Hi Chao,

Quoted 15 lines · Chao Yu

If filesystem is readonly, don't recover inline dot inode.

---
 fs/f2fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/namei.c +0 -0
index 5cc4128..b4a5836 100644
@@ -269,7 +269,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 	if (IS_ERR(inode))
 		return ERR_CAST(inode);
 
Quoted 4 lines

fs/f2fs/namei.c static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, · line 272

Quoted 2 lines
fs/f2fs/namei.c +1 -1
-	if (f2fs_has_inline_dots(inode)) {
+	if (f2fs_has_inline_dots(inode) && !f2fs_readonly(dir->i_sb)) {

We need to return -EROFS if f2fs is readonly?

In a readonly mountpoint, we should still allow user to stat file/dir in directory structure, rather than returning -EROFS when trying to recover, Right?

Thanks,

Quoted 9 lines

Thanks,

Quoted 6 lines
fs/f2fs/namei.c +0 -1
 		err = __recover_dot_dentries(inode, dir->i_ino);
 		if (err)
 			goto err_out;
--

2.6.3

maintainer
#3 lore raw

Hi Chao,

Quoted 27 lines · Chao Yu

Hi Jaegeuk,

Quoted 25 lines

-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Tuesday, December 29, 2015 6:54 AM
To: Chao Yu
Cc: [email protected]; [email protected]
Subject: Re: [PATCH] f2fs: fix to stop recovering dot dentries in a readonly fs

Hi Chao,

Quoted 15 lines · Chao Yu

If filesystem is readonly, don't recover inline dot inode.

---
 fs/f2fs/namei.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/namei.c +0 -0
index 5cc4128..b4a5836 100644
@@ -269,7 +269,7 @@ static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry,
 	if (IS_ERR(inode))
 		return ERR_CAST(inode);
 
Quoted 8 lines
Quoted 4 lines

fs/f2fs/namei.c static struct dentry *f2fs_lookup(struct inode *dir, struct dentry *dentry, · line 272

Quoted 2 lines
fs/f2fs/namei.c +1 -1
-	if (f2fs_has_inline_dots(inode)) {
+	if (f2fs_has_inline_dots(inode) && !f2fs_readonly(dir->i_sb)) {

We need to return -EROFS if f2fs is readonly?

In a readonly mountpoint, we should still allow user to stat file/dir in directory structure, rather than returning -EROFS when trying to recover, Right?

As you suggested, we'd better remain some kernel messages. ;)

Thanks,

Quoted 12 lines

Thanks,

Quoted 9 lines

Thanks,

Quoted 6 lines
fs/f2fs/namei.c +0 -1
 		err = __recover_dot_dentries(inode, dir->i_ino);
 		if (err)
 			goto err_out;
--

2.6.3