linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] Rewriting backing_dev_info in MTD
@ 2010-04-13 11:33 Kirill A. Shutemov
  2010-04-15 17:23 ` Jan Kara
  0 siblings, 1 reply; 7+ messages in thread
From: Kirill A. Shutemov @ 2010-04-13 11:33 UTC (permalink / raw)
  To: Alexander Viro, David Woodhouse
  Cc: linux-fsdevel, linux-mtd, David Howells, Bernd Schmidt,
	Alexander Shishkin

I've got NULL-pointer dereference in __mark_inode_dirty() on chmod()
for MTD device node. wb->bdi was NULL in this case.

During investigation I've found that MTD subsystem rewrites
file->f_mapping->backing_dev_info on openning to get mmap() work on
MMU-less systems. But in fact it rewrites
inode->i_mapping->backing_dev_info too, since inode->i_mapping ==
file->f_mapping (see __dentry_open() in fs/open.c). It breaks
writeback of inode changes.

I guess the right way to fix this is changing of __dentry_open() to
create _copy_ of i_mapping to assign to f_mapping since in common case
f_mapping != i_mapping. But I'm not sure were the copy should be
freed.

What do you think?

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

end of thread, other threads:[~2010-05-03 18:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-13 11:33 [BUG] Rewriting backing_dev_info in MTD Kirill A. Shutemov
2010-04-15 17:23 ` Jan Kara
2010-04-21 15:21   ` [PATCH] mtd: Do not corrupt backing device for inode Kirill A. Shutemov
2010-04-22 11:08     ` David Woodhouse
2010-04-22 15:20       ` Jan Kara
2010-05-03 16:56       ` [PATCH] mtd: Do not corrupt backing device of device node inode Kirill A. Shutemov
2010-05-03 18:54         ` Jan Kara

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).