void xfs_do_force_shutdown( bhv_desc_t *bdp, int flags, char *fname, int lnnum) { int logerror; xfs_mount_t *mp; mp = XFS_BHVTOM(bdp); logerror = flags & SHUTDOWN_LOG_IO_ERROR; if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { cmn_err(CE_NOTE, "xfs_force_shutdown(%s,0x%x) called from " "line %d of file %s. Return address = 0x%p", mp->m_fsname, flags, lnnum, fname, __return_address); } /* * No need to duplicate efforts. */ if (XFS_FORCED_SHUTDOWN(mp) && !logerror) return; /* * This flags XFS_MOUNT_FS_SHUTDOWN, makes sure that we don't * queue up anybody new on the log reservations, and wakes up * everybody who's sleeping on log reservations to tell them * the bad news. */ if (xfs_log_force_umount(mp, logerror)) return; if (flags & SHUTDOWN_CORRUPT_INCORE) { xfs_cmn_err(XFS_PTAG_SHUTDOWN_CORRUPT, CE_ALERT, mp, "Corruption of in-memory data detected. Shutting down filesystem: %s", mp->m_fsname); if (XFS_ERRLEVEL_HIGH <= xfs_error_level) { xfs_stack_trace(); } } else if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { if (logerror) { xfs_cmn_err(XFS_PTAG_SHUTDOWN_LOGERROR, CE_ALERT, mp, "Log I/O Error Detected. Shutting down filesystem: %s", mp->m_fsname); } else if (flags & SHUTDOWN_DEVICE_REQ) { xfs_cmn_err(XFS_PTAG_SHUTDOWN_IOERROR, CE_ALERT, mp, "All device paths lost. Shutting down filesystem: %s", mp->m_fsname); } else if (!(flags & SHUTDOWN_REMOTE_REQ)) { xfs_cmn_err(XFS_PTAG_SHUTDOWN_IOERROR, CE_ALERT, mp, "I/O Error Detected. Shutting down filesystem: %s", mp->m_fsname); } } if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { cmn_err(CE_ALERT, "Please umount the filesystem, " "and rectify the problem(s)"); } }
void xfs_error_report( const char *tag, int level, struct xfs_mount *mp, const char *filename, int linenum, inst_t *ra) { if (level <= xfs_error_level) { xfs_alert_tag(mp, XFS_PTAG_ERROR_REPORT, "Internal error %s at line %d of file %s. Caller 0x%p", tag, linenum, filename, ra); xfs_stack_trace(); } }
void xfs_error_report( char *tag, int level, xfs_mount_t *mp, char *fname, int linenum, inst_t *ra) { if (level <= xfs_error_level) { xfs_cmn_err(XFS_PTAG_ERROR_REPORT, CE_ALERT, mp, "XFS internal error %s at line %d of file %s. Caller 0x%p\n", tag, linenum, fname, ra); xfs_stack_trace(); } }
void xfs_do_force_shutdown( xfs_mount_t *mp, int flags, char *fname, int lnnum) { int logerror; logerror = flags & SHUTDOWN_LOG_IO_ERROR; if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { xfs_notice(mp, "%s(0x%x) called from line %d of file %s. Return address = 0x%p", __func__, flags, lnnum, fname, __return_address); } if (XFS_FORCED_SHUTDOWN(mp) && !logerror) return; if (xfs_log_force_umount(mp, logerror)) return; if (flags & SHUTDOWN_CORRUPT_INCORE) { xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_CORRUPT, "Corruption of in-memory data detected. Shutting down filesystem"); if (XFS_ERRLEVEL_HIGH <= xfs_error_level) xfs_stack_trace(); } else if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { if (logerror) { xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_LOGERROR, "Log I/O Error Detected. Shutting down filesystem"); } else if (flags & SHUTDOWN_DEVICE_REQ) { xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR, "All device paths lost. Shutting down filesystem"); } else if (!(flags & SHUTDOWN_REMOTE_REQ)) { xfs_alert_tag(mp, XFS_PTAG_SHUTDOWN_IOERROR, "I/O Error Detected. Shutting down filesystem"); } } if (!(flags & SHUTDOWN_FORCE_UMOUNT)) { xfs_alert(mp, "Please umount the filesystem and rectify the problem(s)"); } }