I did more testing with your patch on top of today's CVS, but the patch
The following is the results of the tests:
1. created a "/dev/md0" with 4 scsi disks
2. created a LVM Volume group "vg" with the "/dev/md0"
3. created a LVM logical volume "vol1" with "vg"
mkfs.xfs -f -d sunit=8,swidth=8 /dev/vg/vol1
-----------log      =internal log           bsize=4096   blocks=1200,
1. mount with quota enabled => occasional kernel oops, attached the file
2. mount without quota enabled => occasional kernel oops, attached the file
3. mount without quota enabled, while md device is in degraded mode =>
always kernel oops, attached the file oops3
Subject: Re: kernel BUG at filemap.c:843!
> We treat MD and LVM somewhat specially, and I wonder if in this case MD
> is masking the fact that you're using LVM, and that might be where the
> Can you try this patch, which will cause LVM & MD to be treated the
> same, to see if it helps?  It's probably not the final solution, but it
> --- linux/fs/xfs/pagebuf/page_buf_locking.c_1.24 Tue Aug 13 14:05:18 2002
> +++ linux/fs/xfs/pagebuf/page_buf_locking.c Tue Aug 13 13:59:37 2002
>   if ((MAJOR(dev) == MD_MAJOR) || (MAJOR(dev) == EVMS_MAJOR))
> - target->pbr_flags = PBR_ALIGNED_ONLY;
> + target->pbr_flags = PBR_SECTOR_ONLY;
>   else if (MAJOR(dev) == LVM_BLK_MAJOR)
> On Mon, 2002-08-12 at 01:40, James Lee wrote:
> > I'm also having the exactly same problem.
> > Tested with 2.4.19-xfs(checked out from SGI's CVS on Aug 10) on Redhat
> > Kernel and userland tools are compiled with gcc 2.91.66
> > The following is the result of some tests:
> > scsidisks -> raid0 -> lvm -> xfs: OK
> > scsidisks -> raid1 -> lvm -> xfs: OK
> > scsidisks -> raid5 -> lvm -> xfs: kernel BUG at filemap.c:843!
> > This problem is always reproducible with the following shell script:
> >         vgcreate VolumeGroup /dev/md0
> >         lvcreate -L1G -nTestVolume VolumeGroup
> >         mkfs.xfs -f -d size=32m /dev/VolumeGroup/TestVolume
> >         mount -t xfs /dev/VolumeGroup/TestVolume
> > Whenever I run the above script, mount command always generates kernel
> > But, if I insert some delay as of the following, then mount goes well:
> Eric Sandeen      XFS for Linux     http://oss.sgi.com/projects/xfs
> sandeen@sgi.com   SGI, Inc.         651-683-3102