[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cloop and kernel 3.9.0



Hello Max,

On Mon, May 06, 2013 at 09:22:20AM -0700, Max wrote:
> 
> We had almost two years without problems but now it seems that we have a
> problem with kernel 3.9.0  and cloop:
> 
> make[1]: Entering directory `/usr/src/linux-3.9'
>   CC [M]  /usr/src/cloop-2.639/cloop.o
> /usr/src/cloop-2.639/cloop.c: In function 'cloop_get_status':
> /usr/src/cloop-2.639/cloop.c:746:2: warning: passing argument 1 of
> 'vfs_getattr' from incompatible pointer type [enabled by default]
> In file included from /usr/src/cloop-2.639/cloop.c:39:0:
> include/linux/fs.h:2473:12: note: expected 'struct path *' but argument is
> of type 'struct vfsmount *'
> /usr/src/cloop-2.639/cloop.c:746:2: warning: passing argument 2 of
> 'vfs_getattr' from incompatible pointer type [enabled by default]
> In file included from /usr/src/cloop-2.639/cloop.c:39:0:
> include/linux/fs.h:2473:12: note: expected 'struct kstat *' but argument is
> of type 'struct dentry *'
> /usr/src/cloop-2.639/cloop.c:746:2: error: too many arguments to function
> 'vfs_getattr'
> In file included from /usr/src/cloop-2.639/cloop.c:39:0:
> include/linux/fs.h:2473:12: note: declared here
> make[2]: *** [/usr/src/cloop-2.639/cloop.o] Error 1
> make[1]: *** [_module_/usr/src/cloop-2.639] Error 2
> make[1]: Leaving directory `/usr/src/linux-3.9'
> make: *** [cloop.ko] Error 

The Kernel 3.9 API change in vfs_getattr seems to be an optimization,
using just a pointer to the path structure instead of both a pointer to
vfsmount and dentry. See here:
https://github.com/ryao/spl/commit/4880d883d4d0bd86f227c1ce422502691bc8790f

Please try the attached patch, it fixes the changed syntax. I didn't
rebuild the full kernel yet, though.

Regards
-Klaus
--- linux-3.8/drivers/block/cloop.c	2013-03-12 10:15:51.000000000 +0100
+++ linux-3.9/drivers/block/cloop.c	2013-05-07 05:13:55.000000000 +0200
@@ -20,7 +20,7 @@
  */
 
 #define CLOOP_NAME "cloop"
-#define CLOOP_VERSION "2.639"
+#define CLOOP_VERSION "3.9"
 #define CLOOP_MAX 8
 
 #ifndef KBUILD_MODNAME
@@ -743,7 +743,7 @@
  struct kstat stat;
  int err;
  if (!file) return -ENXIO;
- err = vfs_getattr(file->f_path.mnt, file->f_path.dentry, &stat);
+ err = vfs_getattr(&file->f_path, &stat);
  if (err) return err;
  memset(info, 0, sizeof(*info));
  info->lo_number  = clo->clo_number;

Reply to: