Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp2522611rwb; Sun, 6 Aug 2023 21:23:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFnJyFUDV3ljc12+u62ZnXSlzWN7kaLlL+plyRPOORsF0cQqvXRHDqcr40trK/XRV3E6I5T X-Received: by 2002:a05:6358:63a4:b0:13a:935:9f6d with SMTP id k36-20020a05635863a400b0013a09359f6dmr6489950rwh.25.1691382229883; Sun, 06 Aug 2023 21:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691382229; cv=none; d=google.com; s=arc-20160816; b=qEcWeUMldWV2K/bQQe6i0sI7DT76f7yzhUMs0oAdV1yWDv3htGNURi6Phe3IOu86YE Ti/+DnoRxPiIAhyl5zJ/26QNPQjXxxI5X8aly5fhfKv6OkAobm+vF0W2db50zd1kxEad mq9rSvKNJ8ypq6HQ1nPnEwt27d9figZe+zES3xrl3SUx0ti6aosYpfEAYEFZ7P5tNO5D DDKg8IAo/5XW9IxTQcyU3ApeGHO/4RdKG48fwFbEwQR1am6r/Yw0h4GItkzYLZT8LkiF l7OcDY3sSyQlIahPYjcOQinBS3Mg8+YeKZv3aJ/OfgV1eW1paKZUMdMWcYSkUVscnWTO YBYg== 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=YLGI+m+NtSfah82olnSRoKFqUzieef4s4ojluCMDHpQ=; fh=OuPZaBAbxcFr+nIturk+vmgb55p6ykwyHg+Ogi6neck=; b=A8x2hH6FHYB9VzhvB0NniwchedbEvSxELOm17l8lhTQ2ePCVEgWN9Zpu6yVN1Ahh8j bmfaTx97wy7Ov2AlHKy3noE5sYhsa8G8RNOi/kAfKGjFHYLf3Lh1kbmVbZVCkeEZKYC9 QXrUwPjvAEf+sUyb2G63IMoRkhP3Z+7CI3zsDEIORtU45BYt1J3oSGx+lO3nH7mWjAMI Zbrb+fEJ0sM1a7HvYZM1GR7mFjzq5OYEpzANyhsITm7kEPaCFUIDPDneauI7ieAYY8ka 1serPq+zxDQ7YwXiPbCjTG0WGZUSwaafJwPYFy74QY6SkVmheUeROAdL/rkXCjzaZFwr JMaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=avi5+BV2; 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 y127-20020a636485000000b00563f4c4fb02si5178519pgb.622.2023.08.06.21.23.36; Sun, 06 Aug 2023 21:23:49 -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=avi5+BV2; 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 S229941AbjHGDSo (ORCPT + 99 others); Sun, 6 Aug 2023 23:18:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55176 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbjHGDSm (ORCPT ); Sun, 6 Aug 2023 23:18:42 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADC4E10F7; Sun, 6 Aug 2023 20:18:41 -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=YLGI+m+NtSfah82olnSRoKFqUzieef4s4ojluCMDHpQ=; b=avi5+BV2nn4+9w0hK9/NTCHS9f fHFDN2iP+4ajHibTF3ytnoRejVZvJuizuiWN3+ZJw7aKfMR7FRQAl2r1s7fELP0EC39pnh39Kveu1 VOwEg6QBl3iXnaMHMiS9RYcmxUKXiOf9FgdLxGP5Y9m5cEKVdqesePOkhfUOa+tFJQoitydRmNsWr TIGXzMYjGsoEqejJgOqI8ovxWuTEkN74sBZqkezFzAX1wjZXHCyjPuf+1PDmxZXGknOoqFdCnLJNl HiGGROamZfkEYwUE7CgVkzADgahTorf8aAzHWrOhVCn77xvtQiiZQZTIuQ3lYW83TvOv1BTH+LtNl ttBAmL+w==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qSqlS-00828U-Qi; Mon, 07 Aug 2023 03:18:38 +0000 Date: Mon, 7 Aug 2023 04:18:38 +0100 From: Matthew Wilcox To: Mateusz Guzik Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, oleg@redhat.com Subject: Re: [PATCH] fs: use __fput_sync in close(2) Message-ID: References: <20230806230627.1394689-1-mjguzik@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230806230627.1394689-1-mjguzik@gmail.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, 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 Mon, Aug 07, 2023 at 01:06:27AM +0200, Mateusz Guzik wrote: > With the assumption this is not going to work, I wrote my own patch > which adds close_fd_sync() and filp_close_sync(). They are shipped as > dedicated func entry points, but perhaps inlines which internally add a > flag to to the underlying routine would be preferred? Yes, I think static inlines would be better here. > Also adding __ in > front would be in line with __fput_sync, but having __filp_close_sync > call __filp_close looks weird to me. I'd handle this as ... int file_close_sync(struct file *, fl_owner_t, bool sync); static inline filp_close(struct file *file, fl_owner_t owner) { return file_close_sync(file, owner, false); }