I receive this error trying to compile vmhgfs in a guet with ubuntu server 12.04.5 with linux-headers-3.2.0-76-generic.
warning: (near initialization for ‘dentry’) [enabled by default] /tmp/modconfig-20TWVh/vmhgfs-only/inode.c:1973:34: error: ‘struct dentry’ has no member named ‘d_alias’
make[2]: *** [/tmp/modconfig-20TWVh/vmhgfs-only/inode.o] Errore 1
make[1]: *** [_module_/tmp/modconfig-20TWVh/vmhgfs-only] Errore 2
make[1]: uscita dalla directory "/usr/src/linux-headers-3.2.0-76-generic"
I searched and seems that it's not the first time the problem occur
see:
Shared Folders compile error - VMware Tools 9.6.0 - Ubuntu 13.10
but submissed solutions don't works for me
Thanks for any help
Nicola
Hi Nicola,
I also faced the same problem. It was not easy to find a solution, but in the end I could gather pieces of information from here and there. The problem is that this: “d_alias” was moved into “d_u” in kernel 3.2.0-76. See https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/1416003 for more information.
These instructions will depend on the version of VMware Tools you have. You need to change one line of code with older versions, while two changes are required in newer versions.
1) Execute this commands to extract the source code of “inode.c”:
cd /usr/lib/vmware-tools/modules/source/
sudo tar xf vmhgfs.tar
cd vmhgfs-only
sudo gedit inode.c
2) You can use any editor of your choice. In this case I used gedit as you see in previous line. Locate the line with the text “d_alias”. In VMware Tools 8.8.6 is around line 1818 (with newer versions you have to find two lines with “d_alias” and add the respective code to correct the problem). That section of code looks like this (in my case):
/* Find a dentry with valid d_count. Refer bug 587789. */
list_for_each(pos, &inode->i_dentry) {
dentry = list_entry(pos, struct dentry, d_alias);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
dcount = atomic_read(&dentry->d_count);
#else
3) It should look like this (note the addition of preprocessor directives):
/* Find a dentry with valid d_count. Refer bug 587789. */
list_for_each(pos, &inode->i_dentry) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 66)
dentry = list_entry(pos, struct dentry, d_alias);
#else
dentry = list_entry(pos, struct dentry, d_u.d_alias);
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
dcount = atomic_read(&dentry->d_count);
#else
4) Save the file and exit. Remove any backup files created by the editor. With gedit, the file “inode.c~” was created; remove it.
5) Execute this commands to recreate the file vmhgfs.tar:
cd ..
sudo rm vmhgfs.tar
sudo tar cf vmhgfs.tar vmhgfs-only
sudo rm -r vmhgfs-only
6) Configure VMware Tools again!
sudo vmware-config-tools.pl
It should work now. This solved the problem in my case.
Greetings
MI
Hi Nicola,
I also faced the same problem. It was not easy to find a solution, but in the end I could gather pieces of information from here and there. The problem is that this: “d_alias” was moved into “d_u” in kernel 3.2.0-76. See https://bugs.launchpad.net/ubuntu/+source/open-vm-tools/+bug/1416003 for more information.
These instructions will depend on the version of VMware Tools you have. You need to change one line of code with older versions, while two changes are required in newer versions.
1) Execute this commands to extract the source code of “inode.c”:
cd /usr/lib/vmware-tools/modules/source/
sudo tar xf vmhgfs.tar
cd vmhgfs-only
sudo gedit inode.c
2) You can use any editor of your choice. In this case I used gedit as you see in previous line. Locate the line with the text “d_alias”. In VMware Tools 8.8.6 is around line 1818 (with newer versions you have to find two lines with “d_alias” and add the respective code to correct the problem). That section of code looks like this (in my case):
/* Find a dentry with valid d_count. Refer bug 587789. */
list_for_each(pos, &inode->i_dentry) {
dentry = list_entry(pos, struct dentry, d_alias);
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
dcount = atomic_read(&dentry->d_count);
#else
3) It should look like this (note the addition of preprocessor directives):
/* Find a dentry with valid d_count. Refer bug 587789. */
list_for_each(pos, &inode->i_dentry) {
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 2, 66)
dentry = list_entry(pos, struct dentry, d_alias);
#else
dentry = list_entry(pos, struct dentry, d_u.d_alias);
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 38)
dcount = atomic_read(&dentry->d_count);
#else
4) Save the file and exit. Remove any backup files created by the editor. With gedit, the file “inode.c~” was created; remove it.
5) Execute this commands to recreate the file vmhgfs.tar:
cd ..
sudo rm vmhgfs.tar
sudo tar cf vmhgfs.tar vmhgfs-only
sudo rm -r vmhgfs-only
6) Configure VMware Tools again!
sudo vmware-config-tools.pl
It should work now. This solved the problem in my case.
Greetings
MI
Thanks a lot!!
Worked for me
I modified 2 piece of the code, because i use vmware workstation deployed vmtools which are version 9.6.4-2443746 with ws 10.0.5
The code is not exactly the same but very similar and with a search of "d_alias" with nano i found easily what to fix
Thank you so much
This worked for me with Ubuntu 12.04.5 LTS and kernel 3.2.0 (3.2.0-76) and VMware tools 9.9.0-2304977 although the code has changed again in the meantime in inode.c.
Still broken with kernel 3.2.0-80 and VMware tools 9.9.2-2694486. This fix still works.
Thanks, compilation is working again!
It's sad to see VMware using this bug to coerce people to pay for the upgrade, e.g. here: Re: Workstation 10.0.5 build-2443746 VMware Tools fail to compile work fine in 10.0.4 for Ubuntu 14...
Actually, I am having this issue with the very latest Fusion 7.1.1 version, so even upgrading does not solve the problem.