Fixed avoidance of a double opening of an inode in create()

N2009_11_14_FIXES
jpandre 2009-09-18 19:51:10 +00:00
parent b46c8daad5
commit 61f7084020
2 changed files with 4 additions and 7 deletions

View File

@ -668,11 +668,8 @@ static int ntfs_inode_sync_file_name(ntfs_inode *ni)
}
ntfs_index_entry_mark_dirty(ictx);
ntfs_index_ctx_put(ictx);
if (ni != index_ni) {
ntfs_inode_update_times(index_ni, NTFS_UPDATE_CTIME);
if (ntfs_inode_close(index_ni) && !err)
err = errno;
}
if ((ni != index_ni) && ntfs_inode_close(index_ni) && !err)
err = errno;
}
/* Check for real error occurred. */
if (errno != ENOENT) {

View File

@ -1466,8 +1466,8 @@ static int ntfs_fuse_create(const char *org_path, mode_t typemode, dev_t dev,
NInoSetDirty(ni);
/*
* closing ni will necessitate to open dir_ni to
* synchronize the index, which will update the change
* time again. Better avoid a dangerous double opening.
* synchronize the index.
* Better avoid a dangerous double opening.
*/
ntfs_fuse_update_times(dir_ni, NTFS_UPDATE_MCTIME);
if (ntfs_inode_close(dir_ni))