Whamcloud - gitweb
LU-7630 mdt: keep FS capability for getattr_name 15/17815/2
authorLi Dongyang <dongyang.li@anu.edu.au>
Tue, 5 Jan 2016 05:43:39 +0000 (16:43 +1100)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 18 Jan 2016 05:58:57 +0000 (05:58 +0000)
commit396de0a2c1a6f5bf2d505a0f099ac9a0319a4cf7
treeff2fc2c35450184865ad1eba07c0af760987da8c
parent40d986cf69a1acdbcee8ee218c2cfd379855f5b7
LU-7630 mdt: keep FS capability for getattr_name

This is a follow up of LU-6528.

When "no_subtree_check" is set for NFS export, nfsd_set_fh_dentry()
doesn't set correct fsuid explicitely, but raise capability to allow
exportfs_decode_fh() to reconnect disconnected dentry into dcache.

The patch of LU-6528 fixed the issue for mdt_reint_getattr() but
missed the case for mdt_getattr_name().

LU-6528 added drop_fs_cap to old_init_ucred() to preserve
the capability but the logic was removed by LU-7199 commit
2aea469a3a, this patch reverts that.

This patch also makes sure old_init_ucred() won't fail identity check
when we have a raised capability but not a valid fsuid.

Signed-off-by: Li Dongyang <dongyang.li@anu.edu.au>
Change-Id: Ia41a8243eb18b1e469529bef186e3239fe9ebc1d
Reviewed-on: http://review.whamcloud.com/17815
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_lib.c