Patch "autofs: don't fail mount for transient error" has been added to the 4.4-stable tree
This is a note to let you know that I've just added the patch titled
autofs: don't fail mount for transient error
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
autofs-don-t-fail-mount-for-transient-error.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.
Quoted 1 line
From
ecc0c469f27765ed1e2b967be0aa17cee1a60b76Mon Sep 17 00:00:00 2001
From: NeilBrown <[email protected]>
Date: Fri, 17 Nov 2017 15:29:13 -0800
Subject: autofs: don't fail mount for transient error
From: NeilBrown <[email protected]>
commit ecc0c469f27765ed1e2b967be0aa17cee1a60b76 upstream.
Currently if the autofs kernel module gets an error when writing to the pipe which links to the daemon, then it marks the whole moutpoint as catatonic, and it will stop working.
It is possible that the error is transient. This can happen if the daemon is slow and more than 16 requests queue up. If a subsequent process tries to queue a request, and is then signalled, the write to the pipe will return -ERESTARTSYS and autofs will take that as total failure.
So change the code to assess -ERESTARTSYS and -ENOMEM as transient failures which only abort the current request, not the whole mountpoint.
It isn't a crash or a data corruption, but having autofs mountpoints suddenly stop working is rather inconvenient.
Ian said:
: And given the problems with a half dozen (or so) user space applications : consuming large amounts of CPU under heavy mount and umount activity this : could happen more easily than we expect.
--- fs/autofs4/waitq.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
fs/autofs4/waitq.c +14 -1
@@ -87,7 +87,8 @@ static int autofs4_write(struct autofs_sspin_unlock_irqrestore (¤t->sighand->siglock, flags); } -return (bytes >0 ); +/* if 'wr' returned 0 (impossible) we assume -EIO (safe) */ +return bytes ==0 ?0 : wr <0 ? wr : -EIO ; } static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
@@ -101,6 +102,7 @@ static void autofs4_notify_daemon(struct } pkt;struct file *pipe =NULL ;size_t pktsz; +int ret;DPRINTK ("wait id = 0x%08lx, name = %.*s, type=%d" , (unsigned long ) wq->wait_queue_token, wq->name.len, wq->name.name, type);
@@ -173,7 +175,18 @@ static void autofs4_notify_daemon(structmutex_unlock (&sbi->wq_mutex);if (autofs4_write (sbi, pipe, &pkt, pktsz)) +switch (ret =autofs4_write (sbi, pipe, &pkt, pktsz)) { +case 0 : +break ; +case -ENOMEM : +case -ERESTARTSYS : +/* Just fail this one */ +autofs4_wait_release (sbi, wq->wait_queue_token, ret); +break ; +default :autofs4_catatonic_mode (sbi); +break ; + }fput (pipe); }
Patches currently in stable-queue which might be from [email protected] are
queue-4.4/autofs-don-t-fail-mount-for-transient-error.patch