Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp216558ybh; Tue, 14 Jul 2020 23:31:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwae3BeBf8Y+aXCE7u/x8ILtZbfyutvFntTxOOlVh0pB3nf/o/MDGNF04q5KrXpHqfrUqYi X-Received: by 2002:a17:906:c209:: with SMTP id d9mr8095788ejz.449.1594794680741; Tue, 14 Jul 2020 23:31:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594794680; cv=none; d=google.com; s=arc-20160816; b=gJqiY9YOncZ/0iUHBPCgXsyiLMk8hsnM6FEGx0i0OGfnhD1J/x4VjY1YrIGJJ/7ItY YfeTL9q5B1RP3Yb6JmO1oalvZAd1qOEvG4YpLiiydDBSfjEERu3VQiPtfa8rwr9dvWgj iQNMigdPfhkrNEXk5ZeiDXv/smpNPbgC/ARgJVlb1JWPqpAGBkxmtE+np3kHkPrGwUxN krn4Jes+fePuDxgxMqzDxRRLM/C+3l/qVFnsCeZUcHEKdvhDHOvK4Io+nJIz7Lr9/hKn puY/6Yk9fjVALbKyGknMqp6lgFZRODQKYPR+6I/YUA0AlA6qk8rZ7j0ZFv4mN8cnnvb4 pGFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=PCq6UWX/MuFlyUyuIx1KVBfYPyJvjS7FqQ3oZPKfSBs=; b=ui4mOxFIwOvxB+oremTzNQ4Bz12jOAvH723c15fy6VNa4ZajHGheZ3uEIB4kohVVlk Pf3n84t+JW9LsszBvHEQLV6/2p7c1rsalRloNbZZwZF04wYe+FXDCZhKRGBWdAnpOW+H yCuDudQ/PaWi8ey/8jDM/xlP/yFIZCOfQNUUs9tMradQxdgVpO9trfzhcYT5rFcaom6I yLYcYdw7z2XRWVPoi4GRmSlpS/JAvfXnojwhQcARWKfZj1VoLcumIOCdazGT1kXMePPR 67BoHWxEOvxvEibPEcWD8bzVnJIveP6cQN8H6u+FPqPj41i69wMzQZB4m/jRue6xL6/R KcIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f1si639311eje.610.2020.07.14.23.30.57; Tue, 14 Jul 2020 23:31:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728669AbgGOG1P (ORCPT + 99 others); Wed, 15 Jul 2020 02:27:15 -0400 Received: from verein.lst.de ([213.95.11.211]:57655 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbgGOG1P (ORCPT ); Wed, 15 Jul 2020 02:27:15 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 15E5467357; Wed, 15 Jul 2020 08:27:12 +0200 (CEST) Date: Wed, 15 Jul 2020 08:27:11 +0200 From: Christoph Hellwig To: Linus Torvalds Cc: Christoph Hellwig , Linux Kernel Mailing List , "H. Peter Anvin" , Song Liu , Al Viro , linux-raid@vger.kernel.org, linux-fsdevel Subject: Re: [PATCH 17/23] initramfs: switch initramfs unpacking to struct file based APIs Message-ID: <20200715062711.GA21447@lst.de> References: <20200714190427.4332-1-hch@lst.de> <20200714190427.4332-18-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 14, 2020 at 12:31:01PM -0700, Linus Torvalds wrote: > That "vcollected" is ugly and broken, and seems oh-so-wrong. > > Because it's only use is: > > > > - ksys_close(wfd); > > + fput(wfile); > > do_utime(vcollected, mtime); > > kfree(vcollected); > > which should just have done the exact same thing that you did with > vfs_chown() and friends: we already have a "utimes_common()" that > takes a path, and it could have been made into "vfs_utimes()", and > then this whole vcollected confusion would go away and be replaced by > > vfs_truncate(&wfile->f_path, mtime); > > (ok, with all the "timespec64 t[2]" things going on that do_utime() > does now, but you get the idea). > > Talk about de-crufting that initramfs unpacking.. > > But I don't hate this patch, I'm just pointing out that there's room > for improvement. I'll send another series to clean this up. I had a few utimes related patch in a later series and this fits in pretty well with those.