mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[XFS] Fix double free of log tickets
When an I/O error occurs during an intermediate commit on a rolling transaction, xfs_trans_commit() will free the transaction structure and the related ticket. However, the duplicate transaction that gets used as the transaction continues still contains a pointer to the ticket. Hence when the duplicate transaction is cancelled and freed, we free the ticket a second time. Add reference counting to the ticket so that we hold an extra reference to the ticket over the transaction commit. We drop the extra reference once we have checked that the transaction commit did not return an error, thus avoiding a double free on commit error. Credit to Nick Piggin for tripping over the problem. SGI-PV: 989741 Signed-off-by: Dave Chinner <david@fromorbit.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
This commit is contained in:
parent
6307091fe6
commit
cc09c0dc57
8 changed files with 66 additions and 19 deletions
|
@ -134,6 +134,7 @@ typedef struct xfs_log_callback {
|
|||
#ifdef __KERNEL__
|
||||
/* Log manager interfaces */
|
||||
struct xfs_mount;
|
||||
struct xlog_ticket;
|
||||
xfs_lsn_t xfs_log_done(struct xfs_mount *mp,
|
||||
xfs_log_ticket_t ticket,
|
||||
void **iclog,
|
||||
|
@ -177,6 +178,9 @@ int xfs_log_need_covered(struct xfs_mount *mp);
|
|||
|
||||
void xlog_iodone(struct xfs_buf *);
|
||||
|
||||
struct xlog_ticket * xfs_log_ticket_get(struct xlog_ticket *ticket);
|
||||
void xfs_log_ticket_put(struct xlog_ticket *ticket);
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue