提交 311f08ac 编写于 作者: A Alex Elder 提交者: Ben Myers

xfs: memory barrier before wake_up_bit()

In xfs_ifunlock() there is a call to wake_up_bit() after clearing
the flush lock on the xfs inode.  This is not guaranteed to be safe,
as noted in the comments above wake_up_bit() beginning with:

    In order for this to function properly, as it uses
    waitqueue_active() internally, some kind of memory
    barrier must be done prior to calling this.
Signed-off-by: NAlex Elder <elder@inktank.com>
Reviewed-by: NDave Chinner <david@fromorbit.com>
Signed-off-by: NBen Myers <bpm@sgi.com>
上级 a21cd503
......@@ -419,6 +419,7 @@ static inline void xfs_iflock(struct xfs_inode *ip)
static inline void xfs_ifunlock(struct xfs_inode *ip)
{
xfs_iflags_clear(ip, XFS_IFLOCK);
smp_mb();
wake_up_bit(&ip->i_flags, __XFS_IFLOCK_BIT);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册