Commit ac6424b981bc ("sched/wait: Rename wait_queue_t => wait_queue_entry_t") had scripted the renaming incorrectly, and didn't actually check that the 'wait_queue_t' was a full token. As a result, it also triggered on 'wait_queue_token', and renamed that to 'wait_queue_entry_token' entry in the autofs4 packet structure definition too. That was entirely incorrect, and not intended. The end result built fine when building just the kernel - because everything had been renamed consistently there - but caused problems in user space because the "struct autofs_packet_missing" type is exported as part of the uapi. This scripts it all back again: git grep -lw wait_queue_entry_token | xargs sed -i 's/wait_queue_entry_token/wait_queue_token/g' and checks the end result.
Unified · Split
| @@ -316,7 +316,7 @@ For version 5, the format of the message is: · 315 unmodified lines | ||
| 316 | 316 | struct autofs_v5_packet { |
| 317 | 317 | int proto_version; /* Protocol version */ |
| 318 | 318 | int type; /* Type of packet */ |
| 319 | − autofs_wqt_t wait_queue_entry_token; | |
| 319 | + autofs_wqt_t wait_queue_token; | |
| 320 | 320 | __u32 dev; |
| 321 | 321 | __u64 ino; |
| 322 | 322 | __u32 uid; |
| @@ -341,12 +341,12 @@ The pipe will be set to "packet mode" (equivalent to passing · 18 unmodified lines | ||
| 341 | 341 | `O_DIRECT`) to _pipe2(2)_ so that a read from the pipe will return at |
| 342 | 342 | most one packet, and any unread portion of a packet will be discarded. |
| 343 | 343 | |
| 344 | −The `wait_queue_entry_token` is a unique number which can identify a | |
| 344 | +The `wait_queue_token` is a unique number which can identify a | |
| 345 | 345 | particular request to be acknowledged. When a message is sent over |
| 346 | 346 | the pipe the affected dentry is marked as either "active" or |
| 347 | 347 | "expiring" and other accesses to it block until the message is |
| 348 | 348 | acknowledged using one of the ioctls below and the relevant |
| 349 | −`wait_queue_entry_token`. | |
| 349 | +`wait_queue_token`. | |
| 350 | 350 | |
| 351 | 351 | Communicating with autofs: root directory ioctls |
| 352 | 352 | ------------------------------------------------ |
| @@ -358,7 +358,7 @@ capability, or must be the automount daemon. · 5 unmodified lines | ||
| 358 | 358 | The available ioctl commands are: |
| 359 | 359 | |
| 360 | 360 | - **AUTOFS_IOC_READY**: a notification has been handled. The argument |
| 361 | − to the ioctl command is the "wait_queue_entry_token" number | |
| 361 | + to the ioctl command is the "wait_queue_token" number | |
| 362 | 362 | corresponding to the notification being acknowledged. |
| 363 | 363 | - **AUTOFS_IOC_FAIL**: similar to above, but indicates failure with |
| 364 | 364 | the error code `ENOENT`. |
| @@ -382,14 +382,14 @@ The available ioctl commands are: · 17 unmodified lines | ||
| 382 | 382 | struct autofs_packet_expire_multi { |
| 383 | 383 | int proto_version; /* Protocol version */ |
| 384 | 384 | int type; /* Type of packet */ |
| 385 | − autofs_wqt_t wait_queue_entry_token; | |
| 385 | + autofs_wqt_t wait_queue_token; | |
| 386 | 386 | int len; |
| 387 | 387 | char name[NAME_MAX+1]; |
| 388 | 388 | }; |
| 389 | 389 | |
| 390 | 390 | is required. This is filled in with the name of something |
| 391 | 391 | that can be unmounted or removed. If nothing can be expired, |
| 392 | − `errno` is set to `EAGAIN`. Even though a `wait_queue_entry_token` | |
| 392 | + `errno` is set to `EAGAIN`. Even though a `wait_queue_token` | |
| 393 | 393 | is present in the structure, no "wait queue" is established |
| 394 | 394 | and no acknowledgment is needed. |
| 395 | 395 | - **AUTOFS_IOC_EXPIRE_MULTI**: This is similar to |
| @@ -83,7 +83,7 @@ struct autofs_info { · 82 unmodified lines | ||
| 83 | 83 | struct autofs_wait_queue { |
| 84 | 84 | wait_queue_head_t queue; |
| 85 | 85 | struct autofs_wait_queue *next; |
| 86 | − autofs_wqt_t wait_queue_entry_token; | |
| 86 | + autofs_wqt_t wait_queue_token; | |
| 87 | 87 | /* We use the following to see what we are waiting for */ |
| 88 | 88 | struct qstr name; |
| 89 | 89 | u32 dev; |
| @@ -104,7 +104,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, · 103 unmodified lines | ||
| 104 | 104 | size_t pktsz; |
| 105 | 105 | |
| 106 | 106 | pr_debug("wait id = 0x%08lx, name = %.*s, type=%d\n", |
| 107 | − (unsigned long) wq->wait_queue_entry_token, | |
| 107 | + (unsigned long) wq->wait_queue_token, | |
| 108 | 108 | wq->name.len, wq->name.name, type); |
| 109 | 109 | |
| 110 | 110 | memset(&pkt, 0, sizeof(pkt)); /* For security reasons */ |
| @@ -120,7 +120,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, · 9 unmodified lines | ||
| 120 | 120 | |
| 121 | 121 | pktsz = sizeof(*mp); |
| 122 | 122 | |
| 123 | − mp->wait_queue_entry_token = wq->wait_queue_entry_token; | |
| 123 | + mp->wait_queue_token = wq->wait_queue_token; | |
| 124 | 124 | mp->len = wq->name.len; |
| 125 | 125 | memcpy(mp->name, wq->name.name, wq->name.len); |
| 126 | 126 | mp->name[wq->name.len] = '\0'; |
| @@ -133,7 +133,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, · 6 unmodified lines | ||
| 133 | 133 | |
| 134 | 134 | pktsz = sizeof(*ep); |
| 135 | 135 | |
| 136 | − ep->wait_queue_entry_token = wq->wait_queue_entry_token; | |
| 136 | + ep->wait_queue_token = wq->wait_queue_token; | |
| 137 | 137 | ep->len = wq->name.len; |
| 138 | 138 | memcpy(ep->name, wq->name.name, wq->name.len); |
| 139 | 139 | ep->name[wq->name.len] = '\0'; |
| @@ -153,7 +153,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, · 13 unmodified lines | ||
| 153 | 153 | |
| 154 | 154 | pktsz = sizeof(*packet); |
| 155 | 155 | |
| 156 | − packet->wait_queue_entry_token = wq->wait_queue_entry_token; | |
| 156 | + packet->wait_queue_token = wq->wait_queue_token; | |
| 157 | 157 | packet->len = wq->name.len; |
| 158 | 158 | memcpy(packet->name, wq->name.name, wq->name.len); |
| 159 | 159 | packet->name[wq->name.len] = '\0'; |
| @@ -428,7 +428,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, · 268 unmodified lines | ||
| 428 | 428 | return -ENOMEM; |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | − wq->wait_queue_entry_token = autofs4_next_wait_queue; | |
| 431 | + wq->wait_queue_token = autofs4_next_wait_queue; | |
| 432 | 432 | if (++autofs4_next_wait_queue == 0) |
| 433 | 433 | autofs4_next_wait_queue = 1; |
| 434 | 434 | wq->next = sbi->queues; |
| @@ -461,7 +461,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, · 26 unmodified lines | ||
| 461 | 461 | } |
| 462 | 462 | |
| 463 | 463 | pr_debug("new wait id = 0x%08lx, name = %.*s, nfy=%d\n", |
| 464 | − (unsigned long) wq->wait_queue_entry_token, wq->name.len, | |
| 464 | + (unsigned long) wq->wait_queue_token, wq->name.len, | |
| 465 | 465 | wq->name.name, notify); |
| 466 | 466 | |
| 467 | 467 | /* |
| @@ -471,7 +471,7 @@ int autofs4_wait(struct autofs_sb_info *sbi, · 3 unmodified lines | ||
| 471 | 471 | } else { |
| 472 | 472 | wq->wait_ctr++; |
| 473 | 473 | pr_debug("existing wait id = 0x%08lx, name = %.*s, nfy=%d\n", |
| 474 | − (unsigned long) wq->wait_queue_entry_token, wq->name.len, | |
| 474 | + (unsigned long) wq->wait_queue_token, wq->name.len, | |
| 475 | 475 | wq->name.name, notify); |
| 476 | 476 | mutex_unlock(&sbi->wq_mutex); |
| 477 | 477 | kfree(qstr.name); |
| @@ -550,13 +550,13 @@ int autofs4_wait(struct autofs_sb_info *sbi, · 72 unmodified lines | ||
| 550 | 550 | } |
| 551 | 551 | |
| 552 | 552 | |
| 553 | −int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_entry_token, int status) | |
| 553 | +int autofs4_wait_release(struct autofs_sb_info *sbi, autofs_wqt_t wait_queue_token, int status) | |
| 554 | 554 | { |
| 555 | 555 | struct autofs_wait_queue *wq, **wql; |
| 556 | 556 | |
| 557 | 557 | mutex_lock(&sbi->wq_mutex); |
| 558 | 558 | for (wql = &sbi->queues; (wq = *wql) != NULL; wql = &wq->next) { |
| 559 | − if (wq->wait_queue_entry_token == wait_queue_entry_token) | |
| 559 | + if (wq->wait_queue_token == wait_queue_token) | |
| 560 | 560 | break; |
| 561 | 561 | } |
| 562 | 562 | |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | #define AUTOFS_MIN_PROTO_VERSION AUTOFS_PROTO_VERSION |
| 27 | 27 | |
| 28 | 28 | /* |
| 29 | − * The wait_queue_entry_token (autofs_wqt_t) is part of a structure which is passed | |
| 29 | + * The wait_queue_token (autofs_wqt_t) is part of a structure which is passed | |
| 30 | 30 | * back to the kernel via ioctl from userspace. On architectures where 32- and |
| 31 | 31 | * 64-bit userspace binaries can be executed it's important that the size of |
| 32 | 32 | * autofs_wqt_t stays constant between 32- and 64-bit Linux kernels so that we |
| @@ -49,7 +49,7 @@ struct autofs_packet_hdr { · 16 unmodified lines | ||
| 49 | 49 | |
| 50 | 50 | struct autofs_packet_missing { |
| 51 | 51 | struct autofs_packet_hdr hdr; |
| 52 | − autofs_wqt_t wait_queue_entry_token; | |
| 52 | + autofs_wqt_t wait_queue_token; | |
| 53 | 53 | int len; |
| 54 | 54 | char name[NAME_MAX+1]; |
| 55 | 55 | }; |
| @@ -108,7 +108,7 @@ enum autofs_notify { · 107 unmodified lines | ||
| 108 | 108 | /* v4 multi expire (via pipe) */ |
| 109 | 109 | struct autofs_packet_expire_multi { |
| 110 | 110 | struct autofs_packet_hdr hdr; |
| 111 | − autofs_wqt_t wait_queue_entry_token; | |
| 111 | + autofs_wqt_t wait_queue_token; | |
| 112 | 112 | int len; |
| 113 | 113 | char name[NAME_MAX+1]; |
| 114 | 114 | }; |
| @@ -123,7 +123,7 @@ union autofs_packet_union { · 8 unmodified lines | ||
| 123 | 123 | /* autofs v5 common packet struct */ |
| 124 | 124 | struct autofs_v5_packet { |
| 125 | 125 | struct autofs_packet_hdr hdr; |
| 126 | − autofs_wqt_t wait_queue_entry_token; | |
| 126 | + autofs_wqt_t wait_queue_token; | |
| 127 | 127 | __u32 dev; |
| 128 | 128 | __u64 ino; |
| 129 | 129 | __u32 uid; |