Commit 97550c74 authored by Namjae Jeon's avatar Namjae Jeon Committed by Steve French

ksmbd: fix same UniqueId for dot and dotdot entries

ksmbd sets the inode number to UniqueId. However, the same UniqueId for
dot and dotdot entry is set to the inode number of the parent inode.
This patch set them using the current inode and parent inode.
Signed-off-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 6d896d3b
...@@ -308,14 +308,17 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level, ...@@ -308,14 +308,17 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level,
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
struct kstat kstat; struct kstat kstat;
struct ksmbd_kstat ksmbd_kstat; struct ksmbd_kstat ksmbd_kstat;
struct dentry *dentry;
if (!dir->dot_dotdot[i]) { /* fill dot entry info */ if (!dir->dot_dotdot[i]) { /* fill dot entry info */
if (i == 0) { if (i == 0) {
d_info->name = "."; d_info->name = ".";
d_info->name_len = 1; d_info->name_len = 1;
dentry = dir->filp->f_path.dentry;
} else { } else {
d_info->name = ".."; d_info->name = "..";
d_info->name_len = 2; d_info->name_len = 2;
dentry = dir->filp->f_path.dentry->d_parent;
} }
if (!match_pattern(d_info->name, d_info->name_len, if (!match_pattern(d_info->name, d_info->name_len,
...@@ -327,7 +330,7 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level, ...@@ -327,7 +330,7 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level,
ksmbd_kstat.kstat = &kstat; ksmbd_kstat.kstat = &kstat;
ksmbd_vfs_fill_dentry_attrs(work, ksmbd_vfs_fill_dentry_attrs(work,
user_ns, user_ns,
dir->filp->f_path.dentry->d_parent, dentry,
&ksmbd_kstat); &ksmbd_kstat);
rc = fn(conn, info_level, d_info, &ksmbd_kstat); rc = fn(conn, info_level, d_info, &ksmbd_kstat);
if (rc) if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment