On Tue, Jul 10, 2018 at 07:44:59PM -0700, Linus Torvalds wrote: > I like the patch, I hate the commit message. > > It makes sense right now in this sequence, but I'd really like the > commit message to say _why_ this sequence led up to this point. > > Right now I still remember you trying this, and having to revert it > because it didn't work before all the fput/put_filp issues. But a year > from now? Five years from now? > > So at least a "now that fput() works regardless of how far the open > got.." kind of explanation, ok? Umm... Something like These checks are better off in do_dentry_open(); the reason we couldn't put them there used to be that callers couldn't tell what kind of cleanup would do_dentry_open() failure call for. Now that we have FMODE_OPENED, cleanup is the same in all cases - it's simply fput(). So let's fold that into do_dentry_open(), as Christoph's patch tried to. perhaps?