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 X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E2CAC3F68F for ; Sun, 5 Jan 2020 12:48:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 00C0021734 for ; Sun, 5 Jan 2020 12:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726143AbgAEMsB (ORCPT ); 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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()