staging/lustre/llite: IOC_MDC_GETFILEINFO returns the wrong ino

req_capsule_server_get() through  __req_capsule_get in ll_dir_ioctl()
returns a pointer to a PTLRPC request or reply buffer, which is assigned
to struct mdt_body.

If the command is IOC_MDS_GETFILEINFO then the inode "st.st_ino" should
be assigned from one extracted from mdt_body through cl_fid_build_ino().

Signed-off-by: John Hammond <john.hammond@intel.com>
Signed-off-by: akam kumar bharathi <azurelustre@gmail.com>
Reviewed-on: http://review.whamcloud.com/17618
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-5954
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
akam kumar bharathi 2016-06-20 16:55:47 -04:00 committed by Greg Kroah-Hartman
parent aae5d55a24
commit d780846e0f
1 changed files with 3 additions and 1 deletions

View File

@ -1523,7 +1523,9 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
st.st_atime = body->atime;
st.st_mtime = body->mtime;
st.st_ctime = body->ctime;
st.st_ino = inode->i_ino;
st.st_ino = cl_fid_build_ino(&body->fid1,
sbi->ll_flags &
LL_SBI_32BIT_API);
lmdp = (struct lov_user_mds_data __user *)arg;
if (copy_to_user(&lmdp->lmd_st, &st, sizeof(st))) {