1999-11-19 <tytso@valinux.com>
+ * mkdir.c (ext2fs_mkdir): Only update the parent's inode link
+ counts if the link was successful. Patch suggested by
+ jeremy@goop.org.
+
* Makefile.in (distclean): Remove TAGS and Makefile.in.old from
the source directory.
goto cleanup;
/*
- * Update parent inode's counts
- */
- if (parent != ino) {
- retval = ext2fs_read_inode(fs, parent, &inode);
- if (retval)
- goto cleanup;
- inode.i_links_count++;
- retval = ext2fs_write_inode(fs, parent, &inode);
- if (retval)
- goto cleanup;
- }
-
- /*
* Link the directory into the filesystem hierarchy
*/
if (name) {
}
/*
+ * Update parent inode's counts
+ */
+ if (parent != ino) {
+ retval = ext2fs_read_inode(fs, parent, &inode);
+ if (retval)
+ goto cleanup;
+ inode.i_links_count++;
+ retval = ext2fs_write_inode(fs, parent, &inode);
+ if (retval)
+ goto cleanup;
+ }
+
+ /*
* Update accounting....
*/
ext2fs_mark_block_bitmap(fs->block_map, blk);