From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f48.google.com (mail-oo1-f48.google.com [209.85.161.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FBB537BE80 for ; Tue, 16 Jun 2026 01:44:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781574269; cv=none; b=grbiBkq57SApeWu0jiaaGbkPJQROGGBr8bm8P4HmLzPPg/N6hTgsnXRIMdxiYOmMLICUHjeVRMpU20qvyWAe2i4HntEK4MkIdvjkQj38D29Yx4jGuqn/5+SfBogadvNQ/OAEnvNdMORkbbzayXJQpovubA96NpregevJ9Q1+Rjk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781574269; c=relaxed/simple; bh=j9Odu66lZt7PcnJ5WT6Gll+t3YwuMxXF3z8qxx3vhWw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BqDJevf/lIQYa+ACBgGN6hATDSx3PKL2PUSgEl+czZTmPo2mOt2335zlEns9gvej2hIAI3hWoOu4s3YGAUV/SdiSrvrtS4OA6fq1Ez0BVH9X3f27oNTbgmIX3BIgIvQJKx44JbOyi44ih+oJ/EnWAkgwCwBXgk1ABIbdAI+eC0g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O98uU8IN; arc=none smtp.client-ip=209.85.161.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O98uU8IN" Received: by mail-oo1-f48.google.com with SMTP id 006d021491bc7-69e9b037d82so3040900eaf.2 for ; Mon, 15 Jun 2026 18:44:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781574267; x=1782179067; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=0rowMkOrmg67Cdi/fThqMQCof2a6yJIMp5/xtZueyJc=; b=O98uU8INVseKE9OtEGzr1SHGthmaRzW0La1FstLIHbc13G20kX1UAa5mJEGIXzpmSY pq3DANXRXu4qiM6Yv0XQG1Ry/vBAXcIk0pn4l11qVbitV/QWMaVWYaCGsQYc4VC+kFhs nxcHMb9sTh7R+uAE/Fh8HkVVzRpNUpjdlQoUYmOQujVfSqh0zRht0QPQMjOkV+2xobLY mdNcvbLPXcdunz4xyOR+QKfariZCpfqhi/iuRhBp1ge8wR1VvXxqbw9loKktI/grqFTB T2fNeAMKIbokRCh/i3/UzKYwtECh/4mzZOPRsvNl+rR6yegfPGr7uFatoPQEGK8zg/Rr kOQw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781574267; x=1782179067; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=0rowMkOrmg67Cdi/fThqMQCof2a6yJIMp5/xtZueyJc=; b=tW6GwUMM/2w6jk5m3B5K6UhenniTzKlbDuBQjel/u99VZk20QGWXbv8OgFFAuBQNKJ rS5T5KsDhI3STtVlK+7Mv/D8FuwXaLROMJMnLhLxdXGnYNGxpv4dmjRqdWAGOSTnnvJn WU5739VARUJQaT20JbHkUKq2CZKjrNMhoxq0EJb9josEtg5pjMHJBfeZN72OI278FTA8 MPqZ+oqCG8lC0nW1JOSG+AMwfSVDhxmDFzYOkycUVm1vmqcMhhwzd++EO1S2az4gHs1G Oq+8v55I3B8+Ni0mKHC16XQyYPnyWjR1exeksvq2ImGyXuMwQ63E09n7WNW7ZDsfQ0Zi rJSg== X-Forwarded-Encrypted: i=1; AFNElJ8O/nAtNKPH0IYpl9l23suHF4CSa3gAABwhqCRnRYbOw70e38HPrx/+6KZxDRgDyrKHKESB0A3oQvrxr0Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yy6TAo5st5sJQiWZBb8fPDlCZUQKzxN4Xh3BCg1G0jIbJ3cWsTR WW+RzIRn0+wgsCouYgwOjzbwoLyg00N3WV5mnqQDfNNrhfcWL75tQFqj X-Gm-Gg: Acq92OEIfC3tBlqlpBTXYmJf7xhwB888V/PaR46bbIjoAqlSwFgWGPRQe7Rpn3LaceM mieEljpgIFY7CJ3eGGxINAMbiikEaUVdSzJaeDsxBDIVKbS9Znxb173b/AF0r20RbUKVkDgBlSZ 1UxeZSWXIIEQBQsUXGY+9SAn6eTjTjjU9cJk+EghBlpHp/ABFpyeDIyMUAvaPSPPKFEpq1dKmU1 3yhkZXYlv3XGBPGhh9/CkPtZlZNzBSCl9SRTO71hnC8WjZK4iLocqaECjl5xZC3ffCNzTH0/DiY EWQskHYZpSTcvXsddMTXr0AD+4liWLwbcpiju9NJxBRK5UEpHAOHpsSQdv76rdJ5VL/pDJiNW/g Iw8HrEZYO/SHjFz7uk9F8Zzh4el6akIrHqKCUtz8BOndSmfCEDHYnGQ0A5VVbgASui+qZJDIROi SUFjG+6EA+ZYos+ZCmgv3575Ca255g92P7P2sr1wr1bTVp4sGRKLUga/Do5CicSQUAcrZGJzqUT R2tSjUoHsUaFTmV4bNIVwVtYB/zMaVs7elgfk6oE42kpI/pLy6rFm4= X-Received: by 2002:a05:6820:2005:b0:69d:e555:2246 with SMTP id 006d021491bc7-6a0a40439aemr1269105eaf.32.1781574267105; Mon, 15 Jun 2026 18:44:27 -0700 (PDT) Received: from rdf-gcp2.us-central1-b.c.storage-xlrait-66065.internal (163.80.112.136.bc.googleusercontent.com. [136.112.80.163]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-69f00b41ed1sm4093011eaf.0.2026.06.15.18.44.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Jun 2026 18:44:26 -0700 (PDT) From: Russ Fellows To: miklos@szeredi.hu Cc: fuse-devel@lists.linux.dev, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, amir73il@gmail.com, Russ Fellows Subject: [PATCH v2 1/2] fuse: preserve FOPEN_PARALLEL_DIRECT_WRITES for passthrough opens Date: Tue, 16 Jun 2026 01:44:18 +0000 Message-ID: <20260616014419.7913-2-russ.fellows@gmail.com> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260616014419.7913-1-russ.fellows@gmail.com> References: <20260529031918.7361-1-russ.fellows@gmail.com> <20260616014419.7913-1-russ.fellows@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Russ Fellows fuse_file_io_open() currently strips FOPEN_PARALLEL_DIRECT_WRITES whenever FOPEN_DIRECT_IO is absent. That rule is correct for the regular direct-IO path, but it is too strict for passthrough opens. Passthrough I/O already bypasses the page cache through the backing file, so it does not need FOPEN_DIRECT_IO to preserve direct-I/O semantics. Clearing the parallel-write flag for passthrough opens causes the kernel to drop the server's request for parallel direct writes before the passthrough write path ever sees it. Keep FOPEN_PARALLEL_DIRECT_WRITES for opens that also carry FOPEN_PASSTHROUGH, and continue to clear it for non-passthrough opens that lack FOPEN_DIRECT_IO. This is a prerequisite for passthrough write parallelism: without it, the subsequent shared-lock path never activates. Signed-off-by: Russ Fellows --- fs/fuse/iomode.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fs/fuse/iomode.c b/fs/fuse/iomode.c index c99e285f3..0301a48d8 100644 --- a/fs/fuse/iomode.c +++ b/fs/fuse/iomode.c @@ -216,9 +216,12 @@ int fuse_file_io_open(struct file *file, struct inode *inode) goto fail; /* - * FOPEN_PARALLEL_DIRECT_WRITES requires FOPEN_DIRECT_IO. + * FOPEN_PARALLEL_DIRECT_WRITES requires FOPEN_DIRECT_IO, except for + * passthrough opens which bypass the page cache regardless and do not + * need FOPEN_DIRECT_IO to guarantee direct I/O semantics. */ - if (!(ff->open_flags & FOPEN_DIRECT_IO)) + if (!(ff->open_flags & FOPEN_DIRECT_IO) && + !(ff->open_flags & FOPEN_PASSTHROUGH)) ff->open_flags &= ~FOPEN_PARALLEL_DIRECT_WRITES; /* -- 2.51.0