diff options
Diffstat (limited to 'fs/autofs4')
-rw-r--r-- | fs/autofs4/expire.c | 6 | ||||
-rw-r--r-- | fs/autofs4/inode.c | 1 | ||||
-rw-r--r-- | fs/autofs4/root.c | 38 |
3 files changed, 33 insertions, 12 deletions
diff --git a/fs/autofs4/expire.c b/fs/autofs4/expire.c index 8dbd44f10e9d..d96e5c14a9ca 100644 --- a/fs/autofs4/expire.c +++ b/fs/autofs4/expire.c | |||
@@ -32,7 +32,7 @@ static inline int autofs4_can_expire(struct dentry *dentry, | |||
32 | 32 | ||
33 | if (!do_now) { | 33 | if (!do_now) { |
34 | /* Too young to die */ | 34 | /* Too young to die */ |
35 | if (time_after(ino->last_used + timeout, now)) | 35 | if (!timeout || time_after(ino->last_used + timeout, now)) |
36 | return 0; | 36 | return 0; |
37 | 37 | ||
38 | /* update last_used here :- | 38 | /* update last_used here :- |
@@ -253,7 +253,7 @@ static struct dentry *autofs4_expire_direct(struct super_block *sb, | |||
253 | struct dentry *root = dget(sb->s_root); | 253 | struct dentry *root = dget(sb->s_root); |
254 | int do_now = how & AUTOFS_EXP_IMMEDIATE; | 254 | int do_now = how & AUTOFS_EXP_IMMEDIATE; |
255 | 255 | ||
256 | if (!sbi->exp_timeout || !root) | 256 | if (!root) |
257 | return NULL; | 257 | return NULL; |
258 | 258 | ||
259 | now = jiffies; | 259 | now = jiffies; |
@@ -293,7 +293,7 @@ static struct dentry *autofs4_expire_indirect(struct super_block *sb, | |||
293 | int do_now = how & AUTOFS_EXP_IMMEDIATE; | 293 | int do_now = how & AUTOFS_EXP_IMMEDIATE; |
294 | int exp_leaves = how & AUTOFS_EXP_LEAVES; | 294 | int exp_leaves = how & AUTOFS_EXP_LEAVES; |
295 | 295 | ||
296 | if ( !sbi->exp_timeout || !root ) | 296 | if (!root) |
297 | return NULL; | 297 | return NULL; |
298 | 298 | ||
299 | now = jiffies; | 299 | now = jiffies; |
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index 11a6a9ae51b7..800ce876caec 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
@@ -447,7 +447,6 @@ struct inode *autofs4_get_inode(struct super_block *sb, | |||
447 | inode->i_uid = 0; | 447 | inode->i_uid = 0; |
448 | inode->i_gid = 0; | 448 | inode->i_gid = 0; |
449 | } | 449 | } |
450 | inode->i_blksize = PAGE_CACHE_SIZE; | ||
451 | inode->i_blocks = 0; | 450 | inode->i_blocks = 0; |
452 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; | 451 | inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME; |
453 | 452 | ||
diff --git a/fs/autofs4/root.c b/fs/autofs4/root.c index 5100f984783f..27e17f96cada 100644 --- a/fs/autofs4/root.c +++ b/fs/autofs4/root.c | |||
@@ -137,7 +137,9 @@ static int autofs4_dir_open(struct inode *inode, struct file *file) | |||
137 | nd.flags = LOOKUP_DIRECTORY; | 137 | nd.flags = LOOKUP_DIRECTORY; |
138 | ret = (dentry->d_op->d_revalidate)(dentry, &nd); | 138 | ret = (dentry->d_op->d_revalidate)(dentry, &nd); |
139 | 139 | ||
140 | if (!ret) { | 140 | if (ret <= 0) { |
141 | if (ret < 0) | ||
142 | status = ret; | ||
141 | dcache_dir_close(inode, file); | 143 | dcache_dir_close(inode, file); |
142 | goto out; | 144 | goto out; |
143 | } | 145 | } |
@@ -400,13 +402,23 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
400 | struct autofs_sb_info *sbi = autofs4_sbi(dir->i_sb); | 402 | struct autofs_sb_info *sbi = autofs4_sbi(dir->i_sb); |
401 | int oz_mode = autofs4_oz_mode(sbi); | 403 | int oz_mode = autofs4_oz_mode(sbi); |
402 | int flags = nd ? nd->flags : 0; | 404 | int flags = nd ? nd->flags : 0; |
403 | int status = 0; | 405 | int status = 1; |
404 | 406 | ||
405 | /* Pending dentry */ | 407 | /* Pending dentry */ |
406 | if (autofs4_ispending(dentry)) { | 408 | if (autofs4_ispending(dentry)) { |
407 | if (!oz_mode) | 409 | /* The daemon never causes a mount to trigger */ |
408 | status = try_to_fill_dentry(dentry, flags); | 410 | if (oz_mode) |
409 | return !status; | 411 | return 1; |
412 | |||
413 | /* | ||
414 | * A zero status is success otherwise we have a | ||
415 | * negative error code. | ||
416 | */ | ||
417 | status = try_to_fill_dentry(dentry, flags); | ||
418 | if (status == 0) | ||
419 | return 1; | ||
420 | |||
421 | return status; | ||
410 | } | 422 | } |
411 | 423 | ||
412 | /* Negative dentry.. invalidate if "old" */ | 424 | /* Negative dentry.. invalidate if "old" */ |
@@ -421,9 +433,19 @@ static int autofs4_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
421 | DPRINTK("dentry=%p %.*s, emptydir", | 433 | DPRINTK("dentry=%p %.*s, emptydir", |
422 | dentry, dentry->d_name.len, dentry->d_name.name); | 434 | dentry, dentry->d_name.len, dentry->d_name.name); |
423 | spin_unlock(&dcache_lock); | 435 | spin_unlock(&dcache_lock); |
424 | if (!oz_mode) | 436 | /* The daemon never causes a mount to trigger */ |
425 | status = try_to_fill_dentry(dentry, flags); | 437 | if (oz_mode) |
426 | return !status; | 438 | return 1; |
439 | |||
440 | /* | ||
441 | * A zero status is success otherwise we have a | ||
442 | * negative error code. | ||
443 | */ | ||
444 | status = try_to_fill_dentry(dentry, flags); | ||
445 | if (status == 0) | ||
446 | return 1; | ||
447 | |||
448 | return status; | ||
427 | } | 449 | } |
428 | spin_unlock(&dcache_lock); | 450 | spin_unlock(&dcache_lock); |
429 | 451 | ||