Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* -*- c -*- --------------------------------------------------------------- * |
| 2 | * |
| 3 | * linux/fs/autofs/expire.c |
| 4 | * |
| 5 | * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved |
| 6 | * Copyright 1999-2000 Jeremy Fitzhardinge <jeremy@goop.org> |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 7 | * Copyright 2001-2006 Ian Kent <raven@themaw.net> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | * |
| 9 | * This file is part of the Linux kernel and is made available under |
| 10 | * the terms of the GNU General Public License, version 2, or at your |
| 11 | * option, any later version, incorporated herein by reference. |
| 12 | * |
| 13 | * ------------------------------------------------------------------------- */ |
| 14 | |
| 15 | #include "autofs_i.h" |
| 16 | |
| 17 | static unsigned long now; |
| 18 | |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 19 | /* Check if a dentry can be expired */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | static inline int autofs4_can_expire(struct dentry *dentry, |
| 21 | unsigned long timeout, int do_now) |
| 22 | { |
| 23 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
| 24 | |
| 25 | /* dentry in the process of being deleted */ |
| 26 | if (ino == NULL) |
| 27 | return 0; |
| 28 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 29 | if (!do_now) { |
| 30 | /* Too young to die */ |
Ian Kent | c0ba7e5 | 2006-09-25 16:24:16 -0700 | [diff] [blame] | 31 | if (!timeout || time_after(ino->last_used + timeout, now)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 33 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | return 1; |
| 35 | } |
| 36 | |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 37 | /* Check a mount point for busyness */ |
| 38 | static int autofs4_mount_busy(struct vfsmount *mnt, struct dentry *dentry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | { |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 40 | struct dentry *top = dentry; |
Al Viro | 9393bd0 | 2009-04-18 13:58:15 -0400 | [diff] [blame] | 41 | struct path path = {.mnt = mnt, .dentry = dentry}; |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 42 | int status = 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
| 44 | DPRINTK("dentry %p %.*s", |
| 45 | dentry, (int)dentry->d_name.len, dentry->d_name.name); |
| 46 | |
Al Viro | 9393bd0 | 2009-04-18 13:58:15 -0400 | [diff] [blame] | 47 | path_get(&path); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | |
David Howells | cc53ce5 | 2011-01-14 18:45:26 +0000 | [diff] [blame] | 49 | if (!follow_down_one(&path)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 50 | goto done; |
| 51 | |
Al Viro | 9393bd0 | 2009-04-18 13:58:15 -0400 | [diff] [blame] | 52 | if (is_autofs4_dentry(path.dentry)) { |
| 53 | struct autofs_sb_info *sbi = autofs4_sbi(path.dentry->d_sb); |
Ian Kent | bc9c406 | 2008-11-06 12:53:22 -0800 | [diff] [blame] | 54 | |
| 55 | /* This is an autofs submount, we can't expire it */ |
Ian Kent | a92daf6 | 2009-01-06 14:42:08 -0800 | [diff] [blame] | 56 | if (autofs_type_indirect(sbi->type)) |
Ian Kent | bc9c406 | 2008-11-06 12:53:22 -0800 | [diff] [blame] | 57 | goto done; |
Ian Kent | bc9c406 | 2008-11-06 12:53:22 -0800 | [diff] [blame] | 58 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 60 | /* Update the expiry counter if fs is busy */ |
Ian Kent | 37d0892 | 2009-09-01 11:26:22 +0800 | [diff] [blame] | 61 | if (!may_umount_tree(path.mnt)) { |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 62 | struct autofs_info *ino = autofs4_dentry_ino(top); |
| 63 | ino->last_used = jiffies; |
| 64 | goto done; |
| 65 | } |
| 66 | |
| 67 | status = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | done: |
| 69 | DPRINTK("returning = %d", status); |
Al Viro | 9393bd0 | 2009-04-18 13:58:15 -0400 | [diff] [blame] | 70 | path_put(&path); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | return status; |
| 72 | } |
| 73 | |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 74 | /* |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 75 | * Calculate and dget next entry in the subdirs list under root. |
| 76 | */ |
| 77 | static struct dentry *get_next_positive_subdir(struct dentry *prev, |
| 78 | struct dentry *root) |
| 79 | { |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 80 | struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb); |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 81 | struct list_head *next; |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 82 | struct dentry *q; |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 83 | |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 84 | spin_lock(&sbi->lookup_lock); |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 85 | spin_lock(&root->d_lock); |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 86 | |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 87 | if (prev) |
| 88 | next = prev->d_u.d_child.next; |
| 89 | else { |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 90 | prev = dget_dlock(root); |
| 91 | next = prev->d_subdirs.next; |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 92 | } |
| 93 | |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 94 | cont: |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 95 | if (next == &root->d_subdirs) { |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 96 | spin_unlock(&root->d_lock); |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 97 | spin_unlock(&sbi->lookup_lock); |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 98 | dput(prev); |
| 99 | return NULL; |
| 100 | } |
| 101 | |
| 102 | q = list_entry(next, struct dentry, d_u.d_child); |
| 103 | |
| 104 | spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED); |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 105 | /* Already gone or negative dentry (under construction) - try next */ |
Al Viro | 84d08fa | 2013-07-05 18:59:33 +0400 | [diff] [blame] | 106 | if (!d_count(q) || !simple_positive(q)) { |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 107 | spin_unlock(&q->d_lock); |
| 108 | next = q->d_u.d_child.next; |
| 109 | goto cont; |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 110 | } |
| 111 | dget_dlock(q); |
| 112 | spin_unlock(&q->d_lock); |
Ian Kent | a45440f | 2012-08-06 09:37:47 +0800 | [diff] [blame] | 113 | spin_unlock(&root->d_lock); |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 114 | spin_unlock(&sbi->lookup_lock); |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 115 | |
| 116 | dput(prev); |
| 117 | |
| 118 | return q; |
| 119 | } |
| 120 | |
| 121 | /* |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 122 | * Calculate and dget next entry in top down tree traversal. |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 123 | */ |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 124 | static struct dentry *get_next_positive_dentry(struct dentry *prev, |
| 125 | struct dentry *root) |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 126 | { |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 127 | struct autofs_sb_info *sbi = autofs4_sbi(root->d_sb); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 128 | struct list_head *next; |
| 129 | struct dentry *p, *ret; |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 130 | |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 131 | if (prev == NULL) |
Ian Kent | c14cc63 | 2011-01-18 12:06:04 +0800 | [diff] [blame] | 132 | return dget(root); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 133 | |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 134 | spin_lock(&sbi->lookup_lock); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 135 | relock: |
| 136 | p = prev; |
| 137 | spin_lock(&p->d_lock); |
| 138 | again: |
| 139 | next = p->d_subdirs.next; |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 140 | if (next == &p->d_subdirs) { |
| 141 | while (1) { |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 142 | struct dentry *parent; |
| 143 | |
| 144 | if (p == root) { |
| 145 | spin_unlock(&p->d_lock); |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 146 | spin_unlock(&sbi->lookup_lock); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 147 | dput(prev); |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 148 | return NULL; |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 149 | } |
| 150 | |
| 151 | parent = p->d_parent; |
| 152 | if (!spin_trylock(&parent->d_lock)) { |
| 153 | spin_unlock(&p->d_lock); |
| 154 | cpu_relax(); |
| 155 | goto relock; |
| 156 | } |
| 157 | spin_unlock(&p->d_lock); |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 158 | next = p->d_u.d_child.next; |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 159 | p = parent; |
| 160 | if (next != &parent->d_subdirs) |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 161 | break; |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 162 | } |
| 163 | } |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 164 | ret = list_entry(next, struct dentry, d_u.d_child); |
| 165 | |
| 166 | spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED); |
| 167 | /* Negative dentry - try next */ |
| 168 | if (!simple_positive(ret)) { |
Ian Kent | c14cc63 | 2011-01-18 12:06:04 +0800 | [diff] [blame] | 169 | spin_unlock(&p->d_lock); |
Steven Rostedt | 1d6f209 | 2011-08-22 11:52:28 +0800 | [diff] [blame] | 170 | lock_set_subclass(&ret->d_lock.dep_map, 0, _RET_IP_); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 171 | p = ret; |
| 172 | goto again; |
| 173 | } |
| 174 | dget_dlock(ret); |
| 175 | spin_unlock(&ret->d_lock); |
| 176 | spin_unlock(&p->d_lock); |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 177 | spin_unlock(&sbi->lookup_lock); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 178 | |
| 179 | dput(prev); |
| 180 | |
| 181 | return ret; |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 182 | } |
| 183 | |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 184 | /* |
| 185 | * Check a direct mount point for busyness. |
| 186 | * Direct mounts have similar expiry semantics to tree mounts. |
| 187 | * The tree is not busy iff no mountpoints are busy and there are no |
| 188 | * autofs submounts. |
| 189 | */ |
| 190 | static int autofs4_direct_busy(struct vfsmount *mnt, |
| 191 | struct dentry *top, |
| 192 | unsigned long timeout, |
| 193 | int do_now) |
| 194 | { |
| 195 | DPRINTK("top %p %.*s", |
| 196 | top, (int) top->d_name.len, top->d_name.name); |
| 197 | |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 198 | /* If it's busy update the expiry counters */ |
| 199 | if (!may_umount_tree(mnt)) { |
| 200 | struct autofs_info *ino = autofs4_dentry_ino(top); |
| 201 | if (ino) |
| 202 | ino->last_used = jiffies; |
| 203 | return 1; |
| 204 | } |
| 205 | |
| 206 | /* Timeout of a direct mount is determined by its top dentry */ |
| 207 | if (!autofs4_can_expire(top, timeout, do_now)) |
| 208 | return 1; |
| 209 | |
| 210 | return 0; |
| 211 | } |
| 212 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 213 | /* Check a directory tree of mount points for busyness |
| 214 | * The tree is not busy iff no mountpoints are busy |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | */ |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 216 | static int autofs4_tree_busy(struct vfsmount *mnt, |
| 217 | struct dentry *top, |
| 218 | unsigned long timeout, |
| 219 | int do_now) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 220 | { |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 221 | struct autofs_info *top_ino = autofs4_dentry_ino(top); |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 222 | struct dentry *p; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 223 | |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 224 | DPRINTK("top %p %.*s", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | top, (int)top->d_name.len, top->d_name.name); |
| 226 | |
| 227 | /* Negative dentry - give up */ |
| 228 | if (!simple_positive(top)) |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 229 | return 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 231 | p = NULL; |
| 232 | while ((p = get_next_positive_dentry(p, top))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | DPRINTK("dentry %p %.*s", |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 234 | p, (int) p->d_name.len, p->d_name.name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 235 | |
Ian Kent | 1aff3c8 | 2006-03-27 01:14:46 -0800 | [diff] [blame] | 236 | /* |
| 237 | * Is someone visiting anywhere in the subtree ? |
| 238 | * If there's no mount we need to check the usage |
| 239 | * count for the autofs dentry. |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 240 | * If the fs is busy update the expiry counter. |
Ian Kent | 1aff3c8 | 2006-03-27 01:14:46 -0800 | [diff] [blame] | 241 | */ |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 242 | if (d_mountpoint(p)) { |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 243 | if (autofs4_mount_busy(mnt, p)) { |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 244 | top_ino->last_used = jiffies; |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 245 | dput(p); |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 246 | return 1; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 247 | } |
Ian Kent | 1aff3c8 | 2006-03-27 01:14:46 -0800 | [diff] [blame] | 248 | } else { |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 249 | struct autofs_info *ino = autofs4_dentry_ino(p); |
Ian Kent | 1aff3c8 | 2006-03-27 01:14:46 -0800 | [diff] [blame] | 250 | unsigned int ino_count = atomic_read(&ino->count); |
| 251 | |
| 252 | /* allow for dget above and top is already dgot */ |
| 253 | if (p == top) |
| 254 | ino_count += 2; |
| 255 | else |
| 256 | ino_count++; |
| 257 | |
Al Viro | 84d08fa | 2013-07-05 18:59:33 +0400 | [diff] [blame] | 258 | if (d_count(p) > ino_count) { |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 259 | top_ino->last_used = jiffies; |
Ian Kent | 1aff3c8 | 2006-03-27 01:14:46 -0800 | [diff] [blame] | 260 | dput(p); |
| 261 | return 1; |
| 262 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 263 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | } |
Ian Kent | 1aff3c8 | 2006-03-27 01:14:46 -0800 | [diff] [blame] | 265 | |
| 266 | /* Timeout of a tree mount is ultimately determined by its top dentry */ |
| 267 | if (!autofs4_can_expire(top, timeout, do_now)) |
| 268 | return 1; |
| 269 | |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 270 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | } |
| 272 | |
| 273 | static struct dentry *autofs4_check_leaves(struct vfsmount *mnt, |
| 274 | struct dentry *parent, |
| 275 | unsigned long timeout, |
| 276 | int do_now) |
| 277 | { |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 278 | struct dentry *p; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | |
| 280 | DPRINTK("parent %p %.*s", |
| 281 | parent, (int)parent->d_name.len, parent->d_name.name); |
| 282 | |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 283 | p = NULL; |
| 284 | while ((p = get_next_positive_dentry(p, parent))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 285 | DPRINTK("dentry %p %.*s", |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 286 | p, (int) p->d_name.len, p->d_name.name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 287 | |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 288 | if (d_mountpoint(p)) { |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 289 | /* Can we umount this guy */ |
| 290 | if (autofs4_mount_busy(mnt, p)) |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 291 | continue; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 292 | |
Ian Kent | e0a7aae | 2006-03-27 01:14:47 -0800 | [diff] [blame] | 293 | /* Can we expire this guy */ |
| 294 | if (autofs4_can_expire(p, timeout, do_now)) |
Ian Kent | 1ce12ba | 2006-03-27 01:14:45 -0800 | [diff] [blame] | 295 | return p; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 296 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 297 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | return NULL; |
| 299 | } |
| 300 | |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 301 | /* Check if we can expire a direct mount (possibly a tree) */ |
Ian Kent | 8d7b48e | 2008-10-15 22:02:54 -0700 | [diff] [blame] | 302 | struct dentry *autofs4_expire_direct(struct super_block *sb, |
| 303 | struct vfsmount *mnt, |
| 304 | struct autofs_sb_info *sbi, |
| 305 | int how) |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 306 | { |
| 307 | unsigned long timeout; |
| 308 | struct dentry *root = dget(sb->s_root); |
| 309 | int do_now = how & AUTOFS_EXP_IMMEDIATE; |
Ian Kent | b5b8017 | 2011-01-14 18:46:03 +0000 | [diff] [blame] | 310 | struct autofs_info *ino; |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 311 | |
Ian Kent | c0ba7e5 | 2006-09-25 16:24:16 -0700 | [diff] [blame] | 312 | if (!root) |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 313 | return NULL; |
| 314 | |
| 315 | now = jiffies; |
| 316 | timeout = sbi->exp_timeout; |
| 317 | |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 318 | spin_lock(&sbi->fs_lock); |
Ian Kent | b5b8017 | 2011-01-14 18:46:03 +0000 | [diff] [blame] | 319 | ino = autofs4_dentry_ino(root); |
| 320 | /* No point expiring a pending mount */ |
Ian Kent | f9398c2 | 2011-03-25 01:51:14 +0800 | [diff] [blame] | 321 | if (ino->flags & AUTOFS_INF_PENDING) |
| 322 | goto out; |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 323 | if (!autofs4_direct_busy(mnt, root, timeout, do_now)) { |
NeilBrown | 4d885f9 | 2014-10-13 15:52:20 -0700 | [diff] [blame^] | 324 | ino->flags |= AUTOFS_INF_NO_RCU; |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 325 | spin_unlock(&sbi->fs_lock); |
NeilBrown | 4d885f9 | 2014-10-13 15:52:20 -0700 | [diff] [blame^] | 326 | synchronize_rcu(); |
| 327 | spin_lock(&sbi->fs_lock); |
| 328 | if (!autofs4_direct_busy(mnt, root, timeout, do_now)) { |
| 329 | ino->flags |= AUTOFS_INF_EXPIRING; |
| 330 | smp_mb(); |
| 331 | ino->flags &= ~AUTOFS_INF_NO_RCU; |
| 332 | init_completion(&ino->expire_complete); |
| 333 | spin_unlock(&sbi->fs_lock); |
| 334 | return root; |
| 335 | } |
| 336 | ino->flags &= ~AUTOFS_INF_NO_RCU; |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 337 | } |
Ian Kent | f9398c2 | 2011-03-25 01:51:14 +0800 | [diff] [blame] | 338 | out: |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 339 | spin_unlock(&sbi->fs_lock); |
| 340 | dput(root); |
| 341 | |
| 342 | return NULL; |
| 343 | } |
| 344 | |
NeilBrown | a5d1dba | 2014-10-13 15:52:16 -0700 | [diff] [blame] | 345 | /* Check if 'dentry' should expire, or return a nearby |
| 346 | * dentry that is suitable. |
| 347 | * If returned dentry is different from arg dentry, |
| 348 | * then a dget() reference was taken, else not. |
| 349 | */ |
| 350 | static struct dentry *should_expire(struct dentry *dentry, |
| 351 | struct vfsmount *mnt, |
| 352 | unsigned long timeout, |
| 353 | int how) |
| 354 | { |
| 355 | int do_now = how & AUTOFS_EXP_IMMEDIATE; |
| 356 | int exp_leaves = how & AUTOFS_EXP_LEAVES; |
| 357 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
| 358 | unsigned int ino_count; |
| 359 | |
| 360 | /* No point expiring a pending mount */ |
| 361 | if (ino->flags & AUTOFS_INF_PENDING) |
| 362 | return NULL; |
| 363 | |
| 364 | /* |
| 365 | * Case 1: (i) indirect mount or top level pseudo direct mount |
| 366 | * (autofs-4.1). |
| 367 | * (ii) indirect mount with offset mount, check the "/" |
| 368 | * offset (autofs-5.0+). |
| 369 | */ |
| 370 | if (d_mountpoint(dentry)) { |
| 371 | DPRINTK("checking mountpoint %p %.*s", |
| 372 | dentry, (int)dentry->d_name.len, dentry->d_name.name); |
| 373 | |
| 374 | /* Can we umount this guy */ |
| 375 | if (autofs4_mount_busy(mnt, dentry)) |
| 376 | return NULL; |
| 377 | |
| 378 | /* Can we expire this guy */ |
| 379 | if (autofs4_can_expire(dentry, timeout, do_now)) |
| 380 | return dentry; |
| 381 | return NULL; |
| 382 | } |
| 383 | |
| 384 | if (dentry->d_inode && S_ISLNK(dentry->d_inode->i_mode)) { |
| 385 | DPRINTK("checking symlink %p %.*s", |
| 386 | dentry, (int)dentry->d_name.len, dentry->d_name.name); |
| 387 | /* |
| 388 | * A symlink can't be "busy" in the usual sense so |
| 389 | * just check last used for expire timeout. |
| 390 | */ |
| 391 | if (autofs4_can_expire(dentry, timeout, do_now)) |
| 392 | return dentry; |
| 393 | return NULL; |
| 394 | } |
| 395 | |
| 396 | if (simple_empty(dentry)) |
| 397 | return NULL; |
| 398 | |
| 399 | /* Case 2: tree mount, expire iff entire tree is not busy */ |
| 400 | if (!exp_leaves) { |
| 401 | /* Path walk currently on this dentry? */ |
| 402 | ino_count = atomic_read(&ino->count) + 1; |
| 403 | if (d_count(dentry) > ino_count) |
| 404 | return NULL; |
| 405 | |
| 406 | if (!autofs4_tree_busy(mnt, dentry, timeout, do_now)) |
| 407 | return dentry; |
| 408 | /* |
| 409 | * Case 3: pseudo direct mount, expire individual leaves |
| 410 | * (autofs-4.1). |
| 411 | */ |
| 412 | } else { |
| 413 | /* Path walk currently on this dentry? */ |
| 414 | struct dentry *expired; |
| 415 | ino_count = atomic_read(&ino->count) + 1; |
| 416 | if (d_count(dentry) > ino_count) |
| 417 | return NULL; |
| 418 | |
| 419 | expired = autofs4_check_leaves(mnt, dentry, timeout, do_now); |
| 420 | if (expired) { |
| 421 | if (expired == dentry) |
| 422 | dput(dentry); |
| 423 | return expired; |
| 424 | } |
| 425 | } |
| 426 | return NULL; |
| 427 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 428 | /* |
| 429 | * Find an eligible tree to time-out |
| 430 | * A tree is eligible if :- |
| 431 | * - it is unused by any user process |
| 432 | * - it has been unused for exp_timeout time |
| 433 | */ |
Ian Kent | 8d7b48e | 2008-10-15 22:02:54 -0700 | [diff] [blame] | 434 | struct dentry *autofs4_expire_indirect(struct super_block *sb, |
| 435 | struct vfsmount *mnt, |
| 436 | struct autofs_sb_info *sbi, |
| 437 | int how) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 438 | { |
| 439 | unsigned long timeout; |
| 440 | struct dentry *root = sb->s_root; |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 441 | struct dentry *dentry; |
NeilBrown | a5d1dba | 2014-10-13 15:52:16 -0700 | [diff] [blame] | 442 | struct dentry *expired; |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 443 | struct autofs_info *ino; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 444 | |
Ian Kent | c0ba7e5 | 2006-09-25 16:24:16 -0700 | [diff] [blame] | 445 | if (!root) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 446 | return NULL; |
| 447 | |
| 448 | now = jiffies; |
| 449 | timeout = sbi->exp_timeout; |
| 450 | |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 451 | dentry = NULL; |
Ian Kent | d4a85e3 | 2011-03-25 01:51:20 +0800 | [diff] [blame] | 452 | while ((dentry = get_next_positive_subdir(dentry, root))) { |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 453 | spin_lock(&sbi->fs_lock); |
NeilBrown | 4d885f9 | 2014-10-13 15:52:20 -0700 | [diff] [blame^] | 454 | ino = autofs4_dentry_ino(dentry); |
| 455 | if (ino->flags & AUTOFS_INF_NO_RCU) |
| 456 | expired = NULL; |
| 457 | else |
| 458 | expired = should_expire(dentry, mnt, timeout, how); |
| 459 | if (!expired) { |
| 460 | spin_unlock(&sbi->fs_lock); |
| 461 | continue; |
| 462 | } |
| 463 | ino = autofs4_dentry_ino(expired); |
| 464 | ino->flags |= AUTOFS_INF_NO_RCU; |
| 465 | spin_unlock(&sbi->fs_lock); |
| 466 | synchronize_rcu(); |
| 467 | spin_lock(&sbi->fs_lock); |
| 468 | if (should_expire(expired, mnt, timeout, how)) { |
NeilBrown | a5d1dba | 2014-10-13 15:52:16 -0700 | [diff] [blame] | 469 | if (expired != dentry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 470 | dput(dentry); |
NeilBrown | a5d1dba | 2014-10-13 15:52:16 -0700 | [diff] [blame] | 471 | goto found; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | } |
NeilBrown | 4d885f9 | 2014-10-13 15:52:20 -0700 | [diff] [blame^] | 473 | |
| 474 | ino->flags &= ~AUTOFS_INF_NO_RCU; |
| 475 | if (expired != dentry) |
| 476 | dput(expired); |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 477 | spin_unlock(&sbi->fs_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 478 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 479 | return NULL; |
Ian Kent | afec570 | 2008-05-01 04:35:06 -0700 | [diff] [blame] | 480 | |
| 481 | found: |
| 482 | DPRINTK("returning %p %.*s", |
| 483 | expired, (int)expired->d_name.len, expired->d_name.name); |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 484 | ino->flags |= AUTOFS_INF_EXPIRING; |
NeilBrown | 4d885f9 | 2014-10-13 15:52:20 -0700 | [diff] [blame^] | 485 | smp_mb(); |
| 486 | ino->flags &= ~AUTOFS_INF_NO_RCU; |
Ian Kent | 6e60a9a | 2008-07-23 21:30:27 -0700 | [diff] [blame] | 487 | init_completion(&ino->expire_complete); |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 488 | spin_unlock(&sbi->fs_lock); |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 489 | spin_lock(&sbi->lookup_lock); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 490 | spin_lock(&expired->d_parent->d_lock); |
| 491 | spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED); |
Ian Kent | afec570 | 2008-05-01 04:35:06 -0700 | [diff] [blame] | 492 | list_move(&expired->d_parent->d_subdirs, &expired->d_u.d_child); |
Nick Piggin | 2fd6b7f | 2011-01-07 17:49:34 +1100 | [diff] [blame] | 493 | spin_unlock(&expired->d_lock); |
| 494 | spin_unlock(&expired->d_parent->d_lock); |
Ian Kent | e785472 | 2011-03-25 01:51:31 +0800 | [diff] [blame] | 495 | spin_unlock(&sbi->lookup_lock); |
Ian Kent | afec570 | 2008-05-01 04:35:06 -0700 | [diff] [blame] | 496 | return expired; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 497 | } |
| 498 | |
NeilBrown | 23bfc2a | 2014-10-13 15:52:14 -0700 | [diff] [blame] | 499 | int autofs4_expire_wait(struct dentry *dentry, int rcu_walk) |
Ian Kent | 06a3598 | 2008-07-23 21:30:28 -0700 | [diff] [blame] | 500 | { |
| 501 | struct autofs_sb_info *sbi = autofs4_sbi(dentry->d_sb); |
| 502 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
| 503 | int status; |
| 504 | |
| 505 | /* Block on any pending expire */ |
NeilBrown | 4d885f9 | 2014-10-13 15:52:20 -0700 | [diff] [blame^] | 506 | if (!(ino->flags & (AUTOFS_INF_EXPIRING | AUTOFS_INF_NO_RCU))) |
| 507 | return 0; |
| 508 | if (rcu_walk) |
| 509 | return -ECHILD; |
| 510 | |
Ian Kent | 06a3598 | 2008-07-23 21:30:28 -0700 | [diff] [blame] | 511 | spin_lock(&sbi->fs_lock); |
| 512 | if (ino->flags & AUTOFS_INF_EXPIRING) { |
| 513 | spin_unlock(&sbi->fs_lock); |
| 514 | |
| 515 | DPRINTK("waiting for expire %p name=%.*s", |
| 516 | dentry, dentry->d_name.len, dentry->d_name.name); |
| 517 | |
| 518 | status = autofs4_wait(sbi, dentry, NFY_NONE); |
| 519 | wait_for_completion(&ino->expire_complete); |
| 520 | |
| 521 | DPRINTK("expire done status=%d", status); |
| 522 | |
Al Viro | 4b1ae27 | 2010-03-03 12:58:31 -0500 | [diff] [blame] | 523 | if (d_unhashed(dentry)) |
Ian Kent | 06a3598 | 2008-07-23 21:30:28 -0700 | [diff] [blame] | 524 | return -EAGAIN; |
| 525 | |
| 526 | return status; |
| 527 | } |
| 528 | spin_unlock(&sbi->fs_lock); |
| 529 | |
| 530 | return 0; |
| 531 | } |
| 532 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 533 | /* Perform an expiry operation */ |
| 534 | int autofs4_expire_run(struct super_block *sb, |
| 535 | struct vfsmount *mnt, |
| 536 | struct autofs_sb_info *sbi, |
| 537 | struct autofs_packet_expire __user *pkt_p) |
| 538 | { |
| 539 | struct autofs_packet_expire pkt; |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 540 | struct autofs_info *ino; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 541 | struct dentry *dentry; |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 542 | int ret = 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | |
| 544 | memset(&pkt,0,sizeof pkt); |
| 545 | |
| 546 | pkt.hdr.proto_version = sbi->version; |
| 547 | pkt.hdr.type = autofs_ptype_expire; |
| 548 | |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 549 | if ((dentry = autofs4_expire_indirect(sb, mnt, sbi, 0)) == NULL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 550 | return -EAGAIN; |
| 551 | |
| 552 | pkt.len = dentry->d_name.len; |
| 553 | memcpy(pkt.name, dentry->d_name.name, pkt.len); |
| 554 | pkt.name[pkt.len] = '\0'; |
| 555 | dput(dentry); |
| 556 | |
| 557 | if ( copy_to_user(pkt_p, &pkt, sizeof(struct autofs_packet_expire)) ) |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 558 | ret = -EFAULT; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 559 | |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 560 | spin_lock(&sbi->fs_lock); |
| 561 | ino = autofs4_dentry_ino(dentry); |
NeilBrown | 6ece08e | 2014-10-13 15:52:18 -0700 | [diff] [blame] | 562 | /* avoid rapid-fire expire attempts if expiry fails */ |
| 563 | ino->last_used = now; |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 564 | ino->flags &= ~AUTOFS_INF_EXPIRING; |
Ian Kent | 6e60a9a | 2008-07-23 21:30:27 -0700 | [diff] [blame] | 565 | complete_all(&ino->expire_complete); |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 566 | spin_unlock(&sbi->fs_lock); |
| 567 | |
| 568 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 569 | } |
| 570 | |
Ian Kent | 56fcef7 | 2009-03-31 15:24:43 -0700 | [diff] [blame] | 571 | int autofs4_do_expire_multi(struct super_block *sb, struct vfsmount *mnt, |
| 572 | struct autofs_sb_info *sbi, int when) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 573 | { |
| 574 | struct dentry *dentry; |
| 575 | int ret = -EAGAIN; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 576 | |
Ian Kent | a92daf6 | 2009-01-06 14:42:08 -0800 | [diff] [blame] | 577 | if (autofs_type_trigger(sbi->type)) |
Ian Kent | 56fcef7 | 2009-03-31 15:24:43 -0700 | [diff] [blame] | 578 | dentry = autofs4_expire_direct(sb, mnt, sbi, when); |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 579 | else |
Ian Kent | 56fcef7 | 2009-03-31 15:24:43 -0700 | [diff] [blame] | 580 | dentry = autofs4_expire_indirect(sb, mnt, sbi, when); |
Ian Kent | 3a15e2a | 2006-03-27 01:14:55 -0800 | [diff] [blame] | 581 | |
| 582 | if (dentry) { |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 583 | struct autofs_info *ino = autofs4_dentry_ino(dentry); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 584 | |
| 585 | /* This is synchronous because it makes the daemon a |
| 586 | little easier */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 587 | ret = autofs4_wait(sbi, dentry, NFY_EXPIRE); |
Ian Kent | 6e60a9a | 2008-07-23 21:30:27 -0700 | [diff] [blame] | 588 | |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 589 | spin_lock(&sbi->fs_lock); |
NeilBrown | 6ece08e | 2014-10-13 15:52:18 -0700 | [diff] [blame] | 590 | /* avoid rapid-fire expire attempts if expiry fails */ |
| 591 | ino->last_used = now; |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 592 | ino->flags &= ~AUTOFS_INF_EXPIRING; |
Ian Kent | 6e60a9a | 2008-07-23 21:30:27 -0700 | [diff] [blame] | 593 | complete_all(&ino->expire_complete); |
Ian Kent | 97e7449 | 2008-07-23 21:30:26 -0700 | [diff] [blame] | 594 | spin_unlock(&sbi->fs_lock); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 595 | dput(dentry); |
| 596 | } |
Ian Kent | 1f5f2c3 | 2006-03-27 01:14:44 -0800 | [diff] [blame] | 597 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 598 | return ret; |
| 599 | } |
| 600 | |
Ian Kent | 56fcef7 | 2009-03-31 15:24:43 -0700 | [diff] [blame] | 601 | /* Call repeatedly until it returns -EAGAIN, meaning there's nothing |
| 602 | more to be done */ |
| 603 | int autofs4_expire_multi(struct super_block *sb, struct vfsmount *mnt, |
| 604 | struct autofs_sb_info *sbi, int __user *arg) |
| 605 | { |
| 606 | int do_now = 0; |
| 607 | |
| 608 | if (arg && get_user(do_now, arg)) |
| 609 | return -EFAULT; |
| 610 | |
| 611 | return autofs4_do_expire_multi(sb, mnt, sbi, do_now); |
| 612 | } |
| 613 | |