Print out the volume label (e.g. fsname-OST0000) in error messages
instead of the device name (e.g. dm-2) so that it is easier to
correlate this with other messages in the log.
Fix error strings to be on one line to match code style.
Test-Parameters: trivial
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Change-Id: Iff31bc962ca32b1f3a13f579700d03835a3ebbe5
Reviewed-on: https://review.whamcloud.com/40738
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre_loa_swab(loa, true);
/* Check LMA compatibility */
if (lma->lma_incompat & ~LMA_INCOMPAT_SUPP) {
lustre_loa_swab(loa, true);
/* Check LMA compatibility */
if (lma->lma_incompat & ~LMA_INCOMPAT_SUPP) {
- CWARN("%s: unsupported incompat LMA feature(s) %#x "
- "for fid = "DFID", ino = %lu\n",
+ rc = -EOPNOTSUPP;
+ CWARN("%s: unsupported incompat LMA feature(s) %#x for fid = "DFID", ino = %lu: rc = %d\n",
osd_ino2name(inode),
lma->lma_incompat & ~LMA_INCOMPAT_SUPP,
osd_ino2name(inode),
lma->lma_incompat & ~LMA_INCOMPAT_SUPP,
- PFID(&lma->lma_self_fid), inode->i_ino);
- rc = -EOPNOTSUPP;
+ PFID(&lma->lma_self_fid), inode->i_ino, rc);
}
} else if (rc == 0) {
rc = -ENODATA;
}
} else if (rc == 0) {
rc = -ENODATA;
iput(inode);
inode = ERR_PTR(-ESTALE);
} else if (is_bad_inode(inode)) {
iput(inode);
inode = ERR_PTR(-ESTALE);
} else if (is_bad_inode(inode)) {
- CWARN("%s: bad inode: ino = %u\n",
- osd_dev2name(dev), id->oii_ino);
+ rc = -ENOENT;
+ CWARN("%s: bad inode: ino = %u: rc = %d\n",
+ osd_dev2name(dev), id->oii_ino, rc);
- inode = ERR_PTR(-ENOENT);
} else if ((rc = osd_attach_jinode(inode))) {
iput(inode);
inode = ERR_PTR(rc);
} else if ((rc = osd_attach_jinode(inode))) {
iput(inode);
inode = ERR_PTR(rc);
- CDEBUG(D_LFSCK, "%s: fail to check LMV EA, inode = %lu/%u,"
- DFID": rc = %d\n", osd_ino2name(inode),
- inode->i_ino, inode->i_generation,
+ CDEBUG(D_LFSCK,
+ "%s: cannot check LMV, ino = %lu/%u "DFID": rc = %d\n",
+ osd_ino2name(inode), inode->i_ino, inode->i_generation,
PFID(&oic->oic_fid), rc);
else
rc = 0;
PFID(&oic->oic_fid), rc);
else
rc = 0;
bool ignore_edquot = !(attr->la_flags & LUSTRE_SET_SYNC_FL);
if (!ignore_edquot)
bool ignore_edquot = !(attr->la_flags & LUSTRE_SET_SYNC_FL);
if (!ignore_edquot)
- CDEBUG(D_QUOTA, "%s: enforce quota on UID %u, GID %u"
- "(the quota space is %lld)\n",
- obj->oo_inode->i_sb->s_id, attr->la_uid,
+ CDEBUG(D_QUOTA,
+ "%s: enforce quota on UID %u, GID %u (quota space is %lld)\n",
+ osd_ino2name(obj->oo_inode), attr->la_uid,
attr->la_gid, bspace);
/* USERQUOTA */
attr->la_gid, bspace);
/* USERQUOTA */
rc = dquot_transfer(inode, &iattr);
if (rc) {
rc = dquot_transfer(inode, &iattr);
if (rc) {
- CERROR("%s: quota transfer failed: rc = %d. Is quota "
- "enforcement enabled on the ldiskfs "
- "filesystem?\n", inode->i_sb->s_id, rc);
+ CERROR("%s: quota transfer failed. Is quota enforcement enabled on the ldiskfs filesystem? rc = %d\n",
+ osd_ino2name(inode), rc);
rc = -ENOTSUPP;
#endif
if (rc) {
rc = -ENOTSUPP;
#endif
if (rc) {
- CERROR("%s: quota transfer failed: rc = %d. Is project "
- "enforcement enabled on the ldiskfs "
- "filesystem?\n", inode->i_sb->s_id, rc);
+ CERROR("%s: quota transfer failed. Is project enforcement enabled on the ldiskfs filesystem? rc = %d\n",
+ osd_ino2name(inode), rc);
i_projid_read(pobj->oo_inode) != 0) {
rc = osd_transfer_project(local, 0, th);
if (rc) {
i_projid_read(pobj->oo_inode) != 0) {
rc = osd_transfer_project(local, 0, th);
if (rc) {
- CERROR("%s: quota transfer failed: rc = %d. Is project "
- "quota enforcement enabled on the ldiskfs "
- "filesystem?\n", local->i_sb->s_id, rc);
+ CERROR("%s: quota transfer failed:. Is project quota enforcement enabled on the ldiskfs filesystem? rc = %d\n",
+ osd_ino2name(local), rc);
rc = osd_scrub_start(oti->oti_env, dev, SS_AUTO_PARTIAL |
SS_CLEAR_DRYRUN | SS_CLEAR_FAILOUT);
CDEBUG(D_LFSCK | D_CONSOLE | D_WARNING,
rc = osd_scrub_start(oti->oti_env, dev, SS_AUTO_PARTIAL |
SS_CLEAR_DRYRUN | SS_CLEAR_FAILOUT);
CDEBUG(D_LFSCK | D_CONSOLE | D_WARNING,
- "%s: trigger partial OI scrub for RPC inconsistency "
- "checking FID "DFID": rc = %d\n",
+ "%s: trigger partial OI scrub for RPC inconsistency checking FID "DFID": rc = %d\n",
osd_dev2name(dev), PFID(fid), rc);
if (rc == 0 || rc == -EALREADY)
goto again;
osd_dev2name(dev), PFID(fid), rc);
if (rc == 0 || rc == -EALREADY)
goto again;
* That means we lose it!
*/
if (rc != 0)
* That means we lose it!
*/
if (rc != 0)
- CDEBUG(D_LFSCK, "%s: fail to reinsert the dirent, "
- "dir = %lu/%u, name = %.*s, "DFID": rc = %d\n",
- osd_ino2name(inode),
- dir->i_ino, dir->i_generation, namelen,
- dentry->d_name.name, PFID(fid), rc);
+ CDEBUG(D_LFSCK,
+ "%s: fail to reinsert the dirent, dir = %lu/%u, name = %.*s, "DFID": rc = %d\n",
+ osd_ino2name(inode), dir->i_ino, dir->i_generation,
+ namelen, dentry->d_name.name, PFID(fid), rc);
bh = __ldiskfs_bread(NULL, inode, blk, 0);
if (IS_ERR_OR_NULL(bh)) {
bh = __ldiskfs_bread(NULL, inode, blk, 0);
if (IS_ERR_OR_NULL(bh)) {
- CERROR("%s: cannot load idle blocks, blk = %u, err = %ld\n",
+ CERROR("%s: cannot load idle blocks, blk = %u: rc = %ld\n",
osd_ino2name(inode), blk, bh ? PTR_ERR(bh) : -EIO);
c->ic_idle_failed = 1;
if (bh == NULL)
osd_ino2name(inode), blk, bh ? PTR_ERR(bh) : -EIO);
c->ic_idle_failed = 1;
if (bh == NULL)
head = (struct iam_idle_head *)(bh->b_data);
if (le16_to_cpu(head->iih_magic) != IAM_IDLE_HEADER_MAGIC) {
head = (struct iam_idle_head *)(bh->b_data);
if (le16_to_cpu(head->iih_magic) != IAM_IDLE_HEADER_MAGIC) {
- CERROR("%s: invalid idle block head, blk = %u, magic = %d\n",
- osd_ino2name(inode), blk, le16_to_cpu(head->iih_magic));
+ int rc = -EBADF;
+
+ CERROR("%s: invalid idle block head, blk = %u, magic = %x: rc = %d\n",
+ osd_ino2name(inode), blk, le16_to_cpu(head->iih_magic),
+ rc);
brelse(bh);
c->ic_idle_failed = 1;
brelse(bh);
c->ic_idle_failed = 1;
- return ERR_PTR(-EBADF);
return dev->od_mnt->mnt_sb;
}
return dev->od_mnt->mnt_sb;
}
+static inline const char *osd_sb2name(const struct super_block *sb)
+{
+ /* this is LDISKFS_SB(sb), but preserves "const" */
+ const struct ldiskfs_sb_info *sbi = sb->s_fs_info;
+
+ return sbi->s_es->s_volume_name;
+}
+
static inline const char *osd_dev2name(const struct osd_device *dev)
{
static inline const char *osd_dev2name(const struct osd_device *dev)
{
- return osd_sb(dev)->s_id;
+ return osd_sb2name(osd_sb(dev));
}
static inline const char *osd_ino2name(const struct inode *inode)
{
}
static inline const char *osd_ino2name(const struct inode *inode)
{
- return inode->i_sb->s_id;
+ return osd_sb2name(inode->i_sb);
if (unlikely(IS_ERR_OR_NULL(bh) && !sync))
CWARN(
"%s: adding bh without locking off %llu (block %lu, size %d, offs %llu)\n",
if (unlikely(IS_ERR_OR_NULL(bh) && !sync))
CWARN(
"%s: adding bh without locking off %llu (block %lu, size %d, offs %llu)\n",
offset, block, bufsize, *offs);
if (IS_ERR_OR_NULL(bh)) {
offset, block, bufsize, *offs);
if (IS_ERR_OR_NULL(bh)) {
CERROR(
"%s: error reading offset %llu (block %lu, size %d, offs %llu), credits %d/%d: rc = %d\n",
CERROR(
"%s: error reading offset %llu (block %lu, size %d, offs %llu), credits %d/%d: rc = %d\n",
- inode->i_sb->s_id, offset, block, bufsize, *offs,
- credits, handle->h_buffer_credits, err);
+ osd_ino2name(inode), offset, block, bufsize,
+ *offs, credits, handle->h_buffer_credits, err);
/* We should NOT find the same object more than once. */
CERROR("%s: scan the same object multiple times at the pos: "
"group = %u, base = %u, offset = %u, start = %u\n",
/* We should NOT find the same object more than once. */
CERROR("%s: scan the same object multiple times at the pos: "
"group = %u, base = %u, offset = %u, start = %u\n",
- param->sb->s_id, (__u32)param->bg, param->gbase,
+ osd_sb2name(param->sb), (__u32)param->bg, param->gbase,
offset, param->start);
goto again;
}
offset, param->start);
goto again;
}