Message ID | 20230806-resolve_cached-o_tmpfile-v2-0-058bff24fb16@cyphar.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp717014vqr; Sat, 5 Aug 2023 19:06:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFrPvzNnlCuzU8qNnDDf2iTxQZm1JZSznVnGD7HnMTHkoP1awj1Gva+5aKRDU6o28/8VEwZ X-Received: by 2002:aa7:d049:0:b0:522:2bc8:cbb8 with SMTP id n9-20020aa7d049000000b005222bc8cbb8mr4123923edo.6.1691287591071; Sat, 05 Aug 2023 19:06:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691287591; cv=none; d=google.com; s=arc-20160816; b=lBzKPFkO4flhOct+9rhRnpqkt9phwPlTET/UPGK9VVBQudTzSi8YmeJTngvazwNAtK zvVnZhp997ET5FCqiHsCdGL5ogeye03xqBRGF3KP/RKnvs38D4heVQ7ZKv4t0zmDd/Ed vx8FyI9GBMVH74dH4w5xJE/1YZ6DwQmipDXPgiyxTk7I2Ek858C9z8niqlUBThMadUbj wAS5LSHGeHcbUK/utxtsk7r4pIAXDGDATnps3uDZoI2ekeMCS3rhLV+1Sm1LcrtbqH9z 8Vdj6qDWcTZxS3e99tKHUvASeAY9E9C6klUTbxWHcIhvKbck9+wHtiFbd0+s41ZMGOCs JL1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=Zs3M/G44ypGLQBrS+6QpeGQyQMHY0My7xyCyNV5W7UY=; fh=tyuo81uf8EBo4PqTEAeD2fxcZ4owKgaqFeuM7cWaFg4=; b=Wk+DM9tleTUEEfKssTWRFPphuZ8JoGBI+RNHqSYreVOpN6aLFPf0REMViJdFQebt27 ki7AqAoOAN9/sZYkK3PwTe+u6ekbLS5HGZvtiVN4Z8ksV1fgUrtBq9Pya9/doH2bUnMm aECE4EfYJudHt0YpxzLYZhKvo7TcSYFNAuZ4tpf3GNh4RgqHe3LCaEa9sCg2QlFZd5DH HnmU3/76Y1Ta/UH8s8veAl5yGiGQYKYuWqlrQWHgNpmzBQWpeo3NeiU3D6Viikvflkk4 3UT2/V8le71CTGlA3SqNrt1yadU9CkdLP3sZG3PI8+VR5LV3m24pr7mr864pWVTaKZ2p uP7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cyphar.com header.s=MBO0001 header.b=OK8G3j2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cyphar.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a170906654400b0096fe1a56de3si2538388ejn.1048.2023.08.05.19.06.02; Sat, 05 Aug 2023 19:06:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@cyphar.com header.s=MBO0001 header.b=OK8G3j2t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=cyphar.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230013AbjHEWs4 (ORCPT <rfc822;david.simonyants@gmail.com> + 99 others); Sat, 5 Aug 2023 18:48:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjHEWsy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sat, 5 Aug 2023 18:48:54 -0400 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [IPv6:2001:67c:2050:0:465::103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7824B1732; Sat, 5 Aug 2023 15:48:52 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [10.196.197.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4RJHnC3JB0z9sZj; Sun, 6 Aug 2023 00:48:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cyphar.com; s=MBO0001; t=1691275727; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Zs3M/G44ypGLQBrS+6QpeGQyQMHY0My7xyCyNV5W7UY=; b=OK8G3j2tqbi0xW+hYczXouurJh/7+yh1lAy+hUoiYh/a362dI4iHFebLy56nohqqax4s3B hdAJ1wTzBf8B1O65AtKeW9jFupsDqNXNxBbq5rlgI5QNLC62nGqqpAU/gMc0NP4UJxaR6C kPrObKgTeRoZ+ICh1WMceu3on0zEiEkRqm/J859mOhVlPn06gJ9wTI4fZCZzQfiNqFQ/oJ ASoP8boEovce1emNvItAZP3xUvVArWzqNeTDHnnY8iBwxyTgScMzMoHIcVg05he6bWHs/f 2tPKrPdywUs7Jrmsr82JT9taqK+HGBzvky340DKCaTDD9KAqP9hk7vBcIuyTYg== From: Aleksa Sarai <cyphar@cyphar.com> Subject: [PATCH v2 0/2] open: make RESOLVE_CACHED correctly test for O_TMPFILE Date: Sun, 06 Aug 2023 08:48:07 +1000 Message-Id: <20230806-resolve_cached-o_tmpfile-v2-0-058bff24fb16@cyphar.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAKfRzmQC/42NQQ6DIBREr2L+ujSCLVJXvUdjDOK3/ESFgCE1x ruXeoIu32TmzQ4RA2GEptghYKJIbskgLgUYq5c3MhoygyhFVapSsoDRTQk7o43Fgblunf1IE7J HrUwvKtUPUkGe+4AjfU71q81sKa4ubOdT4r/0D2nijLO611zm4k3e8Wk2b3W4GjdDexzHF2sgy UXBAAAA To: Alexander Viro <viro@zeniv.linux.org.uk>, Christian Brauner <brauner@kernel.org>, Jens Axboe <axboe@kernel.dk>, Pavel Begunkov <asml.silence@gmail.com> Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, io-uring@vger.kernel.org, Aleksa Sarai <cyphar@cyphar.com>, stable@vger.kernel.org X-Developer-Signature: v=1; a=openpgp-sha256; l=1214; i=cyphar@cyphar.com; h=from:subject:message-id; bh=iu0CMEKoz0Ewqe8aOMvuXAQy1aWcE4V3njCd+ME8HFo=; b=owGbwMvMwCWmMf3Xpe0vXfIZT6slMaScu3jCQPDPKxvTW8zKfW/nKh57c/r5wtTjrZXtm2ezn N6teeHvso5SFgYxLgZZMUWWbX6eoZvmL76S/GklG8wcViaQIQxcnAIwkX+7Gf4ZPc6Kf7e53XrP 0aPn351rntwsf8VuZeySBFmD5fN4ghM+MzK8WGm3uGN97IWvGm3PjsWuqauNnMpqvOj2BaWudbm J8TfZAA== X-Developer-Key: i=cyphar@cyphar.com; a=openpgp; fpr=C9C370B246B09F6DBCFC744C34401015D1D2D386 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773443577223278033 X-GMAIL-MSGID: 1773443577223278033 |
Series |
open: make RESOLVE_CACHED correctly test for O_TMPFILE
|
|
Message
Aleksa Sarai
Aug. 5, 2023, 10:48 p.m. UTC
There were a few places that were incorrectly testing for whether an
open(2) operation was O_TMPFILE by doing (flags & O_TMPFILE). As
O_TMPFILE is defined as __O_TMPFILE|O_DIRECTORY, this would cause the
code to assume that O_DIRECTORY is equivalent to O_TMPFILE.
The only places where this happened were in RESOLVE_CACHED and
io_uring's checking related to RESOLVE_CACHED, so the only bug this
really fixes is that now O_DIRECTORY will no longer cause RESOLVE_CACHED
to always fail with -EAGAIN (and io_uring will thus be faster when doing
O_DIRECTORY opens).
Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
---
Changes in v2:
- fix io_uring's io_openat_force_async as well.
- v1: <https://lore.kernel.org/r/20230806-resolve_cached-o_tmpfile-v1-1-7ba16308465e@cyphar.com>
---
Aleksa Sarai (2):
open: make RESOLVE_CACHED correctly test for O_TMPFILE
io_uring: correct check for O_TMPFILE
fs/open.c | 2 +-
io_uring/openclose.c | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
---
base-commit: bf5ad7af0516cb47121dae1b1c160e4385615274
change-id: 20230806-resolve_cached-o_tmpfile-978cb238bd68
Best regards,