Whamcloud - gitweb
LU-16056 libcfs: restore umask handling in kernel threads
authorAndreas Dilger <adilger@whamcloud.com>
Tue, 16 Aug 2022 21:30:56 +0000 (15:30 -0600)
committerAndreas Dilger <adilger@whamcloud.com>
Tue, 23 Aug 2022 19:23:50 +0000 (19:23 +0000)
commitc4415fabcdaf621b0c8fa3ba33d53908de6242a1
treeb941d141d35733c96eeff49c1611cbde05615f20
parent324c480a1c177eb65047c1c71eb57dab30d238d3
LU-16056 libcfs: restore umask handling in kernel threads

This reverts commit 9013eb2bb5 which incorrectly assumes that Lustre
service threads do not modify umask.  A quick grep shows that umask
is modified in osd-ldiskfs __osd_create().

If some other thread sharing the same fs context is modifying umask
in an incompatible way (which includes all Lustre threads after
this patch) then it will occasionally break created file access
permissions for Lustre.

Lustre-change: https://review.whamcloud.com/48233
Lustre-commit: TBD (from e88334d806687ad2512323f1e4c2667348f02a4e)

Fixes: 9013eb2bb5 (LU-9859 libcfs: don't call unshare_fs_struct()")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: I589b72e4286dc84f4e3f1a0c54fe31aa988e6c18
Reviewed-on: https://review.whamcloud.com/48236
Tested-by: jenkins <devops@whamcloud.com>
Reviewed-by: Shuichi Ihara <sihara@ddn.com>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_request.c
lustre/obdclass/llog.c
lustre/ptlrpc/import.c
lustre/ptlrpc/pinger.c
lustre/ptlrpc/ptlrpcd.c
lustre/ptlrpc/service.c