Skip to contentSkip to conversation

ecryptfs: add a ->set_page_dirty cludge

PATCH In review Christoph Hellwig 2 participants 2 messages Jun 24, 2021

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ecryptfs: add a ->set_page_dirty cludge

"fix" ecryptfs to work the same as before the recent change to the behavior without a ->set_page_dirty method.

---
 fs/ecryptfs/mmap.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)
fs/ecryptfs/mmap.c +13 -0
index 392e721b50a3..7d85e64ea62f 100644
@@ -533,7 +533,20 @@ static sector_t ecryptfs_bmap(struct address_space *mapping, sector_t block)
 	return block;
 }
 
+#include <linux/buffer_head.h>
+
 const struct address_space_operations ecryptfs_aops = {
+	/*
+	 * XXX: This is pretty broken for multiple reasons: ecryptfs does not
+	 * actually use buffer_heads, and ecryptfs will crash without
+	 * CONFIG_BLOCK.  But it matches the behavior before the default for
+	 * address_space_operations without the ->set_page_dirty method was
+	 * cleaned up, so this is the best we can do without maintainer
+	 * feedback.
+	 */
+#ifdef CONFIG_BLOCK
+	.set_page_dirty = __set_page_dirty_buffers,
+#endif
 	.writepage = ecryptfs_writepage,
 	.readpage = ecryptfs_readpage,
 	.write_begin = ecryptfs_write_begin,
Signature · 1 line
2.30.2