From: Artem Bityutskiy Date: Tue, 27 May 2014 12:24:39 +0000 (+0300) Subject: UBIFS: fix debugging check X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=ba6a7d55634b9ddf119216faef55f2463b17d60b;p=deliverable%2Flinux.git UBIFS: fix debugging check 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 Signed-off-by: Artem Bityutskiy --- diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index 727506b5e2ea..0ab7f7dfb98b 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c @@ -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