Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp7514468rwl; Thu, 23 Mar 2023 05:31:57 -0700 (PDT) X-Google-Smtp-Source: AK7set+3SwHMDwfkc6adPjS71nN7pmiV3fPff+5HSSjI4PP23xqLb6WgFuzDFMSck3CIOj/pgjuK X-Received: by 2002:a17:903:2443:b0:19f:3234:fec5 with SMTP id l3-20020a170903244300b0019f3234fec5mr7319407pls.51.1679574716847; Thu, 23 Mar 2023 05:31:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679574716; cv=none; d=google.com; s=arc-20160816; b=hPo5mZoUbPccMFCKYgRTyeNsn4Bhc8wCcG1rzJ6YoerS0knbGP/UGXhkWaxCu/2+KO q5SvHfOdwDnKCNgO4FCrNXVKMcazw9ylAC5Bl4/QOwt9BA8y1quVrfloYW7YdFfnp9cN OngXKhSvcHt1/0scdJRpXRe75I2rf0s6nnwPtEFiaLbCO+U0kJsvttBf2Llyq9qJvkXL olABbkcZd6b3Md157DRJZNKvua1T6wY2qoG8/RYf1f7gHEdf48GcmhbYrzUfAXTAk/0u KzecWqNyY5qol+/8Xze6Umr4ogrHT34m/ne/0BINyZDHJd63btUBRigjLv+2iTZ4YckU Bc1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bkZg0fteEv+ot3llQzJst6tGw3eyrfkN8Eh1a5WHKwU=; b=qgNLfCVyQvvKmHcYsk7RIJ0DWJeQ8KyCu1P30jJtLPCGwu17/+E6MUDRiSPRsWSm+E qslbcBhk15HCwFpxabWLU4NDOhJMSpFSLZn2xDgA9J7JVPc0HIP1VH+qR4yjXg7s0Uo2 qb65uZWAL/ePJdPcdrjU6debJm3YqezVEbVWz9IlRhq+HM2x9/DGcDuvG/M11cMPvCX0 vOFFPGKjTF87f9EZR3+9yjDdZGHUiXl+k3Uw76hQiURn5fmvDLL2s2RXwFrOEjl+Msv0 3Q9pvBoyMZGIFCElYZNKTGZnwHDkNAxBK/CyRYXvKJKIjiP+blYOnEZ/WfuujJVu9R/M 08Qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=iebeCD1i; 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 e25-20020a630f19000000b0050bdfdf4a66si17321496pgl.147.2023.03.23.05.31.44; Thu, 23 Mar 2023 05:31:56 -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; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=iebeCD1i; 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 S230372AbjCWMXt (ORCPT + 99 others); Thu, 23 Mar 2023 08:23:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43270 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230121AbjCWMXs (ORCPT ); Thu, 23 Mar 2023 08:23:48 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E48811BEC; Thu, 23 Mar 2023 05:23:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=bkZg0fteEv+ot3llQzJst6tGw3eyrfkN8Eh1a5WHKwU=; b=iebeCD1ikKCkOLi2Kft79o/EpL HMA54VQybdeErM4GIeYLu3XCznsTdTk8XlMk+yqVHpdkGLk0EwRnQhw1666LK2hRoyG4ptxuZrP8y DY5Rd7sdL6HWnn1aePKytB+WqSkUfxldpLag6fT5q55gmQLqE1ySDK6T5OkNKaKWY0+O/gk87sdvg urSaKqpmufPn5BZrOZFHbI9KSGtxRDNnGYGA6DBNgsBrMh7OpVvqZvudqs0Cn7D080p8efg0x9ol6 o3SJ6PhjM6jmYlojSj+vgrS/0EGym6LDS4ui3k9TEMX3e1zXJnfAWEGf+/zIyU8IgapGgnw/DrRz1 2QTJmtRA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pfJyf-003wNM-F2; Thu, 23 Mar 2023 12:23:33 +0000 Date: Thu, 23 Mar 2023 12:23:33 +0000 From: Matthew Wilcox To: gouhao@uniontech.com Cc: viro@zeniv.linux.org.uk, brauner@kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] fs/buffer: adjust the order of might_sleep() in __getblk_gfp() Message-ID: References: <20230323093752.17461-1-gouhao@uniontech.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230323093752.17461-1-gouhao@uniontech.com> X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE 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.