mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
Ext4 bug fixes for v4.4, including fixes for post-2038 time encodings,
some endian conversion problems with ext4 encryption, potential memory leaks after truncate in data=journal mode, and an ocfs2 regression caused by a jbd2 performance improvement. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAABCAAGBQJWZP5/AAoJEPL5WVaVDYGjLUwH+wZUMghNAiR+AUEDW5MwbRMd XGvPFr1ohs9ep6vrayRLAVU+BDbcSvL7GRddFpUabTfDqH6tyk43IqOFaE2UMefj +k61vUnEaD7hTOGtgnfkntAcrE8hngTA1UkEGRTRQjRSqKgt1ku2LB/GfGbgv4Yq 1grwLbq/MRZ6gSZIv8TwuLC7BOAt6mLtxtJB8ozRuhVJVo1gzy1IvXkqn2mgf/h4 nIq6i720NxZS9HqncA/o1rxfWb2bwEpLj5MYqdgscwHBGql0riHM0HOebAbgvVqV FgLM81p4qVry8N4ACNLIJsqjWu3eMcNUZFW3vaObGTg2tODTj8WSEClb56Z6fpE= =iOzG -----END PGP SIGNATURE----- Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 Pull ext4 fixes from Ted Ts'o: "Ext4 bug fixes for v4.4, including fixes for post-2038 time encodings, some endian conversion problems with ext4 encryption, potential memory leaks after truncate in data=journal mode, and an ocfs2 regression caused by a jbd2 performance improvement" * tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: jbd2: fix null committed data return in undo_access ext4: add "static" to ext4_seq_##name##_fops struct ext4: fix an endianness bug in ext4_encrypted_follow_link() ext4: fix an endianness bug in ext4_encrypted_zeroout() jbd2: Fix unreclaimed pages after truncate in data=journal mode ext4: Fix handling of extended tv_sec
This commit is contained in:
commit
f41683a204
5 changed files with 56 additions and 13 deletions
|
|
@ -1009,7 +1009,8 @@ out:
|
|||
}
|
||||
|
||||
/* Fast check whether buffer is already attached to the required transaction */
|
||||
static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh)
|
||||
static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh,
|
||||
bool undo)
|
||||
{
|
||||
struct journal_head *jh;
|
||||
bool ret = false;
|
||||
|
|
@ -1036,6 +1037,9 @@ static bool jbd2_write_access_granted(handle_t *handle, struct buffer_head *bh)
|
|||
jh = READ_ONCE(bh->b_private);
|
||||
if (!jh)
|
||||
goto out;
|
||||
/* For undo access buffer must have data copied */
|
||||
if (undo && !jh->b_committed_data)
|
||||
goto out;
|
||||
if (jh->b_transaction != handle->h_transaction &&
|
||||
jh->b_next_transaction != handle->h_transaction)
|
||||
goto out;
|
||||
|
|
@ -1073,7 +1077,7 @@ int jbd2_journal_get_write_access(handle_t *handle, struct buffer_head *bh)
|
|||
struct journal_head *jh;
|
||||
int rc;
|
||||
|
||||
if (jbd2_write_access_granted(handle, bh))
|
||||
if (jbd2_write_access_granted(handle, bh, false))
|
||||
return 0;
|
||||
|
||||
jh = jbd2_journal_add_journal_head(bh);
|
||||
|
|
@ -1210,7 +1214,7 @@ int jbd2_journal_get_undo_access(handle_t *handle, struct buffer_head *bh)
|
|||
char *committed_data = NULL;
|
||||
|
||||
JBUFFER_TRACE(jh, "entry");
|
||||
if (jbd2_write_access_granted(handle, bh))
|
||||
if (jbd2_write_access_granted(handle, bh, true))
|
||||
return 0;
|
||||
|
||||
jh = jbd2_journal_add_journal_head(bh);
|
||||
|
|
@ -2152,6 +2156,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh,
|
|||
|
||||
if (!buffer_dirty(bh)) {
|
||||
/* bdflush has written it. We can drop it now */
|
||||
__jbd2_journal_remove_checkpoint(jh);
|
||||
goto zap_buffer;
|
||||
}
|
||||
|
||||
|
|
@ -2181,6 +2186,7 @@ static int journal_unmap_buffer(journal_t *journal, struct buffer_head *bh,
|
|||
/* The orphan record's transaction has
|
||||
* committed. We can cleanse this buffer */
|
||||
clear_buffer_jbddirty(bh);
|
||||
__jbd2_journal_remove_checkpoint(jh);
|
||||
goto zap_buffer;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue