lkml.org 
[lkml]   [2022]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 03/10] VFS: move want_write checks into lookup_hash_update()
On Fri, Aug 26, 2022 at 12:10:43PM +1000, NeilBrown wrote:
> mnt_want_write() is always called before lookup_hash_update(), so
> we can simplify the code by moving the call into that function.
>
> If lookup_hash_update() succeeds, it now will have claimed the
> want_write lock. If it fails, the want_write lock isn't held.
>
> To allow this, lookup_hash_update() now receives a 'struct path *'
> instead of 'struct dentry *'
>
> Note that when creating a name, any error from mnt_want_write() does not
> get reported unless there is no other error. For unlink/rmdir though,
> an error from mnt_want_write() is immediately fatal - overriding ENOENT
> for example. This behaviour seems strange, but this patch is careful to
> preserve it.

Would be a nice idea, if not for the mess with LOOKUP_SILLY_RENAME later
in the series...

\
 
 \ /
  Last update: 2022-08-27 05:49    [W:0.159 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site