Commit 5614c8c4 authored by Marios Makassikis's avatar Marios Makassikis Committed by Steve French

ksmbd: replace generic_fillattr with vfs_getattr

generic_fillattr should not be used outside of ->getattr
implementations.

Use vfs_getattr instead, and adapt functions to return an
error code to the caller.

Cc: stable@vger.kernel.org
Signed-off-by: default avatarMarios Makassikis <mmakassikis@freebox.fr>
Acked-by: default avatarNamjae Jeon <linkinjeon@kernel.org>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent e8f897f4
This diff is collapsed.
......@@ -457,10 +457,13 @@ int ksmbd_populate_dot_dotdot_entries(struct ksmbd_work *work, int info_level,
}
ksmbd_kstat.kstat = &kstat;
ksmbd_vfs_fill_dentry_attrs(work,
idmap,
dentry,
&ksmbd_kstat);
rc = ksmbd_vfs_fill_dentry_attrs(work,
idmap,
dentry,
&ksmbd_kstat);
if (rc)
break;
rc = fn(conn, info_level, d_info, &ksmbd_kstat);
if (rc)
break;
......
......@@ -1682,11 +1682,19 @@ int ksmbd_vfs_fill_dentry_attrs(struct ksmbd_work *work,
struct dentry *dentry,
struct ksmbd_kstat *ksmbd_kstat)
{
struct ksmbd_share_config *share_conf = work->tcon->share_conf;
u64 time;
int rc;
struct path path = {
.mnt = share_conf->vfs_path.mnt,
.dentry = dentry,
};
generic_fillattr(idmap, STATX_BASIC_STATS, d_inode(dentry),
ksmbd_kstat->kstat);
rc = vfs_getattr(&path, ksmbd_kstat->kstat,
STATX_BASIC_STATS | STATX_BTIME,
AT_STATX_SYNC_AS_STAT);
if (rc)
return rc;
time = ksmbd_UnixTimeToNT(ksmbd_kstat->kstat->ctime);
ksmbd_kstat->create_time = time;
......
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