]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
flexfiles/pNFS: fix NULL checks on result of ff_layout_choose_ds_for_read
authorTigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Thu, 28 Aug 2025 14:51:00 +0000 (16:51 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 19 Sep 2025 14:29:55 +0000 (16:29 +0200)
commite630fa0dfb13f9bac02e3b3a0e14414315f3ea6b
tree9487e5abe768f82efdb62f0347e5bd24631365f7
parentbfb059417fa31a707b1179dcf5b25aa98a342538
flexfiles/pNFS: fix NULL checks on result of ff_layout_choose_ds_for_read

[ Upstream commit 5a46d2339a5ae268ede53a221f20433d8ea4f2f9 ]

Recent commit f06bedfa62d5 ("pNFS/flexfiles: don't attempt pnfs on fatal DS
errors") has changed the error return type of ff_layout_choose_ds_for_read() from
NULL to an error pointer. However, not all code paths have been updated
to match the change. Thus, some non-NULL checks will accept error pointers
as a valid return value.

Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Fixes: f06bedfa62d5 ("pNFS/flexfiles: don't attempt pnfs on fatal DS errors")
Signed-off-by: Tigran Mkrtchyan <tigran.mkrtchyan@desy.de>
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/flexfilelayout/flexfilelayout.c