Skip to content

Commit

Permalink
fs: pass the request_mask to generic_fillattr
Browse files Browse the repository at this point in the history
generic_fillattr just fills in the entire stat struct indiscriminately
today, copying data from the inode. There is at least one attribute
(STATX_CHANGE_COOKIE) that can have side effects when it is reported,
and we're looking at adding more with the addition of multigrain
timestamps.

Add a request_mask argument to generic_fillattr and have most callers
just pass in the value that is passed to getattr. Have other callers
(e.g. ksmbd) just pass in STATX_BASIC_STATS. Also move the setting of
STATX_CHANGE_COOKIE into generic_fillattr.

Acked-by: Joseph Qi <[email protected]>
Reviewed-by: Xiubo Li <[email protected]>
Reviewed-by: "Paulo Alcantara (SUSE)" <[email protected]>
Reviewed-by: Jan Kara <[email protected]>
Signed-off-by: Jeff Layton <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Christian Brauner <[email protected]>
  • Loading branch information
jtlayton authored and brauner committed Aug 9, 2023
1 parent b3030e4 commit 0d72b92
Show file tree
Hide file tree
Showing 40 changed files with 73 additions and 65 deletions.
4 changes: 2 additions & 2 deletions fs/9p/vfs_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ v9fs_vfs_getattr(struct mnt_idmap *idmap, const struct path *path,
p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
v9ses = v9fs_dentry2v9ses(dentry);
if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) {
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
return 0;
} else if (v9ses->cache & CACHE_WRITEBACK) {
if (S_ISREG(inode->i_mode)) {
Expand All @@ -1037,7 +1037,7 @@ v9fs_vfs_getattr(struct mnt_idmap *idmap, const struct path *path,
return PTR_ERR(st);

v9fs_stat2inode(st, d_inode(dentry), dentry->d_sb, 0);
generic_fillattr(&nop_mnt_idmap, d_inode(dentry), stat);
generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(dentry), stat);

p9stat_free(st);
kfree(st);
Expand Down
4 changes: 2 additions & 2 deletions fs/9p/vfs_inode_dotl.c
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,7 @@ v9fs_vfs_getattr_dotl(struct mnt_idmap *idmap,
p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
v9ses = v9fs_dentry2v9ses(dentry);
if (v9ses->cache & (CACHE_META|CACHE_LOOSE)) {
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
return 0;
} else if (v9ses->cache) {
if (S_ISREG(inode->i_mode)) {
Expand All @@ -476,7 +476,7 @@ v9fs_vfs_getattr_dotl(struct mnt_idmap *idmap,
return PTR_ERR(st);

v9fs_stat2inode_dotl(st, d_inode(dentry), 0);
generic_fillattr(&nop_mnt_idmap, d_inode(dentry), stat);
generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(dentry), stat);
/* Change block size to what the server returned */
stat->blksize = st->st_blksize;

Expand Down
2 changes: 1 addition & 1 deletion fs/afs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -773,7 +773,7 @@ int afs_getattr(struct mnt_idmap *idmap, const struct path *path,

do {
read_seqbegin_or_lock(&vnode->cb_lock, &seq);
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
if (test_bit(AFS_VNODE_SILLY_DELETED, &vnode->flags) &&
stat->nlink > 0)
stat->nlink -= 1;
Expand Down
2 changes: 1 addition & 1 deletion fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -8746,7 +8746,7 @@ static int btrfs_getattr(struct mnt_idmap *idmap,
STATX_ATTR_IMMUTABLE |
STATX_ATTR_NODUMP);

generic_fillattr(idmap, inode, stat);
generic_fillattr(idmap, request_mask, inode, stat);
stat->dev = BTRFS_I(inode)->root->anon_dev;

spin_lock(&BTRFS_I(inode)->lock);
Expand Down
2 changes: 1 addition & 1 deletion fs/ceph/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2467,7 +2467,7 @@ int ceph_getattr(struct mnt_idmap *idmap, const struct path *path,
return err;
}

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
stat->ino = ceph_present_inode(inode);

/*
Expand Down
3 changes: 2 additions & 1 deletion fs/coda/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,8 @@ int coda_getattr(struct mnt_idmap *idmap, const struct path *path,
{
int err = coda_revalidate_inode(d_inode(path->dentry));
if (!err)
generic_fillattr(&nop_mnt_idmap, d_inode(path->dentry), stat);
generic_fillattr(&nop_mnt_idmap, request_mask,
d_inode(path->dentry), stat);
return err;
}

Expand Down
5 changes: 3 additions & 2 deletions fs/ecryptfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,7 +982,7 @@ static int ecryptfs_getattr_link(struct mnt_idmap *idmap,

mount_crypt_stat = &ecryptfs_superblock_to_private(
dentry->d_sb)->mount_crypt_stat;
generic_fillattr(&nop_mnt_idmap, d_inode(dentry), stat);
generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(dentry), stat);
if (mount_crypt_stat->flags & ECRYPTFS_GLOBAL_ENCRYPT_FILENAMES) {
char *target;
size_t targetsiz;
Expand Down Expand Up @@ -1011,7 +1011,8 @@ static int ecryptfs_getattr(struct mnt_idmap *idmap,
if (!rc) {
fsstack_copy_attr_all(d_inode(dentry),
ecryptfs_inode_to_lower(d_inode(dentry)));
generic_fillattr(&nop_mnt_idmap, d_inode(dentry), stat);
generic_fillattr(&nop_mnt_idmap, request_mask,
d_inode(dentry), stat);
stat->blocks = lower_stat.blocks;
}
return rc;
Expand Down
2 changes: 1 addition & 1 deletion fs/erofs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@ int erofs_getattr(struct mnt_idmap *idmap, const struct path *path,
stat->attributes_mask |= (STATX_ATTR_COMPRESSED |
STATX_ATTR_IMMUTABLE);

generic_fillattr(idmap, inode, stat);
generic_fillattr(idmap, request_mask, inode, stat);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/exfat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ int exfat_getattr(struct mnt_idmap *idmap, const struct path *path,
struct inode *inode = d_backing_inode(path->dentry);
struct exfat_inode_info *ei = EXFAT_I(inode);

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
exfat_truncate_atime(&stat->atime);
stat->result_mask |= STATX_BTIME;
stat->btime.tv_sec = ei->i_crtime.tv_sec;
Expand Down
2 changes: 1 addition & 1 deletion fs/ext2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -1628,7 +1628,7 @@ int ext2_getattr(struct mnt_idmap *idmap, const struct path *path,
STATX_ATTR_IMMUTABLE |
STATX_ATTR_NODUMP);

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/ext4/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -5535,7 +5535,7 @@ int ext4_getattr(struct mnt_idmap *idmap, const struct path *path,
STATX_ATTR_NODUMP |
STATX_ATTR_VERITY);

generic_fillattr(idmap, inode, stat);
generic_fillattr(idmap, request_mask, inode, stat);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/f2fs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,7 @@ int f2fs_getattr(struct mnt_idmap *idmap, const struct path *path,
STATX_ATTR_NODUMP |
STATX_ATTR_VERITY);

generic_fillattr(idmap, inode, stat);
generic_fillattr(idmap, request_mask, inode, stat);

/* we need to show initial sectors used for inline_data/dentries */
if ((S_ISREG(inode->i_mode) && f2fs_has_inline_data(inode)) ||
Expand Down
2 changes: 1 addition & 1 deletion fs/fat/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,7 @@ int fat_getattr(struct mnt_idmap *idmap, const struct path *path,
struct inode *inode = d_inode(path->dentry);
struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb);

generic_fillattr(idmap, inode, stat);
generic_fillattr(idmap, request_mask, inode, stat);
stat->blksize = sbi->cluster_size;

if (sbi->options.nfs == FAT_NFS_NOSTALE_RO) {
Expand Down
2 changes: 1 addition & 1 deletion fs/fuse/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -1224,7 +1224,7 @@ static int fuse_update_get_attr(struct inode *inode, struct file *file,
forget_all_cached_acls(inode);
err = fuse_do_getattr(inode, stat, file);
} else if (stat) {
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
stat->mode = fi->orig_i_mode;
stat->ino = fi->orig_ino;
}
Expand Down
2 changes: 1 addition & 1 deletion fs/gfs2/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,7 +2071,7 @@ static int gfs2_getattr(struct mnt_idmap *idmap,
STATX_ATTR_IMMUTABLE |
STATX_ATTR_NODUMP);

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);

if (gfs2_holder_initialized(&gh))
gfs2_glock_dq_uninit(&gh);
Expand Down
2 changes: 1 addition & 1 deletion fs/hfsplus/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ int hfsplus_getattr(struct mnt_idmap *idmap, const struct path *path,
stat->attributes_mask |= STATX_ATTR_APPEND | STATX_ATTR_IMMUTABLE |
STATX_ATTR_NODUMP;

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/kernfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int kernfs_iop_getattr(struct mnt_idmap *idmap,

down_read(&root->kernfs_iattr_rwsem);
kernfs_refresh_inode(kn, inode);
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
up_read(&root->kernfs_iattr_rwsem);

return 0;
Expand Down
4 changes: 2 additions & 2 deletions fs/libfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ int simple_getattr(struct mnt_idmap *idmap, const struct path *path,
unsigned int query_flags)
{
struct inode *inode = d_inode(path->dentry);
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
stat->blocks = inode->i_mapping->nrpages << (PAGE_SHIFT - 9);
return 0;
}
Expand Down Expand Up @@ -1334,7 +1334,7 @@ static int empty_dir_getattr(struct mnt_idmap *idmap,
u32 request_mask, unsigned int query_flags)
{
struct inode *inode = d_inode(path->dentry);
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/minix/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -656,7 +656,7 @@ int minix_getattr(struct mnt_idmap *idmap, const struct path *path,
struct super_block *sb = path->dentry->d_sb;
struct inode *inode = d_inode(path->dentry);

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
if (INODE_VERSION(inode) == MINIX_V1)
stat->blocks = (BLOCK_SIZE / 512) * V1_minix_blocks(stat->size, sb);
else
Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -912,7 +912,7 @@ int nfs_getattr(struct mnt_idmap *idmap, const struct path *path,
/* Only return attributes that were revalidated. */
stat->result_mask = nfs_get_valid_attrmask(inode) | request_mask;

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
stat->ino = nfs_compat_user_ino64(NFS_FILEID(inode));
stat->change_cookie = inode_peek_iversion_raw(inode);
stat->attributes_mask |= STATX_ATTR_CHANGE_MONOTONIC;
Expand Down
3 changes: 2 additions & 1 deletion fs/nfs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ nfs_namespace_getattr(struct mnt_idmap *idmap,
if (NFS_FH(d_inode(path->dentry))->size != 0)
return nfs_getattr(idmap, path, stat, request_mask,
query_flags);
generic_fillattr(&nop_mnt_idmap, d_inode(path->dentry), stat);
generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(path->dentry),
stat);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/ntfs3/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ int ntfs_getattr(struct mnt_idmap *idmap, const struct path *path,

stat->attributes_mask |= STATX_ATTR_COMPRESSED | STATX_ATTR_ENCRYPTED;

generic_fillattr(idmap, inode, stat);
generic_fillattr(idmap, request_mask, inode, stat);

stat->result_mask |= STATX_BTIME;
stat->btime = ni->i_crtime;
Expand Down
2 changes: 1 addition & 1 deletion fs/ocfs2/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -1319,7 +1319,7 @@ int ocfs2_getattr(struct mnt_idmap *idmap, const struct path *path,
goto bail;
}

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
/*
* If there is inline data in the inode, the inode will normally not
* have data blocks allocated (it may have an external xattr block).
Expand Down
2 changes: 1 addition & 1 deletion fs/orangefs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@ int orangefs_getattr(struct mnt_idmap *idmap, const struct path *path,
ret = orangefs_inode_getattr(inode,
request_mask & STATX_SIZE ? ORANGEFS_GETATTR_SIZE : 0);
if (ret == 0) {
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);

/* override block size reported to stat */
if (!(request_mask & STATX_SIZE))
Expand Down
4 changes: 2 additions & 2 deletions fs/proc/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1966,7 +1966,7 @@ int pid_getattr(struct mnt_idmap *idmap, const struct path *path,
struct proc_fs_info *fs_info = proc_sb_info(inode->i_sb);
struct task_struct *task;

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);

stat->uid = GLOBAL_ROOT_UID;
stat->gid = GLOBAL_ROOT_GID;
Expand Down Expand Up @@ -3899,7 +3899,7 @@ static int proc_task_getattr(struct mnt_idmap *idmap,
{
struct inode *inode = d_inode(path->dentry);
struct task_struct *p = get_proc_task(inode);
generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);

if (p) {
stat->nlink += get_nr_threads(p);
Expand Down
2 changes: 1 addition & 1 deletion fs/proc/fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ static int proc_fd_getattr(struct mnt_idmap *idmap,
struct inode *inode = d_inode(path->dentry);
int rv = 0;

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);

/* If it's a directory, put the number of open fds there */
if (S_ISDIR(inode->i_mode)) {
Expand Down
2 changes: 1 addition & 1 deletion fs/proc/generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static int proc_getattr(struct mnt_idmap *idmap,
}
}

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
return 0;
}

Expand Down
2 changes: 1 addition & 1 deletion fs/proc/proc_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static int proc_tgid_net_getattr(struct mnt_idmap *idmap,

net = get_proc_task_net(inode);

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);

if (net != NULL) {
stat->nlink = net->proc_net->nlink;
Expand Down
2 changes: 1 addition & 1 deletion fs/proc/proc_sysctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ static int proc_sys_getattr(struct mnt_idmap *idmap,
if (IS_ERR(head))
return PTR_ERR(head);

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
if (table)
stat->mode = (stat->mode & S_IFMT) | table->mode;

Expand Down
3 changes: 2 additions & 1 deletion fs/proc/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,8 @@ static int proc_root_getattr(struct mnt_idmap *idmap,
const struct path *path, struct kstat *stat,
u32 request_mask, unsigned int query_flags)
{
generic_fillattr(&nop_mnt_idmap, d_inode(path->dentry), stat);
generic_fillattr(&nop_mnt_idmap, request_mask, d_inode(path->dentry),
stat);
stat->nlink = proc_root.nlink + nr_processes();
return 0;
}
Expand Down
2 changes: 1 addition & 1 deletion fs/smb/client/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,7 @@ int cifs_getattr(struct mnt_idmap *idmap, const struct path *path,
return rc;
}

generic_fillattr(&nop_mnt_idmap, inode, stat);
generic_fillattr(&nop_mnt_idmap, request_mask, inode, stat);
stat->blksize = cifs_sb->ctx->bsize;
stat->ino = CIFS_I(inode)->uniqueid;

Expand Down
22 changes: 11 additions & 11 deletions fs/smb/server/smb2pdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -4391,8 +4391,8 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp,
}

basic_info = (struct smb2_file_basic_info *)rsp->Buffer;
generic_fillattr(file_mnt_idmap(fp->filp), file_inode(fp->filp),
&stat);
generic_fillattr(file_mnt_idmap(fp->filp), STATX_BASIC_STATS,
file_inode(fp->filp), &stat);
basic_info->CreationTime = cpu_to_le64(fp->create_time);
time = ksmbd_UnixTimeToNT(stat.atime);
basic_info->LastAccessTime = cpu_to_le64(time);
Expand All @@ -4417,7 +4417,7 @@ static void get_file_standard_info(struct smb2_query_info_rsp *rsp,
struct kstat stat;

inode = file_inode(fp->filp);
generic_fillattr(file_mnt_idmap(fp->filp), inode, &stat);
generic_fillattr(file_mnt_idmap(fp->filp), STATX_BASIC_STATS, inode, &stat);

sinfo = (struct smb2_file_standard_info *)rsp->Buffer;
delete_pending = ksmbd_inode_pending_delete(fp);
Expand Down Expand Up @@ -4471,7 +4471,7 @@ static int get_file_all_info(struct ksmbd_work *work,
return PTR_ERR(filename);

inode = file_inode(fp->filp);
generic_fillattr(file_mnt_idmap(fp->filp), inode, &stat);
generic_fillattr(file_mnt_idmap(fp->filp), STATX_BASIC_STATS, inode, &stat);

ksmbd_debug(SMB, "filename = %s\n", filename);
delete_pending = ksmbd_inode_pending_delete(fp);
Expand Down Expand Up @@ -4548,8 +4548,8 @@ static void get_file_stream_info(struct ksmbd_work *work,
int buf_free_len;
struct smb2_query_info_req *req = ksmbd_req_buf_next(work);

generic_fillattr(file_mnt_idmap(fp->filp), file_inode(fp->filp),
&stat);
generic_fillattr(file_mnt_idmap(fp->filp), STATX_BASIC_STATS,
file_inode(fp->filp), &stat);
file_info = (struct smb2_file_stream_info *)rsp->Buffer;

buf_free_len =
Expand Down Expand Up @@ -4639,8 +4639,8 @@ static void get_file_internal_info(struct smb2_query_info_rsp *rsp,
struct smb2_file_internal_info *file_info;
struct kstat stat;

generic_fillattr(file_mnt_idmap(fp->filp), file_inode(fp->filp),
&stat);
generic_fillattr(file_mnt_idmap(fp->filp), STATX_BASIC_STATS,
file_inode(fp->filp), &stat);
file_info = (struct smb2_file_internal_info *)rsp->Buffer;
file_info->IndexNumber = cpu_to_le64(stat.ino);
rsp->OutputBufferLength =
Expand All @@ -4665,7 +4665,7 @@ static int get_file_network_open_info(struct smb2_query_info_rsp *rsp,
file_info = (struct smb2_file_ntwrk_info *)rsp->Buffer;

inode = file_inode(fp->filp);
generic_fillattr(file_mnt_idmap(fp->filp), inode, &stat);
generic_fillattr(file_mnt_idmap(fp->filp), STATX_BASIC_STATS, inode, &stat);

file_info->CreationTime = cpu_to_le64(fp->create_time);
time = ksmbd_UnixTimeToNT(stat.atime);
Expand Down Expand Up @@ -4726,8 +4726,8 @@ static void get_file_compression_info(struct smb2_query_info_rsp *rsp,
struct smb2_file_comp_info *file_info;
struct kstat stat;

generic_fillattr(file_mnt_idmap(fp->filp), file_inode(fp->filp),
&stat);
generic_fillattr(file_mnt_idmap(fp->filp), STATX_BASIC_STATS,
file_inode(fp->filp), &stat);

file_info = (struct smb2_file_comp_info *)rsp->Buffer;
file_info->CompressedFileSize = cpu_to_le64(stat.blocks << 9);
Expand Down
Loading

0 comments on commit 0d72b92

Please sign in to comment.