Ssh – Is mkdir atomic over sshfs

sshfs

I am using mkdir as a locking mechanism, and to my knowledge mkdir is atomic, but it is not atomic over nfs. So my question is simple, is mkdir atomic over sshfs?

Best Answer

I don't know if it is enabled or disabled by default, but mkdir can be cached:

http://goo.gl/QIW4V (cache_mkdir)

Even though the mkdir command itself looks atomic and thread safe enough...

http://goo.gl/LC1Ze (sshfs_mkdir)

http://goo.gl/NHkNH (sftp_request_send)

I would go out on a limb and say that mkdir over sshfs is not atomic, because of the caching.

Related Question