diff options
| -rw-r--r-- | fs/autofs4/inode.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c index ca9cbd6362e0..d76573f62278 100644 --- a/fs/autofs4/inode.c +++ b/fs/autofs4/inode.c | |||
| @@ -274,6 +274,23 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
| 274 | goto fail_dput; | 274 | goto fail_dput; |
| 275 | } | 275 | } |
| 276 | 276 | ||
| 277 | /* Test versions first */ | ||
| 278 | if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION || | ||
| 279 | sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) { | ||
| 280 | pr_err("kernel does not match daemon version " | ||
| 281 | "daemon (%d, %d) kernel (%d, %d)\n", | ||
| 282 | sbi->min_proto, sbi->max_proto, | ||
| 283 | AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION); | ||
| 284 | goto fail_dput; | ||
| 285 | } | ||
| 286 | |||
| 287 | /* Establish highest kernel protocol version */ | ||
| 288 | if (sbi->max_proto > AUTOFS_MAX_PROTO_VERSION) | ||
| 289 | sbi->version = AUTOFS_MAX_PROTO_VERSION; | ||
| 290 | else | ||
| 291 | sbi->version = sbi->max_proto; | ||
| 292 | sbi->sub_version = AUTOFS_PROTO_SUBVERSION; | ||
| 293 | |||
| 277 | if (pgrp_set) { | 294 | if (pgrp_set) { |
| 278 | sbi->oz_pgrp = find_get_pid(pgrp); | 295 | sbi->oz_pgrp = find_get_pid(pgrp); |
| 279 | if (!sbi->oz_pgrp) { | 296 | if (!sbi->oz_pgrp) { |
| @@ -291,23 +308,6 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent) | |||
| 291 | root_inode->i_fop = &autofs4_root_operations; | 308 | root_inode->i_fop = &autofs4_root_operations; |
| 292 | root_inode->i_op = &autofs4_dir_inode_operations; | 309 | root_inode->i_op = &autofs4_dir_inode_operations; |
| 293 | 310 | ||
| 294 | /* Couldn't this be tested earlier? */ | ||
| 295 | if (sbi->max_proto < AUTOFS_MIN_PROTO_VERSION || | ||
| 296 | sbi->min_proto > AUTOFS_MAX_PROTO_VERSION) { | ||
| 297 | pr_err("kernel does not match daemon version " | ||
| 298 | "daemon (%d, %d) kernel (%d, %d)\n", | ||
| 299 | sbi->min_proto, sbi->max_proto, | ||
| 300 | AUTOFS_MIN_PROTO_VERSION, AUTOFS_MAX_PROTO_VERSION); | ||
| 301 | goto fail_dput; | ||
| 302 | } | ||
| 303 | |||
| 304 | /* Establish highest kernel protocol version */ | ||
| 305 | if (sbi->max_proto > AUTOFS_MAX_PROTO_VERSION) | ||
| 306 | sbi->version = AUTOFS_MAX_PROTO_VERSION; | ||
| 307 | else | ||
| 308 | sbi->version = sbi->max_proto; | ||
| 309 | sbi->sub_version = AUTOFS_PROTO_SUBVERSION; | ||
| 310 | |||
| 311 | pr_debug("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp)); | 311 | pr_debug("pipe fd = %d, pgrp = %u\n", pipefd, pid_nr(sbi->oz_pgrp)); |
| 312 | pipe = fget(pipefd); | 312 | pipe = fget(pipefd); |
| 313 | 313 | ||
