Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp429156rwl; Thu, 23 Mar 2023 18:55:23 -0700 (PDT) X-Google-Smtp-Source: AKy350b0AqYKLm2CvDgOFMobH5hb9lAxreoDzdXQwennglnoBvSDy4VOwRX5i70nB2MpwoFvx+jO X-Received: by 2002:a17:90b:1647:b0:237:50b6:7835 with SMTP id il7-20020a17090b164700b0023750b67835mr1117476pjb.20.1679622922827; Thu, 23 Mar 2023 18:55:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679622922; cv=none; d=google.com; s=arc-20160816; b=hglA8KuFH58v8FGJIC1GA+4jji+DjUAt3q9AZkcRxih1GJe1RcbGS5Aal5f8sRxT8s XjUOXWmUUA/Nx1KvpypLQneD2H9jU/iWM5pJSlCKETNwDUymlEIhxqtsqqGW1EMhgvmU UdyoAurtoWVvuzwlUhJrtVtF0OsV52WubMfSSdbvmmi/I8lL46E7unsy31YNHLZXAF9H lGzzHBhBm9UziUnJFwVziTNDlM9zzRI2Zpk3hMuC7GnV87kUNJuwPkQp1Dc8PI7uIVxv jpXtq3hfD19AbYo0p4dZwCba/aB1BMagZutVgB0t8jIYA+20E5BCpumzepUFBWfYYIUT vG5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:feedback-id:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=2eJRPLGPw2Fgmu/zw0rEfnEJ3MJyOe6OtN8gnimXBds=; b=C6W0GoXY8nmTyk7DFCge7pKYKII4+hh/v11k8XSnnH6l0rmJNPR5aaG9iWYeuiUISW 7dnjmssnteYAm2Tg2nP8UdC82aD0f9qnLrHfRAw/5O/H4zkKP5fgnJnIvcoww7hVn1rJ 7VB/iPPOL6JCmChh6BOY/1fhNkE8nuTQh0nkQzQRY/rUYkYqz94K+YfRqmqEku2QCyWI 7/C+Ci/+yDGr+nYm1faiPvBQkJsnGc7j/9R6P17x2QXYVUDyL9bZw1Uf27jJuZhMcm8w FWjnGdEVT3eWVhlw8RBEPDsIKSPpzUxBlFpWZV7SmgB8CsdjZSisJmRVLszrEu4vgAjn j0Yg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l6-20020a654486000000b00503a2a21d1esi19635543pgq.728.2023.03.23.18.55.10; Thu, 23 Mar 2023 18:55:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230471AbjCXBwW (ORCPT + 99 others); Thu, 23 Mar 2023 21:52:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38752 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbjCXBwU (ORCPT ); Thu, 23 Mar 2023 21:52:20 -0400 Received: from smtpbgjp3.qq.com (smtpbgjp3.qq.com [54.92.39.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE92A2331A; Thu, 23 Mar 2023 18:52:18 -0700 (PDT) X-QQ-mid: bizesmtp81t1679622724t44d0krm Received: from localhost.localdomain ( [113.200.76.118]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 24 Mar 2023 09:52:03 +0800 (CST) X-QQ-SSF: 01400000000000B0E000000A0000000 X-QQ-FEAT: fQ7bGlHvZRF4Sn2zEN6FX0NS95S4FTJ9NyzD7uSP8SFE1RnwJWLrQVbaOLqT1 Atqlhfwx3tYgh6kDX+r7nd4Rwq9f0k4J4gbp1c99PHn4X5LUDUBLRL36gdUjjw0gmDgw7CW vmQT9IDtivSuYgQWpQEJeVp92trHQ9YZwlS0dSjvONcEiwcyq9gc8WJDKuLE6ZQdZDDM2v6 v4MBf9KLWu3LfRgWtC4teGF1R3tsVl2A3wsIw5zLUOVXVVzdhBaEMLf/Kf7h3KhP/T/u/rD YSfmH5XZtTqkHK0l5m8ujDa8xmaRUcyK53vMUEIBuu3Q+/1DFG8VHEeHTXOpYvDmDF4hcps lPLz6PVZDBfuP3Yd2EJj3vgrMzR0yG5D7Te+a4yyg73yIxHg2sCriMUhCEZn7dxW0gVh7a4 X-QQ-GoodBg: 1 From: gouhao@uniontech.com To: willy@infradead.org Cc: brauner@kernel.org, gouhao@uniontech.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, viro@zeniv.linux.org.uk Subject: Re: [PATCH] fs/buffer: adjust the order of might_sleep() in __getblk_gfp() Date: Fri, 24 Mar 2023 09:52:01 +0800 Message-Id: <20230324015201.12511-1-gouhao@uniontech.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:uniontech.com:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >On Thu, Mar 23, 2023 at 05:37:52PM +0800, gouhao@uniontech.com wrote: >> From: Gou Hao >> >> If 'bh' is found in cache, just return directly. >> might_sleep() is only required on slow paths. > >You're missing the point. The caller can't know whether the slow or >fast path will be taken. So it must _never_ call this function if it >cannot sleep. I see. Thank you for your explanation! :)