Commit d58fc33e authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] hfsplus: delete inode properly

From: Roman Zippel <zippel@linux-m68k.org>

Call hfsplus_delete_inode() to delete an inode when adding it to the
filesystem failed, so superblock info is correctly updated.
parent 543481c9
...@@ -241,6 +241,7 @@ int hfsplus_create(struct inode *dir, struct dentry *dentry, int mode, ...@@ -241,6 +241,7 @@ int hfsplus_create(struct inode *dir, struct dentry *dentry, int mode,
res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
if (res) { if (res) {
inode->i_nlink = 0; inode->i_nlink = 0;
hfsplus_delete_inode(inode);
iput(inode); iput(inode);
return res; return res;
} }
...@@ -357,6 +358,7 @@ int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, int mode) ...@@ -357,6 +358,7 @@ int hfsplus_mkdir(struct inode *dir, struct dentry *dentry, int mode)
res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
if (res) { if (res) {
inode->i_nlink = 0; inode->i_nlink = 0;
hfsplus_delete_inode(inode);
iput(inode); iput(inode);
return res; return res;
} }
...@@ -397,7 +399,8 @@ int hfsplus_symlink(struct inode *dir, struct dentry *dentry, const char *symnam ...@@ -397,7 +399,8 @@ int hfsplus_symlink(struct inode *dir, struct dentry *dentry, const char *symnam
res = page_symlink(inode, symname, strlen(symname) + 1); res = page_symlink(inode, symname, strlen(symname) + 1);
if (res) { if (res) {
inode->i_nlink = 0; inode->i_nlink = 0;
iput (inode); hfsplus_delete_inode(inode);
iput(inode);
return res; return res;
} }
...@@ -426,6 +429,7 @@ int hfsplus_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev ...@@ -426,6 +429,7 @@ int hfsplus_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev
res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode); res = hfsplus_create_cat(inode->i_ino, dir, &dentry->d_name, inode);
if (res) { if (res) {
inode->i_nlink = 0; inode->i_nlink = 0;
hfsplus_delete_inode(inode);
iput(inode); iput(inode);
return res; return res;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment