From 051e6d3d1c88715d21b422fbcc806ab02d61ab67 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 19 Dec 2012 10:08:06 -0600 Subject: [PATCH] do_apply_dentry_ntfs(): Adjust inode closing --- src/ntfs-apply.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/ntfs-apply.c b/src/ntfs-apply.c index 0bfc060e..ab46c917 100644 --- a/src/ntfs-apply.c +++ b/src/ntfs-apply.c @@ -506,7 +506,8 @@ out_set_dos_name: dentry->file_name_utf8); if (!ni) { ERROR_WITH_ERRNO("Could not find NTFS inode for `%s'", - dir_name); + dentry->full_path_utf8); + ntfs_inode_close(dir_ni); return WIMLIB_ERR_NTFS_3G; } } @@ -527,6 +528,15 @@ out_set_dos_name: } out_close_dir_ni: + if (ni && dir_ni) { + if (ntfs_inode_close_in_dir(ni, dir_ni) != 0) { + ni = NULL; + if (ret == 0) + ret = WIMLIB_ERR_NTFS_3G; + ERROR_WITH_ERRNO("Failed to close inode for `%s'", + dentry->full_path_utf8); + } + } if (ntfs_inode_close(dir_ni) != 0) { if (ret == 0) ret = WIMLIB_ERR_NTFS_3G; @@ -535,7 +545,8 @@ out_close_dir_ni: if (ni && ntfs_inode_close(ni) != 0) { if (ret == 0) ret = WIMLIB_ERR_NTFS_3G; - ERROR_WITH_ERRNO("Failed to close inode"); + ERROR_WITH_ERRNO("Failed to close inode for `%s'", + dentry->full_path_utf8); } return ret; } -- 2.43.0