linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1 2.6.20-rc2] MM: ramfs breaks without CONFIG_BLOCK
@ 2006-12-26 17:09 dimitri.gorokhovik, Dimitri Gorokhovik
  2006-12-27  9:03 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: dimitri.gorokhovik, Dimitri Gorokhovik @ 2006-12-26 17:09 UTC (permalink / raw)
  To: akpm, linux-mm; +Cc: linux-kernel

ramfs doesn't provide the .set_dirty_page a_op, and when the BLOCK
layer is not configured in, 'set_page_dirty' makes a call via a NULL
pointer.

Signed-off-by: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>

---

--- linux-2.6.20-rc2-orig/mm/page-writeback.c	2006-12-26
15:12:21.000000000 +0100
+++ linux-2.6.20-rc2/mm/page-writeback.c	2006-12-26 18:32:26.000000000
+0100
@@ -800,8 +800,8 @@ int redirty_page_for_writepage(struct wr
 EXPORT_SYMBOL(redirty_page_for_writepage);

 /*
- * If the mapping doesn't provide a set_page_dirty a_op, then
- * just fall through and assume that it wants buffer_heads.
+ * If the mapping doesn't provide a set_page_dirty a_op, and the BLOCK
layer is
+ * available, just fall through and assume that it wants buffer_heads.
  */
 int fastcall set_page_dirty(struct page *page)
 {
@@ -812,8 +812,12 @@ int fastcall set_page_dirty(struct page
 #ifdef CONFIG_BLOCK
 		if (!spd)
 			spd = __set_page_dirty_buffers;
-#endif
 		return (*spd)(page);
+#else
+		if (spd)
+			return (*spd)(page);
+#endif
+
 	}
 	if (!PageDirty(page)) {
 		if (!TestSetPageDirty(page))


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1 2.6.20-rc2] MM: ramfs breaks without CONFIG_BLOCK
  2006-12-26 17:09 [PATCH 1/1 2.6.20-rc2] MM: ramfs breaks without CONFIG_BLOCK dimitri.gorokhovik, Dimitri Gorokhovik
@ 2006-12-27  9:03 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2006-12-27  9:03 UTC (permalink / raw)
  To: dimitri.gorokhovik; +Cc: linux-mm, linux-kernel

On Tue, 26 Dec 2006 18:09:47 +0100
dimitri.gorokhovik@free.fr wrote:

> From: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>
> 
> ramfs doesn't provide the .set_dirty_page a_op, and when the BLOCK
> layer is not configured in, 'set_page_dirty' makes a call via a NULL
> pointer.

OK.  But I think it'd be better to fill in the address_space_operations:


From: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>

ramfs doesn't provide the .set_dirty_page a_op, and when the BLOCK layer is
not configured in, 'set_page_dirty' makes a call via a NULL pointer.

Signed-off-by: Dimitri Gorokhovik <dimitri.gorokhovik@free.fr>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 fs/ramfs/file-mmu.c   |    4 +++-
 fs/ramfs/file-nommu.c |    4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff -puN fs/ramfs/file-mmu.c~mm-ramfs-breaks-without-config_block fs/ramfs/file-mmu.c
--- a/fs/ramfs/file-mmu.c~mm-ramfs-breaks-without-config_block
+++ a/fs/ramfs/file-mmu.c
@@ -25,11 +25,13 @@
  */
 
 #include <linux/fs.h>
+#include <linux/mm.h>
 
 const struct address_space_operations ramfs_aops = {
 	.readpage	= simple_readpage,
 	.prepare_write	= simple_prepare_write,
-	.commit_write	= simple_commit_write
+	.commit_write	= simple_commit_write,
+	.set_page_dirty = __set_page_dirty_nobuffers,
 };
 
 const struct file_operations ramfs_file_operations = {
diff -puN fs/ramfs/file-nommu.c~mm-ramfs-breaks-without-config_block fs/ramfs/file-nommu.c
--- a/fs/ramfs/file-nommu.c~mm-ramfs-breaks-without-config_block
+++ a/fs/ramfs/file-nommu.c
@@ -11,6 +11,7 @@
 
 #include <linux/module.h>
 #include <linux/fs.h>
+#include <linux/mm.h>
 #include <linux/pagemap.h>
 #include <linux/highmem.h>
 #include <linux/init.h>
@@ -30,7 +31,8 @@ static int ramfs_nommu_setattr(struct de
 const struct address_space_operations ramfs_aops = {
 	.readpage		= simple_readpage,
 	.prepare_write		= simple_prepare_write,
-	.commit_write		= simple_commit_write
+	.commit_write		= simple_commit_write,
+	.set_page_dirty = __set_page_dirty_nobuffers,
 };
 
 const struct file_operations ramfs_file_operations = {
_

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-12-27  9:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-12-26 17:09 [PATCH 1/1 2.6.20-rc2] MM: ramfs breaks without CONFIG_BLOCK dimitri.gorokhovik, Dimitri Gorokhovik
2006-12-27  9:03 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox