[PATCH 192/241] GFS2: Test bufdata with buffer locked and gfs2_log_lock held

Ben Hutchings ben at decadent.org.uk
Sun Jan 13 14:39:51 UTC 2013


On Thu, 2012-12-13 at 11:59 -0200, Herton Ronaldo Krzesinski wrote:
> 3.5.7.2 -stable review patch.  If anyone has any objections, please let me know.
> 
> ------------------
> 
> From: Benjamin Marzinski <bmarzins at redhat.com>
> 
> commit 96e5d1d3adf56f1c7eeb07258f6a1a0a7ae9c489 upstream.
> 
> In gfs2_trans_add_bh(), gfs2 was testing if a there was a bd attached to the
> buffer without having the gfs2_log_lock held. It was then assuming it would
> stay attached for the rest of the function. However, without either the log
> lock being held of the buffer locked, __gfs2_ail_flush() could detach bd at any
> time.  This patch moves the locking before the test.  If there isn't a bd
> already attached, gfs2 can safely allocate one and attach it before locking.
> There is no way that the newly allocated bd could be on the ail list,
> and thus no way for __gfs2_ail_flush() to detach it.
[...]

Greg, this is missing from 3.0 and 3.4.  I'm attaching the version I
used for 3.2 which might be applicable.

Ben.

-- 
Ben Hutchings
Klipstein's 4th Law of Prototyping and Production:
                                    A fail-safe circuit will destroy others.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gfs2-test-bufdata-with-buffer-locked-and-gfs2_log_lock-held.patch
Type: text/x-patch
Size: 3530 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20130113/c74944e3/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20130113/c74944e3/attachment.sig>


More information about the kernel-team mailing list