From a81f30eaa6604348f71304d58b1162f22d6e74e9 Mon Sep 17 00:00:00 2001 From: szaka Date: Sun, 8 Jul 2007 14:27:55 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20move=20&=20hard=20link=20input/output=20?= =?UTF-8?q?error=20in=201.616=20(Nicol=C3=B2=20Chieffo,=20Szaka)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ntfs-3g.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index a9208136..d90b507d 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -994,11 +994,15 @@ static int ntfs_fuse_link(const char *old_path, const char *new_path) if (ntfs_link(ni, dir_ni, uname, uname_len)) res = -errno; exit: + /* + * Must close dir_ni first otherwise ntfs_inode_sync_file_name(ni) + * may fail because ni may not be in parent's index on the disk yet. + */ + if (dir_ni && ntfs_inode_close(dir_ni)) + set_fuse_error(&res); if (ni && ntfs_inode_close(ni)) set_fuse_error(&res); free(uname); - if (dir_ni && ntfs_inode_close(dir_ni)) - set_fuse_error(&res); free(path); return res; }