Re: question about concurrent cross directory rename?

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

 




On 8/18/23 15:11, songmuhan@xxxxxxxxxxxxxx wrote:
I apologize for any inconvenience, but I have encountered a challenging situation while analyzing the Ceph filesystem's behavior during concurrent rename operations across directories. Specifically, my concern revolves around the potential for directory loops when two clients initiate renames simultaneously.

In the VFS, there's a filesystem-specific vfs_rename_mutex that serializes the rename operation. In Ceph, I noticed the presence of a global client lock. However, I'm uncertain if the MDS serializes rename requests.

Consider the following scenario:

         a
        /   \
      b     c
     /         \
   d           e
  /              \
f                g

If Client 1 attempts to rename "c" to "f" while Client 2 tries to rename "b" to "g" concurrently, and both succeed, we could end up with a loop in the directory structure.

Do you mean 'move' here ? If yes, then the second rename request should fail, please see:

https://github.com/ceph/ceph/blob/main/src/mds/Server.cc#L8810-L8816


BTW, have hit any issue about this or have you reproduced it ? If so then it should be a bug.

Thanks

- Xiubo



Could you please provide clarity on how CephFS handles such situations? Your insights would be invaluable.
_______________________________________________
Dev mailing list -- dev@xxxxxxx
To unsubscribe send an email to dev-leave@xxxxxxx

_______________________________________________
Dev mailing list -- dev@xxxxxxx
To unsubscribe send an email to dev-leave@xxxxxxx



[Index of Archives]     [CEPH Users]     [Ceph Devel]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux