Commit 89838b80 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'upstream-3.17-rc1' of git://git.infradead.org/linux-ubifs

Pull UBI/UBIFS changes from Artem Bityutskiy:
 "No significant changes, mostly small fixes here and there.  The more
  important fixes are:

   - UBI deleted list items while iterating the list with
     'list_for_each_entry'
   - The UBI block driver did not work properly with very large UBI
     volumes"

* tag 'upstream-3.17-rc1' of git://git.infradead.org/linux-ubifs: (21 commits)
  UBIFS: Add log overlap assertions
  Revert "UBIFS: add a log overlap assertion"
  UBI: bugfix in ubi_wl_flush()
  UBI: block: Avoid disk size integer overflow
  UBI: block: Set disk_capacity out of the mutex
  UBI: block: Make ubiblock_resize return something
  UBIFS: add a log overlap assertion
  UBIFS: remove unnecessary check
  UBIFS: remove mst_mutex
  UBIFS: kernel-doc warning fix
  UBI: init_volumes: Ignore volumes with no LEBs
  UBIFS: replace seq_printf by seq_puts
  UBIFS: replace count*size kzalloc by kcalloc
  UBIFS: kernel-doc warning fix
  UBIFS: fix error path in create_default_filesystem()
  UBIFS: fix spelling of "scanned"
  UBIFS: fix some comments
  UBIFS: remove useless @ecc in struct ubifs_scan_leb
  UBIFS: remove useless statements
  UBIFS: Add missing break statements in dbg_chk_pnode()
  ...
parents f6f99332 25601a3c
...@@ -378,9 +378,11 @@ int ubiblock_create(struct ubi_volume_info *vi) ...@@ -378,9 +378,11 @@ int ubiblock_create(struct ubi_volume_info *vi)
{ {
struct ubiblock *dev; struct ubiblock *dev;
struct gendisk *gd; struct gendisk *gd;
int disk_capacity; u64 disk_capacity = ((u64)vi->size * vi->usable_leb_size) >> 9;
int ret; int ret;
if ((sector_t)disk_capacity != disk_capacity)
return -EFBIG;
/* Check that the volume isn't already handled */ /* Check that the volume isn't already handled */
mutex_lock(&devices_mutex); mutex_lock(&devices_mutex);
if (find_dev_nolock(vi->ubi_num, vi->vol_id)) { if (find_dev_nolock(vi->ubi_num, vi->vol_id)) {
...@@ -412,7 +414,6 @@ int ubiblock_create(struct ubi_volume_info *vi) ...@@ -412,7 +414,6 @@ int ubiblock_create(struct ubi_volume_info *vi)
gd->first_minor = dev->ubi_num * UBI_MAX_VOLUMES + dev->vol_id; gd->first_minor = dev->ubi_num * UBI_MAX_VOLUMES + dev->vol_id;
gd->private_data = dev; gd->private_data = dev;
sprintf(gd->disk_name, "ubiblock%d_%d", dev->ubi_num, dev->vol_id); sprintf(gd->disk_name, "ubiblock%d_%d", dev->ubi_num, dev->vol_id);
disk_capacity = (vi->size * vi->usable_leb_size) >> 9;
set_capacity(gd, disk_capacity); set_capacity(gd, disk_capacity);
dev->gd = gd; dev->gd = gd;
...@@ -498,11 +499,16 @@ int ubiblock_remove(struct ubi_volume_info *vi) ...@@ -498,11 +499,16 @@ int ubiblock_remove(struct ubi_volume_info *vi)
return 0; return 0;
} }
static void ubiblock_resize(struct ubi_volume_info *vi) static int ubiblock_resize(struct ubi_volume_info *vi)
{ {
struct ubiblock *dev; struct ubiblock *dev;
int disk_capacity; u64 disk_capacity = ((u64)vi->size * vi->usable_leb_size) >> 9;
if ((sector_t)disk_capacity != disk_capacity) {
ubi_warn("%s: the volume is too big, cannot resize (%d LEBs)",
dev->gd->disk_name, vi->size);
return -EFBIG;
}
/* /*
* Need to lock the device list until we stop using the device, * Need to lock the device list until we stop using the device,
* otherwise the device struct might get released in * otherwise the device struct might get released in
...@@ -512,15 +518,15 @@ static void ubiblock_resize(struct ubi_volume_info *vi) ...@@ -512,15 +518,15 @@ static void ubiblock_resize(struct ubi_volume_info *vi)
dev = find_dev_nolock(vi->ubi_num, vi->vol_id); dev = find_dev_nolock(vi->ubi_num, vi->vol_id);
if (!dev) { if (!dev) {
mutex_unlock(&devices_mutex); mutex_unlock(&devices_mutex);
return; return -ENODEV;
} }
mutex_lock(&dev->dev_mutex); mutex_lock(&dev->dev_mutex);
disk_capacity = (vi->size * vi->usable_leb_size) >> 9;
set_capacity(dev->gd, disk_capacity); set_capacity(dev->gd, disk_capacity);
ubi_msg("%s resized to %d LEBs", dev->gd->disk_name, vi->size); ubi_msg("%s resized to %d LEBs", dev->gd->disk_name, vi->size);
mutex_unlock(&dev->dev_mutex); mutex_unlock(&dev->dev_mutex);
mutex_unlock(&devices_mutex); mutex_unlock(&devices_mutex);
return 0;
} }
static int ubiblock_notify(struct notifier_block *nb, static int ubiblock_notify(struct notifier_block *nb,
......
...@@ -591,7 +591,7 @@ static int init_volumes(struct ubi_device *ubi, ...@@ -591,7 +591,7 @@ static int init_volumes(struct ubi_device *ubi,
/* Static volumes only */ /* Static volumes only */
av = ubi_find_av(ai, i); av = ubi_find_av(ai, i);
if (!av) { if (!av || !av->leb_count) {
/* /*
* No eraseblocks belonging to this volume found. We * No eraseblocks belonging to this volume found. We
* don't actually know whether this static volume is * don't actually know whether this static volume is
......
...@@ -1718,12 +1718,12 @@ int ubi_wl_flush(struct ubi_device *ubi, int vol_id, int lnum) ...@@ -1718,12 +1718,12 @@ int ubi_wl_flush(struct ubi_device *ubi, int vol_id, int lnum)
vol_id, lnum, ubi->works_count); vol_id, lnum, ubi->works_count);
while (found) { while (found) {
struct ubi_work *wrk; struct ubi_work *wrk, *tmp;
found = 0; found = 0;
down_read(&ubi->work_sem); down_read(&ubi->work_sem);
spin_lock(&ubi->wl_lock); spin_lock(&ubi->wl_lock);
list_for_each_entry(wrk, &ubi->works, list) { list_for_each_entry_safe(wrk, tmp, &ubi->works, list) {
if ((vol_id == UBI_ALL || wrk->vol_id == vol_id) && if ((vol_id == UBI_ALL || wrk->vol_id == vol_id) &&
(lnum == UBI_ALL || wrk->lnum == lnum)) { (lnum == UBI_ALL || wrk->lnum == lnum)) {
list_del(&wrk->list); list_del(&wrk->list);
......
...@@ -174,7 +174,6 @@ static int do_commit(struct ubifs_info *c) ...@@ -174,7 +174,6 @@ static int do_commit(struct ubifs_info *c)
if (err) if (err)
goto out; goto out;
mutex_lock(&c->mst_mutex);
c->mst_node->cmt_no = cpu_to_le64(c->cmt_no); c->mst_node->cmt_no = cpu_to_le64(c->cmt_no);
c->mst_node->log_lnum = cpu_to_le32(new_ltail_lnum); c->mst_node->log_lnum = cpu_to_le32(new_ltail_lnum);
c->mst_node->root_lnum = cpu_to_le32(zroot.lnum); c->mst_node->root_lnum = cpu_to_le32(zroot.lnum);
...@@ -204,7 +203,6 @@ static int do_commit(struct ubifs_info *c) ...@@ -204,7 +203,6 @@ static int do_commit(struct ubifs_info *c)
else else
c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_NO_ORPHS); c->mst_node->flags &= ~cpu_to_le32(UBIFS_MST_NO_ORPHS);
err = ubifs_write_master(c); err = ubifs_write_master(c);
mutex_unlock(&c->mst_mutex);
if (err) if (err)
goto out; goto out;
......
...@@ -431,7 +431,7 @@ void ubifs_prep_grp_node(struct ubifs_info *c, void *node, int len, int last) ...@@ -431,7 +431,7 @@ void ubifs_prep_grp_node(struct ubifs_info *c, void *node, int len, int last)
/** /**
* wbuf_timer_callback - write-buffer timer callback function. * wbuf_timer_callback - write-buffer timer callback function.
* @data: timer data (write-buffer descriptor) * @timer: timer data (write-buffer descriptor)
* *
* This function is called when the write-buffer timer expires. * This function is called when the write-buffer timer expires.
*/ */
......
...@@ -240,6 +240,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs) ...@@ -240,6 +240,7 @@ int ubifs_add_bud_to_log(struct ubifs_info *c, int jhead, int lnum, int offs)
if (c->lhead_offs > c->leb_size - c->ref_node_alsz) { if (c->lhead_offs > c->leb_size - c->ref_node_alsz) {
c->lhead_lnum = ubifs_next_log_lnum(c, c->lhead_lnum); c->lhead_lnum = ubifs_next_log_lnum(c, c->lhead_lnum);
ubifs_assert(c->lhead_lnum != c->ltail_lnum);
c->lhead_offs = 0; c->lhead_offs = 0;
} }
...@@ -404,15 +405,14 @@ int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum) ...@@ -404,15 +405,14 @@ int ubifs_log_start_commit(struct ubifs_info *c, int *ltail_lnum)
/* Switch to the next log LEB */ /* Switch to the next log LEB */
if (c->lhead_offs) { if (c->lhead_offs) {
c->lhead_lnum = ubifs_next_log_lnum(c, c->lhead_lnum); c->lhead_lnum = ubifs_next_log_lnum(c, c->lhead_lnum);
ubifs_assert(c->lhead_lnum != c->ltail_lnum);
c->lhead_offs = 0; c->lhead_offs = 0;
} }
if (c->lhead_offs == 0) { /* Must ensure next LEB has been unmapped */
/* Must ensure next LEB has been unmapped */ err = ubifs_leb_unmap(c, c->lhead_lnum);
err = ubifs_leb_unmap(c, c->lhead_lnum); if (err)
if (err) goto out;
goto out;
}
len = ALIGN(len, c->min_io_size); len = ALIGN(len, c->min_io_size);
dbg_log("writing commit start at LEB %d:0, len %d", c->lhead_lnum, len); dbg_log("writing commit start at LEB %d:0, len %d", c->lhead_lnum, len);
......
...@@ -1464,7 +1464,6 @@ struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c, int lnum) ...@@ -1464,7 +1464,6 @@ struct ubifs_lprops *ubifs_lpt_lookup(struct ubifs_info *c, int lnum)
return ERR_CAST(nnode); return ERR_CAST(nnode);
} }
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1)); iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
shft -= UBIFS_LPT_FANOUT_SHIFT;
pnode = ubifs_get_pnode(c, nnode, iip); pnode = ubifs_get_pnode(c, nnode, iip);
if (IS_ERR(pnode)) if (IS_ERR(pnode))
return ERR_CAST(pnode); return ERR_CAST(pnode);
...@@ -1604,7 +1603,6 @@ struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum) ...@@ -1604,7 +1603,6 @@ struct ubifs_lprops *ubifs_lpt_lookup_dirty(struct ubifs_info *c, int lnum)
return ERR_CAST(nnode); return ERR_CAST(nnode);
} }
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1)); iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
shft -= UBIFS_LPT_FANOUT_SHIFT;
pnode = ubifs_get_pnode(c, nnode, iip); pnode = ubifs_get_pnode(c, nnode, iip);
if (IS_ERR(pnode)) if (IS_ERR(pnode))
return ERR_CAST(pnode); return ERR_CAST(pnode);
...@@ -1964,7 +1962,6 @@ int ubifs_lpt_scan_nolock(struct ubifs_info *c, int start_lnum, int end_lnum, ...@@ -1964,7 +1962,6 @@ int ubifs_lpt_scan_nolock(struct ubifs_info *c, int start_lnum, int end_lnum,
} }
} }
iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1)); iip = ((i >> shft) & (UBIFS_LPT_FANOUT - 1));
shft -= UBIFS_LPT_FANOUT_SHIFT;
pnode = scan_get_pnode(c, path + h, nnode, iip); pnode = scan_get_pnode(c, path + h, nnode, iip);
if (IS_ERR(pnode)) { if (IS_ERR(pnode)) {
err = PTR_ERR(pnode); err = PTR_ERR(pnode);
...@@ -2198,6 +2195,7 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, ...@@ -2198,6 +2195,7 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
lprops->dirty); lprops->dirty);
return -EINVAL; return -EINVAL;
} }
break;
case LPROPS_FREEABLE: case LPROPS_FREEABLE:
case LPROPS_FRDI_IDX: case LPROPS_FRDI_IDX:
if (lprops->free + lprops->dirty != c->leb_size) { if (lprops->free + lprops->dirty != c->leb_size) {
...@@ -2206,6 +2204,7 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode, ...@@ -2206,6 +2204,7 @@ static int dbg_chk_pnode(struct ubifs_info *c, struct ubifs_pnode *pnode,
lprops->dirty); lprops->dirty);
return -EINVAL; return -EINVAL;
} }
break;
} }
} }
return 0; return 0;
......
...@@ -304,7 +304,6 @@ static int layout_cnodes(struct ubifs_info *c) ...@@ -304,7 +304,6 @@ static int layout_cnodes(struct ubifs_info *c)
ubifs_assert(lnum >= c->lpt_first && ubifs_assert(lnum >= c->lpt_first &&
lnum <= c->lpt_last); lnum <= c->lpt_last);
} }
done_ltab = 1;
c->ltab_lnum = lnum; c->ltab_lnum = lnum;
c->ltab_offs = offs; c->ltab_offs = offs;
offs += c->ltab_sz; offs += c->ltab_sz;
...@@ -514,7 +513,6 @@ static int write_cnodes(struct ubifs_info *c) ...@@ -514,7 +513,6 @@ static int write_cnodes(struct ubifs_info *c)
if (err) if (err)
return err; return err;
} }
done_ltab = 1;
ubifs_pack_ltab(c, buf + offs, c->ltab_cmt); ubifs_pack_ltab(c, buf + offs, c->ltab_cmt);
offs += c->ltab_sz; offs += c->ltab_sz;
dbg_chk_lpt_sz(c, 1, c->ltab_sz); dbg_chk_lpt_sz(c, 1, c->ltab_sz);
...@@ -1941,6 +1939,11 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum) ...@@ -1941,6 +1939,11 @@ static void dump_lpt_leb(const struct ubifs_info *c, int lnum)
pr_err("LEB %d:%d, nnode, ", pr_err("LEB %d:%d, nnode, ",
lnum, offs); lnum, offs);
err = ubifs_unpack_nnode(c, p, &nnode); err = ubifs_unpack_nnode(c, p, &nnode);
if (err) {
pr_err("failed to unpack_node, error %d\n",
err);
break;
}
for (i = 0; i < UBIFS_LPT_FANOUT; i++) { for (i = 0; i < UBIFS_LPT_FANOUT; i++) {
pr_cont("%d:%d", nnode.nbranch[i].lnum, pr_cont("%d:%d", nnode.nbranch[i].lnum,
nnode.nbranch[i].offs); nnode.nbranch[i].offs);
......
...@@ -352,10 +352,9 @@ int ubifs_read_master(struct ubifs_info *c) ...@@ -352,10 +352,9 @@ int ubifs_read_master(struct ubifs_info *c)
* ubifs_write_master - write master node. * ubifs_write_master - write master node.
* @c: UBIFS file-system description object * @c: UBIFS file-system description object
* *
* This function writes the master node. The caller has to take the * This function writes the master node. Returns zero in case of success and a
* @c->mst_mutex lock before calling this function. Returns zero in case of * negative error code in case of failure. The master node is written twice to
* success and a negative error code in case of failure. The master node is * enable recovery.
* written twice to enable recovery.
*/ */
int ubifs_write_master(struct ubifs_info *c) int ubifs_write_master(struct ubifs_info *c)
{ {
......
...@@ -346,7 +346,6 @@ static int write_orph_nodes(struct ubifs_info *c, int atomic) ...@@ -346,7 +346,6 @@ static int write_orph_nodes(struct ubifs_info *c, int atomic)
int lnum; int lnum;
/* Unmap any unused LEBs after consolidation */ /* Unmap any unused LEBs after consolidation */
lnum = c->ohead_lnum + 1;
for (lnum = c->ohead_lnum + 1; lnum <= c->orph_last; lnum++) { for (lnum = c->ohead_lnum + 1; lnum <= c->orph_last; lnum++) {
err = ubifs_leb_unmap(c, lnum); err = ubifs_leb_unmap(c, lnum);
if (err) if (err)
......
...@@ -596,7 +596,6 @@ static void drop_last_group(struct ubifs_scan_leb *sleb, int *offs) ...@@ -596,7 +596,6 @@ static void drop_last_group(struct ubifs_scan_leb *sleb, int *offs)
* drop_last_node - drop the last node. * drop_last_node - drop the last node.
* @sleb: scanned LEB information * @sleb: scanned LEB information
* @offs: offset of dropped nodes is returned here * @offs: offset of dropped nodes is returned here
* @grouped: non-zero if whole group of nodes have to be dropped
* *
* This is a helper function for 'ubifs_recover_leb()' which drops the last * This is a helper function for 'ubifs_recover_leb()' which drops the last
* node of the scanned LEB. * node of the scanned LEB.
...@@ -629,8 +628,8 @@ static void drop_last_node(struct ubifs_scan_leb *sleb, int *offs) ...@@ -629,8 +628,8 @@ static void drop_last_node(struct ubifs_scan_leb *sleb, int *offs)
* *
* This function does a scan of a LEB, but caters for errors that might have * This function does a scan of a LEB, but caters for errors that might have
* been caused by the unclean unmount from which we are attempting to recover. * been caused by the unclean unmount from which we are attempting to recover.
* Returns %0 in case of success, %-EUCLEAN if an unrecoverable corruption is * Returns the scanned information on success and a negative error code on
* found, and a negative error code in case of failure. * failure.
*/ */
struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum, struct ubifs_scan_leb *ubifs_recover_leb(struct ubifs_info *c, int lnum,
int offs, void *sbuf, int jhead) int offs, void *sbuf, int jhead)
......
...@@ -332,6 +332,8 @@ static int create_default_filesystem(struct ubifs_info *c) ...@@ -332,6 +332,8 @@ static int create_default_filesystem(struct ubifs_info *c)
cs->ch.node_type = UBIFS_CS_NODE; cs->ch.node_type = UBIFS_CS_NODE;
err = ubifs_write_node(c, cs, UBIFS_CS_NODE_SZ, UBIFS_LOG_LNUM, 0); err = ubifs_write_node(c, cs, UBIFS_CS_NODE_SZ, UBIFS_LOG_LNUM, 0);
kfree(cs); kfree(cs);
if (err)
return err;
ubifs_msg("default file-system created"); ubifs_msg("default file-system created");
return 0; return 0;
...@@ -447,7 +449,7 @@ static int validate_sb(struct ubifs_info *c, struct ubifs_sb_node *sup) ...@@ -447,7 +449,7 @@ static int validate_sb(struct ubifs_info *c, struct ubifs_sb_node *sup)
goto failed; goto failed;
} }
if (c->default_compr < 0 || c->default_compr >= UBIFS_COMPR_TYPES_CNT) { if (c->default_compr >= UBIFS_COMPR_TYPES_CNT) {
err = 13; err = 13;
goto failed; goto failed;
} }
......
...@@ -131,7 +131,8 @@ int ubifs_scan_a_node(const struct ubifs_info *c, void *buf, int len, int lnum, ...@@ -131,7 +131,8 @@ int ubifs_scan_a_node(const struct ubifs_info *c, void *buf, int len, int lnum,
* @offs: offset to start at (usually zero) * @offs: offset to start at (usually zero)
* @sbuf: scan buffer (must be c->leb_size) * @sbuf: scan buffer (must be c->leb_size)
* *
* This function returns %0 on success and a negative error code on failure. * This function returns the scanned information on success and a negative error
* code on failure.
*/ */
struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,
int offs, void *sbuf) int offs, void *sbuf)
...@@ -157,9 +158,10 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, ...@@ -157,9 +158,10 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,
return ERR_PTR(err); return ERR_PTR(err);
} }
if (err == -EBADMSG) /*
sleb->ecc = 1; * Note, we ignore integrity errors (EBASMSG) because all the nodes are
* protected by CRC checksums.
*/
return sleb; return sleb;
} }
...@@ -169,8 +171,6 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum, ...@@ -169,8 +171,6 @@ struct ubifs_scan_leb *ubifs_start_scan(const struct ubifs_info *c, int lnum,
* @sleb: scanning information * @sleb: scanning information
* @lnum: logical eraseblock number * @lnum: logical eraseblock number
* @offs: offset to start at (usually zero) * @offs: offset to start at (usually zero)
*
* This function returns %0 on success and a negative error code on failure.
*/ */
void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb, void ubifs_end_scan(const struct ubifs_info *c, struct ubifs_scan_leb *sleb,
int lnum, int offs) int lnum, int offs)
...@@ -257,7 +257,7 @@ void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs, ...@@ -257,7 +257,7 @@ void ubifs_scanned_corruption(const struct ubifs_info *c, int lnum, int offs,
* @quiet: print no messages * @quiet: print no messages
* *
* This function scans LEB number @lnum and returns complete information about * This function scans LEB number @lnum and returns complete information about
* its contents. Returns the scaned information in case of success and, * its contents. Returns the scanned information in case of success and,
* %-EUCLEAN if the LEB neads recovery, and other negative error codes in case * %-EUCLEAN if the LEB neads recovery, and other negative error codes in case
* of failure. * of failure.
* *
......
...@@ -75,7 +75,7 @@ static int validate_inode(struct ubifs_info *c, const struct inode *inode) ...@@ -75,7 +75,7 @@ static int validate_inode(struct ubifs_info *c, const struct inode *inode)
return 1; return 1;
} }
if (ui->compr_type < 0 || ui->compr_type >= UBIFS_COMPR_TYPES_CNT) { if (ui->compr_type >= UBIFS_COMPR_TYPES_CNT) {
ubifs_err("unknown compression type %d", ui->compr_type); ubifs_err("unknown compression type %d", ui->compr_type);
return 2; return 2;
} }
...@@ -424,19 +424,19 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root) ...@@ -424,19 +424,19 @@ static int ubifs_show_options(struct seq_file *s, struct dentry *root)
struct ubifs_info *c = root->d_sb->s_fs_info; struct ubifs_info *c = root->d_sb->s_fs_info;
if (c->mount_opts.unmount_mode == 2) if (c->mount_opts.unmount_mode == 2)
seq_printf(s, ",fast_unmount"); seq_puts(s, ",fast_unmount");
else if (c->mount_opts.unmount_mode == 1) else if (c->mount_opts.unmount_mode == 1)
seq_printf(s, ",norm_unmount"); seq_puts(s, ",norm_unmount");
if (c->mount_opts.bulk_read == 2) if (c->mount_opts.bulk_read == 2)
seq_printf(s, ",bulk_read"); seq_puts(s, ",bulk_read");
else if (c->mount_opts.bulk_read == 1) else if (c->mount_opts.bulk_read == 1)
seq_printf(s, ",no_bulk_read"); seq_puts(s, ",no_bulk_read");
if (c->mount_opts.chk_data_crc == 2) if (c->mount_opts.chk_data_crc == 2)
seq_printf(s, ",chk_data_crc"); seq_puts(s, ",chk_data_crc");
else if (c->mount_opts.chk_data_crc == 1) else if (c->mount_opts.chk_data_crc == 1)
seq_printf(s, ",no_chk_data_crc"); seq_puts(s, ",no_chk_data_crc");
if (c->mount_opts.override_compr) { if (c->mount_opts.override_compr) {
seq_printf(s, ",compr=%s", seq_printf(s, ",compr=%s",
...@@ -796,8 +796,8 @@ static int alloc_wbufs(struct ubifs_info *c) ...@@ -796,8 +796,8 @@ static int alloc_wbufs(struct ubifs_info *c)
{ {
int i, err; int i, err;
c->jheads = kzalloc(c->jhead_cnt * sizeof(struct ubifs_jhead), c->jheads = kcalloc(c->jhead_cnt, sizeof(struct ubifs_jhead),
GFP_KERNEL); GFP_KERNEL);
if (!c->jheads) if (!c->jheads)
return -ENOMEM; return -ENOMEM;
...@@ -1963,7 +1963,6 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi) ...@@ -1963,7 +1963,6 @@ static struct ubifs_info *alloc_ubifs_info(struct ubi_volume_desc *ubi)
mutex_init(&c->lp_mutex); mutex_init(&c->lp_mutex);
mutex_init(&c->tnc_mutex); mutex_init(&c->tnc_mutex);
mutex_init(&c->log_mutex); mutex_init(&c->log_mutex);
mutex_init(&c->mst_mutex);
mutex_init(&c->umount_mutex); mutex_init(&c->umount_mutex);
mutex_init(&c->bu_mutex); mutex_init(&c->bu_mutex);
mutex_init(&c->write_reserve_mutex); mutex_init(&c->write_reserve_mutex);
......
...@@ -3294,7 +3294,6 @@ int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode, ...@@ -3294,7 +3294,6 @@ int dbg_check_inode_size(struct ubifs_info *c, const struct inode *inode,
goto out_unlock; goto out_unlock;
if (err) { if (err) {
err = -EINVAL;
key = &from_key; key = &from_key;
goto out_dump; goto out_dump;
} }
......
...@@ -389,7 +389,6 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt) ...@@ -389,7 +389,6 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt)
ubifs_dump_lprops(c); ubifs_dump_lprops(c);
} }
/* Try to commit anyway */ /* Try to commit anyway */
err = 0;
break; break;
} }
p++; p++;
......
...@@ -314,7 +314,6 @@ struct ubifs_scan_node { ...@@ -314,7 +314,6 @@ struct ubifs_scan_node {
* @nodes_cnt: number of nodes scanned * @nodes_cnt: number of nodes scanned
* @nodes: list of struct ubifs_scan_node * @nodes: list of struct ubifs_scan_node
* @endpt: end point (and therefore the start of empty space) * @endpt: end point (and therefore the start of empty space)
* @ecc: read returned -EBADMSG
* @buf: buffer containing entire LEB scanned * @buf: buffer containing entire LEB scanned
*/ */
struct ubifs_scan_leb { struct ubifs_scan_leb {
...@@ -322,7 +321,6 @@ struct ubifs_scan_leb { ...@@ -322,7 +321,6 @@ struct ubifs_scan_leb {
int nodes_cnt; int nodes_cnt;
struct list_head nodes; struct list_head nodes;
int endpt; int endpt;
int ecc;
void *buf; void *buf;
}; };
...@@ -1051,7 +1049,6 @@ struct ubifs_debug_info; ...@@ -1051,7 +1049,6 @@ struct ubifs_debug_info;
* *
* @mst_node: master node * @mst_node: master node
* @mst_offs: offset of valid master node * @mst_offs: offset of valid master node
* @mst_mutex: protects the master node area, @mst_node, and @mst_offs
* *
* @max_bu_buf_len: maximum bulk-read buffer length * @max_bu_buf_len: maximum bulk-read buffer length
* @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu * @bu_mutex: protects the pre-allocated bulk-read buffer and @c->bu
...@@ -1292,7 +1289,6 @@ struct ubifs_info { ...@@ -1292,7 +1289,6 @@ struct ubifs_info {
struct ubifs_mst_node *mst_node; struct ubifs_mst_node *mst_node;
int mst_offs; int mst_offs;
struct mutex mst_mutex;
int max_bu_buf_len; int max_bu_buf_len;
struct mutex bu_mutex; struct mutex bu_mutex;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment