[Devel,RHEL7,COMMIT] fuse: ratelimint dio complains

Submitted by Konstantin Khorenko on Dec. 15, 2016, 11:54 a.m.

Details

Message ID 201612151154.uBFBsu7E008277@finist_cl7.x64_64.work.ct
State New
Series "fuse: ratelimint dio complains"
Headers show

Commit Message

Konstantin Khorenko Dec. 15, 2016, 11:54 a.m.
The commit is pushed to "branch-rh7-3.10.0-327.36.1.vz7.20.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-327.36.1.vz7.20.15
------>
commit 5a34794839077b82390ce33e88925bc7f52b0f93
Author: Maxim Patlasov <mpatlasov@virtuozzo.com>
Date:   Thu Dec 15 15:54:56 2016 +0400

    fuse: ratelimint dio complains
    
    When userspace fuse daemon dies, from kernel pov, fuse_conn is not connected
    anymore. But users may continue to issue read/write syscalls to fuse mount.
    We fail them with -ENOTCONN, complaining to logs about it -- nothing wrong.
    But we have to rate-limit those printks. Otherwise the node can catch
    hard lockup because of too many output to console.
    
    https://jira.sw.ru/browse/PSBM-55782
    
    Signed-off-by: Maxim Patlasov <mpatlasov@virtuozzo.com>
    Acked-by: Kirill Tkhai <ktkhai@virtuozzo.com>
---
 fs/fuse/file.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index a14c929..501aa27 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -846,7 +846,7 @@  static void fuse_aio_complete(struct fuse_io_priv *io, int err, ssize_t pos)
 			}
 		}
 
-		if (res < 0)
+		if (res < 0 && printk_ratelimit())
 			printk("fuse_aio_complete(io=%p, err=%d, pos=%ld"
 			       "): io->err=%d io->bytes=%ld io->size=%ld "
 			       "is_sync=%d res=%ld ki_opcode=%d ki_pos=%llu\n",
@@ -3365,7 +3365,7 @@  fuse_direct_IO(int rw, struct kiocb *iocb, const struct iovec *iov,
 		ret = __fuse_direct_read(io, iov, nr_segs, &pos, count);
 
 	if (io->async) {
-		if (ret != count) {
+		if (ret != count && printk_ratelimit()) {
 			struct fuse_file *ff = file->private_data;
 			printk("fuse_direct_IO: failed to %s %ld bytes "
 			       "(offset=%llu ret=%ld i_size=%llu ino=%lu "