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 2CC4CC00144 for ; Sat, 30 Jul 2022 00:16:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239410AbiG3AQJ (ORCPT ); Fri, 29 Jul 2022 20:16:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229686AbiG3AQG (ORCPT ); Fri, 29 Jul 2022 20:16:06 -0400 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 E1525175A8; Fri, 29 Jul 2022 17:16:04 -0700 (PDT) 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=s3aSkqR/dYUoO2LIxitiibTrasBdwNm6x5YaSCe1T4c=; b=WeIft9Zo2zESXHly8mhIsLVSGb dbJQYDIHLnES8L5DoSiypKxWusG/dtS3icrixuN9xhE/A2NwJid2XZ8KZ1V9uhv8FI5UCrURGSDZ4 gily7+r3epBqZ+DUUpUivY/663gz7QJ2CgOJh6Pjl8c1kV1JquPn9T9ZB/HLwzKbQ5DRSVL+FxETG KCINowQ73vq+HG5ma71zfHBS6dSbLYM3R8P4Pr8dEioZuV5xk5zA+VA/KqqeHWnXB7dPfmaWJqHDM ZfwYkqjwvl16A7k9vKJNbZrncYMNdv/CKocEuuP7eIUq0MfIzd32sVTQV7tNkQnXYU1iOBPHxhEer 6qCOLrEQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oHa8v-00HD4Q-PH; Sat, 30 Jul 2022 00:15:45 +0000 Date: Sat, 30 Jul 2022 01:15:45 +0100 From: Al Viro To: Oleg Nesterov Cc: "Eric W. Biederman" , Tycho Andersen , "Serge E. Hallyn" , Miklos Szeredi , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [RFC][PATCH] fuse: In fuse_flush only wait if someone wants the return code Message-ID: 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> <20220729204730.GA3625@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220729204730.GA3625@redhat.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 29, 2022 at 10:47:32PM +0200, Oleg Nesterov wrote: > 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() ? ... or holds ->i_lock as expected by __iget()...