[OpenAFS-devel] Re: [OpenAFS] Problems after Linux kernel upgrade 2.2 -> 2.4

Derek Atkins openafs-devel@openafs.org
08 Jan 2002 14:43:39 -0500


You needed to have sent this to the list, so that the people
in charge can see that there is a problem.  It certainly looks
like there is a problem here.  Derrick?

-derek

cg@cdegroot.com (Cees de Groot) writes:

> --==_Exmh_550271906P
> Content-Type: text/plain; charset=us-ascii
> 
> > Which version of OpenAFS are you using? 
> [snip]
> > > OpenAFS 1.2.2
> > > SuSE 7.3 with SuSE-supplied
> > > kernel 2.4.10-64GB-SMP #1 SMP Fri Sep 28 17:26:36 GMT 2001 i686 unknown
> 
> :-)
> 
> > You might want to compare the inode initialization function in libafs
> > vs. the one in the kernel to make sure everything is correct.
> > 
> If you mean compare the kernel inode.c/init_once() with 
> afs_vcache.c/afs_NewVCache, there seem to be slight differences. I quote what 
> I think are the relevant code snippets:
> 
> 2.4.10 kernel:                
> 		memset(inode, 0, sizeof(*inode));
>                 init_waitqueue_head(&inode->i_wait);
>                 INIT_LIST_HEAD(&inode->i_hash);
>                 INIT_LIST_HEAD(&inode->i_data.clean_pages);
>                 INIT_LIST_HEAD(&inode->i_data.dirty_pages);
>                 INIT_LIST_HEAD(&inode->i_data.locked_pages);
>                 INIT_LIST_HEAD(&inode->i_dentry);
>                 INIT_LIST_HEAD(&inode->i_dirty_buffers);
>                 INIT_LIST_HEAD(&inode->i_dirty_data_buffers);
>                 INIT_LIST_HEAD(&inode->i_devices);
>                 sema_init(&inode->i_sem, 1);
>                 sema_init(&inode->i_zombie, 1);
>                 init_rwsem(&inode->i_truncate_sem);
>                 spin_lock_init(&inode->i_data.i_shared_lock);
> 
> OpenAFS 1.2.2:
> #if defined(AFS_LINUX22_ENV)
>     {
>         struct inode *ip = (struct inode*)tvc;
>         sema_init(&ip->i_sem, 1);
> #if defined(AFS_LINUX24_ENV)
>         sema_init(&ip->i_zombie, 1);
>         init_waitqueue_head(&ip->i_wait);
>         spin_lock_init(&ip->i_data.i_shared_lock);
> #ifdef STRUCT_ADDRESS_SPACE_HAS_PAGE_LOCK
>         spin_lock_init(&ip->i_data.page_lock);
> #endif
>         INIT_LIST_HEAD(&ip->i_data.clean_pages);
>         INIT_LIST_HEAD(&ip->i_data.dirty_pages);
>         INIT_LIST_HEAD(&ip->i_data.locked_pages);
>         INIT_LIST_HEAD(&ip->i_dirty_buffers);
>         ip->i_data.host = (void*) ip;
>         ip->i_mapping = &ip->i_data;
> #else
>         sema_init(&ip->i_atomic_write, 1);
>         init_waitqueue(&ip->i_wait);
> #endif
>         INIT_LIST_HEAD(&ip->i_hash);
>         INIT_LIST_HEAD(&ip->i_dentry);
>         if (afs_globalVFS) {
>             ip->i_dev = afs_globalVFS->s_dev;
>             ip->i_sb = afs_globalVFS;
>         }
>      }
> #endif
> 
> It seems that the INIT_LIST_HEAD of i_data.dirty_data_buffers ain't there, 
> Linux 2.4 uses init_waitqueue() whereas AFS uses init_waitqueue_head(), and 
> OpenAFS doesn't do init_rwsem().
> 
> Now the last time I was really involved in Linux kernel hacking was around 
> 0.99pl14, so it's all a bit Chinese to me - any suggestions how I could patch 
> this?
> 
> (for starters, I'll grab the CVS snapshot, maybe someone already patched for 
> what seems to have changed in 2.4.10).
> 
> ====
> Something completely different: the only real annoyance about OpenAFS is that 
> so much happens in the kernel - one glitch and the system is gone. Are there 
> plans to make a thinner kernel module that talks back to a userland client 
> process? I don't like all the kernel-version specific modules I'm collecting 
> in /usr/vice/etc/modload...
> 
> 
> -- 
> Cees de Groot               http://www.cdegroot.com     <cg@cdegroot.com>
> GnuPG 1024D/E0989E8B 0016 F679 F38D 5946 4ECD  1986 F303 937F E098 9E8B
> 
> 
> 
> --==_Exmh_550271906P
> Content-Type: application/pgp-signature
> 
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.0.6 (GNU/Linux)
> Comment: Exmh version 2.2 06/23/2000
> 
> iD8DBQE8O0QH8wOTf+CYnosRAqYiAKCH1C92PfuqaxeVK0jqpswP+ehZrwCfXz6x
> /7EOyicDJ0u9I+Lo0JK7L8o=
> =c1sK
> -----END PGP SIGNATURE-----
> 
> --==_Exmh_550271906P--

-- 
       Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
       Member, MIT Student Information Processing Board  (SIPB)
       URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
       warlord@MIT.EDU                        PGP key available