Skip to content

Commit ccb5a49

Browse files
committed
Merge tag 'upstream-3.19-rc1' of git://git.infradead.org/linux-ubifs
Pull UBI/UBIFS updates from Artem Bityutskiy: "This includes the following UBI/UBIFS changes: - UBI debug messages now include the UBI device number. This change is responsible for the big diffstat since it touched every debugging print statement. - An Xattr bug-fix which fixes SELinux support - Several error path fixes in UBI/UBIFS" * tag 'upstream-3.19-rc1' of git://git.infradead.org/linux-ubifs: UBI: Fix invalid vfree() UBI: Fix double free after do_sync_erase() UBIFS: fix a couple bugs in UBIFS xattr length calculation UBI: vtbl: Use ubi_eba_atomic_leb_change() UBI: Extend UBI layer debug/messaging capabilities UBIFS: fix budget leak in error path
2 parents c05e14f + f38aed9 commit ccb5a49

File tree

17 files changed

+466
-433
lines changed

17 files changed

+466
-433
lines changed

drivers/mtd/ubi/attach.c

Lines changed: 66 additions & 60 deletions
Large diffs are not rendered by default.

drivers/mtd/ubi/block.c

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,13 @@ static int __init ubiblock_set_param(const char *val,
111111

112112
len = strnlen(val, UBIBLOCK_PARAM_LEN);
113113
if (len == 0) {
114-
ubi_warn("block: empty 'block=' parameter - ignored\n");
114+
pr_warn("UBI: block: empty 'block=' parameter - ignored\n");
115115
return 0;
116116
}
117117

118118
if (len == UBIBLOCK_PARAM_LEN) {
119-
ubi_err("block: parameter \"%s\" is too long, max. is %d\n",
120-
val, UBIBLOCK_PARAM_LEN);
119+
pr_err("UBI: block: parameter \"%s\" is too long, max. is %d\n",
120+
val, UBIBLOCK_PARAM_LEN);
121121
return -EINVAL;
122122
}
123123

@@ -188,9 +188,8 @@ static int ubiblock_read_to_buf(struct ubiblock *dev, char *buffer,
188188

189189
ret = ubi_read(dev->desc, leb, buffer, offset, len);
190190
if (ret) {
191-
ubi_err("%s: error %d while reading from LEB %d (offset %d, "
192-
"length %d)", dev->gd->disk_name, ret, leb, offset,
193-
len);
191+
dev_err(disk_to_dev(dev->gd), "%d while reading from LEB %d (offset %d, length %d)",
192+
ret, leb, offset, len);
194193
return ret;
195194
}
196195
return 0;
@@ -328,8 +327,8 @@ static int ubiblock_open(struct block_device *bdev, fmode_t mode)
328327

329328
dev->desc = ubi_open_volume(dev->ubi_num, dev->vol_id, UBI_READONLY);
330329
if (IS_ERR(dev->desc)) {
331-
ubi_err("%s failed to open ubi volume %d_%d",
332-
dev->gd->disk_name, dev->ubi_num, dev->vol_id);
330+
dev_err(disk_to_dev(dev->gd), "failed to open ubi volume %d_%d",
331+
dev->ubi_num, dev->vol_id);
333332
ret = PTR_ERR(dev->desc);
334333
dev->desc = NULL;
335334
goto out_unlock;
@@ -405,7 +404,7 @@ int ubiblock_create(struct ubi_volume_info *vi)
405404
/* Initialize the gendisk of this ubiblock device */
406405
gd = alloc_disk(1);
407406
if (!gd) {
408-
ubi_err("block: alloc_disk failed");
407+
pr_err("UBI: block: alloc_disk failed");
409408
ret = -ENODEV;
410409
goto out_free_dev;
411410
}
@@ -421,7 +420,7 @@ int ubiblock_create(struct ubi_volume_info *vi)
421420
spin_lock_init(&dev->queue_lock);
422421
dev->rq = blk_init_queue(ubiblock_request, &dev->queue_lock);
423422
if (!dev->rq) {
424-
ubi_err("block: blk_init_queue failed");
423+
dev_err(disk_to_dev(gd), "blk_init_queue failed");
425424
ret = -ENODEV;
426425
goto out_put_disk;
427426
}
@@ -446,8 +445,8 @@ int ubiblock_create(struct ubi_volume_info *vi)
446445

447446
/* Must be the last step: anyone can call file ops from now on */
448447
add_disk(dev->gd);
449-
ubi_msg("%s created from ubi%d:%d(%s)",
450-
dev->gd->disk_name, dev->ubi_num, dev->vol_id, vi->name);
448+
dev_info(disk_to_dev(dev->gd), "created from ubi%d:%d(%s)",
449+
dev->ubi_num, dev->vol_id, vi->name);
451450
return 0;
452451

453452
out_free_queue:
@@ -464,7 +463,7 @@ static void ubiblock_cleanup(struct ubiblock *dev)
464463
{
465464
del_gendisk(dev->gd);
466465
blk_cleanup_queue(dev->rq);
467-
ubi_msg("%s released", dev->gd->disk_name);
466+
dev_info(disk_to_dev(dev->gd), "released");
468467
put_disk(dev->gd);
469468
}
470469

@@ -518,17 +517,17 @@ static int ubiblock_resize(struct ubi_volume_info *vi)
518517
}
519518
if ((sector_t)disk_capacity != disk_capacity) {
520519
mutex_unlock(&devices_mutex);
521-
ubi_warn("%s: the volume is too big (%d LEBs), cannot resize",
522-
dev->gd->disk_name, vi->size);
520+
dev_warn(disk_to_dev(dev->gd), "the volume is too big (%d LEBs), cannot resize",
521+
vi->size);
523522
return -EFBIG;
524523
}
525524

526525
mutex_lock(&dev->dev_mutex);
527526

528527
if (get_capacity(dev->gd) != disk_capacity) {
529528
set_capacity(dev->gd, disk_capacity);
530-
ubi_msg("%s resized to %lld bytes", dev->gd->disk_name,
531-
vi->used_bytes);
529+
dev_info(disk_to_dev(dev->gd), "resized to %lld bytes",
530+
vi->used_bytes);
532531
}
533532
mutex_unlock(&dev->dev_mutex);
534533
mutex_unlock(&devices_mutex);
@@ -596,8 +595,8 @@ static int __init ubiblock_create_from_param(void)
596595

597596
desc = open_volume_desc(p->name, p->ubi_num, p->vol_id);
598597
if (IS_ERR(desc)) {
599-
ubi_err("block: can't open volume, err=%ld\n",
600-
PTR_ERR(desc));
598+
pr_err("UBI: block: can't open volume, err=%ld\n",
599+
PTR_ERR(desc));
601600
ret = PTR_ERR(desc);
602601
break;
603602
}
@@ -607,8 +606,8 @@ static int __init ubiblock_create_from_param(void)
607606

608607
ret = ubiblock_create(&vi);
609608
if (ret) {
610-
ubi_err("block: can't add '%s' volume, err=%d\n",
611-
vi.name, ret);
609+
pr_err("UBI: block: can't add '%s' volume, err=%d\n",
610+
vi.name, ret);
612611
break;
613612
}
614613
}

0 commit comments

Comments
 (0)