ChangeLog, mkdir.c:

mkdir.c (ext2fs_mkdir): Only update the parent's inode link counts if
  	the link was successful.  Patch suggested by jeremy@goop.org.
bitmap-optimize
Theodore Ts'o 1999-11-19 18:49:27 +00:00
parent 5c36a2f85b
commit dab278af81
2 changed files with 17 additions and 13 deletions

View File

@ -1,5 +1,9 @@
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.

View File

@ -94,19 +94,6 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum,
if (retval)
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
*/
@ -125,6 +112,19 @@ errcode_t ext2fs_mkdir(ext2_filsys fs, ino_t parent, ino_t inum,
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;
}
/*
* Update accounting....
*/