mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-23 21:19:04 -04:00
Ext4 bug fixes for 3.17, to provide better handling of memory
allocation failures, and to fix some journaling bugs involving journal checksums and FALLOC_FL_ZERO_RANGE. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAABCAAGBQJT/+hGAAoJENNvdpvBGATwlU8P/02752nzboRRtqYZBxh/rP6L QoawhKslb516QFcwgxBpmhf/uSg0XIIakANEFSvlJksj0hcSLNmHl3SjGB6EGyu0 1qOjgXSULFFnLGkjJ9ptzn266irQRR2AX5+mBP1T/JV6L5dRFwylCWbSElxEjobt WhUe0TzXjazYviItOugh8tQYKrfWlfc0UnMSOU7abastStYkROPuvUUOg0fcQCW/ jZpgFQDKO+TmIZ/QtP26Bogz27Cthe5d1XnA9555JOyYjxpRh3HnVaZXLXOtA2nf eQZmDpfXCnbqORLsqDQbq1+TMMFVjudQyIgHkmMojshTc2PWGZyl/KtgxDHCoBxz j3a/qafUPbkqEKTLOunDggkWvOKhah7Z6ZCxzamC3d5Cy2GtjUhhp+iyllf4Tmga OEWIPp/5F3/UfJj/0e3fcmj8tzTP8bOgVh4xC/Iwf3wugKzeGs9iaWEs02TJpCQk Yu+xqhHP05MGQuMXcQbPJy+DPq3a43Y/PBlzyF9ZmvJKqs0SxRIhgDnpRXDLla/m a2zYkzqZBog081idgy1KSJjL1XVBjHkcMwUaZ/mOCd/ok7pAhQIYPVeJEpBylf+l ABtTgn8qU6+QmkaeTypY8h3OAMES/PgA+PQp46zgmPJVopov0926QuMWzXb2Wbq9 ZFGJziWdAZos5XWnMo6A =e6Ou -----END PGP SIGNATURE----- Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 bugfixes from Ted Ts'o: "Ext4 bug fixes for 3.17, to provide better handling of memory allocation failures, and to fix some journaling bugs involving journal checksums and FALLOC_FL_ZERO_RANGE" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: ext4: fix same-dir rename when inline data directory overflows jbd2: fix descriptor block size handling errors with journal_csum jbd2: fix infinite loop when recovering corrupt journal blocks ext4: update i_disksize coherently with block allocation on error path ext4: fix transaction issues for ext4_fallocate and ext_zero_range ext4: fix incorect journal credits reservation in ext4_zero_range ext4: move i_size,i_disksize update routines to helper function ext4: fix BUG_ON in mb_free_blocks() ext4: propagate errors up to ext4_find_entry()'s callers
This commit is contained in:
commit
d4f03186c8
11 changed files with 233 additions and 129 deletions
|
|
@ -159,7 +159,11 @@ typedef struct journal_header_s
|
|||
* journal_block_tag (in the descriptor). The other h_chksum* fields are
|
||||
* not used.
|
||||
*
|
||||
* Checksum v1 and v2 are mutually exclusive features.
|
||||
* If FEATURE_INCOMPAT_CSUM_V3 is set, the descriptor block uses
|
||||
* journal_block_tag3_t to store a full 32-bit checksum. Everything else
|
||||
* is the same as v2.
|
||||
*
|
||||
* Checksum v1, v2, and v3 are mutually exclusive features.
|
||||
*/
|
||||
struct commit_header {
|
||||
__be32 h_magic;
|
||||
|
|
@ -179,6 +183,14 @@ struct commit_header {
|
|||
* raw struct shouldn't be used for pointer math or sizeof() - use
|
||||
* journal_tag_bytes(journal) instead to compute this.
|
||||
*/
|
||||
typedef struct journal_block_tag3_s
|
||||
{
|
||||
__be32 t_blocknr; /* The on-disk block number */
|
||||
__be32 t_flags; /* See below */
|
||||
__be32 t_blocknr_high; /* most-significant high 32bits. */
|
||||
__be32 t_checksum; /* crc32c(uuid+seq+block) */
|
||||
} journal_block_tag3_t;
|
||||
|
||||
typedef struct journal_block_tag_s
|
||||
{
|
||||
__be32 t_blocknr; /* The on-disk block number */
|
||||
|
|
@ -187,9 +199,6 @@ typedef struct journal_block_tag_s
|
|||
__be32 t_blocknr_high; /* most-significant high 32bits. */
|
||||
} journal_block_tag_t;
|
||||
|
||||
#define JBD2_TAG_SIZE32 (offsetof(journal_block_tag_t, t_blocknr_high))
|
||||
#define JBD2_TAG_SIZE64 (sizeof(journal_block_tag_t))
|
||||
|
||||
/* Tail of descriptor block, for checksumming */
|
||||
struct jbd2_journal_block_tail {
|
||||
__be32 t_checksum; /* crc32c(uuid+descr_block) */
|
||||
|
|
@ -284,6 +293,7 @@ typedef struct journal_superblock_s
|
|||
#define JBD2_FEATURE_INCOMPAT_64BIT 0x00000002
|
||||
#define JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT 0x00000004
|
||||
#define JBD2_FEATURE_INCOMPAT_CSUM_V2 0x00000008
|
||||
#define JBD2_FEATURE_INCOMPAT_CSUM_V3 0x00000010
|
||||
|
||||
/* Features known to this kernel version: */
|
||||
#define JBD2_KNOWN_COMPAT_FEATURES JBD2_FEATURE_COMPAT_CHECKSUM
|
||||
|
|
@ -291,7 +301,8 @@ typedef struct journal_superblock_s
|
|||
#define JBD2_KNOWN_INCOMPAT_FEATURES (JBD2_FEATURE_INCOMPAT_REVOKE | \
|
||||
JBD2_FEATURE_INCOMPAT_64BIT | \
|
||||
JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT | \
|
||||
JBD2_FEATURE_INCOMPAT_CSUM_V2)
|
||||
JBD2_FEATURE_INCOMPAT_CSUM_V2 | \
|
||||
JBD2_FEATURE_INCOMPAT_CSUM_V3)
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
|
|
@ -1296,6 +1307,15 @@ static inline int tid_geq(tid_t x, tid_t y)
|
|||
extern int jbd2_journal_blocks_per_page(struct inode *inode);
|
||||
extern size_t journal_tag_bytes(journal_t *journal);
|
||||
|
||||
static inline int jbd2_journal_has_csum_v2or3(journal_t *journal)
|
||||
{
|
||||
if (JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V2) ||
|
||||
JBD2_HAS_INCOMPAT_FEATURE(journal, JBD2_FEATURE_INCOMPAT_CSUM_V3))
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* We reserve t_outstanding_credits >> JBD2_CONTROL_BLOCKS_SHIFT for
|
||||
* transaction control blocks.
|
||||
|
|
|
|||
Loading…
Reference in a new issue