From patchwork Fri Feb 16 20:22:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 13560523 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 43ACF139567; Fri, 16 Feb 2024 20:23:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708114986; cv=none; b=R7io9+kEB8xovDRzbgFsEo9zat2LDSeKSFA1+8KefKMbwzxsXr1NFzw8vuzgeZVdhDp3TXQEucon/Oram7JXrTk4UcthzhBAKyrgd+OYMAJDJAUeQHi7C3i7XTf7ZJKUTlyZEsBuLdgCSxqswNvkrmIHcOhHlGbw7lf8qSjz6fw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708114986; c=relaxed/simple; bh=FZKDvxwOLKdXeXYFLErtJaz9RUHYu0Q/oOHwXC/6poQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=WCgLuNVpUkf5v7Tn/K0dcy1R7B3+6ZBGQTSf3dzRf2zRGgOOcuzSkljcKIJxbCzqG+8sR2kyh0f/eQyXni5Zvxm+vqkEA4G0grikH7TPrnIcUwJ3hm08orjb/zw+ACczGMfsaewcfywmO6J7qlzblVnNv8sD9sYkWyqTPxCV6FI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JPDdKcSU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JPDdKcSU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 881A8C433C7; Fri, 16 Feb 2024 20:23:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708114985; bh=FZKDvxwOLKdXeXYFLErtJaz9RUHYu0Q/oOHwXC/6poQ=; h=From:To:Cc:Subject:Date:From; b=JPDdKcSU1v7J4n2vhyqtW0wo+yuczCaaDoXyAiVLDiVfD4fjvF8z33nTw5/YUrgxF 4hfexzkX3VXEJRBNJH/XXBwUIdfTjbRSUmXTyxkbID0oYvjKDkhxsQOOiGNK1wnJhE OUzxHdS6lE9CA/1zP8cRM0RP35hSBLZGivQSNIYLqZ/IGAVJ0yF9XN8pPyfpkORUjX m/OorVNf1LFJeMU8fNHEQmLwfSPOi9GO+igiUmg574vQlkr9KX+G8GpQUJQRdtPyxS utLzqNDPLEK0p6RlWee0BCXZ5iwwPkQ5pJq4Oyb5OQyMHcAB8fnSGkGKPM6iF5D5Or ElmtWeeTJO8mg== From: Arnd Bergmann To: Dan Williams , Mathieu Desnoyers , Andrew Morton Cc: Arnd Bergmann , kernel test robot , Matthew Wilcox , Jan Kara , Jane Chu , linux-fsdevel@vger.kernel.org, nvdimm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: [PATCH] dax: add set_dax_nomc() and set_dax_nocache() stub helpers Date: Fri, 16 Feb 2024 21:22:51 +0100 Message-Id: <20240216202300.2492566-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: nvdimm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Arnd Bergmann In some randconfig builds, the IS_ERR() check appears to not get completely eliminated, resulting in the compiler to insert references to these two functions that cause a link failure: ERROR: modpost: "set_dax_nocache" [drivers/md/dm-mod.ko] undefined! ERROR: modpost: "set_dax_nomc" [drivers/md/dm-mod.ko] undefined! Add more stub functions for the dax-disabled case here to make it build again. Fixes: d888f6b0a766 ("dm: treat alloc_dax() -EOPNOTSUPP failure as non-fatal") Reported-by: kernel test robot Closes: https://lore.kernel.org/oe-kbuild-all/202402160420.e4QKwoGO-lkp@intel.com/ Signed-off-by: Arnd Bergmann --- include/linux/dax.h | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/include/linux/dax.h b/include/linux/dax.h index df2d52b8a245..4527c10016fb 100644 --- a/include/linux/dax.h +++ b/include/linux/dax.h @@ -64,6 +64,9 @@ void dax_write_cache(struct dax_device *dax_dev, bool wc); bool dax_write_cache_enabled(struct dax_device *dax_dev); bool dax_synchronous(struct dax_device *dax_dev); void set_dax_synchronous(struct dax_device *dax_dev); +void set_dax_nocache(struct dax_device *dax_dev); +void set_dax_nomc(struct dax_device *dax_dev); + size_t dax_recovery_write(struct dax_device *dax_dev, pgoff_t pgoff, void *addr, size_t bytes, struct iov_iter *i); /* @@ -108,6 +111,12 @@ static inline bool dax_synchronous(struct dax_device *dax_dev) static inline void set_dax_synchronous(struct dax_device *dax_dev) { } +static inline void set_dax_nocache(struct dax_device *dax_dev) +{ +} +static inline void set_dax_nomc(struct dax_device *dax_dev) +{ +} static inline bool daxdev_mapping_supported(struct vm_area_struct *vma, struct dax_device *dax_dev) { @@ -120,9 +129,6 @@ static inline size_t dax_recovery_write(struct dax_device *dax_dev, } #endif -void set_dax_nocache(struct dax_device *dax_dev); -void set_dax_nomc(struct dax_device *dax_dev); - struct writeback_control; #if defined(CONFIG_BLOCK) && defined(CONFIG_FS_DAX) int dax_add_host(struct dax_device *dax_dev, struct gendisk *disk);