]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - fs/cifs/dir.c
ACPI / PMIC: Do not register handlers for unhandled OpRegions
[linux.git] / fs / cifs / dir.c
index be424e81e3ad98e20f65de41572d87a569a28c7b..7ce689d31aa2d446e27cfe20ab2ab4bb79d3ac2e 100644 (file)
@@ -125,7 +125,7 @@ build_path_from_dentry_optional_prefix(struct dentry *direntry, bool prefix)
        }
        rcu_read_unlock();
 
-       full_path = kmalloc(namelen+1, GFP_KERNEL);
+       full_path = kmalloc(namelen+1, GFP_ATOMIC);
        if (full_path == NULL)
                return full_path;
        full_path[namelen] = 0; /* trailing null */
@@ -738,10 +738,16 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry,
 static int
 cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
 {
+       struct inode *inode;
+
        if (flags & LOOKUP_RCU)
                return -ECHILD;
 
        if (d_really_is_positive(direntry)) {
+               inode = d_inode(direntry);
+               if ((flags & LOOKUP_REVAL) && !CIFS_CACHE_READ(CIFS_I(inode)))
+                       CIFS_I(inode)->time = 0; /* force reval */
+
                if (cifs_revalidate_dentry(direntry))
                        return 0;
                else {
@@ -752,7 +758,7 @@ cifs_d_revalidate(struct dentry *direntry, unsigned int flags)
                         * attributes will have been updated by
                         * cifs_revalidate_dentry().
                         */
-                       if (IS_AUTOMOUNT(d_inode(direntry)) &&
+                       if (IS_AUTOMOUNT(inode) &&
                           !(direntry->d_flags & DCACHE_NEED_AUTOMOUNT)) {
                                spin_lock(&direntry->d_lock);
                                direntry->d_flags |= DCACHE_NEED_AUTOMOUNT;