Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[cascardo/linux.git] / fs / cachefiles / namei.c
index 9828850..41df8a2 100644 (file)
@@ -20,6 +20,7 @@
 #include <linux/namei.h>
 #include <linux/security.h>
 #include <linux/slab.h>
+#include <linux/xattr.h>
 #include "internal.h"
 
 #define CACHEFILES_KEYBUF_SIZE 512
@@ -261,10 +262,9 @@ requeue:
  * Mark an object as being inactive.
  */
 void cachefiles_mark_object_inactive(struct cachefiles_cache *cache,
-                                    struct cachefiles_object *object)
+                                    struct cachefiles_object *object,
+                                    blkcnt_t i_blocks)
 {
-       blkcnt_t i_blocks = d_backing_inode(object->dentry)->i_blocks;
-
        write_lock(&cache->active_lock);
        rb_erase(&object->active_node, &cache->active_nodes);
        clear_bit(CACHEFILES_OBJECT_ACTIVE, &object->flags);
@@ -707,7 +707,8 @@ mark_active_timed_out:
 
 check_error:
        _debug("check error %d", ret);
-       cachefiles_mark_object_inactive(cache, object);
+       cachefiles_mark_object_inactive(
+               cache, object, d_backing_inode(object->dentry)->i_blocks);
 release_dentry:
        dput(object->dentry);
        object->dentry = NULL;
@@ -799,8 +800,7 @@ struct dentry *cachefiles_get_directory(struct cachefiles_cache *cache,
        }
 
        ret = -EPERM;
-       if (!d_backing_inode(subdir)->i_op->setxattr ||
-           !d_backing_inode(subdir)->i_op->getxattr ||
+       if (!(d_backing_inode(subdir)->i_opflags & IOP_XATTR) ||
            !d_backing_inode(subdir)->i_op->lookup ||
            !d_backing_inode(subdir)->i_op->mkdir ||
            !d_backing_inode(subdir)->i_op->create ||