Loading Documentation/filesystems/porting +3 −0 Original line number Diff line number Diff line Loading @@ -575,3 +575,6 @@ in your dentry operations instead. Old method is only used if the new one is absent; eventually it will be removed. Switch while you still can; the old one won't stay. -- [mandatory] ->atomic_open() calls without O_CREAT may happen in parallel. fs/namei.c +9 −3 Original line number Diff line number Diff line Loading @@ -3084,7 +3084,7 @@ static int do_last(struct nameidata *nd, } retry_lookup: if (op->open_flag & (O_CREAT | O_TRUNC | O_WRONLY | O_RDWR)) { if (open_flag & (O_CREAT | O_TRUNC | O_WRONLY | O_RDWR)) { error = mnt_want_write(nd->path.mnt); if (!error) got_write = true; Loading @@ -3094,9 +3094,15 @@ static int do_last(struct nameidata *nd, * dropping this one anyway. */ } if (open_flag & O_CREAT) inode_lock(dir->d_inode); else inode_lock_shared(dir->d_inode); error = lookup_open(nd, &path, file, op, got_write, opened); if (open_flag & O_CREAT) inode_unlock(dir->d_inode); else inode_unlock_shared(dir->d_inode); if (error <= 0) { if (error) Loading Loading
Documentation/filesystems/porting +3 −0 Original line number Diff line number Diff line Loading @@ -575,3 +575,6 @@ in your dentry operations instead. Old method is only used if the new one is absent; eventually it will be removed. Switch while you still can; the old one won't stay. -- [mandatory] ->atomic_open() calls without O_CREAT may happen in parallel.
fs/namei.c +9 −3 Original line number Diff line number Diff line Loading @@ -3084,7 +3084,7 @@ static int do_last(struct nameidata *nd, } retry_lookup: if (op->open_flag & (O_CREAT | O_TRUNC | O_WRONLY | O_RDWR)) { if (open_flag & (O_CREAT | O_TRUNC | O_WRONLY | O_RDWR)) { error = mnt_want_write(nd->path.mnt); if (!error) got_write = true; Loading @@ -3094,9 +3094,15 @@ static int do_last(struct nameidata *nd, * dropping this one anyway. */ } if (open_flag & O_CREAT) inode_lock(dir->d_inode); else inode_lock_shared(dir->d_inode); error = lookup_open(nd, &path, file, op, got_write, opened); if (open_flag & O_CREAT) inode_unlock(dir->d_inode); else inode_unlock_shared(dir->d_inode); if (error <= 0) { if (error) Loading