Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp20525841ybl; Sun, 5 Jan 2020 04:49:31 -0800 (PST) X-Google-Smtp-Source: APXvYqzO9uewh0+Jmb/+lY2UcNaGc8O84SYckGtqeV7PDUDcarTtsFWciWlHpHlKmYT6T3RFlasj X-Received: by 2002:a9d:21f4:: with SMTP id s107mr112749304otb.102.1578228571607; Sun, 05 Jan 2020 04:49:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578228571; cv=none; d=google.com; s=arc-20160816; b=koK8TTBUgvNXlt7qwhnMH2Y9yq9y0ybiVrExTsEyi/Zt3aqE0REcQf1dASx0Qja2GR sUPONi0O3keSmck4LK6TWN8AWNQ25bIOw6lKB41Vwj0JpF7zwdGCCntHlLpR72y15kZP f9zUk107k2SUt2NUi2QpCZA+uGNu8CzsYXi7KvWBnMzf1BFZod41ynjuqZbYYL8K3jaA GsW0KhX1QFjO2CqjZJKpU0N5b2BNugDCWvDGJgN87Koaq4+JfmtzHiW/c4F8I+5+meWk 4B40iCbvFQM/fNVjjJVYIcG5uj9IuWWFi7FGA8rVK7ItSSpQ5/0Zw7L7bnZeUo4oP89n IKOQ== 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=Dm/OwNDmjqHUS/2NztzZspfQVnrIipEoW48g1Nm9lpk=; b=p0wkfwc7mZi9CHpcCenyLAufdpPSk6HBW4Qu2Ax0XSzL1mEXGov4DwXxKQvLH6ioJf XHIgqvjvzr7mDgyq0L0Z2Aw42L+kzGD8xpn0PD8GRj9OdIoPYxZ4Kg/q27nHxEIPlAx4 McADM2v9dqFaOrJTGc0nmKI7RtUo/UzkfwXKVy/0JL6/F3pMo42p0RKOQR/p8gszxyYD +vsVrwflSb2Zo8NK1nKw9PTvwIGCpODKcFEt5r5vxIZ5M/LoUnN6DT0DEmtDC/aWyn0y OZ/MEBJGtpZ6hAzTvkEBnNCNqTqKLVSVgjSmduLSwfBL9uK5iVpmCoU3VFkTH7gQVzDx JgKg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b137si33640015oii.63.2020.01.05.04.49.07; Sun, 05 Jan 2020 04:49:31 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726260AbgAEMsB (ORCPT + 99 others); Sun, 5 Jan 2020 07:48:01 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:46669 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725990AbgAEMsA (ORCPT ); Sun, 5 Jan 2020 07:48:00 -0500 Received: from [172.58.27.182] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1io5K1-0002I0-8L; Sun, 05 Jan 2020 12:47:58 +0000 Date: Sun, 5 Jan 2020 13:47:49 +0100 From: Christian Brauner To: Sargun Dhillon Cc: linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, tycho@tycho.ws, jannh@google.com, cyphar@cyphar.com, oleg@redhat.com, luto@amacapital.net, viro@zeniv.linux.org.uk, gpascutto@mozilla.com, ealvarez@mozilla.com, fweimer@redhat.com, jld@mozilla.com, arnd@arndb.de Subject: Re: [PATCH v8 1/3] vfs, fdtable: Add get_task_file helper Message-ID: <20200105124747.narl7otqr3d46ljp@wittgenstein> References: <20200103162928.5271-1-sargun@sargun.me> <20200103162928.5271-2-sargun@sargun.me> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20200103162928.5271-2-sargun@sargun.me> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 03, 2020 at 08:29:26AM -0800, Sargun Dhillon wrote: > This introduces a function which can be used to fetch a file, given an > arbitrary task. As long as the user holds a reference (refcnt) to the > task_struct it is safe to call, and will either return NULL on failure, > or a pointer to the file, with a refcnt. > > This patch is based on Oleg Nesterov's (cf. [1]) patch from September > 2018. > > [1]: Link: https://lore.kernel.org/r/20180915160423.GA31461@redhat.com > > Signed-off-by: Sargun Dhillon > Suggested-by: Oleg Nesterov > Acked-by: Christian Brauner Nit: the patch is titled "vfs, fdtable: Add get_task_file helper" but the actual helper is called fget_task()