linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fuse: honor RLIMIT_FSIZE in fuse_file_fallocate
@ 2019-04-17 20:04 Liu Bo
  2019-04-18 11:17 ` Miklos Szeredi
  0 siblings, 1 reply; 2+ messages in thread
From: Liu Bo @ 2019-04-17 20:04 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: Miklos Szeredi

fstests generic/228 reported this failure that fuse fallocate does not
honor what 'ulimit -f' has set.

This adds the necessary inode_newsize_ok() check.

Signed-off-by: Liu Bo <bo.liu@linux.alibaba.com>
---
 fs/fuse/file.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 44e76b00e985..7c9bfeff0dd2 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -3051,6 +3051,13 @@ static long fuse_file_fallocate(struct file *file, int mode, loff_t offset,
 		}
 	}
 
+	if (!(mode & FALLOC_FL_KEEP_SIZE) &&
+	    offset + length > i_size_read(inode)) {
+		err = inode_newsize_ok(inode, offset + length);
+		if (err)
+			return err;
+	}
+
 	if (!(mode & FALLOC_FL_KEEP_SIZE))
 		set_bit(FUSE_I_SIZE_UNSTABLE, &fi->state);
 
-- 
2.20.1.2.gb21ebb6


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fuse: honor RLIMIT_FSIZE in fuse_file_fallocate
  2019-04-17 20:04 [PATCH] Fuse: honor RLIMIT_FSIZE in fuse_file_fallocate Liu Bo
@ 2019-04-18 11:17 ` Miklos Szeredi
  0 siblings, 0 replies; 2+ messages in thread
From: Miklos Szeredi @ 2019-04-18 11:17 UTC (permalink / raw)
  To: Liu Bo; +Cc: linux-fsdevel, Miklos Szeredi

On Wed, Apr 17, 2019 at 10:04 PM Liu Bo <bo.liu@linux.alibaba.com> wrote:
>
> fstests generic/228 reported this failure that fuse fallocate does not
> honor what 'ulimit -f' has set.
>
> This adds the necessary inode_newsize_ok() check.

Applied, thanks.

Miklos

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-04-18 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-17 20:04 [PATCH] Fuse: honor RLIMIT_FSIZE in fuse_file_fallocate Liu Bo
2019-04-18 11:17 ` Miklos Szeredi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).