From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5019FC433ED for ; Sun, 2 May 2021 22:59:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1D4CB611EE for ; Sun, 2 May 2021 22:59:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232166AbhEBXAU (ORCPT ); Sun, 2 May 2021 19:00:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230036AbhEBXAT (ORCPT ); Sun, 2 May 2021 19:00:19 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4577AC06174A for ; Sun, 2 May 2021 15:59:27 -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=glxyuYJp1BIGffXRJutfwTpBRZp72WEHpUf+fCAIPeU=; b=Q+T02j36y4Mb/3Z4UELnNVU5Va oIb7WRvxu6kzHCaFiT8ZpS/AcA1uHWA5Pcu9WZrydm8k7tb/xFlBHI2xmTu1KZaLz5ZlCMg95LBrO T571cF8AM8lY6HcI6UNNH9kFOMldQuFu5pfraHQI9IGcMaOpbmw4lj1jQs/FpEsJ/ga7h9USEg59n KmUrTYtAD/gwHNgQlcXgDrZbFgGmUK0n1KclqOsokgT+t5P0gslegNOqkNVE6YHD91dSus+2d3Q78 HGD2P215YEH+WRSKL9KL6vS69gMEnNKztohdMCUmuXHCqIHIncyVyMP8MDYijgE0tCZ8OlpFj3JTT iB1ivt7Q==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1ldL38-00EMSJ-5S; Sun, 02 May 2021 22:59:04 +0000 Date: Sun, 2 May 2021 23:58:54 +0100 From: Matthew Wilcox To: Mike Marshall Cc: Linus Torvalds , linux-fsdevel , Mike Marshall Subject: Re: [GIT PULL] orangefs pull request for 5.13 Message-ID: <20210502225854.GA1847222@casper.infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Sun, May 02, 2021 at 04:45:19PM -0400, Mike Marshall wrote: > orangefs: implement orangefs_readahead > > mm/readahead.c/read_pages was quite a bit different back > when I put my open-coded readahead logic into orangefs_readpage. > It seemed to work as designed then, it is a trainwreck now. Hey Mike, I happened to have a chance to look at orangefs_readahead today, and I'd like to suggest a minor improvement. It's possible for rac->file to be NULL if the caller doesn't have a struct file. I think that only happens when filesystems call their own readahead routine internally, but in case it might happen from generic code in the future, I recommend you do something like ... - struct file *file = rac->file; - struct inode *inode = file->f_mapping->host; + struct inode *inode = rac->mapping->host; ... - i_pages = &file->f_mapping->i_pages; + i_pages = &rac->mapping->i_pages; ... - inode->i_size, NULL, NULL, file)) < 0) + inode->i_size, NULL, NULL, rac->file)) < 0) (i have this change all tangled up with some other changes in my tree, so no easy patch to apply, sorry)