Skip to contentSkip to conversation

ocfs2: let ocfs2_dir_foreach return the error turned by filldir

PATCH New Wengang Wang 2 participants 4 messages Jul 6, 2011 – Jul 8, 2011 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 2/3 ocfs2: let ocfs2_dir_foreach return the error turned by filldir

Let ocfs2_dir_foreach return the error turned by filldir.

---
 fs/ocfs2/dir.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/ocfs2/dir.c +2 -0
index 8582e3f..6d7560a 100644
@@ -2005,6 +2005,8 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
 
 	if (ret > 0)
 		ret = -EIO;
+	if (!ret)
+		ret = filldir_err;
 
 	return 0;
 }
Signature · 1 line
1.7.5.2
#1 lore raw

PATCH 2/3 ocfs2: let ocfs2_dir_foreach return the error turned by filldir

Quoted 12 lines · Wengang Wang

Let ocfs2_dir_foreach return the error turned by filldir.

---
  fs/ocfs2/dir.c |    2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)
fs/ocfs2/dir.c +0 -0
index 8582e3f..6d7560a 100644

fs/ocfs2/dir.c int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, · line 2012

Quoted 8 lines
fs/ocfs2/dir.c +2 -0
@@ -2005,6 +2005,8 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
 
  	if (ret>  0)
  		ret = -EIO;
+	if (!ret)
+		ret = filldir_err;
 
  	return 0;
  }

That's not enough. Shouldn't it be "return ret" too.

Have you triggered this error manually? I have never seen reports of it before.

#2 lore raw

PATCH 2/3 ocfs2: let ocfs2_dir_foreach return the error turned by filldir

Quoted 19 lines · Sunil Mushran
Quoted 18 lines · Wengang Wang

Let ocfs2_dir_foreach return the error turned by filldir.

---
 fs/ocfs2/dir.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/ocfs2/dir.c +2 -0
index 8582e3f..6d7560a 100644
@@ -2005,6 +2005,8 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
 
 	if (ret>  0)
 		ret = -EIO;
+	if (!ret)
+		ret = filldir_err;
 
Quoted 4 lines

fs/ocfs2/dir.c int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, · line 2012

Quoted 2 lines
fs/ocfs2/dir.c +0 -0
 	return 0;
 }

That's not enough. Shouldn't it be "return ret" too.

If neccesary, We can return both ret and filldir_err.

Quoted 3 lines

Have you triggered this error manually? I have never seen reports of it before.

No error here. This change is only needed for the following patch:
[PATCH 3/3] ocfs2: drop and retake orphan_dir.i_mutex in ocfs2_recover_orphans.

thanks,
wengang.

#3 lore raw

PATCH 2/3 ocfs2: let ocfs2_dir_foreach return the error turned by filldir

Quoted 15 lines · Wengang Wang
Quoted 14 lines · Sunil Mushran
Quoted 13 lines · Wengang Wang

Let ocfs2_dir_foreach return the error turned by filldir.

---
 fs/ocfs2/dir.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/ocfs2/dir.c +0 -0
index 8582e3f..6d7560a 100644
@@ -2005,6 +2005,8 @@ int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv,
 
Quoted 6 lines
Quoted 6 lines

fs/ocfs2/dir.c int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, · line 2011

Quoted 6 lines
fs/ocfs2/dir.c +2 -0
 	if (ret>  0)
 		ret = -EIO;
+	if (!ret)
+		ret = filldir_err;
 
 	return 0;

I meant "return ret" here.

Quoted 14 lines
Quoted 3 lines

fs/ocfs2/dir.c int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, · line 2012

Quoted 1 line
fs/ocfs2/dir.c +0 -0
 }

That's not enough. Shouldn't it be "return ret" too.

If neccesary, We can return both ret and filldir_err.

Quoted 3 lines

Have you triggered this error manually? I have never seen reports of it before.

No error here. This change is only needed for the following patch:
[PATCH 3/3] ocfs2: drop and retake orphan_dir.i_mutex in ocfs2_recover_orphans.

thanks,
wengang.