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=-6.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 5FB9BC34022 for ; Mon, 17 Feb 2020 19:12:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3C97420801 for ; Mon, 17 Feb 2020 19:12:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581966740; bh=DonXOiMyEpWTZbqlEMF0cLa9mqWW6Lv/VC4y2fvM+Pw=; h=Subject:To:Cc:From:Date:List-ID:From; b=0n/AnQAzav5/qvrqa2lry20VJXCCrI1wczYwcVHcIl0DjibEp1jRk3CF0AUvXO71l nO76jLXp5Do517+1nyTHbm1oXMo9Q2cKUtNJKZAcGBTODgNobX7IPwTwAPbAgYoniy MiWSMJptbgmhPwoamuCPd9b9HbFtu/RTheNrC5ZY= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728444AbgBQTMT (ORCPT ); Mon, 17 Feb 2020 14:12:19 -0500 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:36923 "EHLO out5-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728467AbgBQTMT (ORCPT ); Mon, 17 Feb 2020 14:12:19 -0500 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 8F94E21910; Mon, 17 Feb 2020 14:12:18 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Mon, 17 Feb 2020 14:12:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=Aawp7U OTxkOYTt77zSk45sSWsVI3Nqt8K8eYNM6kGHg=; b=J7s+VZ90UegqZHnZYVTcyY L1uu5leu0+Z2SQ+qn+6lOiXtii2S4IKztuYkBGKwYwUSfsIp/JznYUL8W4CMJA5W g8hwfgTu5s8cywxTWrSzeoCL0rtKYaafW5C2mr3xPu18w0y8TuczhTg89eUvZKIi JSNXnFOuxNmEfmBSM+H3soO3M0O8P78F+ZGHZa2aSC3BIUzAEQsudMUTU2yCIe9h VJdF8oceHKbUtHUYsqK4c0BOWnmrYEmXcDVhMd0Ehj1CW548sWkCsQP2fnhnWp+j wxc1HmYgprZgT8tqVcEwYracOuo9kHfemNsGMcNJBEF7QEUwGdOB2yRvKqV9GEzQ == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrjeeigdduvdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvffhfffkgggtgfesthekredttd dtlfenucfhrhhomhepoehgrhgvghhkhheslhhinhhugihfohhunhgurghtihhonhdrohhr gheqnecukfhppeekfedrkeeirdekledruddtjeenucevlhhushhtvghrufhiiigvpedune curfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhhdrtghomh X-ME-Proxy: Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) by mail.messagingengine.com (Postfix) with ESMTPA id 304A4328005A; Mon, 17 Feb 2020 14:12:18 -0500 (EST) Subject: FAILED: patch "[PATCH] io-wq: add support for inheriting ->fs" failed to apply to 5.4-stable tree To: axboe@kernel.dk Cc: From: Date: Mon, 17 Feb 2020 20:12:06 +0100 Message-ID: <15819667262307@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below does not apply to the 5.4-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . thanks, greg k-h ------------------ original commit in Linus's tree ------------------ >From 9392a27d88b9707145d713654eb26f0c29789e50 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Thu, 6 Feb 2020 21:42:51 -0700 Subject: [PATCH] io-wq: add support for inheriting ->fs Some work items need this for relative path lookup, make it available like the other inherited credentials/mm/etc. Cc: stable@vger.kernel.org # 5.3+ Signed-off-by: Jens Axboe diff --git a/fs/io-wq.c b/fs/io-wq.c index cb60a42b9fdf..7ac4a8876a50 100644 --- a/fs/io-wq.c +++ b/fs/io-wq.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "io-wq.h" @@ -59,6 +60,7 @@ struct io_worker { const struct cred *cur_creds; const struct cred *saved_creds; struct files_struct *restore_files; + struct fs_struct *restore_fs; }; #if BITS_PER_LONG == 64 @@ -151,6 +153,9 @@ static bool __io_worker_unuse(struct io_wqe *wqe, struct io_worker *worker) task_unlock(current); } + if (current->fs != worker->restore_fs) + current->fs = worker->restore_fs; + /* * If we have an active mm, we need to drop the wq lock before unusing * it. If we do, return true and let the caller retry the idle loop. @@ -311,6 +316,7 @@ static void io_worker_start(struct io_wqe *wqe, struct io_worker *worker) worker->flags |= (IO_WORKER_F_UP | IO_WORKER_F_RUNNING); worker->restore_files = current->files; + worker->restore_fs = current->fs; io_wqe_inc_running(wqe, worker); } @@ -481,6 +487,8 @@ static void io_worker_handle_work(struct io_worker *worker) current->files = work->files; task_unlock(current); } + if (work->fs && current->fs != work->fs) + current->fs = work->fs; if (work->mm != worker->mm) io_wq_switch_mm(worker, work); if (worker->cur_creds != work->creds) diff --git a/fs/io-wq.h b/fs/io-wq.h index 50b3378febf2..f152ba677d8f 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -74,6 +74,7 @@ struct io_wq_work { struct files_struct *files; struct mm_struct *mm; const struct cred *creds; + struct fs_struct *fs; unsigned flags; }; @@ -81,10 +82,11 @@ struct io_wq_work { do { \ (work)->list.next = NULL; \ (work)->func = _func; \ - (work)->flags = 0; \ (work)->files = NULL; \ (work)->mm = NULL; \ (work)->creds = NULL; \ + (work)->fs = NULL; \ + (work)->flags = 0; \ } while (0) \ typedef void (get_work_fn)(struct io_wq_work *);