diff options
author | Dave Chinner <dchinner@redhat.com> | 2013-04-03 16:11:19 +1100 |
---|---|---|
committer | Ben Myers <bpm@sgi.com> | 2013-04-27 11:49:28 -0500 |
commit | f948dd76dde021c050c7c35720dc066a8b9a5e35 (patch) | |
tree | 457f8097ba46f72ecb6417f96f890f9ee202f6cc /fs/xfs/xfs_log_recover.c | |
parent | 19de7351a8eb82dc99745e60e8f43474831d99c7 (diff) | |
download | op-kernel-dev-f948dd76dde021c050c7c35720dc066a8b9a5e35.zip op-kernel-dev-f948dd76dde021c050c7c35720dc066a8b9a5e35.tar.gz |
xfs: add CRC checks to remote symlinks
Add a header to the remote symlink block, containing location and
owner information, as well as CRCs and LSN fields. This requires
verifiers to be added to the remote symlink buffers for CRC enabled
filesystems.
This also fixes a bug reading multiple block symlinks, where the second
block overwrites the first block when copying out the link name.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_log_recover.c')
-rw-r--r-- | fs/xfs/xfs_log_recover.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c index 2878782..d1292fd 100644 --- a/fs/xfs/xfs_log_recover.c +++ b/fs/xfs/xfs_log_recover.c @@ -45,6 +45,7 @@ #include "xfs_cksum.h" #include "xfs_trace.h" #include "xfs_icache.h" +#include "xfs_symlink.h" STATIC int xlog_find_zeroed( @@ -2002,6 +2003,14 @@ xlog_recover_do_reg_buffer( } bp->b_ops = &xfs_inode_buf_ops; break; + case XFS_BLF_SYMLINK_BUF: + if (*(__be32 *)bp->b_addr != cpu_to_be32(XFS_SYMLINK_MAGIC)) { + xfs_warn(mp, "Bad symlink block magic!"); + ASSERT(0); + break; + } + bp->b_ops = &xfs_symlink_buf_ops; + break; default: break; } |