aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/jfs/jfs_dmap.c70
-rw-r--r--fs/jfs/jfs_dtree.c37
-rw-r--r--fs/jfs/jfs_extent.c2
-rw-r--r--fs/jfs/jfs_imap.c69
-rw-r--r--fs/jfs/jfs_metapage.c5
-rw-r--r--fs/jfs/jfs_superblock.h1
-rw-r--r--fs/jfs/jfs_txnmgr.c2
-rw-r--r--fs/jfs/jfs_xtree.c62
-rw-r--r--fs/jfs/namei.c2
-rw-r--r--fs/jfs/resize.c2
-rw-r--r--fs/jfs/super.c22
-rw-r--r--fs/jfs/xattr.c4
12 files changed, 126 insertions, 152 deletions
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 9a55f53be5ff..370d7b6c5942 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -346,8 +346,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
346 printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n", 346 printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
347 (unsigned long long) blkno, 347 (unsigned long long) blkno,
348 (unsigned long long) nblocks); 348 (unsigned long long) nblocks);
349 jfs_error(ip->i_sb, 349 jfs_error(ip->i_sb, "block to be freed is outside the map\n");
350 "dbFree: block to be freed is outside the map");
351 return -EIO; 350 return -EIO;
352 } 351 }
353 352
@@ -384,7 +383,7 @@ int dbFree(struct inode *ip, s64 blkno, s64 nblocks)
384 383
385 /* free the blocks. */ 384 /* free the blocks. */
386 if ((rc = dbFreeDmap(bmp, dp, blkno, nb))) { 385 if ((rc = dbFreeDmap(bmp, dp, blkno, nb))) {
387 jfs_error(ip->i_sb, "dbFree: error in block map\n"); 386 jfs_error(ip->i_sb, "error in block map\n");
388 release_metapage(mp); 387 release_metapage(mp);
389 IREAD_UNLOCK(ipbmap); 388 IREAD_UNLOCK(ipbmap);
390 return (rc); 389 return (rc);
@@ -441,8 +440,7 @@ dbUpdatePMap(struct inode *ipbmap,
441 printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n", 440 printk(KERN_ERR "blkno = %Lx, nblocks = %Lx\n",
442 (unsigned long long) blkno, 441 (unsigned long long) blkno,
443 (unsigned long long) nblocks); 442 (unsigned long long) nblocks);
444 jfs_error(ipbmap->i_sb, 443 jfs_error(ipbmap->i_sb, "blocks are outside the map\n");
445 "dbUpdatePMap: blocks are outside the map");
446 return -EIO; 444 return -EIO;
447 } 445 }
448 446
@@ -726,7 +724,7 @@ int dbAlloc(struct inode *ip, s64 hint, s64 nblocks, s64 * results)
726 724
727 /* the hint should be within the map */ 725 /* the hint should be within the map */
728 if (hint >= mapSize) { 726 if (hint >= mapSize) {
729 jfs_error(ip->i_sb, "dbAlloc: the hint is outside the map"); 727 jfs_error(ip->i_sb, "the hint is outside the map\n");
730 return -EIO; 728 return -EIO;
731 } 729 }
732 730
@@ -1057,8 +1055,7 @@ static int dbExtend(struct inode *ip, s64 blkno, s64 nblocks, s64 addnblocks)
1057 bmp = sbi->bmap; 1055 bmp = sbi->bmap;
1058 if (lastblkno < 0 || lastblkno >= bmp->db_mapsize) { 1056 if (lastblkno < 0 || lastblkno >= bmp->db_mapsize) {
1059 IREAD_UNLOCK(ipbmap); 1057 IREAD_UNLOCK(ipbmap);
1060 jfs_error(ip->i_sb, 1058 jfs_error(ip->i_sb, "the block is outside the filesystem\n");
1061 "dbExtend: the block is outside the filesystem");
1062 return -EIO; 1059 return -EIO;
1063 } 1060 }
1064 1061
@@ -1134,8 +1131,7 @@ static int dbAllocNext(struct bmap * bmp, struct dmap * dp, s64 blkno,
1134 u32 mask; 1131 u32 mask;
1135 1132
1136 if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) { 1133 if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) {
1137 jfs_error(bmp->db_ipbmap->i_sb, 1134 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n");
1138 "dbAllocNext: Corrupt dmap page");
1139 return -EIO; 1135 return -EIO;
1140 } 1136 }
1141 1137
@@ -1265,8 +1261,7 @@ dbAllocNear(struct bmap * bmp,
1265 s8 *leaf; 1261 s8 *leaf;
1266 1262
1267 if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) { 1263 if (dp->tree.leafidx != cpu_to_le32(LEAFIND)) {
1268 jfs_error(bmp->db_ipbmap->i_sb, 1264 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmap page\n");
1269 "dbAllocNear: Corrupt dmap page");
1270 return -EIO; 1265 return -EIO;
1271 } 1266 }
1272 1267
@@ -1381,8 +1376,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1381 */ 1376 */
1382 if (l2nb > bmp->db_agl2size) { 1377 if (l2nb > bmp->db_agl2size) {
1383 jfs_error(bmp->db_ipbmap->i_sb, 1378 jfs_error(bmp->db_ipbmap->i_sb,
1384 "dbAllocAG: allocation request is larger than the " 1379 "allocation request is larger than the allocation group size\n");
1385 "allocation group size");
1386 return -EIO; 1380 return -EIO;
1387 } 1381 }
1388 1382
@@ -1417,7 +1411,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1417 (unsigned long long) blkno, 1411 (unsigned long long) blkno,
1418 (unsigned long long) nblocks); 1412 (unsigned long long) nblocks);
1419 jfs_error(bmp->db_ipbmap->i_sb, 1413 jfs_error(bmp->db_ipbmap->i_sb,
1420 "dbAllocAG: dbAllocCtl failed in free AG"); 1414 "dbAllocCtl failed in free AG\n");
1421 } 1415 }
1422 return (rc); 1416 return (rc);
1423 } 1417 }
@@ -1433,8 +1427,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1433 budmin = dcp->budmin; 1427 budmin = dcp->budmin;
1434 1428
1435 if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) { 1429 if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
1436 jfs_error(bmp->db_ipbmap->i_sb, 1430 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n");
1437 "dbAllocAG: Corrupt dmapctl page");
1438 release_metapage(mp); 1431 release_metapage(mp);
1439 return -EIO; 1432 return -EIO;
1440 } 1433 }
@@ -1475,7 +1468,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1475 } 1468 }
1476 if (n == 4) { 1469 if (n == 4) {
1477 jfs_error(bmp->db_ipbmap->i_sb, 1470 jfs_error(bmp->db_ipbmap->i_sb,
1478 "dbAllocAG: failed descending stree"); 1471 "failed descending stree\n");
1479 release_metapage(mp); 1472 release_metapage(mp);
1480 return -EIO; 1473 return -EIO;
1481 } 1474 }
@@ -1515,8 +1508,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1515 &blkno))) { 1508 &blkno))) {
1516 if (rc == -ENOSPC) { 1509 if (rc == -ENOSPC) {
1517 jfs_error(bmp->db_ipbmap->i_sb, 1510 jfs_error(bmp->db_ipbmap->i_sb,
1518 "dbAllocAG: control page " 1511 "control page inconsistent\n");
1519 "inconsistent");
1520 return -EIO; 1512 return -EIO;
1521 } 1513 }
1522 return (rc); 1514 return (rc);
@@ -1528,7 +1520,7 @@ dbAllocAG(struct bmap * bmp, int agno, s64 nblocks, int l2nb, s64 * results)
1528 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); 1520 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1529 if (rc == -ENOSPC) { 1521 if (rc == -ENOSPC) {
1530 jfs_error(bmp->db_ipbmap->i_sb, 1522 jfs_error(bmp->db_ipbmap->i_sb,
1531 "dbAllocAG: unable to allocate blocks"); 1523 "unable to allocate blocks\n");
1532 rc = -EIO; 1524 rc = -EIO;
1533 } 1525 }
1534 return (rc); 1526 return (rc);
@@ -1587,8 +1579,7 @@ static int dbAllocAny(struct bmap * bmp, s64 nblocks, int l2nb, s64 * results)
1587 */ 1579 */
1588 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results); 1580 rc = dbAllocCtl(bmp, nblocks, l2nb, blkno, results);
1589 if (rc == -ENOSPC) { 1581 if (rc == -ENOSPC) {
1590 jfs_error(bmp->db_ipbmap->i_sb, 1582 jfs_error(bmp->db_ipbmap->i_sb, "unable to allocate blocks\n");
1591 "dbAllocAny: unable to allocate blocks");
1592 return -EIO; 1583 return -EIO;
1593 } 1584 }
1594 return (rc); 1585 return (rc);
@@ -1652,8 +1643,7 @@ s64 dbDiscardAG(struct inode *ip, int agno, s64 minlen)
1652 range_cnt = min_t(u64, max_ranges + 1, 32 * 1024); 1643 range_cnt = min_t(u64, max_ranges + 1, 32 * 1024);
1653 totrim = kmalloc(sizeof(struct range2trim) * range_cnt, GFP_NOFS); 1644 totrim = kmalloc(sizeof(struct range2trim) * range_cnt, GFP_NOFS);
1654 if (totrim == NULL) { 1645 if (totrim == NULL) {
1655 jfs_error(bmp->db_ipbmap->i_sb, 1646 jfs_error(bmp->db_ipbmap->i_sb, "no memory for trim array\n");
1656 "dbDiscardAG: no memory for trim array");
1657 IWRITE_UNLOCK(ipbmap); 1647 IWRITE_UNLOCK(ipbmap);
1658 return 0; 1648 return 0;
1659 } 1649 }
@@ -1682,8 +1672,7 @@ s64 dbDiscardAG(struct inode *ip, int agno, s64 minlen)
1682 nblocks = 1 << l2nb; 1672 nblocks = 1 << l2nb;
1683 } else { 1673 } else {
1684 /* Trim any already allocated blocks */ 1674 /* Trim any already allocated blocks */
1685 jfs_error(bmp->db_ipbmap->i_sb, 1675 jfs_error(bmp->db_ipbmap->i_sb, "-EIO\n");
1686 "dbDiscardAG: -EIO");
1687 break; 1676 break;
1688 } 1677 }
1689 1678
@@ -1761,7 +1750,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
1761 1750
1762 if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) { 1751 if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
1763 jfs_error(bmp->db_ipbmap->i_sb, 1752 jfs_error(bmp->db_ipbmap->i_sb,
1764 "dbFindCtl: Corrupt dmapctl page"); 1753 "Corrupt dmapctl page\n");
1765 release_metapage(mp); 1754 release_metapage(mp);
1766 return -EIO; 1755 return -EIO;
1767 } 1756 }
@@ -1782,7 +1771,7 @@ static int dbFindCtl(struct bmap * bmp, int l2nb, int level, s64 * blkno)
1782 if (rc) { 1771 if (rc) {
1783 if (lev != level) { 1772 if (lev != level) {
1784 jfs_error(bmp->db_ipbmap->i_sb, 1773 jfs_error(bmp->db_ipbmap->i_sb,
1785 "dbFindCtl: dmap inconsistent"); 1774 "dmap inconsistent\n");
1786 return -EIO; 1775 return -EIO;
1787 } 1776 }
1788 return -ENOSPC; 1777 return -ENOSPC;
@@ -1906,7 +1895,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
1906 if (dp->tree.stree[ROOT] != L2BPERDMAP) { 1895 if (dp->tree.stree[ROOT] != L2BPERDMAP) {
1907 release_metapage(mp); 1896 release_metapage(mp);
1908 jfs_error(bmp->db_ipbmap->i_sb, 1897 jfs_error(bmp->db_ipbmap->i_sb,
1909 "dbAllocCtl: the dmap is not all free"); 1898 "the dmap is not all free\n");
1910 rc = -EIO; 1899 rc = -EIO;
1911 goto backout; 1900 goto backout;
1912 } 1901 }
@@ -1953,7 +1942,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
1953 * to indicate that we have leaked blocks. 1942 * to indicate that we have leaked blocks.
1954 */ 1943 */
1955 jfs_error(bmp->db_ipbmap->i_sb, 1944 jfs_error(bmp->db_ipbmap->i_sb,
1956 "dbAllocCtl: I/O Error: Block Leakage."); 1945 "I/O Error: Block Leakage\n");
1957 continue; 1946 continue;
1958 } 1947 }
1959 dp = (struct dmap *) mp->data; 1948 dp = (struct dmap *) mp->data;
@@ -1965,8 +1954,7 @@ dbAllocCtl(struct bmap * bmp, s64 nblocks, int l2nb, s64 blkno, s64 * results)
1965 * to indicate that we have leaked blocks. 1954 * to indicate that we have leaked blocks.
1966 */ 1955 */
1967 release_metapage(mp); 1956 release_metapage(mp);
1968 jfs_error(bmp->db_ipbmap->i_sb, 1957 jfs_error(bmp->db_ipbmap->i_sb, "Block Leakage\n");
1969 "dbAllocCtl: Block Leakage.");
1970 continue; 1958 continue;
1971 } 1959 }
1972 1960
@@ -2263,8 +2251,7 @@ static void dbAllocBits(struct bmap * bmp, struct dmap * dp, s64 blkno,
2263 for (; nwords > 0; nwords -= nw) { 2251 for (; nwords > 0; nwords -= nw) {
2264 if (leaf[word] < BUDMIN) { 2252 if (leaf[word] < BUDMIN) {
2265 jfs_error(bmp->db_ipbmap->i_sb, 2253 jfs_error(bmp->db_ipbmap->i_sb,
2266 "dbAllocBits: leaf page " 2254 "leaf page corrupt\n");
2267 "corrupt");
2268 break; 2255 break;
2269 } 2256 }
2270 2257
@@ -2536,8 +2523,7 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
2536 dcp = (struct dmapctl *) mp->data; 2523 dcp = (struct dmapctl *) mp->data;
2537 2524
2538 if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) { 2525 if (dcp->leafidx != cpu_to_le32(CTLLEAFIND)) {
2539 jfs_error(bmp->db_ipbmap->i_sb, 2526 jfs_error(bmp->db_ipbmap->i_sb, "Corrupt dmapctl page\n");
2540 "dbAdjCtl: Corrupt dmapctl page");
2541 release_metapage(mp); 2527 release_metapage(mp);
2542 return -EIO; 2528 return -EIO;
2543 } 2529 }
@@ -2638,8 +2624,7 @@ dbAdjCtl(struct bmap * bmp, s64 blkno, int newval, int alloc, int level)
2638 assert(level == bmp->db_maxlevel); 2624 assert(level == bmp->db_maxlevel);
2639 if (bmp->db_maxfreebud != oldroot) { 2625 if (bmp->db_maxfreebud != oldroot) {
2640 jfs_error(bmp->db_ipbmap->i_sb, 2626 jfs_error(bmp->db_ipbmap->i_sb,
2641 "dbAdjCtl: the maximum free buddy is " 2627 "the maximum free buddy is not the old root\n");
2642 "not the old root");
2643 } 2628 }
2644 bmp->db_maxfreebud = dcp->stree[ROOT]; 2629 bmp->db_maxfreebud = dcp->stree[ROOT];
2645 } 2630 }
@@ -3481,7 +3466,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
3481 p = BMAPBLKNO + nbperpage; /* L2 page */ 3466 p = BMAPBLKNO + nbperpage; /* L2 page */
3482 l2mp = read_metapage(ipbmap, p, PSIZE, 0); 3467 l2mp = read_metapage(ipbmap, p, PSIZE, 0);
3483 if (!l2mp) { 3468 if (!l2mp) {
3484 jfs_error(ipbmap->i_sb, "dbExtendFS: L2 page could not be read"); 3469 jfs_error(ipbmap->i_sb, "L2 page could not be read\n");
3485 return -EIO; 3470 return -EIO;
3486 } 3471 }
3487 l2dcp = (struct dmapctl *) l2mp->data; 3472 l2dcp = (struct dmapctl *) l2mp->data;
@@ -3646,8 +3631,7 @@ int dbExtendFS(struct inode *ipbmap, s64 blkno, s64 nblocks)
3646 } 3631 }
3647 } /* for each L1 in a L2 */ 3632 } /* for each L1 in a L2 */
3648 3633
3649 jfs_error(ipbmap->i_sb, 3634 jfs_error(ipbmap->i_sb, "function has not returned as expected\n");
3650 "dbExtendFS: function has not returned as expected");
3651errout: 3635errout:
3652 if (l0mp) 3636 if (l0mp)
3653 release_metapage(l0mp); 3637 release_metapage(l0mp);
@@ -3717,7 +3701,7 @@ void dbFinalizeBmap(struct inode *ipbmap)
3717 } 3701 }
3718 if (bmp->db_agpref >= bmp->db_numag) { 3702 if (bmp->db_agpref >= bmp->db_numag) {
3719 jfs_error(ipbmap->i_sb, 3703 jfs_error(ipbmap->i_sb,
3720 "cannot find ag with average freespace"); 3704 "cannot find ag with average freespace\n");
3721 } 3705 }
3722 } 3706 }
3723 3707
diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index 0ddbeceafc62..c89424e71a0a 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -124,21 +124,21 @@ struct dtsplit {
124#define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot) 124#define DT_PAGE(IP, MP) BT_PAGE(IP, MP, dtpage_t, i_dtroot)
125 125
126/* get page buffer for specified block address */ 126/* get page buffer for specified block address */
127#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC)\ 127#define DT_GETPAGE(IP, BN, MP, SIZE, P, RC) \
128{\ 128do { \
129 BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot)\ 129 BT_GETPAGE(IP, BN, MP, dtpage_t, SIZE, P, RC, i_dtroot); \
130 if (!(RC))\ 130 if (!(RC)) { \
131 {\ 131 if (((P)->header.nextindex > \
132 if (((P)->header.nextindex > (((BN)==0)?DTROOTMAXSLOT:(P)->header.maxslot)) ||\ 132 (((BN) == 0) ? DTROOTMAXSLOT : (P)->header.maxslot)) || \
133 ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT)))\ 133 ((BN) && ((P)->header.maxslot > DTPAGEMAXSLOT))) { \
134 {\ 134 BT_PUTPAGE(MP); \
135 BT_PUTPAGE(MP);\ 135 jfs_error((IP)->i_sb, \
136 jfs_error((IP)->i_sb, "DT_GETPAGE: dtree page corrupt");\ 136 "DT_GETPAGE: dtree page corrupt\n"); \
137 MP = NULL;\ 137 MP = NULL; \
138 RC = -EIO;\ 138 RC = -EIO; \
139 }\ 139 } \
140 }\ 140 } \
141} 141} while (0)
142 142
143/* for consistency */ 143/* for consistency */
144#define DT_PUTPAGE(MP) BT_PUTPAGE(MP) 144#define DT_PUTPAGE(MP) BT_PUTPAGE(MP)
@@ -776,7 +776,7 @@ int dtSearch(struct inode *ip, struct component_name * key, ino_t * data,
776 /* Something's corrupted, mark filesystem dirty so 776 /* Something's corrupted, mark filesystem dirty so
777 * chkdsk will fix it. 777 * chkdsk will fix it.
778 */ 778 */
779 jfs_error(sb, "stack overrun in dtSearch!"); 779 jfs_error(sb, "stack overrun!\n");
780 BT_STACK_DUMP(btstack); 780 BT_STACK_DUMP(btstack);
781 rc = -EIO; 781 rc = -EIO;
782 goto out; 782 goto out;
@@ -3252,8 +3252,7 @@ int jfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
3252 /* Sanity Check */ 3252 /* Sanity Check */
3253 if (d_namleft == 0) { 3253 if (d_namleft == 0) {
3254 jfs_error(ip->i_sb, 3254 jfs_error(ip->i_sb,
3255 "JFS:Dtree error: ino = " 3255 "JFS:Dtree error: ino = %ld, bn=%lld, index = %d\n",
3256 "%ld, bn=%Ld, index = %d",
3257 (long)ip->i_ino, 3256 (long)ip->i_ino,
3258 (long long)bn, 3257 (long long)bn,
3259 i); 3258 i);
@@ -3373,7 +3372,7 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack)
3373 */ 3372 */
3374 if (BT_STACK_FULL(btstack)) { 3373 if (BT_STACK_FULL(btstack)) {
3375 DT_PUTPAGE(mp); 3374 DT_PUTPAGE(mp);
3376 jfs_error(ip->i_sb, "dtReadFirst: btstack overrun"); 3375 jfs_error(ip->i_sb, "btstack overrun\n");
3377 BT_STACK_DUMP(btstack); 3376 BT_STACK_DUMP(btstack);
3378 return -EIO; 3377 return -EIO;
3379 } 3378 }
diff --git a/fs/jfs/jfs_extent.c b/fs/jfs/jfs_extent.c
index e5fe8506ed16..2ae7d59ab10a 100644
--- a/fs/jfs/jfs_extent.c
+++ b/fs/jfs/jfs_extent.c
@@ -388,7 +388,7 @@ int extHint(struct inode *ip, s64 offset, xad_t * xp)
388 388
389 if ((rc == 0) && xlen) { 389 if ((rc == 0) && xlen) {
390 if (xlen != nbperpage) { 390 if (xlen != nbperpage) {
391 jfs_error(ip->i_sb, "extHint: corrupt xtree"); 391 jfs_error(ip->i_sb, "corrupt xtree\n");
392 rc = -EIO; 392 rc = -EIO;
393 } 393 }
394 XADaddress(xp, xaddr); 394 XADaddress(xp, xaddr);
diff --git a/fs/jfs/jfs_imap.c b/fs/jfs/jfs_imap.c
index f7e042b63ddb..f321986e73d2 100644
--- a/fs/jfs/jfs_imap.c
+++ b/fs/jfs/jfs_imap.c
@@ -386,7 +386,7 @@ int diRead(struct inode *ip)
386 dp += rel_inode; 386 dp += rel_inode;
387 387
388 if (ip->i_ino != le32_to_cpu(dp->di_number)) { 388 if (ip->i_ino != le32_to_cpu(dp->di_number)) {
389 jfs_error(ip->i_sb, "diRead: i_ino != di_number"); 389 jfs_error(ip->i_sb, "i_ino != di_number\n");
390 rc = -EIO; 390 rc = -EIO;
391 } else if (le32_to_cpu(dp->di_nlink) == 0) 391 } else if (le32_to_cpu(dp->di_nlink) == 0)
392 rc = -ESTALE; 392 rc = -ESTALE;
@@ -625,7 +625,7 @@ int diWrite(tid_t tid, struct inode *ip)
625 if (!addressPXD(&(jfs_ip->ixpxd)) || 625 if (!addressPXD(&(jfs_ip->ixpxd)) ||
626 (lengthPXD(&(jfs_ip->ixpxd)) != 626 (lengthPXD(&(jfs_ip->ixpxd)) !=
627 JFS_IP(ipimap)->i_imap->im_nbperiext)) { 627 JFS_IP(ipimap)->i_imap->im_nbperiext)) {
628 jfs_error(ip->i_sb, "diWrite: ixpxd invalid"); 628 jfs_error(ip->i_sb, "ixpxd invalid\n");
629 return -EIO; 629 return -EIO;
630 } 630 }
631 631
@@ -893,8 +893,7 @@ int diFree(struct inode *ip)
893 if (iagno >= imap->im_nextiag) { 893 if (iagno >= imap->im_nextiag) {
894 print_hex_dump(KERN_ERR, "imap: ", DUMP_PREFIX_ADDRESS, 16, 4, 894 print_hex_dump(KERN_ERR, "imap: ", DUMP_PREFIX_ADDRESS, 16, 4,
895 imap, 32, 0); 895 imap, 32, 0);
896 jfs_error(ip->i_sb, 896 jfs_error(ip->i_sb, "inum = %d, iagno = %d, nextiag = %d\n",
897 "diFree: inum = %d, iagno = %d, nextiag = %d",
898 (uint) inum, iagno, imap->im_nextiag); 897 (uint) inum, iagno, imap->im_nextiag);
899 return -EIO; 898 return -EIO;
900 } 899 }
@@ -930,15 +929,14 @@ int diFree(struct inode *ip)
930 mask = HIGHORDER >> bitno; 929 mask = HIGHORDER >> bitno;
931 930
932 if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { 931 if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {
933 jfs_error(ip->i_sb, 932 jfs_error(ip->i_sb, "wmap shows inode already free\n");
934 "diFree: wmap shows inode already free");
935 } 933 }
936 934
937 if (!addressPXD(&iagp->inoext[extno])) { 935 if (!addressPXD(&iagp->inoext[extno])) {
938 release_metapage(mp); 936 release_metapage(mp);
939 IREAD_UNLOCK(ipimap); 937 IREAD_UNLOCK(ipimap);
940 AG_UNLOCK(imap, agno); 938 AG_UNLOCK(imap, agno);
941 jfs_error(ip->i_sb, "diFree: invalid inoext"); 939 jfs_error(ip->i_sb, "invalid inoext\n");
942 return -EIO; 940 return -EIO;
943 } 941 }
944 942
@@ -950,7 +948,7 @@ int diFree(struct inode *ip)
950 release_metapage(mp); 948 release_metapage(mp);
951 IREAD_UNLOCK(ipimap); 949 IREAD_UNLOCK(ipimap);
952 AG_UNLOCK(imap, agno); 950 AG_UNLOCK(imap, agno);
953 jfs_error(ip->i_sb, "diFree: numfree > numinos"); 951 jfs_error(ip->i_sb, "numfree > numinos\n");
954 return -EIO; 952 return -EIO;
955 } 953 }
956 /* 954 /*
@@ -1199,7 +1197,7 @@ int diFree(struct inode *ip)
1199 * for the inode being freed. 1197 * for the inode being freed.
1200 */ 1198 */
1201 if (iagp->pmap[extno] != 0) { 1199 if (iagp->pmap[extno] != 0) {
1202 jfs_error(ip->i_sb, "diFree: the pmap does not show inode free"); 1200 jfs_error(ip->i_sb, "the pmap does not show inode free\n");
1203 } 1201 }
1204 iagp->wmap[extno] = 0; 1202 iagp->wmap[extno] = 0;
1205 PXDlength(&iagp->inoext[extno], 0); 1203 PXDlength(&iagp->inoext[extno], 0);
@@ -1518,8 +1516,7 @@ int diAlloc(struct inode *pip, bool dir, struct inode *ip)
1518 release_metapage(mp); 1516 release_metapage(mp);
1519 AG_UNLOCK(imap, agno); 1517 AG_UNLOCK(imap, agno);
1520 jfs_error(ip->i_sb, 1518 jfs_error(ip->i_sb,
1521 "diAlloc: can't find free bit " 1519 "can't find free bit in wmap\n");
1522 "in wmap");
1523 return -EIO; 1520 return -EIO;
1524 } 1521 }
1525 1522
@@ -1660,7 +1657,7 @@ diAllocAG(struct inomap * imap, int agno, bool dir, struct inode *ip)
1660 numinos = imap->im_agctl[agno].numinos; 1657 numinos = imap->im_agctl[agno].numinos;
1661 1658
1662 if (numfree > numinos) { 1659 if (numfree > numinos) {
1663 jfs_error(ip->i_sb, "diAllocAG: numfree > numinos"); 1660 jfs_error(ip->i_sb, "numfree > numinos\n");
1664 return -EIO; 1661 return -EIO;
1665 } 1662 }
1666 1663
@@ -1811,8 +1808,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
1811 if (!iagp->nfreeinos) { 1808 if (!iagp->nfreeinos) {
1812 IREAD_UNLOCK(imap->im_ipimap); 1809 IREAD_UNLOCK(imap->im_ipimap);
1813 release_metapage(mp); 1810 release_metapage(mp);
1814 jfs_error(ip->i_sb, 1811 jfs_error(ip->i_sb, "nfreeinos = 0, but iag on freelist\n");
1815 "diAllocIno: nfreeinos = 0, but iag on freelist");
1816 return -EIO; 1812 return -EIO;
1817 } 1813 }
1818 1814
@@ -1824,7 +1820,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
1824 IREAD_UNLOCK(imap->im_ipimap); 1820 IREAD_UNLOCK(imap->im_ipimap);
1825 release_metapage(mp); 1821 release_metapage(mp);
1826 jfs_error(ip->i_sb, 1822 jfs_error(ip->i_sb,
1827 "diAllocIno: free inode not found in summary map"); 1823 "free inode not found in summary map\n");
1828 return -EIO; 1824 return -EIO;
1829 } 1825 }
1830 1826
@@ -1839,7 +1835,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
1839 if (rem >= EXTSPERSUM) { 1835 if (rem >= EXTSPERSUM) {
1840 IREAD_UNLOCK(imap->im_ipimap); 1836 IREAD_UNLOCK(imap->im_ipimap);
1841 release_metapage(mp); 1837 release_metapage(mp);
1842 jfs_error(ip->i_sb, "diAllocIno: no free extent found"); 1838 jfs_error(ip->i_sb, "no free extent found\n");
1843 return -EIO; 1839 return -EIO;
1844 } 1840 }
1845 extno = (sword << L2EXTSPERSUM) + rem; 1841 extno = (sword << L2EXTSPERSUM) + rem;
@@ -1850,7 +1846,7 @@ static int diAllocIno(struct inomap * imap, int agno, struct inode *ip)
1850 if (rem >= INOSPEREXT) { 1846 if (rem >= INOSPEREXT) {
1851 IREAD_UNLOCK(imap->im_ipimap); 1847 IREAD_UNLOCK(imap->im_ipimap);
1852 release_metapage(mp); 1848 release_metapage(mp);
1853 jfs_error(ip->i_sb, "diAllocIno: free inode not found"); 1849 jfs_error(ip->i_sb, "free inode not found\n");
1854 return -EIO; 1850 return -EIO;
1855 } 1851 }
1856 1852
@@ -1936,7 +1932,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
1936 IREAD_LOCK(imap->im_ipimap, RDWRLOCK_IMAP); 1932 IREAD_LOCK(imap->im_ipimap, RDWRLOCK_IMAP);
1937 if ((rc = diIAGRead(imap, iagno, &mp))) { 1933 if ((rc = diIAGRead(imap, iagno, &mp))) {
1938 IREAD_UNLOCK(imap->im_ipimap); 1934 IREAD_UNLOCK(imap->im_ipimap);
1939 jfs_error(ip->i_sb, "diAllocExt: error reading iag"); 1935 jfs_error(ip->i_sb, "error reading iag\n");
1940 return rc; 1936 return rc;
1941 } 1937 }
1942 iagp = (struct iag *) mp->data; 1938 iagp = (struct iag *) mp->data;
@@ -1948,8 +1944,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
1948 if (sword >= SMAPSZ) { 1944 if (sword >= SMAPSZ) {
1949 release_metapage(mp); 1945 release_metapage(mp);
1950 IREAD_UNLOCK(imap->im_ipimap); 1946 IREAD_UNLOCK(imap->im_ipimap);
1951 jfs_error(ip->i_sb, 1947 jfs_error(ip->i_sb, "free ext summary map not found\n");
1952 "diAllocExt: free ext summary map not found");
1953 return -EIO; 1948 return -EIO;
1954 } 1949 }
1955 if (~iagp->extsmap[sword]) 1950 if (~iagp->extsmap[sword])
@@ -1962,7 +1957,7 @@ static int diAllocExt(struct inomap * imap, int agno, struct inode *ip)
1962 if (rem >= EXTSPERSUM) { 1957 if (rem >= EXTSPERSUM) {
1963 release_metapage(mp); 1958 release_metapage(mp);
1964 IREAD_UNLOCK(imap->im_ipimap); 1959 IREAD_UNLOCK(imap->im_ipimap);
1965 jfs_error(ip->i_sb, "diAllocExt: free extent not found"); 1960 jfs_error(ip->i_sb, "free extent not found\n");
1966 return -EIO; 1961 return -EIO;
1967 } 1962 }
1968 extno = (sword << L2EXTSPERSUM) + rem; 1963 extno = (sword << L2EXTSPERSUM) + rem;
@@ -2081,8 +2076,7 @@ static int diAllocBit(struct inomap * imap, struct iag * iagp, int ino)
2081 if (bmp) 2076 if (bmp)
2082 release_metapage(bmp); 2077 release_metapage(bmp);
2083 2078
2084 jfs_error(imap->im_ipimap->i_sb, 2079 jfs_error(imap->im_ipimap->i_sb, "iag inconsistent\n");
2085 "diAllocBit: iag inconsistent");
2086 return -EIO; 2080 return -EIO;
2087 } 2081 }
2088 2082
@@ -2189,7 +2183,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
2189 /* better have free extents. 2183 /* better have free extents.
2190 */ 2184 */
2191 if (!iagp->nfreeexts) { 2185 if (!iagp->nfreeexts) {
2192 jfs_error(imap->im_ipimap->i_sb, "diNewExt: no free extents"); 2186 jfs_error(imap->im_ipimap->i_sb, "no free extents\n");
2193 return -EIO; 2187 return -EIO;
2194 } 2188 }
2195 2189
@@ -2261,7 +2255,7 @@ static int diNewExt(struct inomap * imap, struct iag * iagp, int extno)
2261 } 2255 }
2262 if (ciagp == NULL) { 2256 if (ciagp == NULL) {
2263 jfs_error(imap->im_ipimap->i_sb, 2257 jfs_error(imap->im_ipimap->i_sb,
2264 "diNewExt: ciagp == NULL"); 2258 "ciagp == NULL\n");
2265 rc = -EIO; 2259 rc = -EIO;
2266 goto error_out; 2260 goto error_out;
2267 } 2261 }
@@ -2498,7 +2492,7 @@ diNewIAG(struct inomap * imap, int *iagnop, int agno, struct metapage ** mpp)
2498 IWRITE_UNLOCK(ipimap); 2492 IWRITE_UNLOCK(ipimap);
2499 IAGFREE_UNLOCK(imap); 2493 IAGFREE_UNLOCK(imap);
2500 jfs_error(imap->im_ipimap->i_sb, 2494 jfs_error(imap->im_ipimap->i_sb,
2501 "diNewIAG: ipimap->i_size is wrong"); 2495 "ipimap->i_size is wrong\n");
2502 return -EIO; 2496 return -EIO;
2503 } 2497 }
2504 2498
@@ -2758,8 +2752,7 @@ diUpdatePMap(struct inode *ipimap,
2758 iagno = INOTOIAG(inum); 2752 iagno = INOTOIAG(inum);
2759 /* make sure that the iag is contained within the map */ 2753 /* make sure that the iag is contained within the map */
2760 if (iagno >= imap->im_nextiag) { 2754 if (iagno >= imap->im_nextiag) {
2761 jfs_error(ipimap->i_sb, 2755 jfs_error(ipimap->i_sb, "the iag is outside the map\n");
2762 "diUpdatePMap: the iag is outside the map");
2763 return -EIO; 2756 return -EIO;
2764 } 2757 }
2765 /* read the iag */ 2758 /* read the iag */
@@ -2788,13 +2781,13 @@ diUpdatePMap(struct inode *ipimap,
2788 */ 2781 */
2789 if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { 2782 if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {
2790 jfs_error(ipimap->i_sb, 2783 jfs_error(ipimap->i_sb,
2791 "diUpdatePMap: inode %ld not marked as " 2784 "inode %ld not marked as allocated in wmap!\n",
2792 "allocated in wmap!", inum); 2785 inum);
2793 } 2786 }
2794 if (!(le32_to_cpu(iagp->pmap[extno]) & mask)) { 2787 if (!(le32_to_cpu(iagp->pmap[extno]) & mask)) {
2795 jfs_error(ipimap->i_sb, 2788 jfs_error(ipimap->i_sb,
2796 "diUpdatePMap: inode %ld not marked as " 2789 "inode %ld not marked as allocated in pmap!\n",
2797 "allocated in pmap!", inum); 2790 inum);
2798 } 2791 }
2799 /* update the bitmap for the extent of the freed inode */ 2792 /* update the bitmap for the extent of the freed inode */
2800 iagp->pmap[extno] &= cpu_to_le32(~mask); 2793 iagp->pmap[extno] &= cpu_to_le32(~mask);
@@ -2809,15 +2802,13 @@ diUpdatePMap(struct inode *ipimap,
2809 if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) { 2802 if (!(le32_to_cpu(iagp->wmap[extno]) & mask)) {
2810 release_metapage(mp); 2803 release_metapage(mp);
2811 jfs_error(ipimap->i_sb, 2804 jfs_error(ipimap->i_sb,
2812 "diUpdatePMap: the inode is not allocated in " 2805 "the inode is not allocated in the working map\n");
2813 "the working map");
2814 return -EIO; 2806 return -EIO;
2815 } 2807 }
2816 if ((le32_to_cpu(iagp->pmap[extno]) & mask) != 0) { 2808 if ((le32_to_cpu(iagp->pmap[extno]) & mask) != 0) {
2817 release_metapage(mp); 2809 release_metapage(mp);
2818 jfs_error(ipimap->i_sb, 2810 jfs_error(ipimap->i_sb,
2819 "diUpdatePMap: the inode is not free in the " 2811 "the inode is not free in the persistent map\n");
2820 "persistent map");
2821 return -EIO; 2812 return -EIO;
2822 } 2813 }
2823 /* update the bitmap for the extent of the allocated inode */ 2814 /* update the bitmap for the extent of the allocated inode */
@@ -2909,8 +2900,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
2909 iagp = (struct iag *) bp->data; 2900 iagp = (struct iag *) bp->data;
2910 if (le32_to_cpu(iagp->iagnum) != i) { 2901 if (le32_to_cpu(iagp->iagnum) != i) {
2911 release_metapage(bp); 2902 release_metapage(bp);
2912 jfs_error(ipimap->i_sb, 2903 jfs_error(ipimap->i_sb, "unexpected value of iagnum\n");
2913 "diExtendFs: unexpected value of iagnum");
2914 return -EIO; 2904 return -EIO;
2915 } 2905 }
2916 2906
@@ -2986,8 +2976,7 @@ int diExtendFS(struct inode *ipimap, struct inode *ipbmap)
2986 2976
2987 if (xnuminos != atomic_read(&imap->im_numinos) || 2977 if (xnuminos != atomic_read(&imap->im_numinos) ||
2988 xnumfree != atomic_read(&imap->im_numfree)) { 2978 xnumfree != atomic_read(&imap->im_numfree)) {
2989 jfs_error(ipimap->i_sb, 2979 jfs_error(ipimap->i_sb, "numinos or numfree incorrect\n");
2990 "diExtendFs: numinos or numfree incorrect");
2991 return -EIO; 2980 return -EIO;
2992 } 2981 }
2993 2982
diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c
index 6740d34cd82b..6052c0d39382 100644
--- a/fs/jfs/jfs_metapage.c
+++ b/fs/jfs/jfs_metapage.c
@@ -646,7 +646,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
646 if (mp) { 646 if (mp) {
647 if (mp->logical_size != size) { 647 if (mp->logical_size != size) {
648 jfs_error(inode->i_sb, 648 jfs_error(inode->i_sb,
649 "__get_metapage: mp->logical_size != size"); 649 "get_mp->logical_size != size\n");
650 jfs_err("logical_size = %d, size = %d", 650 jfs_err("logical_size = %d, size = %d",
651 mp->logical_size, size); 651 mp->logical_size, size);
652 dump_stack(); 652 dump_stack();
@@ -657,8 +657,7 @@ struct metapage *__get_metapage(struct inode *inode, unsigned long lblock,
657 if (test_bit(META_discard, &mp->flag)) { 657 if (test_bit(META_discard, &mp->flag)) {
658 if (!new) { 658 if (!new) {
659 jfs_error(inode->i_sb, 659 jfs_error(inode->i_sb,
660 "__get_metapage: using a " 660 "using a discarded metapage\n");
661 "discarded metapage");
662 discard_metapage(mp); 661 discard_metapage(mp);
663 goto unlock; 662 goto unlock;
664 } 663 }
diff --git a/fs/jfs/jfs_superblock.h b/fs/jfs/jfs_superblock.h
index 884fc21ab8ee..04847b8d3070 100644
--- a/fs/jfs/jfs_superblock.h
+++ b/fs/jfs/jfs_superblock.h
@@ -108,6 +108,7 @@ struct jfs_superblock {
108 108
109extern int readSuper(struct super_block *, struct buffer_head **); 109extern int readSuper(struct super_block *, struct buffer_head **);
110extern int updateSuper(struct super_block *, uint); 110extern int updateSuper(struct super_block *, uint);
111__printf(2, 3)
111extern void jfs_error(struct super_block *, const char *, ...); 112extern void jfs_error(struct super_block *, const char *, ...);
112extern int jfs_mount(struct super_block *); 113extern int jfs_mount(struct super_block *);
113extern int jfs_mount_rw(struct super_block *, int); 114extern int jfs_mount_rw(struct super_block *, int);
diff --git a/fs/jfs/jfs_txnmgr.c b/fs/jfs/jfs_txnmgr.c
index 5fcc02eaa64c..564c4f279ac6 100644
--- a/fs/jfs/jfs_txnmgr.c
+++ b/fs/jfs/jfs_txnmgr.c
@@ -2684,7 +2684,7 @@ void txAbort(tid_t tid, int dirty)
2684 * mark filesystem dirty 2684 * mark filesystem dirty
2685 */ 2685 */
2686 if (dirty) 2686 if (dirty)
2687 jfs_error(tblk->sb, "txAbort"); 2687 jfs_error(tblk->sb, "\n");
2688 2688
2689 return; 2689 return;
2690} 2690}
diff --git a/fs/jfs/jfs_xtree.c b/fs/jfs/jfs_xtree.c
index 6c50871e6220..5ad7748860ce 100644
--- a/fs/jfs/jfs_xtree.c
+++ b/fs/jfs/jfs_xtree.c
@@ -64,22 +64,23 @@
64 64
65/* get page buffer for specified block address */ 65/* get page buffer for specified block address */
66/* ToDo: Replace this ugly macro with a function */ 66/* ToDo: Replace this ugly macro with a function */
67#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC)\ 67#define XT_GETPAGE(IP, BN, MP, SIZE, P, RC) \
68{\ 68do { \
69 BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot)\ 69 BT_GETPAGE(IP, BN, MP, xtpage_t, SIZE, P, RC, i_xtroot); \
70 if (!(RC))\ 70 if (!(RC)) { \
71 {\ 71 if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) || \
72 if ((le16_to_cpu((P)->header.nextindex) < XTENTRYSTART) ||\ 72 (le16_to_cpu((P)->header.nextindex) > \
73 (le16_to_cpu((P)->header.nextindex) > le16_to_cpu((P)->header.maxentry)) ||\ 73 le16_to_cpu((P)->header.maxentry)) || \
74 (le16_to_cpu((P)->header.maxentry) > (((BN)==0)?XTROOTMAXSLOT:PSIZE>>L2XTSLOTSIZE)))\ 74 (le16_to_cpu((P)->header.maxentry) > \
75 {\ 75 (((BN) == 0) ? XTROOTMAXSLOT : PSIZE >> L2XTSLOTSIZE))) { \
76 jfs_error((IP)->i_sb, "XT_GETPAGE: xtree page corrupt");\ 76 jfs_error((IP)->i_sb, \
77 BT_PUTPAGE(MP);\ 77 "XT_GETPAGE: xtree page corrupt\n"); \
78 MP = NULL;\ 78 BT_PUTPAGE(MP); \
79 RC = -EIO;\ 79 MP = NULL; \
80 }\ 80 RC = -EIO; \
81 }\ 81 } \
82} 82 } \
83} while (0)
83 84
84/* for consistency */ 85/* for consistency */
85#define XT_PUTPAGE(MP) BT_PUTPAGE(MP) 86#define XT_PUTPAGE(MP) BT_PUTPAGE(MP)
@@ -499,7 +500,7 @@ static int xtSearch(struct inode *ip, s64 xoff, s64 *nextp,
499 500
500 /* push (bn, index) of the parent page/entry */ 501 /* push (bn, index) of the parent page/entry */
501 if (BT_STACK_FULL(btstack)) { 502 if (BT_STACK_FULL(btstack)) {
502 jfs_error(ip->i_sb, "stack overrun in xtSearch!"); 503 jfs_error(ip->i_sb, "stack overrun!\n");
503 XT_PUTPAGE(mp); 504 XT_PUTPAGE(mp);
504 return -EIO; 505 return -EIO;
505 } 506 }
@@ -1385,7 +1386,7 @@ int xtExtend(tid_t tid, /* transaction id */
1385 1386
1386 if (cmp != 0) { 1387 if (cmp != 0) {
1387 XT_PUTPAGE(mp); 1388 XT_PUTPAGE(mp);
1388 jfs_error(ip->i_sb, "xtExtend: xtSearch did not find extent"); 1389 jfs_error(ip->i_sb, "xtSearch did not find extent\n");
1389 return -EIO; 1390 return -EIO;
1390 } 1391 }
1391 1392
@@ -1393,7 +1394,7 @@ int xtExtend(tid_t tid, /* transaction id */
1393 xad = &p->xad[index]; 1394 xad = &p->xad[index];
1394 if ((offsetXAD(xad) + lengthXAD(xad)) != xoff) { 1395 if ((offsetXAD(xad) + lengthXAD(xad)) != xoff) {
1395 XT_PUTPAGE(mp); 1396 XT_PUTPAGE(mp);
1396 jfs_error(ip->i_sb, "xtExtend: extension is not contiguous"); 1397 jfs_error(ip->i_sb, "extension is not contiguous\n");
1397 return -EIO; 1398 return -EIO;
1398 } 1399 }
1399 1400
@@ -1552,7 +1553,7 @@ printf("xtTailgate: nxoff:0x%lx nxlen:0x%x nxaddr:0x%lx\n",
1552 1553
1553 if (cmp != 0) { 1554 if (cmp != 0) {
1554 XT_PUTPAGE(mp); 1555 XT_PUTPAGE(mp);
1555 jfs_error(ip->i_sb, "xtTailgate: couldn't find extent"); 1556 jfs_error(ip->i_sb, "couldn't find extent\n");
1556 return -EIO; 1557 return -EIO;
1557 } 1558 }
1558 1559
@@ -1560,8 +1561,7 @@ printf("xtTailgate: nxoff:0x%lx nxlen:0x%x nxaddr:0x%lx\n",
1560 nextindex = le16_to_cpu(p->header.nextindex); 1561 nextindex = le16_to_cpu(p->header.nextindex);
1561 if (index != nextindex - 1) { 1562 if (index != nextindex - 1) {
1562 XT_PUTPAGE(mp); 1563 XT_PUTPAGE(mp);
1563 jfs_error(ip->i_sb, 1564 jfs_error(ip->i_sb, "the entry found is not the last entry\n");
1564 "xtTailgate: the entry found is not the last entry");
1565 return -EIO; 1565 return -EIO;
1566 } 1566 }
1567 1567
@@ -1734,7 +1734,7 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
1734 1734
1735 if (cmp != 0) { 1735 if (cmp != 0) {
1736 XT_PUTPAGE(mp); 1736 XT_PUTPAGE(mp);
1737 jfs_error(ip->i_sb, "xtUpdate: Could not find extent"); 1737 jfs_error(ip->i_sb, "Could not find extent\n");
1738 return -EIO; 1738 return -EIO;
1739 } 1739 }
1740 1740
@@ -1758,7 +1758,7 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
1758 (nxoff + nxlen > xoff + xlen)) { 1758 (nxoff + nxlen > xoff + xlen)) {
1759 XT_PUTPAGE(mp); 1759 XT_PUTPAGE(mp);
1760 jfs_error(ip->i_sb, 1760 jfs_error(ip->i_sb,
1761 "xtUpdate: nXAD in not completely contained within XAD"); 1761 "nXAD in not completely contained within XAD\n");
1762 return -EIO; 1762 return -EIO;
1763 } 1763 }
1764 1764
@@ -1907,7 +1907,7 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
1907 1907
1908 if (xoff >= nxoff) { 1908 if (xoff >= nxoff) {
1909 XT_PUTPAGE(mp); 1909 XT_PUTPAGE(mp);
1910 jfs_error(ip->i_sb, "xtUpdate: xoff >= nxoff"); 1910 jfs_error(ip->i_sb, "xoff >= nxoff\n");
1911 return -EIO; 1911 return -EIO;
1912 } 1912 }
1913/* #endif _JFS_WIP_COALESCE */ 1913/* #endif _JFS_WIP_COALESCE */
@@ -2048,14 +2048,13 @@ int xtUpdate(tid_t tid, struct inode *ip, xad_t * nxad)
2048 2048
2049 if (cmp != 0) { 2049 if (cmp != 0) {
2050 XT_PUTPAGE(mp); 2050 XT_PUTPAGE(mp);
2051 jfs_error(ip->i_sb, "xtUpdate: xtSearch failed"); 2051 jfs_error(ip->i_sb, "xtSearch failed\n");
2052 return -EIO; 2052 return -EIO;
2053 } 2053 }
2054 2054
2055 if (index0 != index) { 2055 if (index0 != index) {
2056 XT_PUTPAGE(mp); 2056 XT_PUTPAGE(mp);
2057 jfs_error(ip->i_sb, 2057 jfs_error(ip->i_sb, "unexpected value of index\n");
2058 "xtUpdate: unexpected value of index");
2059 return -EIO; 2058 return -EIO;
2060 } 2059 }
2061 } 2060 }
@@ -3650,7 +3649,7 @@ s64 xtTruncate(tid_t tid, struct inode *ip, s64 newsize, int flag)
3650 getChild: 3649 getChild:
3651 /* save current parent entry for the child page */ 3650 /* save current parent entry for the child page */
3652 if (BT_STACK_FULL(&btstack)) { 3651 if (BT_STACK_FULL(&btstack)) {
3653 jfs_error(ip->i_sb, "stack overrun in xtTruncate!"); 3652 jfs_error(ip->i_sb, "stack overrun!\n");
3654 XT_PUTPAGE(mp); 3653 XT_PUTPAGE(mp);
3655 return -EIO; 3654 return -EIO;
3656 } 3655 }
@@ -3751,8 +3750,7 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
3751 3750
3752 if (cmp != 0) { 3751 if (cmp != 0) {
3753 XT_PUTPAGE(mp); 3752 XT_PUTPAGE(mp);
3754 jfs_error(ip->i_sb, 3753 jfs_error(ip->i_sb, "did not find extent\n");
3755 "xtTruncate_pmap: did not find extent");
3756 return -EIO; 3754 return -EIO;
3757 } 3755 }
3758 } else { 3756 } else {
@@ -3851,7 +3849,7 @@ s64 xtTruncate_pmap(tid_t tid, struct inode *ip, s64 committed_size)
3851 getChild: 3849 getChild:
3852 /* save current parent entry for the child page */ 3850 /* save current parent entry for the child page */
3853 if (BT_STACK_FULL(&btstack)) { 3851 if (BT_STACK_FULL(&btstack)) {
3854 jfs_error(ip->i_sb, "stack overrun in xtTruncate_pmap!"); 3852 jfs_error(ip->i_sb, "stack overrun!\n");
3855 XT_PUTPAGE(mp); 3853 XT_PUTPAGE(mp);
3856 return -EIO; 3854 return -EIO;
3857 } 3855 }
diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 3b91a7ad6086..eb9799bb367c 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -1176,7 +1176,7 @@ static int jfs_rename(struct inode *old_dir, struct dentry *old_dentry,
1176 if (!S_ISDIR(old_ip->i_mode) && new_ip) 1176 if (!S_ISDIR(old_ip->i_mode) && new_ip)
1177 IWRITE_UNLOCK(new_ip); 1177 IWRITE_UNLOCK(new_ip);
1178 jfs_error(new_ip->i_sb, 1178 jfs_error(new_ip->i_sb,
1179 "jfs_rename: new_ip->i_nlink != 0"); 1179 "new_ip->i_nlink != 0\n");
1180 return -EIO; 1180 return -EIO;
1181 } 1181 }
1182 tblk = tid_to_tblock(tid); 1182 tblk = tid_to_tblock(tid);
diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c
index 8d0c1c7c0820..90b3bc21e9b0 100644
--- a/fs/jfs/resize.c
+++ b/fs/jfs/resize.c
@@ -530,7 +530,7 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize)
530 goto resume; 530 goto resume;
531 531
532 error_out: 532 error_out:
533 jfs_error(sb, "jfs_extendfs"); 533 jfs_error(sb, "\n");
534 534
535 resume: 535 resume:
536 /* 536 /*
diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 788e0a9c1fb0..6669aa2042c3 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -92,16 +92,20 @@ static void jfs_handle_error(struct super_block *sb)
92 /* nothing is done for continue beyond marking the superblock dirty */ 92 /* nothing is done for continue beyond marking the superblock dirty */
93} 93}
94 94
95void jfs_error(struct super_block *sb, const char * function, ...) 95void jfs_error(struct super_block *sb, const char *fmt, ...)
96{ 96{
97 static char error_buf[256]; 97 struct va_format vaf;
98 va_list args; 98 va_list args;
99 99
100 va_start(args, function); 100 va_start(args, fmt);
101 vsnprintf(error_buf, sizeof(error_buf), function, args); 101
102 va_end(args); 102 vaf.fmt = fmt;
103 vaf.va = &args;
103 104
104 pr_err("ERROR: (device %s): %s\n", sb->s_id, error_buf); 105 pr_err("ERROR: (device %s): %pf: %pV\n",
106 sb->s_id, __builtin_return_address(0), &vaf);
107
108 va_end(args);
105 109
106 jfs_handle_error(sb); 110 jfs_handle_error(sb);
107} 111}
@@ -617,7 +621,7 @@ static int jfs_freeze(struct super_block *sb)
617 txQuiesce(sb); 621 txQuiesce(sb);
618 rc = lmLogShutdown(log); 622 rc = lmLogShutdown(log);
619 if (rc) { 623 if (rc) {
620 jfs_error(sb, "jfs_freeze: lmLogShutdown failed"); 624 jfs_error(sb, "lmLogShutdown failed\n");
621 625
622 /* let operations fail rather than hang */ 626 /* let operations fail rather than hang */
623 txResume(sb); 627 txResume(sb);
@@ -646,12 +650,12 @@ static int jfs_unfreeze(struct super_block *sb)
646 if (!(sb->s_flags & MS_RDONLY)) { 650 if (!(sb->s_flags & MS_RDONLY)) {
647 rc = updateSuper(sb, FM_MOUNT); 651 rc = updateSuper(sb, FM_MOUNT);
648 if (rc) { 652 if (rc) {
649 jfs_error(sb, "jfs_unfreeze: updateSuper failed"); 653 jfs_error(sb, "updateSuper failed\n");
650 goto out; 654 goto out;
651 } 655 }
652 rc = lmLogInit(log); 656 rc = lmLogInit(log);
653 if (rc) 657 if (rc)
654 jfs_error(sb, "jfs_unfreeze: lmLogInit failed"); 658 jfs_error(sb, "lmLogInit failed\n");
655out: 659out:
656 txResume(sb); 660 txResume(sb);
657 } 661 }
diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
index 86ce028f2566..d3472f4cd530 100644
--- a/fs/jfs/xattr.c
+++ b/fs/jfs/xattr.c
@@ -382,7 +382,7 @@ static int ea_read(struct inode *ip, struct jfs_ea_list *ealist)
382 382
383 nbytes = sizeDXD(&ji->ea); 383 nbytes = sizeDXD(&ji->ea);
384 if (!nbytes) { 384 if (!nbytes) {
385 jfs_error(sb, "ea_read: nbytes is 0"); 385 jfs_error(sb, "nbytes is 0\n");
386 return -EIO; 386 return -EIO;
387 } 387 }
388 388
@@ -482,7 +482,7 @@ static int ea_get(struct inode *inode, struct ea_buffer *ea_buf, int min_size)
482 current_blocks = 0; 482 current_blocks = 0;
483 } else { 483 } else {
484 if (!(ji->ea.flag & DXD_EXTENT)) { 484 if (!(ji->ea.flag & DXD_EXTENT)) {
485 jfs_error(sb, "ea_get: invalid ea.flag)"); 485 jfs_error(sb, "invalid ea.flag\n");
486 return -EIO; 486 return -EIO;
487 } 487 }
488 current_blocks = (ea_size + sb->s_blocksize - 1) >> 488 current_blocks = (ea_size + sb->s_blocksize - 1) >>