aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_mount.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/xfs/xfs_mount.c')
-rw-r--r--fs/xfs/xfs_mount.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
index eb348c168505..244aa1b9f134 100644
--- a/fs/xfs/xfs_mount.c
+++ b/fs/xfs/xfs_mount.c
@@ -1227,12 +1227,15 @@ xfs_mountfs(
1227 * 1227 *
1228 * We default to 5% or 1024 fsbs of space reserved, whichever is smaller. 1228 * We default to 5% or 1024 fsbs of space reserved, whichever is smaller.
1229 * This may drive us straight to ENOSPC on mount, but that implies 1229 * This may drive us straight to ENOSPC on mount, but that implies
1230 * we were already there on the last unmount. 1230 * we were already there on the last unmount. Warn if this occurs.
1231 */ 1231 */
1232 resblks = mp->m_sb.sb_dblocks; 1232 resblks = mp->m_sb.sb_dblocks;
1233 do_div(resblks, 20); 1233 do_div(resblks, 20);
1234 resblks = min_t(__uint64_t, resblks, 1024); 1234 resblks = min_t(__uint64_t, resblks, 1024);
1235 xfs_reserve_blocks(mp, &resblks, NULL); 1235 error = xfs_reserve_blocks(mp, &resblks, NULL);
1236 if (error)
1237 cmn_err(CE_WARN, "XFS: Unable to allocate reserve blocks. "
1238 "Continuing without a reserve pool.");
1236 1239
1237 return 0; 1240 return 0;
1238 1241
@@ -1268,6 +1271,7 @@ int
1268xfs_unmountfs(xfs_mount_t *mp, struct cred *cr) 1271xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1269{ 1272{
1270 __uint64_t resblks; 1273 __uint64_t resblks;
1274 int error = 0;
1271 1275
1272 /* 1276 /*
1273 * We can potentially deadlock here if we have an inode cluster 1277 * We can potentially deadlock here if we have an inode cluster
@@ -1311,7 +1315,11 @@ xfs_unmountfs(xfs_mount_t *mp, struct cred *cr)
1311 * value does not matter.... 1315 * value does not matter....
1312 */ 1316 */
1313 resblks = 0; 1317 resblks = 0;
1314 xfs_reserve_blocks(mp, &resblks, NULL); 1318 error = xfs_reserve_blocks(mp, &resblks, NULL);
1319 if (error)
1320 cmn_err(CE_WARN, "XFS: Unable to free reserved block pool. "
1321 "Freespace may not be correct on next mount.");
1322
1315 1323
1316 xfs_log_sbcount(mp, 1); 1324 xfs_log_sbcount(mp, 1);
1317 xfs_unmountfs_writesb(mp); 1325 xfs_unmountfs_writesb(mp);