Bug 5207 - Unable to compile Cifs VFS as a module on RHAS 2.1 kernel 2.4.9-e.71smp #1 SMP
Unable to compile Cifs VFS as a module on RHAS 2.1 kernel 2.4.9-e.71smp #1 SMP
Product: CifsVFS
Classification: Unclassified
Component: kernel fs
x86 Linux
: P3 regression
: ---
Assigned To: Steve French
Depends on:
  Show dependency treegraph
Reported: 2008-01-16 14:36 UTC by Paul
Modified: 2009-07-21 21:14 UTC (History)
2 users (show)

See Also:

Output of .config, make dep, and make modules (219.41 KB, text/plain)
2008-01-16 14:43 UTC, Paul
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul 2008-01-16 14:36:37 UTC
I downloaded http://pserver.samba.org/samba/ftp/cifs-cvs/cifs-1.50c.tar.gz, updated the fs/cifs files with the downloaded one's in my src dir linux-2.4.9-e.72.cifs, selected CIFS using M option in menuconfig, performed make dep, and the when I perform make modules I get the error below.

gcc -D__KERNEL__ -I/usr/src/linux-2.4.9-e.72.cifs/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.9-e.72.cifs/include/linux/modversions.h   -c -o netmisc.o netmisc.c
In file included from netmisc.c:33:
cifsfs.h:109: parse error before `*'
cifsfs.h:110: warning: function declaration isn't a prototype
cifsfs.h:111: parse error before `*'
cifsfs.h:112: warning: function declaration isn't a prototype
cifsfs.h:142: parse error before `*'
cifsfs.h:142: warning: function declaration isn't a prototype
make[2]: *** [netmisc.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.4.9-e.72.cifs/fs/cifs'
make[1]: *** [_modsubdir_cifs] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.9-e.72.cifs/fs'
make: *** [_mod_fs] Error 2

Please advise if you need more info.

Comment 1 Paul 2008-01-16 14:43:33 UTC
Created attachment 3104 [details]
Output of .config, make dep, and make modules
Comment 2 Paul 2008-01-16 14:59:35 UTC
cifsfs.h lines reporting errors
109  extern ssize_t cifs_user_read(struct file *file, char __user *read_data, 110            size_t read_size, loff_t *poffset);
111  extern ssize_t cifs_user_write(struct file *file, const char __user 
112            *write_data, size_t write_size, loff_t *poffset);
142  extern int cifs_readlink(struct dentry *direntry, char __user *buffer, int buflen);
Comment 3 Paul 2008-01-17 18:46:57 UTC
Is this post being seen by anyone?  Please advise where I should request help on this issue.  This is a serious problem for me and I haven't been able to get any help from RedHat or online so I desperately hope someone can give me a pointer in the right direction.
Thank you
Comment 4 Paul 2008-01-17 19:08:37 UTC
I found a different version cifs-1.20c-2.4.tar.gz for my 2.4 kernel and now I get a different set of errors that I could use some help with....

make[2]: Entering directory `/usr/src/linux-2.4.9-e.72.cifs/fs/cifs'
gcc -D__KERNEL__ -I/usr/src/linux-2.4.9-e.72.cifs/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -Wno-unused -pipe -mpreferred-stack-boundary=2 -march=i686 -DMODULE -DMODVERSIONS -include /usr/src/linux-2.4.9-e.72.cifs/include/linux/modversions.h   -c -o cifssmb.o cifssmb.c
cifssmb.c: In function `CIFSSMBUnixQuerySymLink':
cifssmb.c:1444: warning: implicit declaration of function `min_t'
cifssmb.c:1444: parse error before `const'
cifssmb.c:1453: parse error before `const'
cifssmb.c: In function `CIFSSMBQueryReparseLinkInfo':
cifssmb.c:1532: parse error before `const'
make[2]: *** [cifssmb.o] Error 1
make[2]: Leaving directory `/usr/src/linux-2.4.9-e.72.cifs/fs/cifs'
make[1]: *** [_modsubdir_cifs] Error 2
make[1]: Leaving directory `/usr/src/linux-2.4.9-e.72.cifs/fs'
make: *** [_mod_fs] Error 2
Comment 5 Paul 2008-01-17 20:03:25 UTC
found info that min_t isn't defined in kernel 2.4.9 and that I should add
#ifndef min_t 

#define min_t(type,x,y) min(type,x,y) 

to the cifssmb.c file however I now get the following errors
cifssmb.c: In function `CIFSSMBUnixQuerySymLink':
cifssmb.c:1450: parse error before `const'
cifssmb.c:1459: parse error before `const'
cifssmb.c: In function `CIFSSMBQueryReparseLinkInfo':
cifssmb.c:1538: parse error before `const'
make[2]: *** [cifssmb.o] Error 1
Comment 6 Paul 2008-01-17 20:12:28 UTC
Ok changed
#define min_t(type,x,y) min(type,x,y) in cifssmb.c to
#define min_t(type,x,y) min(x,y) and made it past that error
now I'm getting:
inode.c: In function `cifs_read_inode':
inode.c:373: structure has no member named `i_blkbits'
inode.c: In function `cifs_truncate_page':
inode.c:897: warning: implicit declaration of function `unlock_page'
make[2]: *** [inode.o] Error 1
Comment 7 Paul 2008-01-17 20:22:29 UTC
Ok commented out line 373 in inode.c from error below and compile worked.
inode.c: In function `cifs_read_inode':
inode.c:373: structure has no member named `i_blkbits'

Comment 8 Paul 2008-01-17 21:33:39 UTC
Well it appeared to compile ok and I copied cifs.o to the lib/modules/2.4.9-e.71/kernel/fs/cifs and to lib/modules/2.4.9-e.71smp/kernel/fs/cifs and ran modprobe cifs but get modprobe: Can't locate module cifs
Comment 9 Paul 2008-01-17 21:35:43 UTC
# modinfo cifs.o
filename:    cifs.o
description: "VFS to access servers complying with the SNIA CIFS Specification e.g. Samba and Windows"
author:      "Steve French <sfrench@us.ibm.com>"
license:     "GPL"
Comment 10 Paul 2008-01-18 08:41:15 UTC
 insmod cifs.o
cifs.o: unresolved symbol generic_file_read_Rsmp_1ea1a369
cifs.o: unresolved symbol kmap_high_Rsmp_cc88f2f9
cifs.o: unresolved symbol invalidate_inode_pages_Rsmp_5be990c5
cifs.o: unresolved symbol remove_wait_queue_Rsmp_e3683ece
cifs.o: unresolved symbol wake_up_process_Rsmp_8aff1817
cifs.o: unresolved symbol vmtruncate_Rsmp_aa3da47a
cifs.o: unresolved symbol d_alloc_Rsmp_84e7499b
cifs.o: unresolved symbol sock_sendmsg_Rsmp_935c27ca
cifs.o: unresolved symbol get_empty_inode_Rsmp_24b89d63
cifs.o: unresolved symbol grab_cache_page_Rsmp_ef2a1369
cifs.o: unresolved symbol unlock_page
cifs.o: unresolved symbol generic_read_dir_Rsmp_2d9a8ebe
cifs.o: unresolved symbol sock_recvmsg_Rsmp_9b77b837
cifs.o: unresolved symbol proc_mkdir_Rsmp_e1b56452
cifs.o: unresolved symbol vfs_readlink_Rsmp_decb4488
cifs.o: unresolved symbol iget4_Rsmp_a99bf1c8
cifs.o: unresolved symbol sock_release_Rsmp_7fa19395
cifs.o: unresolved symbol vfs_follow_link_Rsmp_296a24d2
cifs.o: unresolved symbol d_alloc_root_Rsmp_92922274
cifs.o: unresolved symbol sock_create_Rsmp_dd9407ae
cifs.o: unresolved symbol iput_Rsmp_f63e17b6
cifs.o: unresolved symbol inode_setattr_Rsmp_0c92f6ec
cifs.o: unresolved symbol __free_pages_Rsmp_55cc4da9
cifs.o: unresolved symbol init_special_inode_Rsmp_13b48a52
cifs.o: unresolved symbol create_proc_entry_Rsmp_969a9e18
cifs.o: unresolved symbol mem_map_Rsmp_ac19f616
cifs.o: unresolved symbol highmem_start_page_Rsmp_bf3d6032
cifs.o: unresolved symbol d_instantiate_Rsmp_08ee5145
cifs.o: unresolved symbol remove_proc_entry_Rsmp_844913a5
cifs.o: unresolved symbol proc_root_fs_Rsmp_67a5aadf
cifs.o: unresolved symbol generic_file_mmap_Rsmp_89deb003
cifs.o: unresolved symbol d_lookup_Rsmp_759fe50c
cifs.o: unresolved symbol d_rehash_Rsmp_e220a586
cifs.o: unresolved symbol add_wait_queue_Rsmp_853d5d46
cifs.o: unresolved symbol dput_Rsmp_94b4c445
cifs.o: unresolved symbol __mark_inode_dirty_Rsmp_c587c131
cifs.o: unresolved symbol register_filesystem_Rsmp_93b72052
cifs.o: unresolved symbol irq_stat_Rsmp_78ae4fb8
cifs.o: unresolved symbol filemap_fdatasync_Rsmp_5771faeb
cifs.o: unresolved symbol unregister_filesystem_Rsmp_0392574d
cifs.o: unresolved symbol send_sig_Rsmp_2ecbb185
cifs.o: unresolved symbol __set_page_dirty_Rsmp_f8b1a078
cifs.o: unresolved symbol generic_file_write_Rsmp_bd2ff732
cifs.o: unresolved symbol filemap_fdatawait_Rsmp_1b0363e1
cifs.o: unresolved symbol insert_inode_hash_Rsmp_92dd3161
cifs.o: unresolved symbol kunmap_high_Rsmp_dc2eff7b
Comment 11 Jeff Layton 2008-08-28 20:36:24 UTC
My, you have chosen a difficult task...

I've never done any backports to 2.4 kernels. I did post some patches to linux-cifs-client to fix some problems found for the last backport I did to a 2.6.9-based kernel, but I doubt it's sufficient to make it work on 2.4.9. It looks like you patched those things up though since you got it to compile. It might be nice to post those patches to linux-cifs-client once you get this all working...

Some of the symbols that can't be resolved in your last post are ones that I'm pretty sure are exported. That probably means that you're trying to plug a module into the kernel that was built with a configuration that doesn't match.

Things like SMP support, etc are compile time options. You'll need to make sure you're starting with a base .config file that matches the kernel that you're building for.
Comment 12 Shirish S. Pargaonkar 2009-07-21 20:24:29 UTC
Not sure we can do much about this issue!
Comment 13 Jeff Layton 2009-07-21 21:14:41 UTC
Agreed. This isn't really a bug -- it's just that those CIFS tarballs that Steve did aren't set up to build on kernels that old. I doubt Steve would object to patches to fix these problems, but I don't think our time is well-served in a concerted effort for this.

I'm going to close this WONTFIX. Please reopen if you want to discuss it further.