diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-11 09:32:58 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-11-11 09:32:58 -0800 |
commit | 04ca2c17e3fae2d3f73aa5ad533242d556cadf5a (patch) | |
tree | f83be0272c50d6f23e5c94446d9da91a87665092 /fs/xfs/xfs_log_recover.c | |
parent | ad1164b79f1905ec1611cdc2a44949618bced2a6 (diff) | |
parent | 220ca310a53200b4bfbc7c4c6e365eea284ec44f (diff) | |
download | op-kernel-dev-04ca2c17e3fae2d3f73aa5ad533242d556cadf5a.zip op-kernel-dev-04ca2c17e3fae2d3f73aa5ad533242d556cadf5a.tar.gz |
Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs
* 'for-linus' of git://oss.sgi.com/xfs/xfs:
[XFS] XFS: Check for valid transaction headers in recovery
[XFS] handle memory allocation failures during log initialisation
[XFS] Account for allocated blocks when expanding directories
[XFS] Wait for all I/O on truncate to zero file size
[XFS] Fix use-after-free with log and quotas
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 82d46ce..70e3ba3 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -1419,7 +1419,13 @@ xlog_recover_add_to_trans( return 0; item = trans->r_itemq; if (item == NULL) { - ASSERT(*(uint *)dp == XFS_TRANS_HEADER_MAGIC); + /* we need to catch log corruptions here */ + if (*(uint *)dp != XFS_TRANS_HEADER_MAGIC) { + xlog_warn("XFS: xlog_recover_add_to_trans: " + "bad header magic number"); + ASSERT(0); + return XFS_ERROR(EIO); + } if (len == sizeof(xfs_trans_header_t)) xlog_recover_add_item(&trans->r_itemq); memcpy(&trans->r_theader, dp, len); /* d, s, l */ |