]> git.baikalelectronics.ru Git - kernel.git/commit
ocfs2: Use xs->bucket to set xattr value outside
authorTao Ma <tao.ma@oracle.com>
Thu, 12 Mar 2009 00:37:34 +0000 (08:37 +0800)
committerMark Fasheh <mfasheh@suse.com>
Thu, 12 Mar 2009 23:46:09 +0000 (16:46 -0700)
commiteb3e4bbd3c9ef2a2a07bbdb3aeab36d428589443
treef67f6aae06936bcf28c669b48e55ac39a6854be2
parent4b9b27a45f039142000279cc52d6a8d6d36547df
ocfs2: Use xs->bucket to set xattr value outside

A long time ago, xs->base is allocated a 4K size and all the contents
in the bucket are copied to the it. Now we use ocfs2_xattr_bucket to
abstract xattr bucket and xs->base is initialized to the start of the
bu_bhs[0]. So xs->base + offset will overflow when the value root is
stored outside the first block.

Then why we can survive the xattr test by now? It is because we always
read the bucket contiguously now and kernel mm allocate continguous
memory for us. We are lucky, but we should fix it. So just get the
right value root as other callers do.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Acked-by: Joel Becker <joel.becker@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
fs/ocfs2/xattr.c