rasa / vmware-tools-patches

Patch and build VMware tools automatically
https://github.com/rasa/vmware-tools-patches/wiki
MIT License
1.19k stars 198 forks source link

Handle static new_sync_read. #64

Closed taviso closed 9 years ago

taviso commented 9 years ago

Make vmhgfs compile after #61

taviso commented 9 years ago

I think it's more complicated than I thought, please ignore.

rasa commented 9 years ago

Well thanks for at least trying! :)

patmans commented 9 years ago

taviso: so what happened when you tried running with that patch / change in place?

(To not set the read and write values, and just leave them as NULL in vmhgfs-only/file.c)

taviso commented 9 years ago

Some stability issues, I didn't have time to investigate. Perhaps they're unrelated.

patmans commented 9 years ago

Looking at Viro's change in the kernel source (https://github.com/torvalds/linux/commit/5d5d568975307877e9195f5305f4240e506a2807), your patch looks correct.

I tried the patch with OSX host running Fedora 4.1.3-100.fc21.x86_64 with VMwareTools-9.9.2 (not 9.9.3), and it's working fine for me!

I ran a couple of cp -pr /mnt/hgfs/foo/bar ~/local/foo/bar, and then diff-ed the new directory (on linux) with the original on the OSX or hgfs mount, and also vice-a-versa with no problems.

I didn't reboot (the host or the linux on VM).

Given the above, this should be re-opened and commited to master.

I don't know why you're diff/patch looks slightly different than mine, I mean you added two lines of code around the functions that are now not exported.

i.e. this is my patch file:

--- vmhgfs-only.orig/file.c 2015-08-09 12:11:40.221267063 -0700 +++ vmhgfs-only/file.c 2015-08-09 12:11:29.197685431 -0700 @@ -170,8 +170,10 @@ .flush = HgfsFlush,

if defined VMW_USE_AIO

if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 1, 0) .read = new_sync_read, .write = new_sync_write, +#endif .read_iter = HgfsFileRead, .write_iter = HgfsFileWrite,

else // LINUX_VERSION_CODE >= KERNEL_VERSION(3, 16, 0)

taviso commented 9 years ago

Yes, I think my instability was unrelated.

liayn commented 9 years ago

Works with Fedora 21, Kernel 4.1.3, tools 9.9.3 Thanks

Passw commented 9 years ago

taviso's patch worked for me.

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu Wily Werewolf (development branch)
Release:        15.10
Codename:       wily
$ uname -a
Linux sun 4.1.0-3-generic #3-Ubuntu SMP Tue Jul 28 12:22:42 UTC 2015 i686 i686 i686 GNU/Linux
hurda commented 9 years ago

I don't know why you're diff/patch looks slightly different than mine, I mean you added two lines of code around the functions that are now not exported.

The original patch adds another space in front of the two lines between the if/endif.

JustArchi commented 9 years ago

Worked fine, please merge :+1:

rasa commented 9 years ago

Looks good, but I can't test at the moment. Will test soon, though. Thanks!