diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index d351d83e..65422461 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -709,7 +709,8 @@ static int ntfs_fuse_getstat(struct SECURITY_CONTEXT *scx, if (ni->flags & FILE_ATTR_SYSTEM) { na = ntfs_attr_open(ni, AT_DATA, AT_UNNAMED, 0); if (!na) { - goto exit; + stbuf->st_ino = ni->mft_no; + goto nodata; } /* Check whether it's Interix FIFO or socket. */ if (!(ni->flags & FILE_ATTR_HIDDEN)) { @@ -779,6 +780,7 @@ static int ntfs_fuse_getstat(struct SECURITY_CONTEXT *scx, } if (S_ISLNK(stbuf->st_mode)) stbuf->st_mode |= 0777; +nodata : stbuf->st_ino = ni->mft_no; #ifdef HAVE_STRUCT_STAT_ST_ATIMESPEC stbuf->st_atimespec = ntfs2timespec(ni->last_access_time); diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 2946ab91..ccd1f888 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -783,9 +783,11 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf) na = ntfs_attr_open(ni, AT_DATA, stream_name, stream_name_len); if (!na) { - if (stream_name_len) + if (stream_name_len) { res = -ENOENT; - goto exit; + goto exit; + } else + goto nodata; } if (stream_name_len) { stbuf->st_size = na->data_size; @@ -869,6 +871,7 @@ static int ntfs_fuse_getattr(const char *org_path, struct stat *stbuf) } if (S_ISLNK(stbuf->st_mode)) stbuf->st_mode |= 0777; +nodata : stbuf->st_ino = ni->mft_no; #ifdef HAVE_STRUCT_STAT_ST_ATIMESPEC stbuf->st_atimespec = ntfs2timespec(ni->last_access_time);