Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 250418
b: refs/heads/master
c: c436157
h: refs/heads/master
v: v3
  • Loading branch information
Artem Bityutskiy authored and Artem Bityutskiy committed May 13, 2011
1 parent 2b5808b commit a347d41
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1bbfc848a915081237660d898bbcf50e4a8fc59f
refs/heads/master: c43615702f9c5957981693a4d966ed81d8fc1ecc
3 changes: 2 additions & 1 deletion trunk/fs/ubifs/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -2421,7 +2421,8 @@ int dbg_check_nondata_nodes_order(struct ubifs_info *c, struct list_head *head)
hashb = key_block(c, &sb->key);

if (hasha > hashb) {
ubifs_err("larger hash %u goes before %u", hasha, hashb);
ubifs_err("larger hash %u goes before %u",
hasha, hashb);
goto error_dump;
}
}
Expand Down
17 changes: 9 additions & 8 deletions trunk/fs/ubifs/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -971,11 +971,11 @@ static int do_writepage(struct page *page, int len)
* the page locked, and it locks @ui_mutex. However, write-back does take inode
* @i_mutex, which means other VFS operations may be run on this inode at the
* same time. And the problematic one is truncation to smaller size, from where
* we have to call 'truncate_setsize()', which first changes @inode->i_size, then
* drops the truncated pages. And while dropping the pages, it takes the page
* lock. This means that 'do_truncation()' cannot call 'truncate_setsize()' with
* @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'. This
* means that @inode->i_size is changed while @ui_mutex is unlocked.
* we have to call 'truncate_setsize()', which first changes @inode->i_size,
* then drops the truncated pages. And while dropping the pages, it takes the
* page lock. This means that 'do_truncation()' cannot call 'truncate_setsize()'
* with @ui_mutex locked, because it would deadlock with 'ubifs_writepage()'.
* This means that @inode->i_size is changed while @ui_mutex is unlocked.
*
* XXX(truncate): with the new truncate sequence this is not true anymore,
* and the calls to truncate_setsize can be move around freely. They should
Expand Down Expand Up @@ -1432,10 +1432,11 @@ static int ubifs_releasepage(struct page *page, gfp_t unused_gfp_flags)
}

/*
* mmap()d file has taken write protection fault and is being made
* writable. UBIFS must ensure page is budgeted for.
* mmap()d file has taken write protection fault and is being made writable.
* UBIFS must ensure page is budgeted for.
*/
static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
static int ubifs_vm_page_mkwrite(struct vm_area_struct *vma,
struct vm_fault *vmf)
{
struct page *page = vmf->page;
struct inode *inode = vma->vm_file->f_path.dentry->d_inode;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/ubifs/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ int ubifs_wbuf_sync_nolock(struct ubifs_wbuf *wbuf)
ubifs_assert(wbuf->size % c->min_io_size == 0);
ubifs_assert(!c->ro_media && !c->ro_mount);
if (c->leb_size - wbuf->offs >= c->max_write_size)
ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size ));
ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size));

if (c->ro_error)
return -EROFS;
Expand Down Expand Up @@ -588,7 +588,7 @@ int ubifs_wbuf_write_nolock(struct ubifs_wbuf *wbuf, void *buf, int len)
ubifs_assert(mutex_is_locked(&wbuf->io_mutex));
ubifs_assert(!c->ro_media && !c->ro_mount);
if (c->leb_size - wbuf->offs >= c->max_write_size)
ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size ));
ubifs_assert(!((wbuf->offs + wbuf->size) % c->max_write_size));

if (c->leb_size - wbuf->offs - wbuf->used < aligned_len) {
err = -ENOSPC;
Expand Down
2 changes: 1 addition & 1 deletion trunk/fs/ubifs/lpt_commit.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ static struct ubifs_pnode *next_pnode_to_dirty(struct ubifs_info *c,
if (nnode->nbranch[iip].lnum)
break;
}
} while (iip >= UBIFS_LPT_FANOUT);
} while (iip >= UBIFS_LPT_FANOUT);

/* Go right */
nnode = ubifs_get_nnode(c, nnode, iip);
Expand Down
3 changes: 2 additions & 1 deletion trunk/fs/ubifs/orphan.c
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,8 @@ static int kill_orphans(struct ubifs_info *c)
sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1);
if (IS_ERR(sleb)) {
if (PTR_ERR(sleb) == -EUCLEAN)
sleb = ubifs_recover_leb(c, lnum, 0, c->sbuf, 0);
sleb = ubifs_recover_leb(c, lnum, 0,
c->sbuf, 0);
if (IS_ERR(sleb)) {
err = PTR_ERR(sleb);
break;
Expand Down
4 changes: 2 additions & 2 deletions trunk/fs/ubifs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1144,7 +1144,7 @@ static int check_free_space(struct ubifs_info *c)
{
ubifs_assert(c->dark_wm > 0);
if (c->lst.total_free + c->lst.total_dirty < c->dark_wm) {
ubifs_err("insufficient free space to mount in read/write mode");
ubifs_err("insufficient free space to mount in R/W mode");
dbg_dump_budg(c);
dbg_dump_lprops(c);
return -ENOSPC;
Expand Down Expand Up @@ -1456,7 +1456,7 @@ static int mount_ubifs(struct ubifs_info *c)
dbg_msg("node sizes: ref %zu, cmt. start %zu, orph %zu",
UBIFS_REF_NODE_SZ, UBIFS_CS_NODE_SZ, UBIFS_ORPH_NODE_SZ);
dbg_msg("max. node sizes: data %zu, inode %zu dentry %zu, idx %d",
UBIFS_MAX_DATA_NODE_SZ, UBIFS_MAX_INO_NODE_SZ,
UBIFS_MAX_DATA_NODE_SZ, UBIFS_MAX_INO_NODE_SZ,
UBIFS_MAX_DENT_NODE_SZ, ubifs_idx_node_sz(c, c->fanout));
dbg_msg("dead watermark: %d", c->dead_wm);
dbg_msg("dark watermark: %d", c->dark_wm);
Expand Down
10 changes: 5 additions & 5 deletions trunk/fs/ubifs/tnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2557,11 +2557,11 @@ int ubifs_tnc_remove_nm(struct ubifs_info *c, const union ubifs_key *key,
if (err) {
/* Ensure the znode is dirtied */
if (znode->cnext || !ubifs_zn_dirty(znode)) {
znode = dirty_cow_bottom_up(c, znode);
if (IS_ERR(znode)) {
err = PTR_ERR(znode);
goto out_unlock;
}
znode = dirty_cow_bottom_up(c, znode);
if (IS_ERR(znode)) {
err = PTR_ERR(znode);
goto out_unlock;
}
}
err = tnc_delete(c, znode, n);
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/fs/ubifs/ubifs.h
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ struct ubifs_gced_idx_leb {
* The @ui_size is a "shadow" variable for @inode->i_size and UBIFS uses
* @ui_size instead of @inode->i_size. The reason for this is that UBIFS cannot
* make sure @inode->i_size is always changed under @ui_mutex, because it
* cannot call 'truncate_setsize()' with @ui_mutex locked, because it would deadlock
* with 'ubifs_writepage()' (see file.c). All the other inode fields are
* changed under @ui_mutex, so they do not need "shadow" fields. Note, one
* cannot call 'truncate_setsize()' with @ui_mutex locked, because it would
* deadlock with 'ubifs_writepage()' (see file.c). All the other inode fields
* are changed under @ui_mutex, so they do not need "shadow" fields. Note, one
* could consider to rework locking and base it on "shadow" fields.
*/
struct ubifs_inode {
Expand Down

0 comments on commit a347d41

Please sign in to comment.