From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423863AbcFMTqg (ORCPT ); Mon, 13 Jun 2016 15:46:36 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:35372 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423235AbcFMTqd (ORCPT ); Mon, 13 Jun 2016 15:46:33 -0400 From: Topi Miettinen To: linux-kernel@vger.kernel.org Cc: Topi Miettinen , Alexander Viro , Andrew Morton , Jan Kara , Johannes Weiner , Michal Hocko , Ross Zwisler , "Kirill A. Shutemov" , Mel Gorman , Junichi Nomura , Matthew Wilcox , linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure)), linux-mm@kvack.org (open list:MEMORY MANAGEMENT) Subject: [RFC 07/18] limits: track RLIMIT_FSIZE actual max Date: Mon, 13 Jun 2016 22:44:14 +0300 Message-Id: <1465847065-3577-8-git-send-email-toiwoton@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> References: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Track maximum file size, presented in /proc/self/limits. Signed-off-by: Topi Miettinen --- fs/attr.c | 2 ++ mm/filemap.c | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/attr.c b/fs/attr.c index 25b24d0..1b620f7 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -116,6 +116,8 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset) return -ETXTBSY; } + bump_rlimit(RLIMIT_FSIZE, offset); + return 0; out_sig: send_sig(SIGXFSZ, current, 0); diff --git a/mm/filemap.c b/mm/filemap.c index 00ae878..1fa9864 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2447,6 +2447,7 @@ inline ssize_t generic_write_checks(struct kiocb *iocb, struct iov_iter *from) send_sig(SIGXFSZ, current, 0); return -EFBIG; } + bump_rlimit(RLIMIT_FSIZE, iocb->ki_pos); iov_iter_truncate(from, limit - (unsigned long)pos); } -- 2.8.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Topi Miettinen To: linux-kernel@vger.kernel.org Cc: Topi Miettinen , Alexander Viro , Andrew Morton , Jan Kara , Johannes Weiner , Michal Hocko , Ross Zwisler , "Kirill A. Shutemov" , Mel Gorman , Junichi Nomura , Matthew Wilcox , linux-fsdevel@vger.kernel.org (open list:FILESYSTEMS (VFS and infrastructure)), linux-mm@kvack.org (open list:MEMORY MANAGEMENT) Subject: [RFC 07/18] limits: track RLIMIT_FSIZE actual max Date: Mon, 13 Jun 2016 22:44:14 +0300 Message-Id: <1465847065-3577-8-git-send-email-toiwoton@gmail.com> In-Reply-To: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> References: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: Track maximum file size, presented in /proc/self/limits. Signed-off-by: Topi Miettinen --- fs/attr.c | 2 ++ mm/filemap.c | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/attr.c b/fs/attr.c index 25b24d0..1b620f7 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -116,6 +116,8 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset) return -ETXTBSY; } + bump_rlimit(RLIMIT_FSIZE, offset); + return 0; out_sig: send_sig(SIGXFSZ, current, 0); diff --git a/mm/filemap.c b/mm/filemap.c index 00ae878..1fa9864 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2447,6 +2447,7 @@ inline ssize_t generic_write_checks(struct kiocb *iocb, struct iov_iter *from) send_sig(SIGXFSZ, current, 0); return -EFBIG; } + bump_rlimit(RLIMIT_FSIZE, iocb->ki_pos); iov_iter_truncate(from, limit - (unsigned long)pos); } -- 2.8.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f69.google.com (mail-wm0-f69.google.com [74.125.82.69]) by kanga.kvack.org (Postfix) with ESMTP id 8D5326B0273 for ; Mon, 13 Jun 2016 15:46:34 -0400 (EDT) Received: by mail-wm0-f69.google.com with SMTP id 4so34044392wmz.1 for ; Mon, 13 Jun 2016 12:46:34 -0700 (PDT) Received: from mail-wm0-x244.google.com (mail-wm0-x244.google.com. [2a00:1450:400c:c09::244]) by mx.google.com with ESMTPS id gy3si30992652wjb.244.2016.06.13.12.46.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jun 2016 12:46:32 -0700 (PDT) Received: by mail-wm0-x244.google.com with SMTP id n184so17318483wmn.1 for ; Mon, 13 Jun 2016 12:46:32 -0700 (PDT) From: Topi Miettinen Subject: [RFC 07/18] limits: track RLIMIT_FSIZE actual max Date: Mon, 13 Jun 2016 22:44:14 +0300 Message-Id: <1465847065-3577-8-git-send-email-toiwoton@gmail.com> In-Reply-To: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> References: <1465847065-3577-1-git-send-email-toiwoton@gmail.com> Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org Cc: Topi Miettinen , Alexander Viro , Andrew Morton , Jan Kara , Johannes Weiner , Michal Hocko , Ross Zwisler , "Kirill A. Shutemov" , Mel Gorman , Junichi Nomura , Matthew Wilcox , "open list:FILESYSTEMS VFS and infrastructure" , "open list:MEMORY MANAGEMENT" Track maximum file size, presented in /proc/self/limits. Signed-off-by: Topi Miettinen --- fs/attr.c | 2 ++ mm/filemap.c | 1 + 2 files changed, 3 insertions(+) diff --git a/fs/attr.c b/fs/attr.c index 25b24d0..1b620f7 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -116,6 +116,8 @@ int inode_newsize_ok(const struct inode *inode, loff_t offset) return -ETXTBSY; } + bump_rlimit(RLIMIT_FSIZE, offset); + return 0; out_sig: send_sig(SIGXFSZ, current, 0); diff --git a/mm/filemap.c b/mm/filemap.c index 00ae878..1fa9864 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2447,6 +2447,7 @@ inline ssize_t generic_write_checks(struct kiocb *iocb, struct iov_iter *from) send_sig(SIGXFSZ, current, 0); return -EFBIG; } + bump_rlimit(RLIMIT_FSIZE, iocb->ki_pos); iov_iter_truncate(from, limit - (unsigned long)pos); } -- 2.8.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org