From: Jan Kara Date: Tue, 4 Jun 2013 16:22:15 +0000 (-0400) Subject: jbd2: fix race in t_outstanding_credits update in jbd2_journal_extend() X-Git-Tag: omap-for-v3.11/fixes-for-merge-window~83^2~53 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fe1e8db598b259eafdffbe3dd5fe849cd2ad97d5;p=pandora-kernel.git jbd2: fix race in t_outstanding_credits update in jbd2_journal_extend() jbd2_journal_extend() first checked whether transaction can accept extending handle with more credits and then added credits to t_outstanding_credits. This can race with start_this_handle() adding another handle to a transaction and thus overbooking a transaction. Make jbd2_journal_extend() use atomic_add_return() to close the race. Reviewed-by: Zheng Liu Signed-off-by: Jan Kara Signed-off-by: "Theodore Ts'o" --- Reading git-diff-tree failed