From 0838891015f9211394ea97ca78aa1029996429b6 Mon Sep 17 00:00:00 2001 From: Ian Kent Date: Wed, 23 Jul 2008 21:30:20 -0700 Subject: [PATCH] --- yaml --- r: 105465 b: refs/heads/master c: e64be33ccaceaca67c84237dff8805b861398eab h: refs/heads/master i: 105463: 760684a6ee190f678fcd9d4e524221abbb833215 v: v3 --- [refs] | 2 +- trunk/fs/autofs4/waitq.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 21cad2498d6f..b02d48f8882e 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f4c7da02615bebcaf89f15a8d055922f515160b8 +refs/heads/master: e64be33ccaceaca67c84237dff8805b861398eab diff --git a/trunk/fs/autofs4/waitq.c b/trunk/fs/autofs4/waitq.c index 1132cc2a0310..dd2914d7ad7f 100644 --- a/trunk/fs/autofs4/waitq.c +++ b/trunk/fs/autofs4/waitq.c @@ -99,6 +99,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, union autofs_packet_union v4_pkt; union autofs_v5_packet_union v5_pkt; } pkt; + struct file *pipe = NULL; size_t pktsz; DPRINTK("wait id = 0x%08lx, name = %.*s, type=%d", @@ -164,8 +165,19 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi, return; } - if (autofs4_write(sbi->pipe, &pkt, pktsz)) - autofs4_catatonic_mode(sbi); + /* Check if we have become catatonic */ + mutex_lock(&sbi->wq_mutex); + if (!sbi->catatonic) { + pipe = sbi->pipe; + get_file(pipe); + } + mutex_unlock(&sbi->wq_mutex); + + if (pipe) { + if (autofs4_write(pipe, &pkt, pktsz)) + autofs4_catatonic_mode(sbi); + fput(pipe); + } } static int autofs4_getpath(struct autofs_sb_info *sbi,