orangefs: don't continue on to gpf if client dies on write.
 	If the orangefs userspace client died while writeback
 	was occurring it led to a gpf. This patch allows
 	the kernel to finish the writeback.
 	Reported by Farhad Alemi.
 
 orangefs:don't wait on service operation on system shutdown.
 	This patch avoids waiting an already dead userspace to
 	process an unmount operation if the system is shutdown
 	while orangefs filesystems are still mounted.
 
 orangefs: use ssize_t instead of size_t for error codes...
 	This patch fixes a situation where an unsigned variable was being
 	used to collect a string size, or possibly a negative error code.
 	Reported by lkp@intel.com
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEWLOQAZkv9m2xtUCf/Vh1C1u0YnAFAmrZBc8ACgkQ/Vh1C1u0
 YnD5iRAAip+dq6DI5RNZf/BeE7nBv0QN4lvYcAhC1zogKllvwy9u9W4mIWM8edsE
 Dl9/MpJAQVu0WZUw38o2PO7Qs2Dw63cLiltoizytEjFtYO7R5PVcqNeekDqTcoKJ
 1mkYw4f6ywdSD0eXvS/kJKoct0puUId0g0VlxyyGU5n3aFXZnYI5qN3k4N7Mlwep
 DguBmnTLKD/wnmv8ZmmLdyhWUsH++U4iFuZdcMRnq9CY96dsTKByYXiwelkLKgb0
 rpG7dHMvqD6hfwI17DnPDDOzt5OoC70dTFqJi3nSYP3nJHf5gkpZpRGy1hMrdt1g
 zf9zcE/cnNZs1YgukIB/vItg8QDqNGKwvB9JORtkFyXf+g8n1j5KKPJagB9fhf4f
 jye/u3Hdo3zKSqRw4W7OuAZnKyJLMKAnIJUkCsdJHXNP4NGr8wTo4G2NJyNiUsnc
 NSioaX6b1RJR7yY6j5EzsI7s9bH/1sFku7sXd2A4t5zgoNBt8f3LHujWzXeMLVMi
 AikmqYx4AMxA+MumZXl1Z8JJggH4qz+C83UCjVpd5AkowzfuMfqVt2/GfLZww4gy
 Nzfj5HFu1A2xtUrYaXrXsgVnxe/Zt7RsOhFD2J7b9KPcQt5EZMWpPGyerXzVJqcb
 Q+5B25OTLOOMCwoJArJU5wLCwnP0+RJUKOnfxEzlx9Yru1PBWik=
 =MdF/
 -----END PGP SIGNATURE-----

Merge tag 'for-linus-7.4-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux

Pull orangefs updates from Mike Marshall:

 - Don't continue on to gpf if client dies on write.

   If the orangefs userspace client died while writeback was
   occurring it led to a gpf. This allows the kernel to finish
   the writeback. Reported by Farhad Alemi.

 - Don't wait on service operation on system shutdown

   This avoids waiting an already dead userspace to process an
   unmount operation if the system is shutdown while orangefs
   filesystems are still mounted.

 - Use ssize_t instead of size_t for error codes...

   This fixes a situation where an unsigned variable was being
   used to collect a string size, or possibly a negative error
   code. Reported by lkp@intel.com

* tag 'for-linus-7.4-ofs1' of git://git.kernel.org/pub/scm/linux/kernel/git/hubcap/linux:
  orangefs: don't continue on to gpf if client dies on write.
  orangefs_super: don't wait on service operation on system shutdown.
  orangefs: use ssize_t instead of size_t for error codes...
This commit is contained in:
Linus Torvalds 2026-10-25 15:07:49 -10:00
commit 9206d6c40b

View File

@ -181,8 +181,27 @@ static int orangefs_writepages(struct address_space *mapping,
{
struct orangefs_writepages *ow;
struct blk_plug plug;
int error;
int error = 0;
struct folio *folio = NULL;
int maxpages;
maxpages = orangefs_bufmap_size_query() / PAGE_SIZE;
if (maxpages < 1) {
/*
* Probably the client is dead and there's no bufmap.
* Walk writeback_iter anyway so each dirty folio is unlocked
* and writeback is ended. wait_for_direct_io will fail; the
* data is not written.
*/
gossip_err("%s: maxpages < 1. \n", __func__);
while ((folio = writeback_iter(mapping, wbc, folio, &error))) {
error = orangefs_writepage_locked(folio, wbc);
mapping_set_error(mapping, error);
folio_unlock(folio);
folio_end_writeback(folio);
}
return error;
}
ow = kzalloc_obj(struct orangefs_writepages);
if (!ow)