On Fri, 2008-06-06 at 16:21 +0800, Ian Kent wrote: > On Fri, 2008-06-06 at 08:23 +0200, Jesper Krogh wrote: > > Hi. > > > > This isn't a test of the proposed patch. I just got another variatioin > > of the problem in the log. (I've tried running the automount daemon both > > with and without the --ghost option) that is the only change I can see. > > Still 2.6.26-rc4.. > > Right. > > Whether that would make a difference depends largely on your map > configuration. If you have simple indirect or direct maps then then > using the --ghost option (or just adding the "browse" option if you're > using version 5) should prevent the code that turns the dentry negative > from being executed at all. If you're using submounts in your map, or > the "hosts" map or you have multi-mount entries in the maps then that > code could still be executed. > btw, I'm currently testing with these additional changes. I don't think they will result in functional differences but it's best we keep in sync. autofs4 - leave rehash dentry positive fix From: Ian Kent <raven@xxxxxxxxxx> Change ENOSPC to ENOMEM. Make autofs4_init_ino() always set mode field. Signed-off-by: Ian Kent <raven@xxxxxxxxxx> --- fs/autofs4/inode.c | 2 +- fs/autofs4/root.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index ec9a641..3221506 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c @@ -45,7 +45,6 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino, if (!reinit) { ino->flags = 0; - ino->mode = mode; ino->inode = NULL; ino->dentry = NULL; ino->size = 0; @@ -53,6 +52,7 @@ struct autofs_info *autofs4_init_ino(struct autofs_info *ino, atomic_set(&ino->count, 0); } + ino->mode = mode; ino->last_used = jiffies; ino->sbi = sbi; diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 6ce603b..f438e6b 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c @@ -713,13 +713,13 @@ static int autofs4_dir_symlink(struct inode *dir, ino = autofs4_init_ino(ino, sbi, S_IFLNK | 0555); if (!ino) - return -ENOSPC; + return -ENOMEM; cp = kmalloc(ino->size + 1, GFP_KERNEL); if (!cp) { if (!dentry->d_fsdata) kfree(ino); - return -ENOSPC; + return -ENOMEM; } strcpy(cp, symname); @@ -733,7 +733,7 @@ static int autofs4_dir_symlink(struct inode *dir, kfree(cp); if (!dentry->d_fsdata) kfree(ino); - return -ENOSPC; + return -ENOMEM; } d_add(dentry, inode); @@ -866,7 +866,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode) ino = autofs4_init_ino(ino, sbi, S_IFDIR | 0555); if (!ino) - return -ENOSPC; + return -ENOMEM; inode = dentry->d_inode; if (inode) @@ -876,7 +876,7 @@ static int autofs4_dir_mkdir(struct inode *dir, struct dentry *dentry, int mode) if (!inode) { if (!dentry->d_fsdata) kfree(ino); - return -ENOSPC; + return -ENOMEM; } d_add(dentry, inode); -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html