Revert "mcexec_open_exec: make fput and add to mckernel_exec_files atomic"

This reverts commit c80ea0ed23.

Change-Id: I0541e8af5157c7128f8774f6581cc207d13b649a
This commit is contained in:
Masamichi Takagi
2021-03-10 14:19:16 +09:00
parent 1c0da3c5b9
commit e43d52df20

View File

@ -2001,31 +2001,26 @@ int mcexec_open_exec(ihk_os_t os, char * __user filename)
goto out_free;
}
/* fget and list_add should be atomic */
down(&mckernel_exec_file_lock);
file = open_exec(kfilename);
retval = PTR_ERR(file);
if (IS_ERR(file)) {
up(&mckernel_exec_file_lock);
goto out_free;
}
fullpath = d_path(&file->f_path, pathbuf, PATH_MAX);
if (IS_ERR(fullpath)) {
up(&mckernel_exec_file_lock);
retval = PTR_ERR(fullpath);
goto out_put_file;
goto out_free;
}
mcef = kmalloc(sizeof(*mcef), GFP_KERNEL);
if (!mcef) {
up(&mckernel_exec_file_lock);
retval = -ENOMEM;
goto out_put_file;
}
memset(mcef, 0, sizeof(struct mckernel_exec_file)); /* debug */
down(&mckernel_exec_file_lock);
/* Find previous file (if exists) and drop it */
list_for_each_entry(mcef_iter, &mckernel_exec_files, list) {
if (mcef_iter->os == os && mcef_iter->pid == task_tgid_vnr(current)) {