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.
Change-Id: I589b72e4286dc84f4e3f1a0c54fe31aa988e6c18
Fixes:
9013eb2bb5 (LU-9859 libcfs: don't call unshare_fs_struct()")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/48233
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>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
#define DEBUG_SUBSYSTEM S_LDLM
#include <cl_object.h>
#define DEBUG_SUBSYSTEM S_LDLM
#include <cl_object.h>
+#include <linux/fs_struct.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/jiffies.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
OBD_ALLOC_PTR(thread);
if (thread == NULL)
RETURN(-ENOMEM);
OBD_ALLOC_PTR(thread);
if (thread == NULL)
RETURN(-ENOMEM);
#define DEBUG_SUBSYSTEM S_LDLM
#define DEBUG_SUBSYSTEM S_LDLM
+#include <linux/fs_struct.h>
#include <lustre_errno.h>
#include <lustre_dlm.h>
#include <obd_class.h>
#include <lustre_errno.h>
#include <lustre_dlm.h>
#include <obd_class.h>
{
struct obd_import *imp = data;
{
struct obd_import *imp = data;
CDEBUG(D_HA, "lock replay thread %s to %s@%s\n",
imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid);
CDEBUG(D_HA, "lock replay thread %s to %s@%s\n",
imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid);
#define DEBUG_SUBSYSTEM S_LOG
#define DEBUG_SUBSYSTEM S_LOG
+#include <linux/fs_struct.h>
#include <linux/pid_namespace.h>
#include <linux/kthread.h>
#include <llog_swab.h>
#include <linux/pid_namespace.h>
#include <linux/kthread.h>
#include <llog_swab.h>
}
task_unlock(lpi->lpi_reftask);
}
task_unlock(lpi->lpi_reftask);
/* client env has no keys, tags is just 0 */
rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD);
if (rc)
/* client env has no keys, tags is just 0 */
rc = lu_env_init(&env, LCT_LOCAL | LCT_MG_THREAD);
if (rc)
#define DEBUG_SUBSYSTEM S_RPC
#define DEBUG_SUBSYSTEM S_RPC
+#include <linux/fs_struct.h>
#include <linux/kthread.h>
#include <linux/delay.h>
#include <obd_support.h>
#include <linux/kthread.h>
#include <linux/delay.h>
#include <obd_support.h>
struct obd_import *imp = data;
ENTRY;
struct obd_import *imp = data;
ENTRY;
CDEBUG(D_HA, "thread invalidate import %s to %s@%s\n",
imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid);
CDEBUG(D_HA, "thread invalidate import %s to %s@%s\n",
imp->imp_obd->obd_name, obd2cli_tgt(imp->imp_obd),
imp->imp_connection->c_remote_uuid.uuid);
#define DEBUG_SUBSYSTEM S_RPC
#define DEBUG_SUBSYSTEM S_RPC
+#include <linux/fs_struct.h>
#include <linux/kthread.h>
#include <linux/workqueue.h>
#include <obd_support.h>
#include <linux/kthread.h>
#include <linux/workqueue.h>
#include <obd_support.h>
time64_t expire_time;
ENTRY;
time64_t expire_time;
ENTRY;
CDEBUG(D_HA, "Starting Ping Evictor\n");
pet_state = PET_READY;
while (1) {
CDEBUG(D_HA, "Starting Ping Evictor\n");
pet_state = PET_READY;
while (1) {
#define DEBUG_SUBSYSTEM S_RPC
#define DEBUG_SUBSYSTEM S_RPC
+#include <linux/fs_struct.h>
#include <linux/kthread.h>
#include <libcfs/libcfs.h>
#include <lustre_net.h>
#include <linux/kthread.h>
#include <libcfs/libcfs.h>
#include <lustre_net.h>
if (cfs_cpt_bind(cfs_cpt_tab, pc->pc_cpt) != 0)
CWARN("Failed to bind %s on CPT %d\n", pc->pc_name, pc->pc_cpt);
if (cfs_cpt_bind(cfs_cpt_tab, pc->pc_cpt) != 0)
CWARN("Failed to bind %s on CPT %d\n", pc->pc_name, pc->pc_cpt);
#define DEBUG_SUBSYSTEM S_RPC
#define DEBUG_SUBSYSTEM S_RPC
+#include <linux/fs_struct.h>
#include <linux/kthread.h>
#include <linux/ratelimit.h>
#include <linux/kthread.h>
#include <linux/ratelimit.h>
int counter = 0, rc = 0;
ENTRY;
int counter = 0, rc = 0;
ENTRY;
thread->t_task = current;
thread->t_pid = current->pid;
thread->t_task = current;
thread->t_pid = current->pid;
struct lu_env *env;
int rc;
struct lu_env *env;
int rc;
OBD_ALLOC_PTR(env);
if (env == NULL)
RETURN(-ENOMEM);
OBD_ALLOC_PTR(env);
if (env == NULL)
RETURN(-ENOMEM);