Whamcloud - gitweb
LU-1337 llite: ll_inode_permission should check RCU walk
authorPeng Tao <tao.peng@emc.com>
Tue, 18 Sep 2012 10:57:53 +0000 (18:57 +0800)
committerOleg Drokin <green@whamcloud.com>
Mon, 29 Oct 2012 06:10:50 +0000 (02:10 -0400)
For >3.1 kernels, RCU flag is folded into mask field.

Signed-off-by: Peng Tao <tao.peng@emc.com>
Change-Id: Icc6751493e7359646cb6bd84b3ac05de167e4d88
Reviewed-on: http://review.whamcloud.com/4039
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Liu Xuezhao <xuezhao.liu@emc.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/file.c

index e988c81..e43dfb5 100644 (file)
@@ -2597,7 +2597,10 @@ int ll_inode_permission(struct inode *inode, int mask, struct nameidata *nd)
         int rc = 0;
         ENTRY;
 
-#ifdef HAVE_GENERIC_PERMISSION_4ARGS
+#ifdef MAY_NOT_BLOCK
+       if (mask & MAY_NOT_BLOCK)
+               return -ECHILD;
+#elif defined(HAVE_GENERIC_PERMISSION_4ARGS)
        if (flags & IPERM_FLAG_RCU)
                return -ECHILD;
 #endif