Linux 5.14 commit: 'mm: require ->set_page_dirty to be explicitly wired
up' (
0af573780b0b13) removed calling __set_page_dirty_buffers when the
address_space_operations structure member set_page_dirty was NULL.
A kernel RIP error can occur when the set_page_dirty operation is
requested. (Reproducible by running 'iozone -B -a')
Update the definition for afs_file_aops to explicitly set the
'set_page_dirty' member to '__set_page_dirty_buffers'.
There are no functional changes, since this commit is using the same
function that the Linux kernel was using if set_page_dirty had been
NULL.
Problem originally reported by "Andrej Filipcic"
<andrej.filipcic@ijs.si> in the openafs-info mailing list. The Linux
5.14 commit causing the openafs failure was identified by "Michael Laß"
<lass@mail.upb.de> also on in the openafs-info mailing list.
Note: The declaration for the function '__set_page_dirty_buffers' was
moved from linux/mm.h into linux/buffer_head.h in Linux 2.6.19. Since
this is close to the minimum supported Linux version 2.6.18, we are not
introducing an additional autoconf test to determine which header file
the declaration for __set_page_dirty_buffers resides in.
Change-Id: I8f2a00e374635ab1aa69d6eaef8cf97bb449d089
Reviewed-on: https://gerrit.openafs.org/14826
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: Michael Laß <lass@mail.uni-paderborn.de>
Reviewed-by: Michael Laß <lass@mail.uni-paderborn.de>
Tested-by: Cheyenne Wills <cwills@sinenomine.net>
Reviewed-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Tested-by: Ralf Brunckhorst <rbrunckhorst@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
#include "afsincludes.h"
#include "afs/afs_stats.h"
#include <linux/mm.h>
+#include <linux/buffer_head.h>
#ifdef HAVE_MM_INLINE_H
#include <linux/mm_inline.h>
#endif
.readpage = afs_linux_readpage,
.readpages = afs_linux_readpages,
.writepage = afs_linux_writepage,
+ .set_page_dirty = __set_page_dirty_buffers,
#if defined (STRUCT_ADDRESS_SPACE_OPERATIONS_HAS_WRITE_BEGIN)
.write_begin = afs_linux_write_begin,
.write_end = afs_linux_write_end,