@@ -617,6 +617,9 @@ do_version(xfs_agnumber_t agno, uint16_t version, uint32_t features)
tsb.sb_bad_features2 = features;
libxfs_sb_to_disk(iocur_top->data, &tsb);
write_cur();
+ if (!iocur_top->bp || iocur_top->bp->b_error)
+ return 0;
+
return 1;
}
@@ -804,7 +807,8 @@ version_f(
if (!do_version(ag, version, features)) {
dbprintf(_("failed to set versionnum "
"in AG %d\n"), ag);
- break;
+ exitcode = 1;
+ return 1;
}
mp->m_sb.sb_versionnum = version;
mp->m_sb.sb_features2 = features;
@@ -46,6 +46,9 @@ case $# in
eval xfs_db -x -p xfs_admin $DB_OPTS "$1"
status=$?
fi
+ if [ $status -eq 1 ]; then
+ echo "Conversion failed due to filesystem errors; run xfs_repair."
+ fi
if [ -n "$REPAIR_OPTS" ]
then
# Hide normal repair output which is sent to stderr
@@ -981,6 +981,14 @@ and
.I features2
bits respectively, and their string equivalent reported
(but no modifications are made).
+.IP
+If the feature upgrade succeeds, the program will return 0.
+If the requested upgrade has already been applied to the filesystem, the
+program will also return 0.
+If the upgrade fails due to corruption or IO errors, the program will return
+1.
+If the requested upgrade is not appropriate for this filesystem, the program
+will return 2.
.TP
.BI "write [\-c|\-d] [" "field value" "] ..."
Write a value to disk.