Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2595201ybg; Fri, 31 Jul 2020 04:58:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye3kSZCFjlgOS2lEKKlqaoHoQw9fcR0aF7f4LDkk29vz9q2VyERSW8coyf83Ygl+p5lvV5 X-Received: by 2002:a17:906:60c6:: with SMTP id f6mr3474488ejk.265.1596196680528; Fri, 31 Jul 2020 04:58:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596196680; cv=none; d=google.com; s=arc-20160816; b=o0aqlBK9/q6mpLf5Sk/F92MXMbHx06AExo9MTpvKnZFFG5JMPaUxgKk4p/PDWLNa66 xPi01i5eolEqPXqeJigkiL6B+6scmdf/6TlZkutixSlfiZM3SnmfHd7YatWXPGc/oLxq GtdaFTs9MZW/T+06UIqdB7FL+XyO77zu37qkVfW/OpPw/rHxB9uZPeZECzvKZSaOe2Of w07z9k87S7aPLvd1jVtKdEmdITieMsNanS5aNsDM8FtV55r6+VGamL1VUk2BIXjYFUhr IRGHRi3bXmkBsoWsSN9mnowBV56QZ7ANys/a3eJkdPOGnSFeiI5kiwXlz3vVaFJZABPl sGDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id:dkim-signature; bh=DZEmb5QpciOTDtRnuwdgHoO/DXBXQzNhtgND0HhCw3g=; b=ge8jq1wcX5GKZ7wnNGA8goPl0NZkDX0n+ZxVQIAkcrW+8VG5B+DXmzh0rRs4i6xQzB Nw8829mWxGrGfNqBo7ZSV/LO4qyIkGLSuH00S1D3iARB1r9BVNlj1OqRxEzH8WxgrnS4 J+7lhj+DO5MQ/I1Mxh5k+U7fjLiM2dAA5iDBmGw/GZZbMSW6FvqoZOPT2G8rjsSAYp44 lfATFj4mSaf8kV3K2IGXs6mOejp5ycWbF5DsEQO4Hw2nYcENYcusmh7la2CcSP8vOXjn cirSvXQiYG8+7a2iNIEUufmJ0tcUmGLXJmZfo7cVJd6phyyhUFK8qZBqZlovyF5qqrjd bwjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="I/U5X4an"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g6si4948416edk.604.2020.07.31.04.57.36; Fri, 31 Jul 2020 04:58:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="I/U5X4an"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732776AbgGaL5U (ORCPT + 99 others); Fri, 31 Jul 2020 07:57:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:51912 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732689AbgGaL5T (ORCPT ); Fri, 31 Jul 2020 07:57:19 -0400 Received: from tleilax.poochiereds.net (68-20-15-154.lightspeed.rlghnc.sbcglobal.net [68.20.15.154]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D30952245C; Fri, 31 Jul 2020 11:57:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1596196639; bh=+k3lFtYGhDnloybocGoXeHOCVdx05t4BuYuTBWRbY8k=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=I/U5X4ann1uOLkPXYvcX5ePUiDBHlhMCR+wxShGSNt3JZrl9GLDjd/Qz/F9QwbyiE kRmHHFytj+OXysKHDnnHbstpFVOesoPhMql6z3xtr8WNBSfUwD7BB1n2uzgEUVNmfb fxB1+fvihvnCQomBRiVmpDGwrOveHHUnQcAT8z/M= Message-ID: <8e87954aa5d04dd25330afd68b396ef40ff53398.camel@kernel.org> Subject: Re: [v2] ceph: use frag's MDS in either mode From: Jeff Layton To: Yanhu Cao Cc: idryomov@gmail.com, ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org Date: Fri, 31 Jul 2020 07:57:17 -0400 In-Reply-To: <20200731082513.11806-1-gmayyyha@gmail.com> References: <20200731082513.11806-1-gmayyyha@gmail.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.4 (3.36.4-1.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2020-07-31 at 16:25 +0800, Yanhu Cao wrote: > When doing some tests with multiple mds, there are many > mds forwarding requests between them and then the client request > is resent. > > If the request is a modification operation and the mode is set to USE_AUTH_MDS. > Auth mds should be selected to handle the request, and if auth mds for > frag is already set, it can be returned directly without the logic behind it. > > But the current logic doesn't return directly because the condition > 'mode == USE_AUTH_MDS', and sometimes frag's mds is not equal to > cap's session mds, which then causes the request to be resent. > > Signed-off-by: Yanhu Cao > --- > fs/ceph/mds_client.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/fs/ceph/mds_client.c b/fs/ceph/mds_client.c > index a50497142e59..b2255a9be7c0 100644 > --- a/fs/ceph/mds_client.c > +++ b/fs/ceph/mds_client.c > @@ -1103,8 +1103,7 @@ static int __choose_mds(struct ceph_mds_client *mdsc, > frag.frag, mds); > if (ceph_mdsmap_get_state(mdsc->mdsmap, mds) >= > CEPH_MDS_STATE_ACTIVE) { > - if (mode == USE_ANY_MDS && > - !ceph_mdsmap_is_laggy(mdsc->mdsmap, > + if (!ceph_mdsmap_is_laggy(mdsc->mdsmap, > mds)) > goto out; > } Much better! A good changelog is as important as the patch, esp in code like this that is quite non-obvious. Merged into testing branch. I did clean up the changelog a bit before I merged it. Please take a look when you have time and let me know if you think I got it wrong. Thanks! -- Jeff Layton