hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/fs/autofs/waitq.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Copyright 1997-1998 Transmeta Corporation -- All Rights Reserved
34 * Copyright 2001-2006 Ian Kent <raven@themaw.net>
4
- *
5
- * This file is part of the Linux kernel and is made available under
6
- * the terms of the GNU General Public License, version 2, or at your
7
- * option, any later version, incorporated herein by reference.
85 */
96
107 #include <linux/sched/signal.h>
....@@ -20,14 +17,14 @@
2017 struct autofs_wait_queue *wq, *nwq;
2118
2219 mutex_lock(&sbi->wq_mutex);
23
- if (sbi->catatonic) {
20
+ if (sbi->flags & AUTOFS_SBI_CATATONIC) {
2421 mutex_unlock(&sbi->wq_mutex);
2522 return;
2623 }
2724
2825 pr_debug("entering catatonic mode\n");
2926
30
- sbi->catatonic = 1;
27
+ sbi->flags |= AUTOFS_SBI_CATATONIC;
3128 wq = sbi->queues;
3229 sbi->queues = NULL; /* Erase all wait queues */
3330 while (wq) {
....@@ -56,7 +53,7 @@
5653
5754 mutex_lock(&sbi->pipe_mutex);
5855 while (bytes) {
59
- wr = __kernel_write(file, data, bytes, &file->f_pos);
56
+ wr = __kernel_write(file, data, bytes, NULL);
6057 if (wr <= 0)
6158 break;
6259 data += wr;
....@@ -255,7 +252,7 @@
255252 struct autofs_wait_queue *wq;
256253 struct autofs_info *ino;
257254
258
- if (sbi->catatonic)
255
+ if (sbi->flags & AUTOFS_SBI_CATATONIC)
259256 return -ENOENT;
260257
261258 /* Wait in progress, continue; */
....@@ -290,7 +287,7 @@
290287 if (mutex_lock_interruptible(&sbi->wq_mutex))
291288 return -EINTR;
292289
293
- if (sbi->catatonic)
290
+ if (sbi->flags & AUTOFS_SBI_CATATONIC)
294291 return -ENOENT;
295292
296293 wq = autofs_find_wait(sbi, qstr);
....@@ -359,7 +356,7 @@
359356 pid_t tgid;
360357
361358 /* In catatonic mode, we don't wait for nobody */
362
- if (sbi->catatonic)
359
+ if (sbi->flags & AUTOFS_SBI_CATATONIC)
363360 return -ENOENT;
364361
365362 /*