diff options
Diffstat (limited to 'fs/xfs/linux-2.6/xfs_super.c')
-rw-r--r-- | fs/xfs/linux-2.6/xfs_super.c | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 36f6cc703ef2..c71e226da7f5 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c | |||
@@ -1197,6 +1197,7 @@ xfs_fs_remount( | |||
1197 | struct xfs_mount *mp = XFS_M(sb); | 1197 | struct xfs_mount *mp = XFS_M(sb); |
1198 | substring_t args[MAX_OPT_ARGS]; | 1198 | substring_t args[MAX_OPT_ARGS]; |
1199 | char *p; | 1199 | char *p; |
1200 | int error; | ||
1200 | 1201 | ||
1201 | while ((p = strsep(&options, ",")) != NULL) { | 1202 | while ((p = strsep(&options, ",")) != NULL) { |
1202 | int token; | 1203 | int token; |
@@ -1247,11 +1248,25 @@ xfs_fs_remount( | |||
1247 | } | 1248 | } |
1248 | } | 1249 | } |
1249 | 1250 | ||
1250 | /* rw/ro -> rw */ | 1251 | /* ro -> rw */ |
1251 | if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { | 1252 | if ((mp->m_flags & XFS_MOUNT_RDONLY) && !(*flags & MS_RDONLY)) { |
1252 | mp->m_flags &= ~XFS_MOUNT_RDONLY; | 1253 | mp->m_flags &= ~XFS_MOUNT_RDONLY; |
1253 | if (mp->m_flags & XFS_MOUNT_BARRIER) | 1254 | if (mp->m_flags & XFS_MOUNT_BARRIER) |
1254 | xfs_mountfs_check_barriers(mp); | 1255 | xfs_mountfs_check_barriers(mp); |
1256 | |||
1257 | /* | ||
1258 | * If this is the first remount to writeable state we | ||
1259 | * might have some superblock changes to update. | ||
1260 | */ | ||
1261 | if (mp->m_update_flags) { | ||
1262 | error = xfs_mount_log_sb(mp, mp->m_update_flags); | ||
1263 | if (error) { | ||
1264 | cmn_err(CE_WARN, | ||
1265 | "XFS: failed to write sb changes"); | ||
1266 | return error; | ||
1267 | } | ||
1268 | mp->m_update_flags = 0; | ||
1269 | } | ||
1255 | } | 1270 | } |
1256 | 1271 | ||
1257 | /* rw -> ro */ | 1272 | /* rw -> ro */ |
@@ -1269,14 +1284,14 @@ xfs_fs_remount( | |||
1269 | * need to take care of the metadata. Once that's done write a dummy | 1284 | * need to take care of the metadata. Once that's done write a dummy |
1270 | * record to dirty the log in case of a crash while frozen. | 1285 | * record to dirty the log in case of a crash while frozen. |
1271 | */ | 1286 | */ |
1272 | STATIC void | 1287 | STATIC int |
1273 | xfs_fs_lockfs( | 1288 | xfs_fs_freeze( |
1274 | struct super_block *sb) | 1289 | struct super_block *sb) |
1275 | { | 1290 | { |
1276 | struct xfs_mount *mp = XFS_M(sb); | 1291 | struct xfs_mount *mp = XFS_M(sb); |
1277 | 1292 | ||
1278 | xfs_quiesce_attr(mp); | 1293 | xfs_quiesce_attr(mp); |
1279 | xfs_fs_log_dummy(mp); | 1294 | return -xfs_fs_log_dummy(mp); |
1280 | } | 1295 | } |
1281 | 1296 | ||
1282 | STATIC int | 1297 | STATIC int |
@@ -1348,7 +1363,7 @@ xfs_finish_flags( | |||
1348 | { | 1363 | { |
1349 | int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); | 1364 | int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); |
1350 | 1365 | ||
1351 | /* Fail a mount where the logbuf is smaller then the log stripe */ | 1366 | /* Fail a mount where the logbuf is smaller than the log stripe */ |
1352 | if (xfs_sb_version_haslogv2(&mp->m_sb)) { | 1367 | if (xfs_sb_version_haslogv2(&mp->m_sb)) { |
1353 | if (mp->m_logbsize <= 0 && | 1368 | if (mp->m_logbsize <= 0 && |
1354 | mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { | 1369 | mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { |
@@ -1557,7 +1572,7 @@ static struct super_operations xfs_super_operations = { | |||
1557 | .put_super = xfs_fs_put_super, | 1572 | .put_super = xfs_fs_put_super, |
1558 | .write_super = xfs_fs_write_super, | 1573 | .write_super = xfs_fs_write_super, |
1559 | .sync_fs = xfs_fs_sync_super, | 1574 | .sync_fs = xfs_fs_sync_super, |
1560 | .write_super_lockfs = xfs_fs_lockfs, | 1575 | .freeze_fs = xfs_fs_freeze, |
1561 | .statfs = xfs_fs_statfs, | 1576 | .statfs = xfs_fs_statfs, |
1562 | .remount_fs = xfs_fs_remount, | 1577 | .remount_fs = xfs_fs_remount, |
1563 | .show_options = xfs_fs_show_options, | 1578 | .show_options = xfs_fs_show_options, |