diff options
author | Prasad Joshi <prasadjoshi124@gmail.com> | 2010-12-21 20:24:20 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-12-22 22:43:33 -0500 |
commit | f06328d7721ad3852c45eb2a10a0c8f9439b5f33 (patch) | |
tree | 739a5e8e3c0a38dccc18e9155add4ec9a528c8d1 /fs/logfs | |
parent | eabb26cacdec33ca6f6fcaee762b57c2205169ca (diff) |
logfs: fix "Kernel BUG at readwrite.c:1193"
This happens when __logfs_create() tries to write a new inode to the disk
which is full.
__logfs_create() associates the transaction pointer with inode. During
the logfs_write_inode() function call chain this transaction pointer is
moved from inode to page->private using function move_inode_to_page
(do_write_inode() -> inode_to_page() -> move_inode_to_page)
When the write inode fails, the transaction is aborted and iput is called
on the failed inode. During delete_inode the same transaction pointer
associated with the page is getting used. Thus causing kernel BUG.
The patch checks for error in write_inode() and restores the page->private
to NULL.
Addresses https://bugzilla.kernel.org/show_bug.cgi?id=20162
Signed-off-by: Prasad Joshi <prasadjoshi124@gmail.com>
Cc: Joern Engel <joern@logfs.org>
Cc: Florian Mickler <florian@mickler.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Maciej Rutecki <maciej.rutecki@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/logfs')
-rw-r--r-- | fs/logfs/readwrite.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/logfs/readwrite.c b/fs/logfs/readwrite.c index 6127baf0e188..ee99a9f5dfd3 100644 --- a/fs/logfs/readwrite.c +++ b/fs/logfs/readwrite.c | |||
@@ -1994,6 +1994,9 @@ static int do_write_inode(struct inode *inode) | |||
1994 | 1994 | ||
1995 | /* FIXME: transaction is part of logfs_block now. Is that enough? */ | 1995 | /* FIXME: transaction is part of logfs_block now. Is that enough? */ |
1996 | err = logfs_write_buf(master_inode, page, 0); | 1996 | err = logfs_write_buf(master_inode, page, 0); |
1997 | if (err) | ||
1998 | move_page_to_inode(inode, page); | ||
1999 | |||
1997 | logfs_put_write_page(page); | 2000 | logfs_put_write_page(page); |
1998 | return err; | 2001 | return err; |
1999 | } | 2002 | } |