diff options
-rw-r--r-- | fs/autofs4/waitq.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/fs/autofs4/waitq.c b/fs/autofs4/waitq.c index 1132cc2a0310..dd2914d7ad7f 100644 --- a/fs/autofs4/waitq.c +++ b/fs/autofs4/waitq.c | |||
@@ -99,6 +99,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, | |||
99 | union autofs_packet_union v4_pkt; | 99 | union autofs_packet_union v4_pkt; |
100 | union autofs_v5_packet_union v5_pkt; | 100 | union autofs_v5_packet_union v5_pkt; |
101 | } pkt; | 101 | } pkt; |
102 | struct file *pipe = NULL; | ||
102 | size_t pktsz; | 103 | size_t pktsz; |
103 | 104 | ||
104 | DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d", | 105 | DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d", |
@@ -164,8 +165,19 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, | |||
164 | return; | 165 | return; |
165 | } | 166 | } |
166 | 167 | ||
167 | if (autofs4_write(sbi->pipe, &pkt, pktsz)) | 168 | /* Check if we have become catatonic */ |
168 | autofs4_catatonic_mode(sbi); | 169 | mutex_lock(&sbi->wq_mutex); |
170 | if (!sbi->catatonic) { | ||
171 | pipe = sbi->pipe; | ||
172 | get_file(pipe); | ||
173 | } | ||
174 | mutex_unlock(&sbi->wq_mutex); | ||
175 | |||
176 | if (pipe) { | ||
177 | if (autofs4_write(pipe, &pkt, pktsz)) | ||
178 | autofs4_catatonic_mode(sbi); | ||
179 | fput(pipe); | ||
180 | } | ||
169 | } | 181 | } |
170 | 182 | ||
171 | static int autofs4_getpath(struct autofs_sb_info *sbi, | 183 | static int autofs4_getpath(struct autofs_sb_info *sbi, |