Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

jfs: Update jfs_error

Use a more current logging style.

Add __printf format and argument verification.

Remove embedded function names from formats.
Add %pf, __builtin_return_address(0) to jfs_error.
Add newlines to formats for kernel style consistency.
(One format already had an erroneous newline)
Coalesce formats and align arguments.

Object size reduced ~1KiB.

$ size fs/jfs/built-in.o*
text data bss dec hex filename
201891 35488 63936 301315 49903 fs/jfs/built-in.o.new
202821 35488 64192 302501 49da5 fs/jfs/built-in.o.old

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Dave Kleikamp <dave.kleikamp@oracle.com>

authored by

Joe Perches and committed by
Dave Kleikamp
eb8630d7 21d1101f

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