diff options
author | Andrew Morton <akpm@linux-foundation.org> | 2013-07-08 17:24:15 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-07-13 05:27:42 -0400 |
commit | 64372501e2af9b11e2ffd1ff79345dc4b1abe539 (patch) | |
tree | c3a26f2e5320a5def0838adbac4cca4de5e2b29b | |
parent | bb458c644a59dbba3a1fe59b27106c5e68e1c4bd (diff) |
fs/file_table.c:fput(): add comment
A missed update to "fput: task_work_add() can fail if the caller has
passed exit_task_work()".
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Andrey Vagin <avagin@openvz.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r-- | fs/file_table.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index 08e719b884ca..b9a77ad08b4d 100644 --- a/fs/file_table.c +++ b/fs/file_table.c | |||
@@ -313,6 +313,12 @@ void fput(struct file *file) | |||
313 | init_task_work(&file->f_u.fu_rcuhead, ____fput); | 313 | init_task_work(&file->f_u.fu_rcuhead, ____fput); |
314 | if (!task_work_add(task, &file->f_u.fu_rcuhead, true)) | 314 | if (!task_work_add(task, &file->f_u.fu_rcuhead, true)) |
315 | return; | 315 | return; |
316 | /* | ||
317 | * After this task has run exit_task_work(), | ||
318 | * task_work_add() will fail. free_ipc_ns()-> | ||
319 | * shm_destroy() can do this. Fall through to delayed | ||
320 | * fput to avoid leaking *file. | ||
321 | */ | ||
316 | } | 322 | } |
317 | spin_lock_irqsave(&delayed_fput_lock, flags); | 323 | spin_lock_irqsave(&delayed_fput_lock, flags); |
318 | list_add(&file->f_u.fu_list, &delayed_fput_list); | 324 | list_add(&file->f_u.fu_list, &delayed_fput_list); |