Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#10502 - aufs with kernel 2.6.25.4 hangs system

Attached to Project: Arch Linux
Opened by Michael Towers (gradgrind) - Monday, 26 May 2008, 07:45 GMT
Last edited by Paul Mattal (paul) - Friday, 30 May 2008, 14:24 GMT
Task Type Bug Report
Category Kernel
Status Closed
Assigned To Tobias Powalowski (tpowa)
Paul Mattal (paul)
Thomas Bächler (brain0)
Architecture i686
Severity Critical
Priority Normal
Reported Version 2007.08-2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
There seems to be a big problem with aufs in conjunction with kernel26-2.6.25.4-1, it hangs the whole system, requiring a hard reset.

There is no error message, nothing in the logs.

I have tried this on two different computers. I can't test x86_64.

This is with aufs-20080421-2, but a more recent aufs behaved in the same way. I've put it in the kernel category, because I guess that's where the problem is, but I'll report it on the aufs mailing list too.

Steps to reproduce:

Run this script as root:
#!/bin/sh

mkdir -p aufsu
mkdir -p tfs/system
mkdir -p tfs/mods
mount -t aufs -o br:tfs/mods=rw:tfs/system=ro aufs aufsu
This task depends upon

Closed by  Paul Mattal (paul)
Friday, 30 May 2008, 14:24 GMT
Reason for closing:  Fixed
Additional comments about closing:  fixed in aufs 20080527-1
Comment by Michael Towers (gradgrind) - Monday, 26 May 2008, 12:11 GMT
I got a reply from the aufs developer very quickly:

====================================================================
According to your config.gz, the recent unionfs patch is applied to your
kernel which adds a lock to fsstack_copy_inode_size() in
linux/fs/stack.c.
Aufs already acquire the same lock (since 2006) before calling the
function, so the deadlock happens.

You need to modify au_fsstack_copy_inode_size() in
AufsCVS/fs/aufs25/cpup.c, and make '#else' block available.

----------------------------------------------------------------------
static void au_fsstack_copy_inode_size(struct inode *inode,
struct inode *h_inode)
{
/* this spin_lock conflicts the new unionfs patch in -mm tree */
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26) || !defined(MmTree)
spin_lock(&inode->i_lock);
fsstack_copy_inode_size(inode, h_inode);
spin_unlock(&inode->i_lock);
#else
fsstack_copy_inode_size(inode, h_inode);
#endif
}
----------------------------------------------------------------------


Junjiro Okajima

====================================================================



I have tested this with the latest aufs and it seems to work. Here is the PKGBUILD I used
(note that the handling of the splice patch has changed too):

pkgname=aufs
pkgver=20080527
pkgrel=1
_kernver='2.6.25-ARCH'
pkgdesc="Another Unionfs Implementation that supports NFS branches"
arch=('i686' 'x86_64')
url="http://aufs.sourceforge.net/"
license=('GPL2')
depends=('kernel26>=2.6.25.4-1' 'kernel26<=2.6.26-0' 'glibc' 'aufs-utils')
install=$pkgname.install
options=(!libtool !makeflags)

_cvsr=":pserver:anonymous:@aufs.cvs.sourceforge.net:/cvsroot/aufs"
_cvsmod="aufs"

build() {
msg "Connecting to $_cvsmod.sourceforge.net CVS server...."
cvs -d$_cvsr checkout -D $pkgver $_cvsmod

msg "CVS checkout done or server timeout"
msg "Starting make..."

rm -rf $startdir/src/$_cvsmod-build
cp -r $startdir/src/$_cvsmod $startdir/src/$_cvsmod-build

cd $startdir/src/$_cvsmod-build

# use splice functions exported by unionfs kernel patch
# - important for loopback fs mounts
sed s'|#if.*KERNEL_VERSION(2, 6, 26).*|#if 0|' -i fs/aufs25/vfsub.h
sed -i 's|CONFIG_AUFS_SPLICE_PATCH =|CONFIG_AUFS_SPLICE_PATCH = y|' \
local.mk || return 1

# patch for spin_lock conflict with the new unionfs patch
sed s'|#if.*KERNEL_VERSION(2, 6, 26).*|#if 0|' -i fs/aufs25/cpup.c

sed -i 's|.*CONFIG_AUFS_SHWH =.*|CONFIG_AUFS_SHWH = y|' \
local.mk || return 1

# configure for NFS by:
# 1) configure local.mk to use FILP and LHASH
sed -i 's|CONFIG_AUFS_PUT_FILP_PATCH =|CONFIG_AUFS_PUT_FILP_PATCH = y|' \
local.mk || return 1
sed -i 's|CONFIG_AUFS_LHASH_PATCH =|CONFIG_AUFS_LHASH_PATCH = y|' \
local.mk || return 1
# 2) configure local.mk NOT to use FAKE_DM
sed -i 's|CONFIG_AUFS_FAKE_DM = y|CONFIG_AUFS_FAKE_DM = |' \
local.mk || return 1

# build
make KDIR=/usr/src/linux-$_kernver/ -f local.mk || return 1

# install
install -D -m644 fs/aufs25/aufs.ko \
$startdir/pkg/lib/modules/$_kernver/fs/aufs25/aufs.ko || return 1

# tweak the install script for the right kernel version
sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/g" \
$startdir/$pkgname.install || return 1
}

Comment by Aaron Griffin (phrakture) - Tuesday, 27 May 2008, 20:41 GMT
Adding Paul to see if we can fix this at the AUFS level, instead of the kernel level.
Comment by Paul Mattal (paul) - Thursday, 29 May 2008, 19:06 GMT
The above has been confirmed to fix the problem. I'll try to get new packages out tonight, for this and maybe a few other things!
Comment by Paul Mattal (paul) - Friday, 30 May 2008, 12:15 GMT
updated 20080527 aufs{,-utils} are now in testing
should be moved out today to extra

Thanks for all the input on this one. Please let me know if this fixes your problems. We'll be testing separately today.

Loading...