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=-8.3 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,USER_AGENT_SANE_1 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 6F2B8C35E04 for ; Tue, 25 Feb 2020 18:55:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 39EE021927 for ; Tue, 25 Feb 2020 18:55:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20150623.gappssmtp.com header.i=@kernel-dk.20150623.gappssmtp.com header.b="BhU8o5FU" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730990AbgBYSzR (ORCPT ); Tue, 25 Feb 2020 13:55:17 -0500 Received: from mail-il1-f172.google.com ([209.85.166.172]:36965 "EHLO mail-il1-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728051AbgBYSzQ (ORCPT ); Tue, 25 Feb 2020 13:55:16 -0500 Received: by mail-il1-f172.google.com with SMTP id v13so115679iln.4 for ; Tue, 25 Feb 2020 10:55:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=to:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=xFiwD6W4pffPMEC91vNu4ohAIbsNI8GSrTw4huICYec=; b=BhU8o5FUikJyZz0tZlFgpHUaBjvK6xZDSkHLj6tqqo0nxKA3S28DLVTFxtRCg5TZNw 50LiW2n4Lan/fWwCXfZFMeBBvi83c5bGCkDUR+HIwfMRCpWJWewMuf4rC7pcixhS2CkZ BzADQJfSg5b5Sh5X2vbVwohwpPDsofQdYxPosuWrP8sPrpO2fxo3rdXcyK9KxkxPMZJB jLf/a/QaD1KHDqwZAfHe2yGmTTprPXQG40EohelxD/oiW+mLBIMno7Zyy6ft0yrEkCED /Miqlq51M4csQ74PPNdAkXq/nESpjz+osJwcnbqVnjrsc8nIt+rfFMAh6Nnh/XICiJhe DQ5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-language:content-transfer-encoding; bh=xFiwD6W4pffPMEC91vNu4ohAIbsNI8GSrTw4huICYec=; b=EawmWsjNUYLeXUhq1kS6AmnutjI8/NizDANGYey68XaEslWPVlFssOhmRWMuSXSYNr vJV/oRvi8KysFh1BjzbIYMy+arr5z70iZTtOvvcKImkf3yMg0sCC9disIpS57syctYOj MpAufxeibMzDQwEjDVWoEjwHPdj7Zg0jkzrwxB2zFr3alxaR1DG72Zbroo04MP4Ce51S 3qgeS94bOCwat6mYHLVsXrdFUSHuAUJUbK0D+WBnGx27SAYNvQQ1R/fEvYpIaBlxNOYK sZFdrlIQrjFIarRfeeMgNUtLqCJSHmr0s6I+ENEhu2TYkYws7GG9SJpwcVnMICAETsUG PMvA== X-Gm-Message-State: APjAAAVZeV9eB+u32bllFhtECMOrd53+LX2RIvA0k/eTUxeY4lB37R1K 98Tcb+AZZALtxkyKDsNqWw5l8yAnQ9s= X-Google-Smtp-Source: APXvYqyJ7gxWSBY/Re1kBd/m61v+X0jz1mgwGjyGblzFKSesVk8iZ0fmszOOmBg+6gwVuhOk5jXgAA== X-Received: by 2002:a92:5e9b:: with SMTP id f27mr27219ilg.263.1582656915440; Tue, 25 Feb 2020 10:55:15 -0800 (PST) Received: from [192.168.1.159] ([65.144.74.34]) by smtp.gmail.com with ESMTPSA id v5sm5759849ilg.73.2020.02.25.10.55.14 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 25 Feb 2020 10:55:15 -0800 (PST) To: io-uring From: Jens Axboe Subject: [PATCH] io-wq: ensure work->task_pid is cleared on init Message-ID: Date: Tue, 25 Feb 2020 11:55:11 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org We use ->task_pid for exit cancellation, but we need to ensure it's cleared to zero for io_req_work_grab_env() to do the right thing. Fixes: 36282881a795 ("io-wq: add io_wq_cancel_pid() to cancel based on a specific pid") Signed-off-by: Jens Axboe --- diff --git a/fs/io-wq.h b/fs/io-wq.h index ccc7d84af57d..9e9419c08bc1 100644 --- a/fs/io-wq.h +++ b/fs/io-wq.h @@ -88,6 +88,7 @@ struct io_wq_work { (work)->creds = NULL; \ (work)->fs = NULL; \ (work)->flags = 0; \ + (work)->task_pid = 0; \ } while (0) \ typedef void (get_work_fn)(struct io_wq_work *); -- Jens Axboe