Commit fc1f8c1c authored by Nathan Scott's avatar Nathan Scott

[XFS] Track external log/realtime device names for correct reporting in

/proc/mounts.

SGI-PV: 942984
SGI-Modid: xfs-linux:xfs-kern:23862a
Signed-off-by: default avatarNathan Scott <nathans@sgi.com>
parent 4aeb664c
......@@ -483,7 +483,8 @@ xfs_log_mount(xfs_mount_t *mp,
#if defined(DEBUG) || defined(XLOG_NOLOG)
if (!xlog_debug) {
cmn_err(CE_NOTE, "log dev: %s", XFS_BUFTARG_NAME(log_target));
cmn_err(CE_NOTE, "logdev: %s", mp->m_logname ?
mp->m_logname : "internal");
return 0;
}
#endif
......
......@@ -2226,8 +2226,9 @@ xlog_recover_do_buffer_trans(
break;
default:
xfs_fs_cmn_err(CE_ALERT, log->l_mp,
"xfs_log_recover: unknown buffer type 0x%x, dev %s",
buf_f->blf_type, XFS_BUFTARG_NAME(log->l_targ));
"xfs_log_recover: unknown buffer type 0x%x, logdev %s",
buf_f->blf_type, log->l_mp->m_logname ?
log->l_mp->m_logname : "internal");
XFS_ERROR_REPORT("xlog_recover_do_buffer_trans",
XFS_ERRLEVEL_LOW, log->l_mp);
return XFS_ERROR(EFSCORRUPTED);
......@@ -3938,8 +3939,9 @@ xlog_recover(
}
cmn_err(CE_NOTE,
"Starting XFS recovery on filesystem: %s (dev: %s)",
log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ));
"Starting XFS recovery on filesystem: %s (logdev: %s)",
log->l_mp->m_fsname, log->l_mp->m_logname ?
log->l_mp->m_logname : "internal");
error = xlog_do_recover(log, head_blk, tail_blk);
log->l_flags |= XLOG_RECOVERY_NEEDED;
......@@ -3987,8 +3989,9 @@ xlog_recover_finish(
xlog_recover_check_summary(log);
cmn_err(CE_NOTE,
"Ending XFS recovery on filesystem: %s (dev: %s)",
log->l_mp->m_fsname, XFS_BUFTARG_NAME(log->l_targ));
"Ending XFS recovery on filesystem: %s (logdev: %s)",
log->l_mp->m_fsname, log->l_mp->m_logname ?
log->l_mp->m_logname : "internal");
log->l_flags &= ~XLOG_RECOVERY_NEEDED;
} else {
cmn_err(CE_DEBUG,
......
......@@ -180,6 +180,10 @@ xfs_mount_free(
if (mp->m_fsname != NULL)
kmem_free(mp->m_fsname, mp->m_fsname_len);
if (mp->m_rtname != NULL)
kmem_free(mp->m_rtname, strlen(mp->m_rtname) + 1);
if (mp->m_logname != NULL)
kmem_free(mp->m_logname, strlen(mp->m_logname) + 1);
if (remove_bhv) {
struct vfs *vfsp = XFS_MTOVFS(mp);
......
......@@ -292,6 +292,8 @@ typedef struct xfs_mount {
struct xfs_buf *m_sb_bp; /* buffer for superblock */
char *m_fsname; /* filesystem name */
int m_fsname_len; /* strlen of fs name */
char *m_rtname; /* realtime device name */
char *m_logname; /* external log device name */
int m_bsize; /* fs logical block size */
xfs_agnumber_t m_agfrotor; /* last ag where space found */
xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */
......
......@@ -257,6 +257,14 @@ xfs_start_flags(
mp->m_fsname_len = strlen(ap->fsname) + 1;
mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP);
strcpy(mp->m_fsname, ap->fsname);
if (ap->rtname[0]) {
mp->m_rtname = kmem_alloc(strlen(ap->rtname) + 1, KM_SLEEP);
strcpy(mp->m_rtname, ap->rtname);
}
if (ap->logname[0]) {
mp->m_logname = kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP);
strcpy(mp->m_logname, ap->logname);
}
if (ap->flags & XFSMNT_WSYNC)
mp->m_flags |= XFS_MOUNT_WSYNC;
......@@ -1914,13 +1922,11 @@ xfs_showargs(
if (mp->m_logbsize > 0)
seq_printf(m, "," MNTOPT_LOGBSIZE "=%d", mp->m_logbsize);
if (mp->m_ddev_targp != mp->m_logdev_targp)
seq_printf(m, "," MNTOPT_LOGDEV "=%s",
XFS_BUFTARG_NAME(mp->m_logdev_targp));
if (mp->m_logname)
seq_printf(m, "," MNTOPT_LOGDEV "=%s", mp->m_logname);
if (mp->m_rtdev_targp && mp->m_ddev_targp != mp->m_rtdev_targp)
seq_printf(m, "," MNTOPT_RTDEV "=%s",
XFS_BUFTARG_NAME(mp->m_rtdev_targp));
if (mp->m_rtname)
seq_printf(m, "," MNTOPT_RTDEV "=%s", mp->m_rtname);
if (mp->m_dalign > 0)
seq_printf(m, "," MNTOPT_SUNIT "=%d",
......
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