From: Linus Torvalds Date: Fri, 23 Nov 2007 20:14:37 +0000 (-0500) Subject: Linux 2.1.84 X-Git-Tag: 2.1.84 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=9ba959810385ea04a5d26de7066deffb33ff9bd4;p=history.git Linux 2.1.84 - 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] --- diff --git a/Makefile b/Makefile index 303abea28d1a..2b386d291ec6 100644 --- 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/) diff --git a/fs/autofs/root.c b/fs/autofs/root.c index 541f7fba38a2..36d38b84e69d 100644 --- a/fs/autofs/root.c +++ b/fs/autofs/root.c @@ -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 diff --git a/fs/inode.c b/fs/inode.c index 36765e27843f..a88b53d13a63 100644 --- a/fs/inode.c +++ b/fs/inode.c @@ -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 */ diff --git a/fs/super.c b/fs/super.c index cefd90c9bd23..84ef3ffb8b2c 100644 --- a/fs/super.c +++ b/fs/super.c @@ -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 diff --git a/include/linux/fs.h b/include/linux/fs.h index 221548a6e266..4685ce27475a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -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 diff --git a/mm/filemap.c b/mm/filemap.c index d4bdac314588..1a94fe5d2280 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -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;