From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7992039BFFE; Sat, 12 Sep 2026 18:34:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789238095; cv=none; b=Wxw5Sj1naA4YQIZ4DeOFzFbJzv4/C1teBaIFjU5ED4LQMUdy+6hwnl4M2Dk6My/R/XJ1nlAqgAqKZsS+hHd+eVon7gjDEcH/J1K30k3RtvtAjUUvY5p5gjxi467YhziEYfWeXY0A52O4R5WGvIkpLm5rltxk66SYkz1cmxmW5/Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789238095; c=relaxed/simple; bh=FkOAVkiRpi4wgK6tpjhrBWSTWk/HrIGjrl4Q6my9lPY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=O0YhZutGKnUurfSgpbID7sj9Ob3LKwnGL16PfN0iZkQsbhAFTAshfLmNyTP3hCjw445369Ft1/31m71/gGTfH3HMCCWBg2nwrtb8bVJspEVg94jR2xUlVGRNxKtI6XSJqRwykYgfd90LVVoKD5s5DnoSgttmd0CQ9cU1H/E/748= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=KpHCXMqf; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="KpHCXMqf" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 19A311F000FF; Sat, 12 Sep 2026 18:34:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789238094; bh=aVatLXky4bHLYdSM5v0cav193++YT7AZlSZv4Ug+QXw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=KpHCXMqfU1z/8hRznsrOEHlNyBhGqhgIp7FIllPoVXEcT0krENWGdASZVE1qOU4zL WCBJG1pMsDnXJzqHwFvIcpuabUQVt1hy/BLTbKaRKyTnBoJFYSvex0Vb6y6QalJoFh 4gvVitxiouR3nzyeCOXQ2iQMwqS28VY08sVMrqtU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, stable@kernel.org, Wenjie Qi , Chao Yu , Jaegeuk Kim Subject: [PATCH 5.15 355/935] f2fs: return symlink writeback errors Date: Sat, 12 Sep 2026 08:56:25 +0200 Message-ID: <20260912065534.952805666@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065526.833703348@linuxfoundation.org> References: <20260912065526.833703348@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Wenjie Qi commit a2c73a7a677afdaa8b16d775188f9ef5cfbfd8b2 upstream. F2FS writes long symlink data with page_symlink() and then flushes the symlink mapping to reduce the chance of exposing a broken symlink. That flush result is currently ignored. If the writeback fails, symlink() still returns success even though the symlink is not durable and the same operation can already surface -EIO through syncfs(). Return the writeback error to userspace and skip the dirsync flush once the symlink data flush has failed. Fixes: d0cae97cb600 ("f2fs: flush symlink path to avoid broken symlink after POR") Cc: stable@kernel.org Signed-off-by: Wenjie Qi Reviewed-by: Chao Yu Signed-off-by: Jaegeuk Kim Signed-off-by: Greg Kroah-Hartman --- fs/f2fs/namei.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) --- a/fs/f2fs/namei.c +++ b/fs/f2fs/namei.c @@ -668,15 +668,16 @@ err_out: * performance regression. */ if (!err) { - filemap_write_and_wait_range(inode->i_mapping, 0, - disk_link.len - 1); + err = filemap_write_and_wait_range(inode->i_mapping, 0, + disk_link.len - 1); - if (IS_DIRSYNC(dir)) + if (!err && IS_DIRSYNC(dir)) f2fs_sync_fs(sbi->sb, 1); - } else { - f2fs_unlink(dir, dentry); } + if (err) + f2fs_unlink(dir, dentry); + f2fs_balance_fs(sbi, true); goto out_free_encrypted_link;