[PATCH] ubifs: add missing ui pointer in debugging code

Daniel daniel at makrotopia.org
Thu May 15 08:54:50 PDT 2014


On 05/14/2014 09:32 AM, hujianyang wrote:
>> diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c
>> index 4f34dba..e13ec5e 100644
>> --- a/fs/ubifs/file.c
>> +++ b/fs/ubifs/file.c
>> @@ -903,6 +903,7 @@ static int do_writepage(struct page *page, int len)
>>  	struct ubifs_info *c = inode->i_sb->s_fs_info;
>>  
>>  #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);
> 
> I think here should be:
>   	ubifs_assert(page->index <= ui->synced_i_size >> PAGE_CACHE_SHIFT);
> 
> as line 1023 in ubifs_writepage:
> 
>         /* Is the page fully inside @i_size? */
>         if (page->index < end_index) {
>                 if (page->index >= synced_i_size >> PAGE_CACHE_SHIFT) {
>                         err = inode->i_sb->s_op->write_inode(inode, NULL);
> 

My intention was merely to get the code compiled with UBIFS_DEBUG enabled. If
things further than that need to be sorted out in that place as well, I suggest
that should go in a separate discussion.


Cheers

Daniel



More information about the linux-mtd mailing list