summaryrefslogtreecommitdiff
path: root/fs/ext4/fast_commit.h
diff options
context:
space:
mode:
authorHarshad Shirwadkar <harshadshirwadkar@gmail.com>2021-05-20 00:59:20 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-06-10 14:39:26 +0300
commitfb86acc6236934e2b654f50d2a97fa77eac17859 (patch)
treefff1a7a1271d0ac28c9c5712924e8cb17f16e54c /fs/ext4/fast_commit.h
parentd3b668b96ad3192c0581a248ae2f596cd054792a (diff)
downloadlinux-fb86acc6236934e2b654f50d2a97fa77eac17859.tar.xz
ext4: fix fast commit alignment issues
commit a7ba36bc94f20b6c77f16364b9a23f582ea8faac upstream. Fast commit recovery data on disk may not be aligned. So, when the recovery code reads it, this patch makes sure that fast commit info found on-disk is first memcpy-ed into an aligned variable before accessing it. As a consequence of it, we also remove some macros that could resulted in unaligned accesses. Cc: stable@kernel.org Fixes: 8016e29f4362 ("ext4: fast commit recovery path") Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com> Link: https://lore.kernel.org/r/20210519215920.2037527-1-harshads@google.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/fast_commit.h')
-rw-r--r--fs/ext4/fast_commit.h7
1 files changed, 0 insertions, 7 deletions
diff --git a/fs/ext4/fast_commit.h b/fs/ext4/fast_commit.h
index 3a6e5a1fa1b8..d8d0998a5c16 100644
--- a/fs/ext4/fast_commit.h
+++ b/fs/ext4/fast_commit.h
@@ -146,12 +146,5 @@ struct ext4_fc_replay_state {
#define region_last(__region) (((__region)->lblk) + ((__region)->len) - 1)
-#define fc_for_each_tl(__start, __end, __tl) \
- for (tl = (struct ext4_fc_tl *)start; \
- (u8 *)tl < (u8 *)end; \
- tl = (struct ext4_fc_tl *)((u8 *)tl + \
- sizeof(struct ext4_fc_tl) + \
- + le16_to_cpu(tl->fc_len)))
-
#endif /* __FAST_COMMIT_H__ */