]> git.baikalelectronics.ru Git - kernel.git/commit
ceph: return error for traceless reply race
authorYan, Zheng <zyan@redhat.com>
Wed, 4 Feb 2015 07:10:48 +0000 (15:10 +0800)
committerIlya Dryomov <idryomov@gmail.com>
Thu, 19 Feb 2015 10:31:40 +0000 (13:31 +0300)
commit9064b68dabc197ca951c9f2baa260686ba15f62b
treea1f4d52a98108b57002941a47965320c712428f4
parentbcd6f8270f8ccba95d20beee65dbdb2eb733600e
ceph: return error for traceless reply race

When we receives traceless reply for request that created new inode,
we re-send a lookup request to MDS get information of the newly created
inode. (VFS expects FS' callback return an inode in create case)
This breaks one request into two requests. Other client may modify or
move to the new inode in the middle.

When the race happens, ceph_handle_notrace_create() unconditionally
links the dentry for 'create' operation to the inode returned by lookup.
This may confuse VFS when the inode is a directory (VFS does not allow
multiple linkages for directory inode).

This patch makes ceph_handle_notrace_create() when it detect a race.
This event should be rare and it happens only when we talk to old MDS.
Recent MDS does not send traceless reply for request that creates new
inode.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
fs/ceph/dir.c