mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-07 15:18:15 +00:00
ext4: Use bforget() in no journal mode for ext4_journal_{forget,revoke}()
When ext4 is using a journal, a metadata block which is deallocated must be passed into the journal layer so it can be dropped from the current transaction and/or revoked. This is done by calling the functions ext4_journal_forget() and ext4_journal_revoke(), which call jbd2_journal_forget(), and jbd2_journal_revoke(), respectively. Since the jbd2_journal_forget() and jbd2_journal_revoke() call bforget(), if ext4 is not using a journal, ext4_journal_forget() and ext4_journal_revoke() must call bforget() to avoid a dirty metadata block overwriting a block after it has been reallocated and reused for another inode's data block. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
This commit is contained in:
parent
80e42468d6
commit
c7acb4c166
1 changed files with 2 additions and 2 deletions
|
@ -44,7 +44,7 @@ int __ext4_journal_forget(const char *where, handle_t *handle,
|
||||||
handle, err);
|
handle, err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
brelse(bh);
|
bforget(bh);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ int __ext4_journal_revoke(const char *where, handle_t *handle,
|
||||||
handle, err);
|
handle, err);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
brelse(bh);
|
bforget(bh);
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue