From fd2e6eb09d2d292414a895170369ca0650f4f647 Mon Sep 17 00:00:00 2001 From: cha0smaster Date: Mon, 1 Aug 2005 22:04:27 +0000 Subject: [PATCH] ntfsmount: fix nr_links for directories. --- ChangeLog | 1 + ntfsprogs/ntfsmount.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 740e1f5d..c5643dbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -22,6 +22,7 @@ xx/xx/xxxx - 1.12.0-WIP wasn't in use. (Szaka) - Fix ntfs_attr_p{read,write} to not return less bytes if trapped on unmapped runlist region. (Yura) + - Make find work correctly on volumes mounted by ntfsmount. (Yura) 20/07/2005 - 1.11.1 - Fix several ntfsmount bugs. diff --git a/ntfsprogs/ntfsmount.c b/ntfsprogs/ntfsmount.c index b9754320..aa2c96c9 100644 --- a/ntfsprogs/ntfsmount.c +++ b/ntfsprogs/ntfsmount.c @@ -264,6 +264,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf) stbuf->st_size = 0; stbuf->st_blocks = 0; } + stbuf->st_nlink = 1; /* Needed for correct find work. */ } else { stbuf->st_mode = S_IFREG | (0777 & ~ctx->fmask); na = ntfs_attr_open(ni, AT_DATA, stream_name, @@ -279,11 +280,11 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf) if (stream_name_len) res = -ENOENT; } + stbuf->st_nlink = le16_to_cpu(ni->mrec->link_count); } stbuf->st_uid = ctx->uid; stbuf->st_gid = ctx->gid; stbuf->st_ino = ni->mft_no; - stbuf->st_nlink = le16_to_cpu(ni->mrec->link_count); stbuf->st_atime = ni->atime; stbuf->st_ctime = ni->ctime; stbuf->st_mtime = ni->mtime;