diff options
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r-- | fs/xfs/xfs_mount.c | 148 |
1 files changed, 75 insertions, 73 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index d447aef84bc3..bb3f9a7b24ed 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c | |||
@@ -133,9 +133,7 @@ xfs_uuid_mount( | |||
133 | return 0; | 133 | return 0; |
134 | 134 | ||
135 | if (uuid_is_nil(uuid)) { | 135 | if (uuid_is_nil(uuid)) { |
136 | cmn_err(CE_WARN, | 136 | xfs_warn(mp, "Filesystem has nil UUID - can't mount"); |
137 | "XFS: Filesystem %s has nil UUID - can't mount", | ||
138 | mp->m_fsname); | ||
139 | return XFS_ERROR(EINVAL); | 137 | return XFS_ERROR(EINVAL); |
140 | } | 138 | } |
141 | 139 | ||
@@ -163,8 +161,7 @@ xfs_uuid_mount( | |||
163 | 161 | ||
164 | out_duplicate: | 162 | out_duplicate: |
165 | mutex_unlock(&xfs_uuid_table_mutex); | 163 | mutex_unlock(&xfs_uuid_table_mutex); |
166 | cmn_err(CE_WARN, "XFS: Filesystem %s has duplicate UUID - can't mount", | 164 | xfs_warn(mp, "Filesystem has duplicate UUID - can't mount"); |
167 | mp->m_fsname); | ||
168 | return XFS_ERROR(EINVAL); | 165 | return XFS_ERROR(EINVAL); |
169 | } | 166 | } |
170 | 167 | ||
@@ -311,6 +308,8 @@ xfs_mount_validate_sb( | |||
311 | xfs_sb_t *sbp, | 308 | xfs_sb_t *sbp, |
312 | int flags) | 309 | int flags) |
313 | { | 310 | { |
311 | int loud = !(flags & XFS_MFSI_QUIET); | ||
312 | |||
314 | /* | 313 | /* |
315 | * If the log device and data device have the | 314 | * If the log device and data device have the |
316 | * same device number, the log is internal. | 315 | * same device number, the log is internal. |
@@ -319,28 +318,32 @@ xfs_mount_validate_sb( | |||
319 | * a volume filesystem in a non-volume manner. | 318 | * a volume filesystem in a non-volume manner. |
320 | */ | 319 | */ |
321 | if (sbp->sb_magicnum != XFS_SB_MAGIC) { | 320 | if (sbp->sb_magicnum != XFS_SB_MAGIC) { |
322 | xfs_fs_mount_cmn_err(flags, "bad magic number"); | 321 | if (loud) |
322 | xfs_warn(mp, "bad magic number"); | ||
323 | return XFS_ERROR(EWRONGFS); | 323 | return XFS_ERROR(EWRONGFS); |
324 | } | 324 | } |
325 | 325 | ||
326 | if (!xfs_sb_good_version(sbp)) { | 326 | if (!xfs_sb_good_version(sbp)) { |
327 | xfs_fs_mount_cmn_err(flags, "bad version"); | 327 | if (loud) |
328 | xfs_warn(mp, "bad version"); | ||
328 | return XFS_ERROR(EWRONGFS); | 329 | return XFS_ERROR(EWRONGFS); |
329 | } | 330 | } |
330 | 331 | ||
331 | if (unlikely( | 332 | if (unlikely( |
332 | sbp->sb_logstart == 0 && mp->m_logdev_targp == mp->m_ddev_targp)) { | 333 | sbp->sb_logstart == 0 && mp->m_logdev_targp == mp->m_ddev_targp)) { |
333 | xfs_fs_mount_cmn_err(flags, | 334 | if (loud) |
334 | "filesystem is marked as having an external log; " | 335 | xfs_warn(mp, |
335 | "specify logdev on the\nmount command line."); | 336 | "filesystem is marked as having an external log; " |
337 | "specify logdev on the mount command line."); | ||
336 | return XFS_ERROR(EINVAL); | 338 | return XFS_ERROR(EINVAL); |
337 | } | 339 | } |
338 | 340 | ||
339 | if (unlikely( | 341 | if (unlikely( |
340 | sbp->sb_logstart != 0 && mp->m_logdev_targp != mp->m_ddev_targp)) { | 342 | sbp->sb_logstart != 0 && mp->m_logdev_targp != mp->m_ddev_targp)) { |
341 | xfs_fs_mount_cmn_err(flags, | 343 | if (loud) |
342 | "filesystem is marked as having an internal log; " | 344 | xfs_warn(mp, |
343 | "do not specify logdev on\nthe mount command line."); | 345 | "filesystem is marked as having an internal log; " |
346 | "do not specify logdev on the mount command line."); | ||
344 | return XFS_ERROR(EINVAL); | 347 | return XFS_ERROR(EINVAL); |
345 | } | 348 | } |
346 | 349 | ||
@@ -369,7 +372,8 @@ xfs_mount_validate_sb( | |||
369 | (sbp->sb_rextsize * sbp->sb_blocksize > XFS_MAX_RTEXTSIZE) || | 372 | (sbp->sb_rextsize * sbp->sb_blocksize > XFS_MAX_RTEXTSIZE) || |
370 | (sbp->sb_rextsize * sbp->sb_blocksize < XFS_MIN_RTEXTSIZE) || | 373 | (sbp->sb_rextsize * sbp->sb_blocksize < XFS_MIN_RTEXTSIZE) || |
371 | (sbp->sb_imax_pct > 100 /* zero sb_imax_pct is valid */))) { | 374 | (sbp->sb_imax_pct > 100 /* zero sb_imax_pct is valid */))) { |
372 | xfs_fs_mount_cmn_err(flags, "SB sanity check 1 failed"); | 375 | if (loud) |
376 | xfs_warn(mp, "SB sanity check 1 failed"); | ||
373 | return XFS_ERROR(EFSCORRUPTED); | 377 | return XFS_ERROR(EFSCORRUPTED); |
374 | } | 378 | } |
375 | 379 | ||
@@ -382,7 +386,8 @@ xfs_mount_validate_sb( | |||
382 | (xfs_drfsbno_t)sbp->sb_agcount * sbp->sb_agblocks || | 386 | (xfs_drfsbno_t)sbp->sb_agcount * sbp->sb_agblocks || |
383 | sbp->sb_dblocks < (xfs_drfsbno_t)(sbp->sb_agcount - 1) * | 387 | sbp->sb_dblocks < (xfs_drfsbno_t)(sbp->sb_agcount - 1) * |
384 | sbp->sb_agblocks + XFS_MIN_AG_BLOCKS)) { | 388 | sbp->sb_agblocks + XFS_MIN_AG_BLOCKS)) { |
385 | xfs_fs_mount_cmn_err(flags, "SB sanity check 2 failed"); | 389 | if (loud) |
390 | xfs_warn(mp, "SB sanity check 2 failed"); | ||
386 | return XFS_ERROR(EFSCORRUPTED); | 391 | return XFS_ERROR(EFSCORRUPTED); |
387 | } | 392 | } |
388 | 393 | ||
@@ -390,12 +395,12 @@ xfs_mount_validate_sb( | |||
390 | * Until this is fixed only page-sized or smaller data blocks work. | 395 | * Until this is fixed only page-sized or smaller data blocks work. |
391 | */ | 396 | */ |
392 | if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) { | 397 | if (unlikely(sbp->sb_blocksize > PAGE_SIZE)) { |
393 | xfs_fs_mount_cmn_err(flags, | 398 | if (loud) { |
394 | "file system with blocksize %d bytes", | 399 | xfs_warn(mp, |
395 | sbp->sb_blocksize); | 400 | "File system with blocksize %d bytes. " |
396 | xfs_fs_mount_cmn_err(flags, | 401 | "Only pagesize (%ld) or less will currently work.", |
397 | "only pagesize (%ld) or less will currently work.", | 402 | sbp->sb_blocksize, PAGE_SIZE); |
398 | PAGE_SIZE); | 403 | } |
399 | return XFS_ERROR(ENOSYS); | 404 | return XFS_ERROR(ENOSYS); |
400 | } | 405 | } |
401 | 406 | ||
@@ -409,21 +414,23 @@ xfs_mount_validate_sb( | |||
409 | case 2048: | 414 | case 2048: |
410 | break; | 415 | break; |
411 | default: | 416 | default: |
412 | xfs_fs_mount_cmn_err(flags, | 417 | if (loud) |
413 | "inode size of %d bytes not supported", | 418 | xfs_warn(mp, "inode size of %d bytes not supported", |
414 | sbp->sb_inodesize); | 419 | sbp->sb_inodesize); |
415 | return XFS_ERROR(ENOSYS); | 420 | return XFS_ERROR(ENOSYS); |
416 | } | 421 | } |
417 | 422 | ||
418 | if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) || | 423 | if (xfs_sb_validate_fsb_count(sbp, sbp->sb_dblocks) || |
419 | xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) { | 424 | xfs_sb_validate_fsb_count(sbp, sbp->sb_rblocks)) { |
420 | xfs_fs_mount_cmn_err(flags, | 425 | if (loud) |
421 | "file system too large to be mounted on this system."); | 426 | xfs_warn(mp, |
427 | "file system too large to be mounted on this system."); | ||
422 | return XFS_ERROR(EFBIG); | 428 | return XFS_ERROR(EFBIG); |
423 | } | 429 | } |
424 | 430 | ||
425 | if (unlikely(sbp->sb_inprogress)) { | 431 | if (unlikely(sbp->sb_inprogress)) { |
426 | xfs_fs_mount_cmn_err(flags, "file system busy"); | 432 | if (loud) |
433 | xfs_warn(mp, "file system busy"); | ||
427 | return XFS_ERROR(EFSCORRUPTED); | 434 | return XFS_ERROR(EFSCORRUPTED); |
428 | } | 435 | } |
429 | 436 | ||
@@ -431,8 +438,9 @@ xfs_mount_validate_sb( | |||
431 | * Version 1 directory format has never worked on Linux. | 438 | * Version 1 directory format has never worked on Linux. |
432 | */ | 439 | */ |
433 | if (unlikely(!xfs_sb_version_hasdirv2(sbp))) { | 440 | if (unlikely(!xfs_sb_version_hasdirv2(sbp))) { |
434 | xfs_fs_mount_cmn_err(flags, | 441 | if (loud) |
435 | "file system using version 1 directory format"); | 442 | xfs_warn(mp, |
443 | "file system using version 1 directory format"); | ||
436 | return XFS_ERROR(ENOSYS); | 444 | return XFS_ERROR(ENOSYS); |
437 | } | 445 | } |
438 | 446 | ||
@@ -673,6 +681,7 @@ xfs_readsb(xfs_mount_t *mp, int flags) | |||
673 | unsigned int sector_size; | 681 | unsigned int sector_size; |
674 | xfs_buf_t *bp; | 682 | xfs_buf_t *bp; |
675 | int error; | 683 | int error; |
684 | int loud = !(flags & XFS_MFSI_QUIET); | ||
676 | 685 | ||
677 | ASSERT(mp->m_sb_bp == NULL); | 686 | ASSERT(mp->m_sb_bp == NULL); |
678 | ASSERT(mp->m_ddev_targp != NULL); | 687 | ASSERT(mp->m_ddev_targp != NULL); |
@@ -688,7 +697,8 @@ reread: | |||
688 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, | 697 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, |
689 | XFS_SB_DADDR, sector_size, 0); | 698 | XFS_SB_DADDR, sector_size, 0); |
690 | if (!bp) { | 699 | if (!bp) { |
691 | xfs_fs_mount_cmn_err(flags, "SB buffer read failed"); | 700 | if (loud) |
701 | xfs_warn(mp, "SB buffer read failed"); | ||
692 | return EIO; | 702 | return EIO; |
693 | } | 703 | } |
694 | 704 | ||
@@ -699,7 +709,8 @@ reread: | |||
699 | xfs_sb_from_disk(&mp->m_sb, XFS_BUF_TO_SBP(bp)); | 709 | xfs_sb_from_disk(&mp->m_sb, XFS_BUF_TO_SBP(bp)); |
700 | error = xfs_mount_validate_sb(mp, &(mp->m_sb), flags); | 710 | error = xfs_mount_validate_sb(mp, &(mp->m_sb), flags); |
701 | if (error) { | 711 | if (error) { |
702 | xfs_fs_mount_cmn_err(flags, "SB validate failed"); | 712 | if (loud) |
713 | xfs_warn(mp, "SB validate failed"); | ||
703 | goto release_buf; | 714 | goto release_buf; |
704 | } | 715 | } |
705 | 716 | ||
@@ -707,9 +718,9 @@ reread: | |||
707 | * We must be able to do sector-sized and sector-aligned IO. | 718 | * We must be able to do sector-sized and sector-aligned IO. |
708 | */ | 719 | */ |
709 | if (sector_size > mp->m_sb.sb_sectsize) { | 720 | if (sector_size > mp->m_sb.sb_sectsize) { |
710 | xfs_fs_mount_cmn_err(flags, | 721 | if (loud) |
711 | "device supports only %u byte sectors (not %u)", | 722 | xfs_warn(mp, "device supports %u byte sectors (not %u)", |
712 | sector_size, mp->m_sb.sb_sectsize); | 723 | sector_size, mp->m_sb.sb_sectsize); |
713 | error = ENOSYS; | 724 | error = ENOSYS; |
714 | goto release_buf; | 725 | goto release_buf; |
715 | } | 726 | } |
@@ -853,8 +864,7 @@ xfs_update_alignment(xfs_mount_t *mp) | |||
853 | if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || | 864 | if ((BBTOB(mp->m_dalign) & mp->m_blockmask) || |
854 | (BBTOB(mp->m_swidth) & mp->m_blockmask)) { | 865 | (BBTOB(mp->m_swidth) & mp->m_blockmask)) { |
855 | if (mp->m_flags & XFS_MOUNT_RETERR) { | 866 | if (mp->m_flags & XFS_MOUNT_RETERR) { |
856 | cmn_err(CE_WARN, | 867 | xfs_warn(mp, "alignment check 1 failed"); |
857 | "XFS: alignment check 1 failed"); | ||
858 | return XFS_ERROR(EINVAL); | 868 | return XFS_ERROR(EINVAL); |
859 | } | 869 | } |
860 | mp->m_dalign = mp->m_swidth = 0; | 870 | mp->m_dalign = mp->m_swidth = 0; |
@@ -867,8 +877,9 @@ xfs_update_alignment(xfs_mount_t *mp) | |||
867 | if (mp->m_flags & XFS_MOUNT_RETERR) { | 877 | if (mp->m_flags & XFS_MOUNT_RETERR) { |
868 | return XFS_ERROR(EINVAL); | 878 | return XFS_ERROR(EINVAL); |
869 | } | 879 | } |
870 | xfs_fs_cmn_err(CE_WARN, mp, | 880 | xfs_warn(mp, |
871 | "stripe alignment turned off: sunit(%d)/swidth(%d) incompatible with agsize(%d)", | 881 | "stripe alignment turned off: sunit(%d)/swidth(%d) " |
882 | "incompatible with agsize(%d)", | ||
872 | mp->m_dalign, mp->m_swidth, | 883 | mp->m_dalign, mp->m_swidth, |
873 | sbp->sb_agblocks); | 884 | sbp->sb_agblocks); |
874 | 885 | ||
@@ -878,9 +889,9 @@ xfs_update_alignment(xfs_mount_t *mp) | |||
878 | mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth); | 889 | mp->m_swidth = XFS_BB_TO_FSBT(mp, mp->m_swidth); |
879 | } else { | 890 | } else { |
880 | if (mp->m_flags & XFS_MOUNT_RETERR) { | 891 | if (mp->m_flags & XFS_MOUNT_RETERR) { |
881 | xfs_fs_cmn_err(CE_WARN, mp, | 892 | xfs_warn(mp, |
882 | "stripe alignment turned off: sunit(%d) less than bsize(%d)", | 893 | "stripe alignment turned off: sunit(%d) less than bsize(%d)", |
883 | mp->m_dalign, | 894 | mp->m_dalign, |
884 | mp->m_blockmask +1); | 895 | mp->m_blockmask +1); |
885 | return XFS_ERROR(EINVAL); | 896 | return XFS_ERROR(EINVAL); |
886 | } | 897 | } |
@@ -1026,14 +1037,14 @@ xfs_check_sizes(xfs_mount_t *mp) | |||
1026 | 1037 | ||
1027 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); | 1038 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_dblocks); |
1028 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { | 1039 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_dblocks) { |
1029 | cmn_err(CE_WARN, "XFS: filesystem size mismatch detected"); | 1040 | xfs_warn(mp, "filesystem size mismatch detected"); |
1030 | return XFS_ERROR(EFBIG); | 1041 | return XFS_ERROR(EFBIG); |
1031 | } | 1042 | } |
1032 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, | 1043 | bp = xfs_buf_read_uncached(mp, mp->m_ddev_targp, |
1033 | d - XFS_FSS_TO_BB(mp, 1), | 1044 | d - XFS_FSS_TO_BB(mp, 1), |
1034 | BBTOB(XFS_FSS_TO_BB(mp, 1)), 0); | 1045 | BBTOB(XFS_FSS_TO_BB(mp, 1)), 0); |
1035 | if (!bp) { | 1046 | if (!bp) { |
1036 | cmn_err(CE_WARN, "XFS: last sector read failed"); | 1047 | xfs_warn(mp, "last sector read failed"); |
1037 | return EIO; | 1048 | return EIO; |
1038 | } | 1049 | } |
1039 | xfs_buf_relse(bp); | 1050 | xfs_buf_relse(bp); |
@@ -1041,14 +1052,14 @@ xfs_check_sizes(xfs_mount_t *mp) | |||
1041 | if (mp->m_logdev_targp != mp->m_ddev_targp) { | 1052 | if (mp->m_logdev_targp != mp->m_ddev_targp) { |
1042 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); | 1053 | d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); |
1043 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { | 1054 | if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { |
1044 | cmn_err(CE_WARN, "XFS: log size mismatch detected"); | 1055 | xfs_warn(mp, "log size mismatch detected"); |
1045 | return XFS_ERROR(EFBIG); | 1056 | return XFS_ERROR(EFBIG); |
1046 | } | 1057 | } |
1047 | bp = xfs_buf_read_uncached(mp, mp->m_logdev_targp, | 1058 | bp = xfs_buf_read_uncached(mp, mp->m_logdev_targp, |
1048 | d - XFS_FSB_TO_BB(mp, 1), | 1059 | d - XFS_FSB_TO_BB(mp, 1), |
1049 | XFS_FSB_TO_B(mp, 1), 0); | 1060 | XFS_FSB_TO_B(mp, 1), 0); |
1050 | if (!bp) { | 1061 | if (!bp) { |
1051 | cmn_err(CE_WARN, "XFS: log device read failed"); | 1062 | xfs_warn(mp, "log device read failed"); |
1052 | return EIO; | 1063 | return EIO; |
1053 | } | 1064 | } |
1054 | xfs_buf_relse(bp); | 1065 | xfs_buf_relse(bp); |
@@ -1086,7 +1097,7 @@ xfs_mount_reset_sbqflags( | |||
1086 | return 0; | 1097 | return 0; |
1087 | 1098 | ||
1088 | #ifdef QUOTADEBUG | 1099 | #ifdef QUOTADEBUG |
1089 | xfs_fs_cmn_err(CE_NOTE, mp, "Writing superblock quota changes"); | 1100 | xfs_notice(mp, "Writing superblock quota changes"); |
1090 | #endif | 1101 | #endif |
1091 | 1102 | ||
1092 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); | 1103 | tp = xfs_trans_alloc(mp, XFS_TRANS_QM_SBCHANGE); |
@@ -1094,8 +1105,7 @@ xfs_mount_reset_sbqflags( | |||
1094 | XFS_DEFAULT_LOG_COUNT); | 1105 | XFS_DEFAULT_LOG_COUNT); |
1095 | if (error) { | 1106 | if (error) { |
1096 | xfs_trans_cancel(tp, 0); | 1107 | xfs_trans_cancel(tp, 0); |
1097 | xfs_fs_cmn_err(CE_ALERT, mp, | 1108 | xfs_alert(mp, "%s: Superblock update failed!", __func__); |
1098 | "xfs_mount_reset_sbqflags: Superblock update failed!"); | ||
1099 | return error; | 1109 | return error; |
1100 | } | 1110 | } |
1101 | 1111 | ||
@@ -1161,8 +1171,7 @@ xfs_mountfs( | |||
1161 | * transaction subsystem is online. | 1171 | * transaction subsystem is online. |
1162 | */ | 1172 | */ |
1163 | if (xfs_sb_has_mismatched_features2(sbp)) { | 1173 | if (xfs_sb_has_mismatched_features2(sbp)) { |
1164 | cmn_err(CE_WARN, | 1174 | xfs_warn(mp, "correcting sb_features alignment problem"); |
1165 | "XFS: correcting sb_features alignment problem"); | ||
1166 | sbp->sb_features2 |= sbp->sb_bad_features2; | 1175 | sbp->sb_features2 |= sbp->sb_bad_features2; |
1167 | sbp->sb_bad_features2 = sbp->sb_features2; | 1176 | sbp->sb_bad_features2 = sbp->sb_features2; |
1168 | mp->m_update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2; | 1177 | mp->m_update_flags |= XFS_SB_FEATURES2 | XFS_SB_BAD_FEATURES2; |
@@ -1241,7 +1250,7 @@ xfs_mountfs( | |||
1241 | */ | 1250 | */ |
1242 | error = xfs_rtmount_init(mp); | 1251 | error = xfs_rtmount_init(mp); |
1243 | if (error) { | 1252 | if (error) { |
1244 | cmn_err(CE_WARN, "XFS: RT mount failed"); | 1253 | xfs_warn(mp, "RT mount failed"); |
1245 | goto out_remove_uuid; | 1254 | goto out_remove_uuid; |
1246 | } | 1255 | } |
1247 | 1256 | ||
@@ -1272,12 +1281,12 @@ xfs_mountfs( | |||
1272 | INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); | 1281 | INIT_RADIX_TREE(&mp->m_perag_tree, GFP_ATOMIC); |
1273 | error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); | 1282 | error = xfs_initialize_perag(mp, sbp->sb_agcount, &mp->m_maxagi); |
1274 | if (error) { | 1283 | if (error) { |
1275 | cmn_err(CE_WARN, "XFS: Failed per-ag init: %d", error); | 1284 | xfs_warn(mp, "Failed per-ag init: %d", error); |
1276 | goto out_remove_uuid; | 1285 | goto out_remove_uuid; |
1277 | } | 1286 | } |
1278 | 1287 | ||
1279 | if (!sbp->sb_logblocks) { | 1288 | if (!sbp->sb_logblocks) { |
1280 | cmn_err(CE_WARN, "XFS: no log defined"); | 1289 | xfs_warn(mp, "no log defined"); |
1281 | XFS_ERROR_REPORT("xfs_mountfs", XFS_ERRLEVEL_LOW, mp); | 1290 | XFS_ERROR_REPORT("xfs_mountfs", XFS_ERRLEVEL_LOW, mp); |
1282 | error = XFS_ERROR(EFSCORRUPTED); | 1291 | error = XFS_ERROR(EFSCORRUPTED); |
1283 | goto out_free_perag; | 1292 | goto out_free_perag; |
@@ -1290,7 +1299,7 @@ xfs_mountfs( | |||
1290 | XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), | 1299 | XFS_FSB_TO_DADDR(mp, sbp->sb_logstart), |
1291 | XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); | 1300 | XFS_FSB_TO_BB(mp, sbp->sb_logblocks)); |
1292 | if (error) { | 1301 | if (error) { |
1293 | cmn_err(CE_WARN, "XFS: log mount failed"); | 1302 | xfs_warn(mp, "log mount failed"); |
1294 | goto out_free_perag; | 1303 | goto out_free_perag; |
1295 | } | 1304 | } |
1296 | 1305 | ||
@@ -1327,16 +1336,14 @@ xfs_mountfs( | |||
1327 | */ | 1336 | */ |
1328 | error = xfs_iget(mp, NULL, sbp->sb_rootino, 0, XFS_ILOCK_EXCL, &rip); | 1337 | error = xfs_iget(mp, NULL, sbp->sb_rootino, 0, XFS_ILOCK_EXCL, &rip); |
1329 | if (error) { | 1338 | if (error) { |
1330 | cmn_err(CE_WARN, "XFS: failed to read root inode"); | 1339 | xfs_warn(mp, "failed to read root inode"); |
1331 | goto out_log_dealloc; | 1340 | goto out_log_dealloc; |
1332 | } | 1341 | } |
1333 | 1342 | ||
1334 | ASSERT(rip != NULL); | 1343 | ASSERT(rip != NULL); |
1335 | 1344 | ||
1336 | if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { | 1345 | if (unlikely((rip->i_d.di_mode & S_IFMT) != S_IFDIR)) { |
1337 | cmn_err(CE_WARN, "XFS: corrupted root inode"); | 1346 | xfs_warn(mp, "corrupted root inode %llu: not a directory", |
1338 | cmn_err(CE_WARN, "Device %s - root %llu is not a directory", | ||
1339 | XFS_BUFTARG_NAME(mp->m_ddev_targp), | ||
1340 | (unsigned long long)rip->i_ino); | 1347 | (unsigned long long)rip->i_ino); |
1341 | xfs_iunlock(rip, XFS_ILOCK_EXCL); | 1348 | xfs_iunlock(rip, XFS_ILOCK_EXCL); |
1342 | XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW, | 1349 | XFS_ERROR_REPORT("xfs_mountfs_int(2)", XFS_ERRLEVEL_LOW, |
@@ -1356,7 +1363,7 @@ xfs_mountfs( | |||
1356 | /* | 1363 | /* |
1357 | * Free up the root inode. | 1364 | * Free up the root inode. |
1358 | */ | 1365 | */ |
1359 | cmn_err(CE_WARN, "XFS: failed to read RT inodes"); | 1366 | xfs_warn(mp, "failed to read RT inodes"); |
1360 | goto out_rele_rip; | 1367 | goto out_rele_rip; |
1361 | } | 1368 | } |
1362 | 1369 | ||
@@ -1368,7 +1375,7 @@ xfs_mountfs( | |||
1368 | if (mp->m_update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY)) { | 1375 | if (mp->m_update_flags && !(mp->m_flags & XFS_MOUNT_RDONLY)) { |
1369 | error = xfs_mount_log_sb(mp, mp->m_update_flags); | 1376 | error = xfs_mount_log_sb(mp, mp->m_update_flags); |
1370 | if (error) { | 1377 | if (error) { |
1371 | cmn_err(CE_WARN, "XFS: failed to write sb changes"); | 1378 | xfs_warn(mp, "failed to write sb changes"); |
1372 | goto out_rtunmount; | 1379 | goto out_rtunmount; |
1373 | } | 1380 | } |
1374 | } | 1381 | } |
@@ -1389,10 +1396,7 @@ xfs_mountfs( | |||
1389 | * quotachecked license. | 1396 | * quotachecked license. |
1390 | */ | 1397 | */ |
1391 | if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT) { | 1398 | if (mp->m_sb.sb_qflags & XFS_ALL_QUOTA_ACCT) { |
1392 | cmn_err(CE_NOTE, | 1399 | xfs_notice(mp, "resetting quota flags"); |
1393 | "XFS: resetting qflags for filesystem %s", | ||
1394 | mp->m_fsname); | ||
1395 | |||
1396 | error = xfs_mount_reset_sbqflags(mp); | 1400 | error = xfs_mount_reset_sbqflags(mp); |
1397 | if (error) | 1401 | if (error) |
1398 | return error; | 1402 | return error; |
@@ -1406,7 +1410,7 @@ xfs_mountfs( | |||
1406 | */ | 1410 | */ |
1407 | error = xfs_log_mount_finish(mp); | 1411 | error = xfs_log_mount_finish(mp); |
1408 | if (error) { | 1412 | if (error) { |
1409 | cmn_err(CE_WARN, "XFS: log mount finish failed"); | 1413 | xfs_warn(mp, "log mount finish failed"); |
1410 | goto out_rtunmount; | 1414 | goto out_rtunmount; |
1411 | } | 1415 | } |
1412 | 1416 | ||
@@ -1435,8 +1439,8 @@ xfs_mountfs( | |||
1435 | resblks = xfs_default_resblks(mp); | 1439 | resblks = xfs_default_resblks(mp); |
1436 | error = xfs_reserve_blocks(mp, &resblks, NULL); | 1440 | error = xfs_reserve_blocks(mp, &resblks, NULL); |
1437 | if (error) | 1441 | if (error) |
1438 | cmn_err(CE_WARN, "XFS: Unable to allocate reserve " | 1442 | xfs_warn(mp, |
1439 | "blocks. Continuing without a reserve pool."); | 1443 | "Unable to allocate reserve blocks. Continuing without reserve pool."); |
1440 | } | 1444 | } |
1441 | 1445 | ||
1442 | return 0; | 1446 | return 0; |
@@ -1525,12 +1529,12 @@ xfs_unmountfs( | |||
1525 | resblks = 0; | 1529 | resblks = 0; |
1526 | error = xfs_reserve_blocks(mp, &resblks, NULL); | 1530 | error = xfs_reserve_blocks(mp, &resblks, NULL); |
1527 | if (error) | 1531 | if (error) |
1528 | cmn_err(CE_WARN, "XFS: Unable to free reserved block pool. " | 1532 | xfs_warn(mp, "Unable to free reserved block pool. " |
1529 | "Freespace may not be correct on next mount."); | 1533 | "Freespace may not be correct on next mount."); |
1530 | 1534 | ||
1531 | error = xfs_log_sbcount(mp, 1); | 1535 | error = xfs_log_sbcount(mp, 1); |
1532 | if (error) | 1536 | if (error) |
1533 | cmn_err(CE_WARN, "XFS: Unable to update superblock counters. " | 1537 | xfs_warn(mp, "Unable to update superblock counters. " |
1534 | "Freespace may not be correct on next mount."); | 1538 | "Freespace may not be correct on next mount."); |
1535 | xfs_unmountfs_writesb(mp); | 1539 | xfs_unmountfs_writesb(mp); |
1536 | xfs_unmountfs_wait(mp); /* wait for async bufs */ | 1540 | xfs_unmountfs_wait(mp); /* wait for async bufs */ |
@@ -2013,10 +2017,8 @@ xfs_dev_is_read_only( | |||
2013 | if (xfs_readonly_buftarg(mp->m_ddev_targp) || | 2017 | if (xfs_readonly_buftarg(mp->m_ddev_targp) || |
2014 | xfs_readonly_buftarg(mp->m_logdev_targp) || | 2018 | xfs_readonly_buftarg(mp->m_logdev_targp) || |
2015 | (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) { | 2019 | (mp->m_rtdev_targp && xfs_readonly_buftarg(mp->m_rtdev_targp))) { |
2016 | cmn_err(CE_NOTE, | 2020 | xfs_notice(mp, "%s required on read-only device.", message); |
2017 | "XFS: %s required on read-only device.", message); | 2021 | xfs_notice(mp, "write access unavailable, cannot proceed."); |
2018 | cmn_err(CE_NOTE, | ||
2019 | "XFS: write access unavailable, cannot proceed."); | ||
2020 | return EROFS; | 2022 | return EROFS; |
2021 | } | 2023 | } |
2022 | return 0; | 2024 | return 0; |