]> Pileus Git - ~andy/linux/blobdiff - fs/file_table.c
fs/file_table.c:fput(): add comment
[~andy/linux] / fs / file_table.c
index 08e719b884ca31320bbcded23f6963ae0268779d..b9a77ad08b4d305c149a7d891b4a95d0e3538bff 100644 (file)
@@ -313,6 +313,12 @@ void fput(struct file *file)
                        init_task_work(&file->f_u.fu_rcuhead, ____fput);
                        if (!task_work_add(task, &file->f_u.fu_rcuhead, true))
                                return;
+                       /*
+                        * After this task has run exit_task_work(),
+                        * task_work_add() will fail.  free_ipc_ns()->
+                        * shm_destroy() can do this.  Fall through to delayed
+                        * fput to avoid leaking *file.
+                        */
                }
                spin_lock_irqsave(&delayed_fput_lock, flags);
                list_add(&file->f_u.fu_list, &delayed_fput_list);