Re: [PATCH 05/11] vfs: add RENAME_NOREPLACE flag

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

 



On Wed, Jan 15, 2014 at 7:19 PM, J. Bruce Fields <bfields@xxxxxxxxxxxx> wrote:
> On Wed, Jan 08, 2014 at 11:10:09PM +0100, Miklos Szeredi wrote:
>> From: Miklos Szeredi <mszeredi@xxxxxxx>
>>
>> If this flag is specified and the target of the rename exists then the
>> rename syscall fails with EEXIST.
>
> Why is this useful?
>
> (I'm sure it is, it'd just be useful to have the reasons recorded
> someplace.)
>
>> The VFS does the existence checking, so it is trivial to enable for most
>> local filesystems.  This patch only enables it in ext4.
>>
>> For network filesystems the VFS check is not enough as there may be a race
>> between a remote create and the rename, so these filesystems need to handle
>> this flag in their ->rename() implementations to ensure atomicity.
>
> Till that's done this should probably result in -EOPNOTSUPP on those
> filesystems?
>
> I think this would need new protocol in the NFS case.

Yes, it needs to be enabled on a case-by-case basis.  Only enabled for
ext4 now, but trivial to do for most fs.

Thanks,
Miklos
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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