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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02D3EC00144 for ; Fri, 29 Jul 2022 20:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238247AbiG2Urq (ORCPT ); Fri, 29 Jul 2022 16:47:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47370 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230089AbiG2Uro (ORCPT ); Fri, 29 Jul 2022 16:47:44 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3159F6A4B6 for ; Fri, 29 Jul 2022 13:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659127662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=bD2SiMlD4xD+BqEtfLLnVfvqTe1uoHgWXGwb6/5GECc=; b=QGnWyPiuVbzugGmvr6QnBg+b7dg/iU6fTwq710Mi+UNVPiUjKReIc5GusLUWWz7IA4D6Ly iyssrVsAB8Re7DFYMpJCH/EdsXXhOVHJBwjImtij5sAVO1jbt2u2+49VowCWuPokZHUsaq lMJFhE5HU9eXcMG7wN0at6L0BZqxR1s= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-617-W4q5IP3nPqu8r8KnJDNhcA-1; Fri, 29 Jul 2022 16:47:38 -0400 X-MC-Unique: W4q5IP3nPqu8r8KnJDNhcA-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41591380451F; Fri, 29 Jul 2022 20:47:38 +0000 (UTC) Received: from dhcp-27-174.brq.redhat.com (unknown [10.40.192.26]) by smtp.corp.redhat.com (Postfix) with SMTP id E89E51121314; Fri, 29 Jul 2022 20:47:35 +0000 (UTC) Received: by dhcp-27-174.brq.redhat.com (nbSMTP-1.00) for uid 1000 oleg@redhat.com; Fri, 29 Jul 2022 22:47:35 +0200 (CEST) Date: Fri, 29 Jul 2022 22:47:32 +0200 From: Oleg Nesterov To: "Eric W. Biederman" Cc: Tycho Andersen , "Serge E. Hallyn" , Miklos Szeredi , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Al Viro Subject: Re: [RFC][PATCH] fuse: In fuse_flush only wait if someone wants the return code Message-ID: <20220729204730.GA3625@redhat.com> References: <20220727191949.GD18822@redhat.com> <20220728091220.GA11207@redhat.com> <87pmhofr1q.fsf@email.froward.int.ebiederm.org> <87v8rfevz3.fsf@email.froward.int.ebiederm.org> <87h72zes14.fsf_-_@email.froward.int.ebiederm.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87h72zes14.fsf_-_@email.froward.int.ebiederm.org> User-Agent: Mutt/1.5.24 (2015-08-30) X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/29, Eric W. Biederman wrote: > > +static int fuse_flush_async(struct file *file, fl_owner_t id) > +{ > + struct inode *inode = file_inode(file); > + struct fuse_mount *fm = get_fuse_mount(inode); > + struct fuse_file *ff = file->private_data; > + struct fuse_flush_args *fa; > + int err; > + > + fa = kzalloc(sizeof(*fa), GFP_KERNEL); > + if (!fa) > + return -ENOMEM; > + > + fa->inarg.fh = ff->fh; > + fa->inarg.lock_owner = fuse_lock_owner_id(fm->fc, id); > + fa->args.opcode = FUSE_FLUSH; > + fa->args.nodeid = get_node_id(inode); > + fa->args.in_numargs = 1; > + fa->args.in_args[0].size = sizeof(fa->inarg); > + fa->args.in_args[0].value = &fa->inarg; > + fa->args.force = true; > + fa->args.end = fuse_flush_end; > + fa->inode = inode; > + __iget(inode); Hmm... who does iput() ? Oleg.