Control: tag -1 patch moreinfo On Thu, 21 Jan 2016 15:08:17 +0000 Akihiro Suda <suda.kyoto@gmail.com> wrote: > Source: linux-image-3.16.0-4 Please use 'reportbug kernel' to report any future kernel bugs, as that will select the correct package name automatically. > Version: 3.16.7-ckt20 > Severity: important > > Dear Maintainer, > > AUFS can hang up (more precisely, produces unkillable processes) with kernel 3.16.7-ckt20 due to commit 296291cdd1629c308114504b850dc343eabc278 appeared in ckt20. > http://kernel.ubuntu.com/git/ubuntu/linux.git/tag/?h=linux-3.16.y&id=v3.16.7-ckt20 > http://kernel.ubuntu.com/git/ubuntu/linux.git/commit/?h=linux-3.16.y&id=475a23000dd8d2f264bab9d6eb71a2a6b9d4de72 > > Many docker users have been experiencing this issue: https://github.com/docker/docker/issues/18180 > > The issue has been fixed since AUFS v20160111: http://permalink.gmane.org/gmane.linux.file-systems.aufs.user/5345 > So I suggest updating AUFS to v20160111 or later. We can't do that because it is no longer supported on Linux 3.x (and not all the changes would be suitable for a stable update, anyway). > Although I didn't test for 3.16.7, I think merging this commit is enough: https://github.com/sfjro/aufs4-linux/commit/f60d586b7b8cae42bacc603d192810db85278d3c That and the previous commit appear to be sufficient, though they needed some minor changes. Please can you test whether the attached patches work, following the procedure at <https://kernel-handbook.alioth.debian.org/ch-common-tasks.html#s-common-official>. Ben. -- Ben Hutchings Q. Which is the greater problem in the world today, ignorance or apathy? A. I don't know and I couldn't care less.
From: "J. R. Okajima" <hooanon05g@gmail.com>
Date: Mon, 4 Jan 2016 23:31:56 +0900
Subject: aufs: tiny, extract a new func xino_fwrite_wkq()
Origin: https://github.com/sfjro/aufs4-standalone/commit/44c72b4050c2563cc6053b91c47885e0409943a5
Bug-Debian: https://bugs.debian.org/812207
Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
[bwh: Backported to aufs3.16:
- s/vfs_writef_t/au_writef_t/
- Adjust context]
---
fs/aufs/xino.c | 47 +++++++++++++++++++++++++++--------------------
1 file changed, 27 insertions(+), 20 deletions(-)
diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c
index 44bbede..cde6ce7 100644
--- a/fs/aufs/xino.c
+++ b/fs/aufs/xino.c
@@ -95,35 +95,42 @@ static void call_do_xino_fwrite(void *args)
*a->errp = do_xino_fwrite(a->func, a->file, a->buf, a->size, a->pos);
}
+static ssize_t xino_fwrite_wkq(au_writef_t func, struct file *file, void *buf,
+ size_t size, loff_t *pos)
+{
+ ssize_t err;
+ int wkq_err;
+ struct do_xino_fwrite_args args = {
+ .errp = &err,
+ .func = func,
+ .file = file,
+ .buf = buf,
+ .size = size,
+ .pos = pos
+ };
+
+ /*
+ * it breaks RLIMIT_FSIZE and normal user's limit,
+ * users should care about quota and real 'filesystem full.'
+ */
+ wkq_err = au_wkq_wait(call_do_xino_fwrite, &args);
+ if (unlikely(wkq_err))
+ err = wkq_err;
+
+ return err;
+}
+
ssize_t xino_fwrite(au_writef_t func, struct file *file, void *buf, size_t size,
loff_t *pos)
{
ssize_t err;
- /* todo: signal block and no wkq? */
if (rlimit(RLIMIT_FSIZE) == RLIM_INFINITY) {
lockdep_off();
err = do_xino_fwrite(func, file, buf, size, pos);
lockdep_on();
- } else {
- /*
- * it breaks RLIMIT_FSIZE and normal user's limit,
- * users should care about quota and real 'filesystem full.'
- */
- int wkq_err;
- struct do_xino_fwrite_args args = {
- .errp = &err,
- .func = func,
- .file = file,
- .buf = buf,
- .size = size,
- .pos = pos
- };
-
- wkq_err = au_wkq_wait(call_do_xino_fwrite, &args);
- if (unlikely(wkq_err))
- err = wkq_err;
- }
+ } else
+ err = xino_fwrite_wkq(func, file, buf, size, pos);
return err;
}
From: "J. R. Okajima" <hooanon05g@gmail.com>
Date: Mon, 4 Jan 2016 23:33:09 +0900
Subject: aufs: for 4.3, XINO handles EINTR from the dying process
Origin: https://github.com/sfjro/aufs4-standalone/commit/5e439ff30c92143d9a9ee3401a84e34c9852533b
Bug-Debian: https://bugs.debian.org/812207
By the commit
296291c 2015-10-23 mm: make sendfile(2) killable
new_sync_write() (or ->write()) may return EINTR ealier even if it can
succeed the operation. It causes an endless loop in aufs
do_xino_fwrite().
Here is a dirty workaround to retry do_xino_fwrite() in another context
(workqueue).
Reported-by: Akihiro Suda <suda.kyoto@gmail.com>
Tested-by: Akihiro Suda <suda.kyoto@gmail.com>
See-also: http://www.mail-archive.com/aufs-users@lists.sourceforge.net/msg05231.html
Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
[bwh: Backported to aufs3.16: s/vfs_writef_t/au_writef_t/]
---
fs/aufs/xino.c | 19 +++++++++++++++++--
1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/fs/aufs/xino.c b/fs/aufs/xino.c
index cde6ce7..e3cab07 100644
--- a/fs/aufs/xino.c
+++ b/fs/aufs/xino.c
@@ -53,6 +53,9 @@ ssize_t xino_fread(vfs_readf_t func, struct file *file, void *kbuf, size_t size,
/* ---------------------------------------------------------------------- */
+static ssize_t xino_fwrite_wkq(au_writef_t func, struct file *file, void *buf,
+ size_t size, loff_t *pos);
+
static ssize_t do_xino_fwrite(au_writef_t func, struct file *file, void *kbuf,
size_t size, loff_t *pos)
{
@@ -62,14 +65,26 @@ static ssize_t do_xino_fwrite(vfs_writef_t func, struct file *file, void *kbuf,
void *k;
const char __user *u;
} buf;
+ int i;
+ const int prevent_endless = 10;
+ i = 0;
buf.k = kbuf;
oldfs = get_fs();
set_fs(KERNEL_DS);
do {
- /* todo: signal_pending? */
err = func(file, buf.u, size, pos);
- } while (err == -EAGAIN || err == -EINTR);
+ if (err == -EINTR
+ && !au_wkq_test()
+ && fatal_signal_pending(current)) {
+ set_fs(oldfs);
+ err = xino_fwrite_wkq(func, file, kbuf, size, pos);
+ BUG_ON(err == -EINTR);
+ oldfs = get_fs();
+ set_fs(KERNEL_DS);
+ }
+ } while (i++ < prevent_endless
+ && (err == -EAGAIN || err == -EINTR));
set_fs(oldfs);
#if 0 /* reserved for future use */
Attachment:
signature.asc
Description: This is a digitally signed message part