A kthread runs with the same fs_struct as init.
It is only helpful to unshare this if the thread
will change one of the fields in the fs_struct:
root directory
current working directory
umask.
No lustre kthread changes any of these, so there is
no need to call unshare_fs_struct().
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I7309b6ed184b14a272bad7dc5149ad36281f948e
Reviewed-on: https://review.whamcloud.com/39132
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
return notifier_from_errno(err) | NOTIFY_STOP_MASK;
}
-/*
- * Defined by platform
- */
-int unshare_fs_struct(void);
-
int libcfs_ioctl_data_adjust(struct libcfs_ioctl_data *data);
#define container_of0(ptr, type, member) container_of_safe(ptr, type, member)
#include <linux/sched/signal.h>
#include <linux/sched/mm.h>
#endif
-#include <linux/fs_struct.h>
#include <linux/pagemap.h>
#include <linux/compat.h>
#include <linux/thread_info.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/fs.h>
-#include <linux/fs_struct.h>
#include <linux/sched.h>
#ifdef HAVE_SCHED_HEADERS
#include <linux/sched/mm.h>
#include <linux/aio.h>
#include <linux/fs.h>
-#include <linux/fs_struct.h>
#include <linux/namei.h>
#include <linux/pagemap.h>
#include <linux/posix_acl_xattr.h>
int rc = 0;
ENTRY;
-
- unshare_fs_struct();
OBD_ALLOC_PTR(thread);
if (thread == NULL)
RETURN(-ENOMEM);
{
struct obd_import *imp = data;
- unshare_fs_struct();
-
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);
#include <linux/delay.h>
#include <linux/uidgid.h>
#include <linux/security.h>
+#include <linux/fs_struct.h>
#ifndef HAVE_CPUS_READ_LOCK
#include <libcfs/linux/linux-cpu.h>
}
task_unlock(lpi->lpi_reftask);
- unshare_fs_struct();
-
/* 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_OSD
+#include <linux/fs_struct.h>
#include <linux/kallsyms.h>
#include <linux/module.h>
#include <linux/user_namespace.h>
struct obd_import *imp = data;
ENTRY;
-
- unshare_fs_struct();
-
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);
time64_t expire_time;
ENTRY;
- unshare_fs_struct();
-
CDEBUG(D_HA, "Starting Ping Evictor\n");
pet_state = PET_READY;
while (1) {
int exit = 0;
ENTRY;
-
- unshare_fs_struct();
-
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_FILTER
#include <linux/fs.h>
+#include <linux/fs_struct.h>
#include <libcfs/libcfs.h>
#include <lvfs.h>
#include <obd_class.h>
thread->t_task = current;
thread->t_pid = current->pid;
- unshare_fs_struct();
if (svc->srv_cpt_bind) {
rc = cfs_cpt_bind(svc->srv_cptable, svcpt->scp_cpt);
if (env == NULL)
RETURN(-ENOMEM);
- unshare_fs_struct();
-
rc = cfs_cpt_bind(ptlrpc_hr.hr_cpt_table, hrp->hrp_cpt);
if (rc != 0) {
char threadname[20];