UBIFS: fix debugging check
authorArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Tue, 27 May 2014 12:24:39 +0000 (15:24 +0300)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 28 May 2014 08:10:09 +0000 (11:10 +0300)
The debugging check which verifies that we never write outside of the file
length was incorrect, since it was multiplying file length by the page size,
instead of dividing. Fix this.

Spotted-by: hujianyang <hujianyang@huawei.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
fs/ubifs/file.c

index 727506b5e2ea34a30b25b5ef352e5e47611201e2..0ab7f7dfb98b632818a9b1dde1e74f4799633b8b 100644 (file)
@@ -905,7 +905,7 @@ static int do_writepage(struct page *page, int len)
 #ifdef UBIFS_DEBUG
        struct ubifs_inode *ui = ubifs_inode(inode);
        spin_lock(&ui->ui_lock);
-       ubifs_assert(page->index <= ui->synced_i_size << PAGE_CACHE_SIZE);
+       ubifs_assert(page->index <= ui->synced_i_size >> PAGE_CACHE_SHIFT);
        spin_unlock(&ui->ui_lock);
 #endif
 
This page took 0.025153 seconds and 5 git commands to generate.