Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp595036imn; Fri, 29 Jul 2022 17:22:07 -0700 (PDT) X-Google-Smtp-Source: AA6agR62sWMuVXcDMdPSR23s7ZgbkodLwVsG5dYoVwdancUhR2LvinYCcdk9dQkr2nHFcdkax3ST X-Received: by 2002:a17:902:ef4d:b0:16d:ab14:cc7b with SMTP id e13-20020a170902ef4d00b0016dab14cc7bmr6231747plx.59.1659140527422; Fri, 29 Jul 2022 17:22:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659140527; cv=none; d=google.com; s=arc-20160816; b=MtenPkuOpLobXSTDi9tuLTrRf6gvYQOtlg/ylv1ZA5ebTwnQF2/PTePCdVFjyxZXpx 7GrJ9YaUFTAVMjSubBPT/gwh8HBF88JZ9JrUqmVGaNu37g/SjUIiOf+2zPCyrtkscf8S QJmt7q8vvCIkXAU6TkoqZarO1K4sZbgt5dT5y3eM19OlhBk8Mo9M/1ZOaAg/oXzZHaVJ qQyfRoj7eK7is4Fid1MRP48qvHBo2/e05/OAgs4MZ23KS99XZNNoVUQchbTltpKBgQrk H7P5pqNEG6zhboBjCe0YCjJcGO511z4BArCqzixjW+rr29VX6i+gsBscsx2llOYaYWuZ jjhA== 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=s3aSkqR/dYUoO2LIxitiibTrasBdwNm6x5YaSCe1T4c=; b=SlXPQ/bOPbfSi24I5QSil9G5lrjjp6K+uW3Y6ApWh94dfU5upGpF2eOfU1Ag1XYVve 8wyFGCzQ6uE/qiBvWj138Es/01h41QY356w5o+ZZx208GEhRzgml8Ua35/O0HOwRLGs2 6jvlvQE9VX6o00VNMrJ3Ce1vp31e/zjYT+fm+mdRiKAdX4/63b7W78s7WVmolfeaMpv/ SwNb8q+aP0C4wV/2Tl9a0Phgn1imrgDw/lLgjez2+8f+T94FoH+5SfLQ1cFnSbgwj7zS lJElihQLwIfBzWsH1UUAQo4OdZVrbD+NY7SH86wfGTcuWWiMbwlxaLrj9HZX8nnYa/et zlzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=WeIft9Zo; 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 h7-20020a17090ac38700b001f326875740si4506930pjt.20.2022.07.29.17.21.35; Fri, 29 Jul 2022 17:22:07 -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=@linux.org.uk header.s=zeniv-20220401 header.b=WeIft9Zo; 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 S239299AbiG3AQH (ORCPT + 99 others); Fri, 29 Jul 2022 20:16:07 -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 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 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()...