Re: [PATCH RFC] VFS: lock source directory for link to avoid rename race.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 16, 2022 at 05:32:45PM +0300, Amir Goldstein wrote:
> On Fri, Sep 16, 2022 at 9:26 AM NeilBrown <neilb@xxxxxxx> wrote:
> >
> >
> > rename(2) is documented as
> >
> >        If newpath already exists, it will be atomically replaced, so
> >        that there is no point at which another process attempting to
> >        access newpath will find it missing.
> >
> > However link(2) from a given path can race with rename renaming to that
> > path so that link gets -ENOENT because the path has already been unlinked
> > by rename, and creating a link to an unlinked file is not permitted.
> >
> 
> I have to ask. Is this a real problem or just a matter of respecting
> the laws of this man page?

I have to say that I have the same reaction. The commit message doesn't
really explain where the current behavior becomes an issue and whether
there are any users seeing issues with this. And the patch makes
do_linkat() way more complex than it was before.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [NTFS 3]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [NTFS 3]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux