Re: [PATCH] ceph: fail the open_by_handle_at() if the dentry is being unlinked

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

 



While reviewing the implementation of __fh_to_dentry (in the CephFS client), I noticed a possible race condition.

Linux has a syscall linkat(2) which allows, given an open file descriptor, to create a link for the file. So an inode that is unlinked can become linked.

Now the problem: The line ((inode->i_nlink == 0) && !__ceph_is_file_opened(ci)) performs two checks. If, in between those checks, the file goes from the unlinked and open state to the linked and closed state, then we return -ESTALE even though the inode is linked. I don't think this is the intended behavior. I guess this (going from unlinked and open to linked and closed) can happen when a concurrent process calls linkat() and then close().




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

  Powered by Linux