# Gentoo-sources-r9 with XFS

## Jasper

Basically what I did was this:

- Emerge the gentoo-sources(r9)

- Patch it against the 2.4.19 XFS patch: ftp://oss.sgi.com/projects/xfs/download/patches/2.4.19/xfs-2.4.19-all-i386.bz2

- Manually apply the following rejected hunks(With some tinkering):

  fs/Makefile.rej (Mind the tabs !)

  fs/namei.c.rej

  kernel/Makefile.rej (Mind the tabs !)

  kernel/ksyms.c.rej

  mm/mprotect.c.rej

  include/linux/sysctl.h.rej

  arch/i386/defconfig.rej

  Makefile.rej (Mind the tabs !)

Producing the following files:

http://217.121.81.57/tmp/fs/Makefile

http://217.121.81.57/tmp/fs/namei.c

http://217.121.81.57/tmp/kernel/Makefile

http://217.121.81.57/tmp/kernel/ksyms.c

http://217.121.81.57/tmp/mm/mprotect.c

http://217.121.81.57/tmp/include/linux/sysctl.h

http://217.121.81.57/tmp/arch/i386/defconfig

http://217.121.81.57/tmp/Makefile

- Replace DQUOT_SYNC(dev) with DQUOT_SYNC_DEV(dev) in fs/buffer.c:419

Then just configured the kernel and did a make dep bzImage modules modules_install, added the appropriate lilo entries and booted with the new kernel:

SGI XFS snapshot 2.4.19-2002-09-27_04:22_UTC with ACLs, no debug enabled

And you guys couldn't figure out how to do this ? Tsk  :Wink: 

- Jasper

----------

## Henning

Hi,

that's what I need.

But please explain how to apply the patch. I'm a newbie on patching.

(It's my secon one)

I tried : bzip2 -c -d xfs... | patch -p0

but there is a message that a file xfs-pristine... is not found.

Thank you

----------

## Jasper

Move the patch into your /usr/src/linux-2.4.9-gentoo-r9/ directory and then in that directory do:

bzip2 -dc xfs-2.4.19-all-i386.bz2 | patch -p1

----------

## Henning

Hi,

I have applied the patch as described above. But when I try booting with this kernel I get the following message. (Same as without xfs)

Kernel panic: VFS: Unable to mount root fs on 03:03

Any hints?

----------

## corporate_gadfly

Hi Jasper,

Just for completeness, I think the file fs/namei.c doesn't seem to be patched properly (disclaimer - I haven't compiled the kernel yet). My namei.c.rej had the following lines which I didn't quite see in your file. 

```
***************

*** 1450,1457 ****

        dentry = lookup_create(&nd, 1);

        error = PTR_ERR(dentry);

        if (!IS_ERR(dentry)) {

-           error = vfs_mkdir(nd.dentry->d_inode, dentry,

-                     mode & ~current->fs->umask);

            dput(dentry);

        }

        up(&nd.dentry->d_inode->i_sem);

--- 1452,1460 ----

        dentry = lookup_create(&nd, 1);

        error = PTR_ERR(dentry);

        if (!IS_ERR(dentry)) {

+           if (!IS_POSIXACL(nd.dentry->d_inode))

+               mode &= ~current->fs->umask;

+           error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);

            dput(dentry);

        }

        up(&nd.dentry->d_inode->i_sem);

```

FWIW, here is my diff -Naur output for namei.c

```

--- namei.c~    2002-09-30 14:19:38.000000000 -0400

+++ namei.c     2002-09-30 14:43:32.000000000 -0400

@@ -1114,8 +1114,9 @@

                        goto exit_dput;

                }

-               error = vfs_create(dir->d_inode, dentry,

-                                  mode & ~current->fs->umask);

+               if (!IS_POSIXACL(dir->d_inode))

+                       mode &= ~current->fs->umask;

+               error = vfs_create(dir->d_inode, dentry, mode);

                up(&dir->d_inode->i_sem);

                dput(nd->dentry);

                nd->dentry = dentry;

@@ -1381,7 +1382,8 @@

        dentry = lookup_create(&nd, 0);

        error = PTR_ERR(dentry);

-       mode &= ~current->fs->umask;

+       if (!IS_POSIXACL(nd.dentry->d_inode))

+               mode &= ~current->fs->umask;

        if (!IS_ERR(dentry)) {

        if (grsec_enable_chroot_mknod && !S_ISFIFO(mode) && proc_is_chrooted(current)) {

                switch (mode & S_IFMT) {

@@ -1498,9 +1500,11 @@

                                error = -EACCES;

                        }

-                       if(!error)

-                               error = vfs_mkdir(nd.dentry->d_inode, dentry,

-                                         mode & ~current->fs->umask);

+                       if(!error) {

+                               if (!IS_POSIXACL(nd.dentry->d_inode))

+                                       mode &= ~current->fs->umask;

+                               error = vfs_mkdir(nd.dentry->d_inode, dentry, mode);

+                       }

                        if(!error) {

                                struct nameidata temp =

                                {

```

Again to reiterate, I have yet to compile my kernel and I don't even use ACL (not that I know of), so take it for what its worth. I don't know if I made the correct choice or not near the vfs_mkdir function call.

----------

## corporate_gadfly

 *corporate_gadfly wrote:*   

> 
> 
> Again to reiterate, I have yet to compile my kernel and I don't even use ACL (not that I know of), so take it for what its worth. I don't know if I made the correct choice or not near the vfs_mkdir function call.

 

Thanks Jasper,

Just made the modifications and compiled the kernel and rebooted into the new kernel. Keeping my fingers crossed as things seem to be holding up pretty well, so far.

----------

