From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (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 D342D38944D for ; Mon, 6 Jul 2026 16:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783353956; cv=none; b=MY15YWB+5GkgjM9hGUUUJaexUCu1+IP7LBi+IJnn49getgp+xCLsvEQ4YR0iit/SXj5iyj4iB1qY8ejZO7kslVXgGXTBO20Vi3vWaL56Bhdd3nTkP4fIlw8C19gtuTGTVxRC2945qov7eT+GDkDqZ+VxTm5Er9zw/7Xg+n0bnzY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783353956; c=relaxed/simple; bh=XPdmJdluNL8xm9ELWi8Md4kauHaGYg6f9QOXAWYJaR4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=M87Ja5Gc6MhyCkGrbPXiFt622NWOYOvdoz4dUlAbyjRhjtMCkgM+x8pV2iWrcs78HzUfEsiERgZEvlmkdFJahWpdiGgtEg1jWLdc4C95MGLisfPg74jLkCfgOnFnE4V+oq5JP0HOevOq1AGu+9fT1ppDfOWg2cU67tuWPYnxL7c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hammerspace.com; spf=pass smtp.mailfrom=hammerspace.com; dkim=pass (2048-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b=VOKeqO+J; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=hammerspace.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hammerspace.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b="VOKeqO+J" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-6a19a5691bbso2256280eaf.3 for ; Mon, 06 Jul 2026 09:05:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com; s=google; t=1783353954; x=1783958754; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:from:to:cc:subject:date :message-id:reply-to:content-type; bh=uEL0aHDi47AllM85UC2VoFZUZtA7pPsLGPoBdPm2mEM=; b=VOKeqO+J+E0M2dNTr94zcOLl7n4jZrsIjdDwmupXpoijCih47I/+ZXyJ+Ki4Uqfyyg k+oQru3lnSr2PY7+8gNW+O3X1b4nK+CZ4g4SIZjvQMiPtYSPIzjZmE0wO24rGXZlar3b 1kwXb7Pku++MHPXPV5u27OsrxtcYaap9/h/XrNgYW6KnoiETvR70Th0iMj9CXOv5JMrM rQkM46e2KgzREp9mofYL2jDH/ZZZzlQ5OqgF+2xQ9y8J7YalLw3c+hx7BCutxyx0abw7 2M5VmS/E4kF98umZ4DYF5UuTPXJpDjQbIwR+snQs5xvbFD2flrXl1N1wjSy8w2fERrdw KO+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783353954; x=1783958754; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:sender:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=uEL0aHDi47AllM85UC2VoFZUZtA7pPsLGPoBdPm2mEM=; b=U2ydofEjZRWDsrm5dDzcxJDtDXWAc/PU1YTG92hYWY4uZv2/lOW3zZvtfUHi8yGKq7 hPZejP6TbWiJ54JD1O49SS0BX5FcrUsOHsU7iBkocZd6XdhwkV7Jd6oAQbc3ZFQMBcIL ePa9XmSHEMOJZJEHeN2bPpyJPNOEREM2sNM9RI+Kyq2Uwi7WdLb34LjL7fsKbTXL2bvB OP8k6qwRd7Iqv8qHf3/WiX9A2KQITmivYailjNPxDI+2nvjFmdcEgAaOMh9LohzebLsb fGMVNTx23A+qpDAhUbpuFadi+q59Btiv7eEiPJ3AbthH7yWlSl/7mv4QgbjQ4/n25a5W jk0w== X-Forwarded-Encrypted: i=1; AFNElJ++EXPwgCXVNlgl4/SC3O9XfhyXdayRvsHf306WQgCCqBozneZWOXmUyj7wMX4S0NzFtGDMQy8EJaiKEcg=@vger.kernel.org X-Gm-Message-State: AOJu0YxDvFk1ZvGYripzeLrmgc2lTdM5q3yXh/ZJrh2HiBo3D4uXFSnG U/URY0kLwoDeMyBU0ONnv/Auy71LT58Bxu5YNf6QigUTBQOSewKOV8PYiUaPnjrslrg= X-Gm-Gg: AfdE7clrwYm2Dgoh8um++H2Ckzwlg2sdWhTi5tMZ54j1xUVQmc1QcEgVNflP2UUjRoI dIAUGr9CYhuNee8o26hI6FUCwA/QNCxK+jrcQVsX6oWV7/U/Pqu09fTnlSbKG2flw4kXf6GXPIA CrlqN9m78kyHc+RlHw2pjX4kLIJ1c+VrMhTW/rwL2DVXjLOHRS05RAWLlaKOLKm8ci7RpUL2THK fjURPdsSXXm+In4zyHMjVCsNpcZ/tESx/L6n7IlksnnvdFqZ5eTLh4xsC6a/YufWl7NN/z6rxzo Ixxp2WGDfVceuL4WS5/vGJRj6LoKqUtUccUprnfgv1umFJUPrxHR7fdh20hANL1qKcTnkY9DMKb zXB6YoCjjBJ3uwAh8/++KqTTjY7OgW37MEMuWAAg36WRxConmz5tE8dJbWO1pZq1zmd1JYH7kpu khLdrKX2JdB73Tv+yLbE7oWkJJDm/nsIry77+FRPxnUR5XRbb6kEldBayJUj54zjO3K0hT4hadC dxiIlNn0Arvy/0I X-Received: by 2002:a05:6820:4cc5:b0:6a1:11a5:32df with SMTP id 006d021491bc7-6a3555af3f4mr709954eaf.50.1783353953294; Mon, 06 Jul 2026 09:05:53 -0700 (PDT) Received: from localhost (pool-68-160-167-46.bstnma.fios.verizon.net. [68.160.167.46]) by smtp.gmail.com with ESMTPSA id af79cd13be357-92e90bb91adsm963038785a.20.2026.07.06.09.05.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Jul 2026 09:05:52 -0700 (PDT) Sender: Mike Snitzer From: Mike Snitzer X-Google-Original-From: Mike Snitzer To: Trond Myklebust , Anna Schumaker Cc: Tejun Heo , Lai Jiangshan , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/3] NFS/localio: remove dead FLUSH_SYNC handling from nfs_local_commit Date: Mon, 6 Jul 2026 12:05:48 -0400 Message-ID: <20260706160549.97580-3-snitzer@kernel.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20260706160549.97580-1-snitzer@kernel.org> References: <20260706160549.97580-1-snitzer@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit nfs_local_commit() is reached only through nfs_initiate_commit(), and every path that supplies its "how" argument has already cleared FLUSH_SYNC: __nfs_commit_inode() strips it (how &= ~FLUSH_SYNC) before dispatch and does its own waiting via wait_on_commit(), while the O_DIRECT path passes how=0. filelayout issues its DS commit with a NULL localio, so it never enters nfs_local_commit() at all. The FLUSH_SYNC branch has therefore been dead since it was introduced with commit 70ba381e1a43 ("nfs: add LOCALIO support"). Remove the never-taken FLUSH_SYNC branch along with the completion plumbing it was the sole user of: the struct nfs_local_fsync_ctx::done member, its initialization, and the complete() call in nfs_local_fsync_work(). With the branch gone the "how" parameter is unused, so drop it from nfs_local_commit() and its callers. No functional change. Assisted-by: Claude:claude-opus-4-8 Signed-off-by: Mike Snitzer --- fs/nfs/internal.h | 4 ++-- fs/nfs/localio.c | 15 ++------------- fs/nfs/write.c | 2 +- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 0338603e9674..66dbc9befdbb 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h @@ -476,7 +476,7 @@ extern int nfs_local_doio(struct nfs_client *, const struct rpc_call_ops *); extern int nfs_local_commit(struct nfsd_file *, struct nfs_commit_data *, - const struct rpc_call_ops *, int); + const struct rpc_call_ops *); extern bool nfs_server_is_local(const struct nfs_client *clp); #else /* CONFIG_NFS_LOCALIO */ @@ -498,7 +498,7 @@ static inline int nfs_local_doio(struct nfs_client *clp, } static inline int nfs_local_commit(struct nfsd_file *localio, struct nfs_commit_data *data, - const struct rpc_call_ops *call_ops, int how) + const struct rpc_call_ops *call_ops) { return -EINVAL; } diff --git a/fs/nfs/localio.c b/fs/nfs/localio.c index d3e480888eb1..acbc2bddcf81 100644 --- a/fs/nfs/localio.c +++ b/fs/nfs/localio.c @@ -52,7 +52,6 @@ struct nfs_local_fsync_ctx { struct nfsd_file *localio; struct nfs_commit_data *data; struct work_struct work; - struct completion *done; }; static bool localio_enabled __read_mostly = true; @@ -1100,8 +1099,6 @@ nfs_local_fsync_work(struct work_struct *work) status = nfs_local_run_commit(nfs_to->nfsd_file_file(ctx->localio), ctx->data); nfs_local_commit_done(ctx->data, status); - if (ctx->done != NULL) - complete(ctx->done); nfs_local_fsync_ctx_free(ctx); current->flags = old_flags; @@ -1117,14 +1114,13 @@ nfs_local_fsync_ctx_alloc(struct nfs_commit_data *data, ctx->localio = localio; ctx->data = data; INIT_WORK(&ctx->work, nfs_local_fsync_work); - ctx->done = NULL; } return ctx; } int nfs_local_commit(struct nfsd_file *localio, struct nfs_commit_data *data, - const struct rpc_call_ops *call_ops, int how) + const struct rpc_call_ops *call_ops) { struct nfs_local_fsync_ctx *ctx; @@ -1136,14 +1132,7 @@ int nfs_local_commit(struct nfsd_file *localio, } nfs_local_init_commit(data, call_ops); - - if (how & FLUSH_SYNC) { - DECLARE_COMPLETION_ONSTACK(done); - ctx->done = &done; - queue_work(nfslocaliod_workqueue, &ctx->work); - wait_for_completion(&done); - } else - queue_work(nfslocaliod_workqueue, &ctx->work); + queue_work(nfslocaliod_workqueue, &ctx->work); return 0; } diff --git a/fs/nfs/write.c b/fs/nfs/write.c index 0d7f2c2e599c..3afe243597fb 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c @@ -1663,7 +1663,7 @@ int nfs_initiate_commit(struct rpc_clnt *clnt, struct nfs_commit_data *data, dprintk("NFS: initiated commit call\n"); if (localio) - return nfs_local_commit(localio, data, call_ops, how); + return nfs_local_commit(localio, data, call_ops); task = rpc_run_task(&task_setup_data); if (IS_ERR(task)) -- 2.44.0