mtd/fs/jffs2 write.c,1.52,1.53
David Woodhouse
dwmw2 at infradead.org
Wed Mar 27 08:36:09 EST 2002
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv29030
Modified Files:
write.c
Log Message:
Don't oops on unlinking a dirent which was pointing to a nonexistent inode.
Index: write.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/write.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- write.c 8 Mar 2002 11:01:43 -0000 1.52
+++ write.c 27 Mar 2002 13:36:07 -0000 1.53
@@ -472,7 +472,8 @@
}
-int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f, const char *name, int namelen, struct jffs2_inode_info *dead_f)
+int jffs2_do_unlink(struct jffs2_sb_info *c, struct jffs2_inode_info *dir_f,
+ const char *name, int namelen, struct jffs2_inode_info *dead_f)
{
struct jffs2_raw_dirent *rd;
struct jffs2_full_dirent *fd;
@@ -522,7 +523,10 @@
jffs2_complete_reservation(c);
up(&dir_f->sem);
- if (dead_f) { /* Null if this was a rename not a real unlink */
+ /* dead_f is NULL if this was a rename not a real unlink */
+ /* Also catch the !f->inocache case, where there was a dirent
+ pointing to an inode which didn't exist. */
+ if (dead_f && dead_f->inocache) {
down(&dead_f->sem);
More information about the linux-mtd-cvs
mailing list