summaryrefslogtreecommitdiff
path: root/fs/jffs2/fs.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-08 04:10:06 +0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-08 04:10:06 +0400
commit3975d16760d4be7402d1067c548c30c427971331 (patch)
tree4fa12ee1e8aabf1352307455163dabe293ed4874 /fs/jffs2/fs.c
parent4d3d769c605ebdf9fbb5a9d63827598b48351861 (diff)
parent1c24d06f8e065023ebb428db5af5514500839ee6 (diff)
downloadlinux-3975d16760d4be7402d1067c548c30c427971331.tar.xz
Merge git://git.infradead.org/~dwmw2/mtd-2.6.35
* git://git.infradead.org/~dwmw2/mtd-2.6.35: jffs2: update ctime when changing the file's permission by setfacl jffs2: Fix NFS race by using insert_inode_locked() jffs2: Fix in-core inode leaks on error paths mtd: Fix NAND submenu mtd/r852: update card detect early. mtd/r852: Fixes in case of DMA timeout mtd/r852: register IRQ as last step drivers/mtd: Use memdup_user docbook: make mtd nand module init static
Diffstat (limited to 'fs/jffs2/fs.c')
-rw-r--r--fs/jffs2/fs.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/fs/jffs2/fs.c b/fs/jffs2/fs.c
index 8bc2c80ab159..459d39d1ea0b 100644
--- a/fs/jffs2/fs.c
+++ b/fs/jffs2/fs.c
@@ -465,7 +465,12 @@ struct inode *jffs2_new_inode (struct inode *dir_i, int mode, struct jffs2_raw_i
inode->i_blocks = 0;
inode->i_size = 0;
- insert_inode_hash(inode);
+ if (insert_inode_locked(inode) < 0) {
+ make_bad_inode(inode);
+ unlock_new_inode(inode);
+ iput(inode);
+ return ERR_PTR(-EINVAL);
+ }
return inode;
}