Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5979194rwb; Sun, 11 Dec 2022 16:39:02 -0800 (PST) X-Google-Smtp-Source: AA0mqf5r3TNbIRdHOqPJbwCOCQoJVywGLsALswkOe6gDF1TMO2MK7xGOnqwf5wIFU5A5E/LvVL3z X-Received: by 2002:a05:6a00:1c89:b0:576:e33e:cd63 with SMTP id y9-20020a056a001c8900b00576e33ecd63mr12854777pfw.30.1670805542159; Sun, 11 Dec 2022 16:39:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670805542; cv=none; d=google.com; s=arc-20160816; b=YwZpToNWRF34Z1Q0Yo1Lq8Sf3pLRqhPPVm9HlqNniObjn3/ZT+LgHqnjtYuVI0QnjA Ki1bOQ8Y9ghuUw/E+SIM8OS95DFx90BWoaJXkJ8Y5/GVqiikwmxQgWN0Obe1H6XBgopt zECMGzhu0VOlOjBYtz+11SNCyhbMV6iLNADPzUdpX6ti8ih01jcrocRF/4OvJYQWB3V2 hEhwQ3KoqhtQnQWlDDqhnTJDaKnDKLBhHBsJI6YfnLe8VM3p+p9NZe6oIswUwkFI/PId EhYu3VtLRPNsw4iFoT52NoDz1TWnDFOOdGZQ/h+xBEnvT3AdOf5gjCOLANdFnaiErZSV jZfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RkoXLrf60DlqfevHVd1fistJ/ZvbvLvkVLWJvdmPdTY=; b=JzcXxGPbmEyPqmYDGRBKSlbiFIJvgPlgbL3U0kH8cWh6MGvjo1Y6+xlrii3ajDfMK8 RvHz3kvITXR2LfzgrUCL/umYvfwBeGltAIOu053zpqsQlOx5XtDzPhHAqAw7bJt5lo29 Gf4Zwhtn30HYkkz7t3pXSNfDglr5nnTI8RCRo3+Gd7e9DKMW2MmVi7xBgtHy5ZjNCPnl T4/IoF2NYCTey909Rdzun0amC71/c2pUfl09fZ8fUa4rCG98hpExb1WmBNk62j86NJuk GRsZNtlaZ36SbEHRiCq2Swg0pnGAfIuMtnNOlVzeX+kde22fd6dbsOLSkwwGVRZyemDR PlZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=t2swjnBP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dc8-20020a056a0035c800b005752121f13dsi7889169pfb.113.2022.12.11.16.38.52; Sun, 11 Dec 2022 16:39:02 -0800 (PST) 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=@linux.org.uk header.s=zeniv-20220401 header.b=t2swjnBP; 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=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230398AbiLKW3k (ORCPT + 75 others); Sun, 11 Dec 2022 17:29:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229845AbiLKW3i (ORCPT ); Sun, 11 Dec 2022 17:29:38 -0500 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 91B11BE27; Sun, 11 Dec 2022 14:29:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=RkoXLrf60DlqfevHVd1fistJ/ZvbvLvkVLWJvdmPdTY=; b=t2swjnBPMgJs0tduA6VEkoE4ms qg1XHhVIB+Tdxrw2ZvPedffiLUl8yP98KB/DVSBDEcNvi9lMIyQKVz8x3uzDnhRXiSrESBEzJ9w0V NVde3mnrdrxklo48kk7dHLVQ5sf6acV9YmRKsd3bCTnUy3AVoc0wpmND9tQenRnPj7AKW/LKTkjbj H6cyhGaJ/R9vTfkoW92/4S7Qq8tVqp3jl25IbpElvmkxtp7DAbbwvVCIjQHIXahkNVbAFRg1zOxIU wz7joIsCkxpshuCXlTRbyfnTuwmBanOMpZlcjU54XE7z9CYNCTWoVMkOXSOw+X/v/ske1FfrQaG+3 kITHprQg==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1p4Up9-00B6qQ-0P; Sun, 11 Dec 2022 22:29:31 +0000 Date: Sun, 11 Dec 2022 22:29:31 +0000 From: Al Viro To: "Fabio M. De Francesco" Cc: Evgeniy Dushistov , Ira Weiny , linux-kernel@vger.kernel.org, bpf@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 2/3] fs/ufs: Change the signature of ufs_get_page() Message-ID: References: <20221211213111.30085-1-fmdefrancesco@gmail.com> <20221211213111.30085-3-fmdefrancesco@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221211213111.30085-3-fmdefrancesco@gmail.com> Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE 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 On Sun, Dec 11, 2022 at 10:31:10PM +0100, Fabio M. De Francesco wrote: > -static struct page *ufs_get_page(struct inode *dir, unsigned long n) > +static void *ufs_get_page(struct inode *dir, unsigned long n, struct page **page) > { > struct address_space *mapping = dir->i_mapping; > - struct page *page = read_mapping_page(mapping, n, NULL); > - if (!IS_ERR(page)) { > - kmap(page); > - if (unlikely(!PageChecked(page))) { > - if (!ufs_check_page(page)) > + *page = read_mapping_page(mapping, n, NULL); > + if (!IS_ERR(*page)) { > + kmap(*page); > + if (unlikely(!PageChecked(*page))) { > + if (!ufs_check_page(*page)) > goto fail; > } > } > return page; return page_address(page), surely? > > fail: > - ufs_put_page(page); > + ufs_put_page(*page); > return ERR_PTR(-EIO); > } > > @@ -227,15 +227,12 @@ ufs_next_entry(struct super_block *sb, struct ufs_dir_entry *p) > > struct ufs_dir_entry *ufs_dotdot(struct inode *dir, struct page **p) > { > - struct page *page = ufs_get_page(dir, 0); > - struct ufs_dir_entry *de = NULL; > + struct ufs_dir_entry *de = ufs_get_page(dir, 0, p); ... considering e.g. this. The caller expects the pointer to beginning of page, not pointer to struct page itself. Other callers are also like that...