]> git.neil.brown.name Git - history.git/commitdiff
Linux 2.1.84 2.1.84
authorLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:14:37 +0000 (15:14 -0500)
committerLinus Torvalds <torvalds@linuxfoundation.org>
Fri, 23 Nov 2007 20:14:37 +0000 (15:14 -0500)
- Update makefile version (forgot to in .83)
- fixes a (very obscure, possibly never happens) autofs bug.
- fix missing ; compile error in mm/filemap.c
- MS_NODIRATIME support.

[changelog summary by davej]

Makefile
fs/autofs/root.c
fs/inode.c
fs/super.c
include/linux/fs.h
mm/filemap.c

index 303abea28d1ad35247ee4d844f2f0f4b6edc544d..2b386d291ec63ee07f5cb6a4148fa6646e044bf0 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 VERSION = 2
 PATCHLEVEL = 1
-SUBLEVEL = 82
+SUBLEVEL = 84
 
 ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
 
index 541f7fba38a2d8634f44fb3b523d06ce5a044bbe..36d38b84e69de503202c37eace320f2e64de5edb 100644 (file)
@@ -104,19 +104,27 @@ static int try_to_fill_dentry(struct dentry *dentry, struct super_block *sb, str
 {
        struct inode * inode;
        struct autofs_dir_ent *ent;
-
-       while (!(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name))) {
-               int status = autofs_wait(sbi, &dentry->d_name);
-
-               /* Turn this into a real negative dentry? */
-               if (status == -ENOENT) {
-                       dentry->d_time = jiffies + AUTOFS_NEGATIVE_TIMEOUT;
-                       dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
-                       return 1;
-               } else if (status) {
-                       /* Return a negative dentry, but leave it "pending" */
-                       return 1;
-               }
+       int status = 0;
+
+       if ( !(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name)) ) {
+               do {
+                       if ( status && dentry->d_inode ) {
+                               printk("autofs: lookup failure on existing dentry, status = %d, name = %s\n", status, dentry->d_name.name);
+                               printk("autofs: trying to recover, but prepare for Armageddon\n");
+                               break;
+                       }
+
+                       /* Turn this into a real negative dentry? */
+                       if (status == -ENOENT) {
+                               dentry->d_time = jiffies + AUTOFS_NEGATIVE_TIMEOUT;
+                               dentry->d_flags &= ~DCACHE_AUTOFS_PENDING;
+                               return 1;
+                       } else if (status) {
+                               /* Return a negative dentry, but leave it "pending" */
+                               return 1;
+                       }
+                       status = autofs_wait(sbi, &dentry->d_name);
+               } while (!(ent = autofs_hash_lookup(&sbi->dirhash, &dentry->d_name)) );
        }
 
        /* Abuse this field as a pointer to the directory entry, used to
index 36765e27843f189c1fb743325388a9ab7d5306eb..a88b53d13a63031c98d5699e9cfc27a865c92d87 100644 (file)
@@ -759,3 +759,12 @@ int fs_may_remount_ro(struct super_block *sb)
        }
        return 1; /* Tis' cool bro. */
 }
+
+void update_atime (struct inode *inode)
+{
+    if ( IS_NOATIME (inode) ) return;
+    if ( IS_NODIRATIME (inode) && S_ISDIR (inode->i_mode) ) return;
+    if ( IS_RDONLY (inode) ) return;
+    inode->i_atime = CURRENT_TIME;
+    mark_inode_dirty (inode);
+}   /*  End Function update_atime  */
index cefd90c9bd23c17a40b735019b19e83e4130ed41..84ef3ffb8b2c389dd25588a3ab2549993adb9f33 100644 (file)
@@ -292,6 +292,7 @@ static struct proc_fs_info {
        { MS_SYNCHRONOUS, ",sync" },
        { MS_MANDLOCK, ",mand" },
        { MS_NOATIME, ",noatime" },
+       { MS_NODIRATIME, ",nodiratime" },
 #ifdef MS_NOSUB                        /* Can't find this except in mount.c */
        { MS_NOSUB, ",nosub" },
 #endif
index 221548a6e266ff8bc2bf015e46741b157945a421..4685ce27475a43f40242f312acc5407add78e3c0 100644 (file)
@@ -17,6 +17,7 @@
 #include <linux/ioctl.h>
 #include <linux/list.h>
 #include <linux/dcache.h>
+#include <linux/stat.h>
 
 #include <asm/atomic.h>
 #include <asm/bitops.h>
@@ -90,11 +91,12 @@ extern int max_files, nr_files, nr_free_files;
 #define S_APPEND       256     /* Append-only file */
 #define S_IMMUTABLE    512     /* Immutable file */
 #define MS_NOATIME     1024    /* Do not update access times. */
+#define MS_NODIRATIME   2048    /* Do not update directory access times */
 
 /*
  * Flags that can be altered by MS_REMOUNT
  */
-#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME)
+#define MS_RMT_MASK (MS_RDONLY|MS_NOSUID|MS_NODEV|MS_NOEXEC|MS_SYNCHRONOUS|MS_MANDLOCK|MS_NOATIME|MS_NODIRATIME)
 
 /*
  * Magic mount flag number. Has to be or-ed to the flag values.
@@ -121,12 +123,10 @@ extern int max_files, nr_files, nr_free_files;
 #define IS_APPEND(inode) ((inode)->i_flags & S_APPEND)
 #define IS_IMMUTABLE(inode) ((inode)->i_flags & S_IMMUTABLE)
 #define IS_NOATIME(inode) ((inode)->i_flags & MS_NOATIME)
+#define IS_NODIRATIME(inode) ((inode)->i_flags & MS_NODIRATIME)
 
-#define UPDATE_ATIME(inode) \
-       if (!IS_NOATIME(inode) && !IS_RDONLY(inode)) { \
-               inode->i_atime = CURRENT_TIME; \
-               mark_inode_dirty(inode); \
-       }
+extern void update_atime (struct inode *inode);
+#define UPDATE_ATIME(inode) update_atime (inode)
 
 /* the read-only stuff doesn't really belong here, but any other place is
    probably as bad and I don't want to create yet another include file. */
@@ -313,6 +313,7 @@ struct iattr {
 #define ATTR_FLAG_NOATIME      2       /* Don't update atime */
 #define ATTR_FLAG_APPEND       4       /* Append-only file */
 #define ATTR_FLAG_IMMUTABLE    8       /* Immutable file */
+#define ATTR_FLAG_NODIRATIME   16      /* Don't update atime for directory */
 
 #include <linux/quota.h>
 
index d4bdac314588b3e86a7c1c3366af5a3ce162f042..1a94fe5d2280b6bfb8cfa6bbd0348dafcd76aee3 100644 (file)
@@ -751,7 +751,7 @@ page_read_error:
        filp->f_reada = 1;
        if (page_cache)
                free_page(page_cache);
-       UPDATE_ATIME(inode)
+       UPDATE_ATIME(inode);
        if (!read)
                read = error;
        return read;