virtualbox/fix_shared_folder_time.patch
Larry Finger edb4fccf84 Accepting request 1170064 from home:lwfinger:branches:Virtualization
- Provide a temporary fix to the problem of wrong timestamp for files
  in a shared folder since kernel 6.6. File "fix_shared_folder_time.patch"
  is added. This change fixes boo#1220524.

OBS-URL: https://build.opensuse.org/request/show/1170064
OBS-URL: https://build.opensuse.org/package/show/Virtualization/virtualbox?expand=0&rev=736
2024-04-24 16:27:50 +00:00

23 lines
1.2 KiB
Diff

Index: VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/utils.c
===================================================================
--- VirtualBox-7.0.14.orig/src/VBox/Additions/linux/sharedfolders/utils.c
+++ VirtualBox-7.0.14/src/VBox/Additions/linux/sharedfolders/utils.c
@@ -297,10 +297,14 @@ DECLINLINE(int) sf_file_mode_to_linux(ui
*/
static void vbsf_update_inode_timestamps(struct inode *pInode, PSHFLFSOBJINFO pObjInfo)
{
+/* Oracle has a bad fix for i_atime, etc missing from struct inode. The fix
+ * below produces the correct results, but is not correct either as it references
+ * variables such as __i_atime that are supposed to be hidden. Larry Finger
+ */
#if RTLNX_VER_MIN(6,6,0)
- struct timespec64 ts;
- vbsf_time_to_linux(&ts, &pObjInfo->ChangeTime);
- inode_set_ctime_to_ts(pInode, ts);
+ vbsf_time_to_linux(&pInode->__i_atime, &pObjInfo->AccessTime);
+ vbsf_time_to_linux(&pInode->__i_ctime, &pObjInfo->ChangeTime);
+ vbsf_time_to_linux(&pInode->__i_mtime, &pObjInfo->ModificationTime);
#else
vbsf_time_to_linux(&pInode->i_atime, &pObjInfo->AccessTime);
vbsf_time_to_linux(&pInode->i_ctime, &pObjInfo->ChangeTime);