diff options
-rw-r--r-- | fs/ubifs/debug.c | 3 | ||||
-rw-r--r-- | fs/ubifs/file.c | 17 | ||||
-rw-r--r-- | fs/ubifs/io.c | 4 | ||||
-rw-r--r-- | fs/ubifs/lpt_commit.c | 2 | ||||
-rw-r--r-- | fs/ubifs/orphan.c | 3 | ||||
-rw-r--r-- | fs/ubifs/super.c | 4 | ||||
-rw-r--r-- | fs/ubifs/tnc.c | 10 | ||||
-rw-r--r-- | fs/ubifs/ubifs.h | 6 |
8 files changed, 26 insertions, 23 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index da9ecddf028a..fa65b2931034 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -2421,7 +2421,8 @@ int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head) | |||
2421 | hashb = key_block(c, &sb->key); | 2421 | hashb = key_block(c, &sb->key); |
2422 | 2422 | ||
2423 | if (hasha > hashb) { | 2423 | if (hasha > hashb) { |
2424 | ubifs_err("larger hash %u goes before %u", hasha, hashb); | 2424 | ubifs_err("larger hash %u goes before %u", |
2425 | hasha, hashb); | ||
2425 | goto error_dump; | 2426 | goto error_dump; |
2426 | } | 2427 | } |
2427 | } | 2428 | } |
diff --git a/fs/ubifs/file.c b/fs/ubifs/file.c index b286db79c686..3f254e37b25b 100644 --- a/fs/ubifs/file.c +++ b/fs/ubifs/file.c | |||
@@ -971,11 +971,11 @@ static int do_writepage(struct page *page, int len) | |||
971 | * the page locked, and it locks @ui_mutex. However, write-back does take inode | 971 | * the page locked, and it locks @ui_mutex. However, write-back does take inode |
972 | * @i_mutex, which means other VFS operations may be run on this inode at the | 972 | * @i_mutex, which means other VFS operations may be run on this inode at the |
973 | * same time. And the problematic one is truncation to smaller size, from where | 973 | * same time. And the problematic one is truncation to smaller size, from where |
974 | * we have to call 'truncate_setsize()', which first changes @inode->i_size, then | 974 | * we have to call 'truncate_setsize()', which first changes @inode->i_size, |
975 | * drops the truncated pages. And while dropping the pages, it takes the page | 975 | * then drops the truncated pages. And while dropping the pages, it takes the |
976 | * lock. This means that 'do_truncation()' cannot call 'truncate_setsize()' with | 976 | * page lock. This means that 'do_truncation()' cannot call 'truncate_setsize()' |
977 | * @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'. This | 977 | * with @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'. |
978 | * means that @inode->i_size is changed while @ui_mutex is unlocked. | 978 | * This means that @inode->i_size is changed while @ui_mutex is unlocked. |
979 | * | 979 | * |
980 | * XXX(truncate): with the new truncate sequence this is not true anymore, | 980 | * XXX(truncate): with the new truncate sequence this is not true anymore, |
981 | * and the calls to truncate_setsize can be move around freely. They should | 981 | * and the calls to truncate_setsize can be move around freely. They should |
@@ -1432,10 +1432,11 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags) | |||
1432 | } | 1432 | } |
1433 | 1433 | ||
1434 | /* | 1434 | /* |
1435 | * mmap()d file has taken write protection fault and is being made | 1435 | * mmap()d file has taken write protection fault and is being made writable. |
1436 | * writable. UBIFS must ensure page is budgeted for. | 1436 | * UBIFS must ensure page is budgeted for. |
1437 | */ | 1437 | */ |
1438 | static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | 1438 | static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, |
1439 | struct vm_fault *vmf) | ||
1439 | { | 1440 | { |
1440 | struct page *page = vmf->page; | 1441 | struct page *page = vmf->page; |
1441 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; | 1442 | struct inode *inode = vma->vm_file->f_path.dentry->d_inode; |
diff --git a/fs/ubifs/io.c b/fs/ubifs/io.c index dfd168b7807e..6cc09311a632 100644 --- a/fs/ubifs/io.c +++ b/fs/ubifs/io.c | |||
@@ -393,7 +393,7 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf) | |||
393 | ubifs_assert(wbuf->size % c->min_io_size == 0); | 393 | ubifs_assert(wbuf->size % c->min_io_size == 0); |
394 | ubifs_assert(!c->ro_media && !c->ro_mount); | 394 | ubifs_assert(!c->ro_media && !c->ro_mount); |
395 | if (c->leb_size - wbuf->offs >= c->max_write_size) | 395 | if (c->leb_size - wbuf->offs >= c->max_write_size) |
396 | ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size )); | 396 | ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size)); |
397 | 397 | ||
398 | if (c->ro_error) | 398 | if (c->ro_error) |
399 | return -EROFS; | 399 | return -EROFS; |
@@ -588,7 +588,7 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len) | |||
588 | ubifs_assert(mutex_is_locked(&wbuf->io_mutex)); | 588 | ubifs_assert(mutex_is_locked(&wbuf->io_mutex)); |
589 | ubifs_assert(!c->ro_media && !c->ro_mount); | 589 | ubifs_assert(!c->ro_media && !c->ro_mount); |
590 | if (c->leb_size - wbuf->offs >= c->max_write_size) | 590 | if (c->leb_size - wbuf->offs >= c->max_write_size) |
591 | ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size )); | 591 | ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size)); |
592 | 592 | ||
593 | if (c->leb_size - wbuf->offs - wbuf->used < aligned_len) { | 593 | if (c->leb_size - wbuf->offs - wbuf->used < aligned_len) { |
594 | err = -ENOSPC; | 594 | err = -ENOSPC; |
diff --git a/fs/ubifs/lpt_commit.c b/fs/ubifs/lpt_commit.c index 0c9c69bd983a..9fe376a039cd 100644 --- a/fs/ubifs/lpt_commit.c +++ b/fs/ubifs/lpt_commit.c | |||
@@ -586,7 +586,7 @@ static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c, | |||
586 | if (nnode->nbranch[iip].lnum) | 586 | if (nnode->nbranch[iip].lnum) |
587 | break; | 587 | break; |
588 | } | 588 | } |
589 | } while (iip >= UBIFS_LPT_FANOUT); | 589 | } while (iip >= UBIFS_LPT_FANOUT); |
590 | 590 | ||
591 | /* Go right */ | 591 | /* Go right */ |
592 | nnode = ubifs_get_nnode(c, nnode, iip); | 592 | nnode = ubifs_get_nnode(c, nnode, iip); |
diff --git a/fs/ubifs/orphan.c b/fs/ubifs/orphan.c index 09df318e368f..bd644bf587a8 100644 --- a/fs/ubifs/orphan.c +++ b/fs/ubifs/orphan.c | |||
@@ -673,7 +673,8 @@ static int kill_orphans(struct ubifs_info *c) | |||
673 | sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); | 673 | sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1); |
674 | if (IS_ERR(sleb)) { | 674 | if (IS_ERR(sleb)) { |
675 | if (PTR_ERR(sleb) == -EUCLEAN) | 675 | if (PTR_ERR(sleb) == -EUCLEAN) |
676 | sleb = ubifs_recover_leb(c, lnum, 0, c->sbuf, 0); | 676 | sleb = ubifs_recover_leb(c, lnum, 0, |
677 | c->sbuf, 0); | ||
677 | if (IS_ERR(sleb)) { | 678 | if (IS_ERR(sleb)) { |
678 | err = PTR_ERR(sleb); | 679 | err = PTR_ERR(sleb); |
679 | break; | 680 | break; |
diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c index 04ad07f4fcc3..a089cca63436 100644 --- a/fs/ubifs/super.c +++ b/fs/ubifs/super.c | |||
@@ -1144,7 +1144,7 @@ static int check_free_space(struct ubifs_info *c) | |||
1144 | { | 1144 | { |
1145 | ubifs_assert(c->dark_wm > 0); | 1145 | ubifs_assert(c->dark_wm > 0); |
1146 | if (c->lst.total_free + c->lst.total_dirty < c->dark_wm) { | 1146 | if (c->lst.total_free + c->lst.total_dirty < c->dark_wm) { |
1147 | ubifs_err("insufficient free space to mount in read/write mode"); | 1147 | ubifs_err("insufficient free space to mount in R/W mode"); |
1148 | dbg_dump_budg(c); | 1148 | dbg_dump_budg(c); |
1149 | dbg_dump_lprops(c); | 1149 | dbg_dump_lprops(c); |
1150 | return -ENOSPC; | 1150 | return -ENOSPC; |
@@ -1456,7 +1456,7 @@ static int mount_ubifs(struct ubifs_info *c) | |||
1456 | dbg_msg("node sizes: ref %zu, cmt. start %zu, orph %zu", | 1456 | dbg_msg("node sizes: ref %zu, cmt. start %zu, orph %zu", |
1457 | UBIFS_REF_NODE_SZ, UBIFS_CS_NODE_SZ, UBIFS_ORPH_NODE_SZ); | 1457 | UBIFS_REF_NODE_SZ, UBIFS_CS_NODE_SZ, UBIFS_ORPH_NODE_SZ); |
1458 | dbg_msg("max. node sizes: data %zu, inode %zu dentry %zu, idx %d", | 1458 | dbg_msg("max. node sizes: data %zu, inode %zu dentry %zu, idx %d", |
1459 | UBIFS_MAX_DATA_NODE_SZ, UBIFS_MAX_INO_NODE_SZ, | 1459 | UBIFS_MAX_DATA_NODE_SZ, UBIFS_MAX_INO_NODE_SZ, |
1460 | UBIFS_MAX_DENT_NODE_SZ, ubifs_idx_node_sz(c, c->fanout)); | 1460 | UBIFS_MAX_DENT_NODE_SZ, ubifs_idx_node_sz(c, c->fanout)); |
1461 | dbg_msg("dead watermark: %d", c->dead_wm); | 1461 | dbg_msg("dead watermark: %d", c->dead_wm); |
1462 | dbg_msg("dark watermark: %d", c->dark_wm); | 1462 | dbg_msg("dark watermark: %d", c->dark_wm); |
diff --git a/fs/ubifs/tnc.c b/fs/ubifs/tnc.c index de485979ca39..8119b1fd8d94 100644 --- a/fs/ubifs/tnc.c +++ b/fs/ubifs/tnc.c | |||
@@ -2557,11 +2557,11 @@ int ubifs_tnc_remove_nm(struct ubifs_info *c, const union ubifs_key *key, | |||
2557 | if (err) { | 2557 | if (err) { |
2558 | /* Ensure the znode is dirtied */ | 2558 | /* Ensure the znode is dirtied */ |
2559 | if (znode->cnext || !ubifs_zn_dirty(znode)) { | 2559 | if (znode->cnext || !ubifs_zn_dirty(znode)) { |
2560 | znode = dirty_cow_bottom_up(c, znode); | 2560 | znode = dirty_cow_bottom_up(c, znode); |
2561 | if (IS_ERR(znode)) { | 2561 | if (IS_ERR(znode)) { |
2562 | err = PTR_ERR(znode); | 2562 | err = PTR_ERR(znode); |
2563 | goto out_unlock; | 2563 | goto out_unlock; |
2564 | } | 2564 | } |
2565 | } | 2565 | } |
2566 | err = tnc_delete(c, znode, n); | 2566 | err = tnc_delete(c, znode, n); |
2567 | } | 2567 | } |
diff --git a/fs/ubifs/ubifs.h b/fs/ubifs/ubifs.h index 8c40ad3c6721..d4c07a9b8211 100644 --- a/fs/ubifs/ubifs.h +++ b/fs/ubifs/ubifs.h | |||
@@ -389,9 +389,9 @@ struct ubifs_gced_idx_leb { | |||
389 | * The @ui_size is a "shadow" variable for @inode->i_size and UBIFS uses | 389 | * The @ui_size is a "shadow" variable for @inode->i_size and UBIFS uses |
390 | * @ui_size instead of @inode->i_size. The reason for this is that UBIFS cannot | 390 | * @ui_size instead of @inode->i_size. The reason for this is that UBIFS cannot |
391 | * make sure @inode->i_size is always changed under @ui_mutex, because it | 391 | * make sure @inode->i_size is always changed under @ui_mutex, because it |
392 | * cannot call 'truncate_setsize()' with @ui_mutex locked, because it would deadlock | 392 | * cannot call 'truncate_setsize()' with @ui_mutex locked, because it would |
393 | * with 'ubifs_writepage()' (see file.c). All the other inode fields are | 393 | * deadlock with 'ubifs_writepage()' (see file.c). All the other inode fields |
394 | * changed under @ui_mutex, so they do not need "shadow" fields. Note, one | 394 | * are changed under @ui_mutex, so they do not need "shadow" fields. Note, one |
395 | * could consider to rework locking and base it on "shadow" fields. | 395 | * could consider to rework locking and base it on "shadow" fields. |
396 | */ | 396 | */ |
397 | struct ubifs_inode { | 397 | struct ubifs_inode { |