Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 539736 - app-emulation/virtualbox-guest-additions-4.3.20 with kernel 3.19.0 - 'struct file' has no member named 'f_dentry'
Summary: app-emulation/virtualbox-guest-additions-4.3.20 with kernel 3.19.0 - 'struct ...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Library (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Patrick Lauer
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-11 09:10 UTC by Stefan Böhmann
Modified: 2015-04-01 13:16 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Böhmann 2015-02-11 09:10:28 UTC
After updating to kernel 3.19 the virtualbox-guest-additions-4.3.20 package failed to compile. 

The compiler error is: "'struct file' has no member named 'f_dentry'"

The reason is that the API has changed with kernel 3.19 [1]. The struct access f->f_dentry->d_inode was replaced by the accessor function file_inode(f).

The "works for me" patch looks like this:

--- src/VBox/Additions/linux/sharedfolders/dirops.c~     2015-02-11 09:50:42.528112663 +0100
+++ src/VBox/Additions/linux/sharedfolders/dirops.c      2015-02-11 09:37:14.232081996 +0100
@@ -126,13 +126,13 @@
 
     TRACE();
 
-    sf_g = GET_GLOB_INFO(dir->f_dentry->d_inode->i_sb);
+    sf_g = GET_GLOB_INFO(file_inode(dir)->i_sb);
     sf_d = dir->private_data;
 
     BUG_ON(!sf_g);
     BUG_ON(!sf_d);
 
-    inode = dir->f_dentry->d_inode;
+    inode = file_inode(dir);
     sf_i = GET_INODE_INFO(inode);
 
     BUG_ON(!sf_i);

--- src/VBox/Additions/linux/sharedfolders/regops.c~  2015-02-11 09:50:47.272112843 +0100
+++ src/VBox/Additions/linux/sharedfolders/regops.c   2015-02-11 09:37:20.268082225 +0100
@@ -108,7 +108,7 @@
     size_t tmp_size;
     size_t left = size;
     ssize_t total_bytes_read = 0;
-    struct inode *inode = file->f_dentry->d_inode;
+    struct inode *inode = file_inode(file);
     struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     struct sf_reg_info *sf_r = file->private_data;
     loff_t pos = *off;
@@ -183,7 +183,7 @@
     size_t tmp_size;
     size_t left = size;
     ssize_t total_bytes_written = 0;
-    struct inode *inode = file->f_dentry->d_inode;
+    struct inode *inode = file_inode(file);
     struct sf_inode_info *sf_i = GET_INODE_INFO(inode);
     struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     struct sf_reg_info *sf_r = file->private_data;
@@ -465,7 +465,7 @@
     uint32_t nread = PAGE_SIZE;
     int err;
     struct file *file = vma->vm_file;
-    struct inode *inode = file->f_dentry->d_inode;
+    struct inode *inode = file_inode(file);
     struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     struct sf_reg_info *sf_r = file->private_data;
 
@@ -605,7 +605,7 @@
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 0)
 static int sf_readpage(struct file *file, struct page *page)
 {
-    struct inode *inode = file->f_dentry->d_inode;
+    struct inode *inode = file_inode(file);
     struct sf_glob_info *sf_g = GET_GLOB_INFO(inode->i_sb);
     struct sf_reg_info *sf_r = file->private_data;
     uint32_t nread = PAGE_SIZE;




[1] https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=496ad9aa8ef448058e36ca7a787c61f2e63f0f54

Reproducible: Always
Comment 1 Viktor Yu. Kovalskii 2015-02-13 06:00:40 UTC
Upstream bug[1] was fixed at virtualbox-4.3.22. See [2].

-----
[1] https://www.virtualbox.org/ticket/13741
[2] https://www.virtualbox.org/wiki/Changelog
Comment 2 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2015-04-01 13:16:52 UTC
Fixed with latest virtualbox versions.