Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ceph: register MDS request with dir inode from the start

When the unsafe reply to a request comes in, the request is put on the
r_unsafe_dir inode's list. In future patches, we're going to need to
wait on requests that may not have gotten an unsafe reply yet.

Change __register_request to put the entry on the dir inode's list when
the pointer is set in the request, and don't check the
CEPH_MDS_R_GOT_UNSAFE flag when unregistering it.

The only place that uses this list today is fsync codepath, and with
the coming changes, we'll want to wait on all operations whether it has
gotten an unsafe reply or not.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>

authored by

Jeff Layton and committed by
Ilya Dryomov
3db0a2fc 7111951b

+6 -10
+6 -10
fs/ceph/mds_client.c
··· 793 793 mdsc->oldest_tid = req->r_tid; 794 794 795 795 if (dir) { 796 + struct ceph_inode_info *ci = ceph_inode(dir); 797 + 796 798 ihold(dir); 797 799 req->r_unsafe_dir = dir; 800 + spin_lock(&ci->i_unsafe_lock); 801 + list_add_tail(&req->r_unsafe_dir_item, &ci->i_unsafe_dirops); 802 + spin_unlock(&ci->i_unsafe_lock); 798 803 } 799 804 } 800 805 ··· 827 822 828 823 erase_request(&mdsc->request_tree, req); 829 824 830 - if (req->r_unsafe_dir && 831 - test_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags)) { 825 + if (req->r_unsafe_dir) { 832 826 struct ceph_inode_info *ci = ceph_inode(req->r_unsafe_dir); 833 827 spin_lock(&ci->i_unsafe_lock); 834 828 list_del_init(&req->r_unsafe_dir_item); ··· 2939 2935 } else { 2940 2936 set_bit(CEPH_MDS_R_GOT_UNSAFE, &req->r_req_flags); 2941 2937 list_add_tail(&req->r_unsafe_item, &req->r_session->s_unsafe); 2942 - if (req->r_unsafe_dir) { 2943 - struct ceph_inode_info *ci = 2944 - ceph_inode(req->r_unsafe_dir); 2945 - spin_lock(&ci->i_unsafe_lock); 2946 - list_add_tail(&req->r_unsafe_dir_item, 2947 - &ci->i_unsafe_dirops); 2948 - spin_unlock(&ci->i_unsafe_lock); 2949 - } 2950 2938 } 2951 2939 2952 2940 dout("handle_reply tid %lld result %d\n", tid, result);