summaryrefslogtreecommitdiff
path: root/fs/ufs/balloc.c
diff options
context:
space:
mode:
authorEvgeniy Dushistov <dushistov@mail.ru>2007-01-29 13:19:54 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-01-30 08:26:45 -0800
commita685e26fff387db350966f88eaad515bf41c4705 (patch)
treeaa32924e5641541df5e178908bf8e88fb9d2f508 /fs/ufs/balloc.c
parentff79544754631cf3d237ff47b7d0e7ab2d211fcf (diff)
[PATCH] ufs: alloc metadata null page fix
These series of patches result of UFS1 write support stress testing, like running fsx-linux, untar and build linux kernel etc We pass from ufs::get_block_t to levels below: pointer to the current page, to make possible things like reallocation of blocks on the fly, and we also uses this pointer for indication, what actually we allocate data block or meta data block, but currently we make decision about what we allocate on the wrong level, this may and cause oops if we allocate blocks in some special order. Signed-off-by: Evgeniy Dushistov <dushistov@mail.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/ufs/balloc.c')
-rw-r--r--fs/ufs/balloc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/ufs/balloc.c b/fs/ufs/balloc.c
index 2e0021e8f366..96ca8453bab6 100644
--- a/fs/ufs/balloc.c
+++ b/fs/ufs/balloc.c
@@ -233,7 +233,7 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
{
unsigned int blk_per_page = 1 << (PAGE_CACHE_SHIFT - inode->i_blkbits);
struct address_space *mapping = inode->i_mapping;
- pgoff_t index, cur_index = locked_page->index;
+ pgoff_t index, cur_index;
unsigned int i, j;
struct page *page;
struct buffer_head *head, *bh;
@@ -241,8 +241,11 @@ static void ufs_change_blocknr(struct inode *inode, unsigned int baseblk,
UFSD("ENTER, ino %lu, count %u, oldb %u, newb %u\n",
inode->i_ino, count, oldb, newb);
+ BUG_ON(!locked_page);
BUG_ON(!PageLocked(locked_page));
+ cur_index = locked_page->index;
+
for (i = 0; i < count; i += blk_per_page) {
index = (baseblk+i) >> (PAGE_CACHE_SHIFT - inode->i_blkbits);