Received: by 2002:a05:6358:c692:b0:131:369:b2a3 with SMTP id fe18csp762313rwb; Thu, 27 Jul 2023 22:27:27 -0700 (PDT) X-Google-Smtp-Source: APBJJlH7b9zL58GZLYETsCbbrymKsmc0HjHvu8ExuZSbGczzWlK9j0QcmT/b3DvRw9kwq+js0zpx X-Received: by 2002:a9d:6d13:0:b0:6b9:cba0:93a9 with SMTP id o19-20020a9d6d13000000b006b9cba093a9mr1357057otp.31.1690522046762; Thu, 27 Jul 2023 22:27:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690522046; cv=none; d=google.com; s=arc-20160816; b=NGHC8XW6mMtgN1ZNJIVjqtEbk6u6NVgwY/8Oq86bW94Wk5ILtNkXcB4hytkHNTiBJx 228j7o4U6hVgy1RlXv/BUwX1bKLKFzF8dZlpfkIUGhTz/oAtnHR3HIHjj7qT1NYtGg+U oJCmUEd21FLHbpPG4yys4fq5rUvtT2LcJjmDlJNQC2AYusNp6piR9Ca/bOsyoZVue/aF S+rEet80OTx1kaK3n3VKkJxrb72PzESUZMv4CJPg1Cw9fMqJ1RePIEaVeyw1ScHlkJgb fTrXymAvzZo0RcuaWEnNfKyXXhWotC4SikBtKL3oGmgMmvNsHUbKdXqK2x7wTVG767t3 YHfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id; bh=ZARm40aPisTp+8wvDSSUipvG8sNQy5OKEwSfC9Hkd+s=; fh=zWmbvOT8nk7dxoSSGLPHlsaGIQ9ni7tKQUs4m7lhSH0=; b=Szi79UiUkV9SIJs4NkHgKKLdsjHU1JZWUahYV6I+LF9M69K9g59oqhCf4BPivB3wSC jrvE8G1MKjm/O1tiOJWvYJ75V8yjoA0Z38/hxrmAvXqtSMmg8epF7S+n2SMgNEGvYX0z +kmQ2c7KPURIotjLWacfQiAJSwWVCHdno6we8hP1jp3xNRFrlvz65lQ/hhJrdhSROGgR AwO0iFOP1C7tEIOA124T8TfAEANDJO+khE6FcUkMK202mWRFX13qJBjYbTF4Ntmin7p+ ZMIwBrVWzeljFmZ5C+11tNFWq35JmnbrnvmbX6qgHWQcSw6vwnBONjSaV+HooA0EMrcg HmuA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uls.co.za Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m3-20020a632603000000b005575a066789si2436953pgm.341.2023.07.27.22.27.13; Thu, 27 Jul 2023 22:27:26 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=uls.co.za Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232982AbjG1FFm (ORCPT + 99 others); Fri, 28 Jul 2023 01:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54620 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230512AbjG1FFk (ORCPT ); Fri, 28 Jul 2023 01:05:40 -0400 Received: from bagheera.iewc.co.za (bagheera.iewc.co.za [IPv6:2c0f:f720:0:3::9a49:2249]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EB282D67; Thu, 27 Jul 2023 22:05:38 -0700 (PDT) Received: from [154.73.32.4] (helo=tauri.local.uls.co.za) by bagheera.iewc.co.za with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qPFf1-0005PS-Vn; Fri, 28 Jul 2023 07:05:08 +0200 Received: from [192.168.1.145] by tauri.local.uls.co.za with esmtp (Exim 4.94.2) (envelope-from ) id 1qPFf0-0005t6-R4; Fri, 28 Jul 2023 07:05:06 +0200 Message-ID: Date: Fri, 28 Jul 2023 07:05:06 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] fuse: enable larger read buffers for readdir [v2]. Content-Language: en-GB To: Bernd Schubert , Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Randy Dunlap , Antonio SJ Musumeci References: <20230726105953.843-1-jaco@uls.co.za> <20230727081237.18217-1-jaco@uls.co.za> From: Jaco Kroon Organization: Ultimate Linux Solutions (Pty) Ltd In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi, >>>          plus = fuse_use_readdirplus(inode, ctx); >>>          ap->args.out_pages = true; >>> -       ap->num_pages = 1; >>> +       ap->num_pages = READDIR_PAGES; >> >> No.  This is the array lenght, which is 1.  This is the hack I guess, >> which makes the above trick work. > > Hmm, ap->num_pages / ap->pages[] is used in fuse_copy_pages, but so is > ap->descs[] - shouldn't the patch caused an out-of-bound access? > Out of interest, would you mind to explain how the hack worked? Apparently it shouldn't ... my understanding of how pages* worked was all wrong. I'm guessing since all the data fits in the first page (ap->pages[0] in other words, of length/size desc.length) that the other pages are never accessed.  Looking at fuse_copy_pages this does indeed seem to be the case.  So I ended up just being really, really lucky here. Kind regards, Jaco