[Devel] [RFC PATCH 1/2] autofs: set compat flag on sbi when daemon uses 32bit addressation

Stanislav Kinsburskiy skinsbursky at virtuozzo.com
Thu Aug 31 16:57:06 MSK 2017


Signed-off-by: Stanislav Kinsburskiy <skinsbursky at virtuozzo.com>
---
 fs/autofs4/inode.c |   16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index b23cf2a..989ac38 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -217,6 +217,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 	int pgrp;
 	bool pgrp_set = false;
 	int ret = -EINVAL;
+	struct task_struct *tsk;
 
 	sbi = kzalloc(sizeof(*sbi), GFP_KERNEL);
 	if (!sbi)
@@ -281,10 +282,25 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
 				pgrp);
 			goto fail_dput;
 		}
+		tsk = get_pid_task(sbi->oz_pgrp, PIDTYPE_PGID);
+		if (!tsk) {
+			pr_warn("autofs: could not find process group leader %d\n",
+				pgrp);
+			goto fail_put_pid;
+		}
 	} else {
 		sbi->oz_pgrp = get_task_pid(current, PIDTYPE_PGID);
+		get_task_struct(current);
+		tsk = current;
 	}
 
+	if (test_tsk_thread_flag(tsk, TIF_ADDR32))
+		sbi->is32bit = 1;
+	else
+		sbi->is32bit = 0;
+
+	put_task_struct(tsk);
+
 	if (autofs_type_trigger(sbi->type))
 		__managed_dentry_set_managed(root);
 



More information about the Devel mailing list