Skip to contentSkip to conversation

ocfs2: Let inode be really deleted when ocfs2_mknod_locked() fails

PATCH New Jan Kara 2 participants 3 messages Oct 20, 2008 – Oct 24, 2008 OCFS2

lore
Share & tools
lore

Jan Kara

author
#0 lore raw

PATCH 1/1 ocfs2: Let inode be really deleted when ocfs2_mknod_locked() fails

We forgot to set i_nlink to 0 when returning due to error from ocfs2_mknod_locked() and thus inode was not properly released via ocfs2_delete_inode() (e.g. claimed space was not released). Fix it.

---
 fs/ocfs2/namei.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/ocfs2/namei.c +3 -1
index 0372ef0..ff1a56d 100644
@@ -495,8 +495,10 @@ leave:
 			brelse(*new_fe_bh);
 			*new_fe_bh = NULL;
 		}
-		if (inode)
+		if (inode) {
+			clear_nlink(inode);
 			iput(inode);
+		}
 	}
 
 	mlog_exit(status);
Signature · 1 line
1.5.2.4
#1 lore raw

PATCH 1/1 ocfs2: Let inode be really deleted when ocfs2_mknod_locked() fails

Quoted 5 lines · Jan Kara

We forgot to set i_nlink to 0 when returning due to error from ocfs2_mknod_locked() and thus inode was not properly released via ocfs2_delete_inode() (e.g. claimed space was not released). Fix it.

For upstream too.

Quoted 28 lines
---
 fs/ocfs2/namei.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
fs/ocfs2/namei.c +3 -1
index 0372ef0..ff1a56d 100644
@@ -495,8 +495,10 @@ leave:
 			brelse(*new_fe_bh);
 			*new_fe_bh = NULL;
 		}
-		if (inode)
+		if (inode) {
+			clear_nlink(inode);
 			iput(inode);
+		}
 	}
 
 	mlog_exit(status);
Signature · 7 lines
1.5.2.4


_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel at oss.oracle.com
http://oss.oracle.com/mailman/listinfo/ocfs2-devel
Signature · 9 lines
Life's Little Instruction Book #335

	"Every so often, push your luck."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
#2 lore raw

PATCH 1/1 ocfs2: Let inode be really deleted when ocfs2_mknod_locked() fails

Quoted 9 lines · Joel Becker
Quoted 5 lines · Jan Kara

We forgot to set i_nlink to 0 when returning due to error from ocfs2_mknod_locked() and thus inode was not properly released via ocfs2_delete_inode() (e.g. claimed space was not released). Fix it.

For upstream too.

Also in my xattr-28 branch.

Joel

Signature · 9 lines
Life's Little Instruction Book #237

	"Seek out the good in people."

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127