Add sanity check to ntfs_inode_close() to detect attempts at closing

extent inodes.

(Logical change 1.43)
edge.strict_endians
cantab.net!aia21 2002-12-13 15:06:29 +00:00
parent 0ae3f129fc
commit ce025a34ea
1 changed files with 8 additions and 0 deletions

View File

@ -194,9 +194,17 @@ err_out:
* and call ntfs_inode_close() again. The following error codes are defined:
*
* EBUSY @ni is dirty and/or the attribute list runlist is dirty.
* EINVAL @ni is invalid (probably it is an extent inode!)
*/
int ntfs_inode_close(ntfs_inode *ni)
{
/* If the inode is an extent inode, comply rudely! */
if (ni->nr_extents == -1) {
Dprintf("%s(): BUG: Tried to close extent inode!\n",
__FUNCTION__);
errno = EINVAL;
return -1;
}
// TODO: This needs to be replaced with a flush to disk attempt. (AIA)
if (NInoDirty(ni) || NInoAttrListDirty(ni)) {
errno = EBUSY;