Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1224364
| From | Jeff Layton <jlayton@poochiereds.net> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/4] fs: add fput_queue |
| Date | 2015-09-14 19:40 +0200 |
| Message-ID | <q8FTs-4AL-19@gated-at.bofh.it> (permalink) |
| References | <q8CiS-7Pp-15@gated-at.bofh.it> <q8Csx-80G-3@gated-at.bofh.it> <q8CLT-b7-9@gated-at.bofh.it> <q8CLT-b7-7@gated-at.bofh.it> <q8F75-3qM-55@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Mon, 14 Sep 2015 17:39:54 +0100 Al Viro <viro@ZenIV.linux.org.uk> wrote: > On Mon, Sep 14, 2015 at 10:19:18AM -0400, Jeff Layton wrote: > > > > + * borrow the infrastructure used by kthreads, and the task can then just > > > > + * called flush_delayed_fput to ensure that the final fput has completed. > > > > > > Are you sure that it's not a typo? > > > > I don't think so, but it could be clearer. Something like this maybe? > > > > "then we can't queue it via task_work_add." > > Huh? > > task_work_add() callbacks *will* run before we return to userland Right, but only just before. We need it to run before we try to set the lease in the context of a fcntl() call. How about this text instead then? I'll fix up the patch if this sounds reasonable: "When fput is called in the context of a userland process, it'll queue the actual work (__fput()) to be done just before returning to userland. In some cases however, we need to ensure that the __fput runs before that point. There is no safe way to flush work that has been queued via task_work_add however, so to do this we borrow the delayed_fput infrastructure that kthreads use. The userland process can use fput_queue() on one or more struct files and then call flush_delayed_fput() to ensure that they are completely closed." -- Jeff Layton <jlayton@poochiereds.net> -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/4] fs: allow userland tasks to use delayed_fput infrastructure Jeff Layton <jlayton@poochiereds.net> - 2015-09-14 15:50 +0200
[PATCH 1/4] fs: have flush_delayed_fput flush the workqueue job Jeff Layton <jlayton@poochiereds.net> - 2015-09-14 15:50 +0200
[PATCH 4/4] fs: export flush_delayed_fput Jeff Layton <jlayton@poochiereds.net> - 2015-09-14 15:50 +0200
[PATCH 3/4] fs: add fput_queue Jeff Layton <jlayton@poochiereds.net> - 2015-09-14 16:00 +0200
Re: [PATCH 3/4] fs: add fput_queue Jeff Layton <jlayton@poochiereds.net> - 2015-09-14 16:20 +0200
Re: [PATCH 3/4] fs: add fput_queue Al Viro <viro@ZenIV.linux.org.uk> - 2015-09-14 18:50 +0200
Re: [PATCH 3/4] fs: add fput_queue Jeff Layton <jlayton@poochiereds.net> - 2015-09-14 19:40 +0200
Re: [PATCH 3/4] fs: add fput_queue Al Viro <viro@ZenIV.linux.org.uk> - 2015-09-14 16:20 +0200
Re: [PATCH 0/4] fs: allow userland tasks to use delayed_fput infrastructure "J. Bruce Fields" <bfields@fieldses.org> - 2015-09-14 16:50 +0200
Re: [PATCH 0/4] fs: allow userland tasks to use delayed_fput infrastructure Jeff Layton <jlayton@poochiereds.net> - 2015-09-14 17:30 +0200
csiph-web