From: Mr NeilBrown Date: Wed, 9 Dec 2020 02:11:18 +0000 (+1100) Subject: LU-14195 lustre: remove 'fs' from 'struct lvfs_run_ctxt' X-Git-Tag: 2.14.51~139 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=de60e7767c0e3ba38f4de37e46328012780b6d19 LU-14195 lustre: remove 'fs' from 'struct lvfs_run_ctxt' The code protected by push_ctxt() and pop_ctx() never tries to access any user-space data, so call set_fs() to KERNEL_DS is not needed. So remove the 'fs' field and related code. In linux-5.10 this code fails to compile as set_fs() is deprecated. Test-Parameters: trivial Signed-off-by: Mr NeilBrown Change-Id: Idb2744d656dc4228375b6da54673e38cc1c112f5 Reviewed-on: https://review.whamcloud.com/40910 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: James Simmons Reviewed-by: Alex Zhuravlev Reviewed-by: Oleg Drokin --- diff --git a/lustre/include/lvfs.h b/lustre/include/lvfs.h index 3544b53..7025155 100644 --- a/lustre/include/lvfs.h +++ b/lustre/include/lvfs.h @@ -52,7 +52,6 @@ struct dt_device; struct lvfs_run_ctxt { struct vfsmount *pwdmnt; struct dentry *pwd; - mm_segment_t fs; int umask; struct dt_device *dt; #ifdef OBD_CTXT_DEBUG diff --git a/lustre/osd-ldiskfs/osd_compat.c b/lustre/osd-ldiskfs/osd_compat.c index 8b70faf..56561b6 100644 --- a/lustre/osd-ldiskfs/osd_compat.c +++ b/lustre/osd-ldiskfs/osd_compat.c @@ -59,7 +59,6 @@ static void osd_push_ctxt(const struct osd_device *dev, OBD_SET_CTXT_MAGIC(newctxt); newctxt->pwdmnt = dev->od_mnt; newctxt->pwd = dev->od_mnt->mnt_root; - newctxt->fs = KERNEL_DS; newctxt->umask = current_umask(); newctxt->dt = NULL; diff --git a/lustre/osd-ldiskfs/osd_scrub.c b/lustre/osd-ldiskfs/osd_scrub.c index 866dd04..1c4adcc 100644 --- a/lustre/osd-ldiskfs/osd_scrub.c +++ b/lustre/osd-ldiskfs/osd_scrub.c @@ -2581,7 +2581,6 @@ int osd_scrub_setup(const struct lu_env *env, struct osd_device *dev) OBD_SET_CTXT_MAGIC(ctxt); ctxt->pwdmnt = dev->od_mnt; ctxt->pwd = dev->od_mnt->mnt_root; - ctxt->fs = KERNEL_DS; init_rwsem(&scrub->os_rwsem); spin_lock_init(&scrub->os_lock); diff --git a/lustre/ptlrpc/sec_ctx.c b/lustre/ptlrpc/sec_ctx.c index fffb7f2..a5de864 100644 --- a/lustre/ptlrpc/sec_ctx.c +++ b/lustre/ptlrpc/sec_ctx.c @@ -72,7 +72,6 @@ void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx) ASSERT_CTXT_MAGIC(new_ctx->magic); OBD_SET_CTXT_MAGIC(save); - save->fs = get_fs(); LASSERT(ll_d_count(current->fs->pwd.dentry)); LASSERT(ll_d_count(new_ctx->pwd)); save->pwd = dget(current->fs->pwd.dentry); @@ -85,7 +84,6 @@ void push_ctxt(struct lvfs_run_ctxt *save, struct lvfs_run_ctxt *new_ctx) LASSERT(new_ctx->pwdmnt); current->fs->umask = 0; /* umask already applied on client */ - set_fs(new_ctx->fs); ll_set_fs_pwd(current->fs, new_ctx->pwdmnt, new_ctx->pwd); } EXPORT_SYMBOL(push_ctxt); @@ -103,7 +101,6 @@ void pop_ctxt(struct lvfs_run_ctxt *saved, struct lvfs_run_ctxt *new_ctx) LASSERTF(current->fs->pwd.mnt == new_ctx->pwdmnt, "%p != %p\n", current->fs->pwd.mnt, new_ctx->pwdmnt); - set_fs(saved->fs); ll_set_fs_pwd(current->fs, saved->pwdmnt, saved->pwd); dput(saved->pwd);