From 0002c36666c9b043a330ee08533a87fe7fd16491 Mon Sep 17 00:00:00 2001 From: Mohit Agrawal Date: Mon, 26 Mar 2018 12:55:12 +0530 Subject: posix: reserve option behavior is not correct while using fallocate Problem: storage.reserve option is not working correctly while disk space is allocate throguh fallocate Solution: In posix_disk_space_check_thread_proc after every 5 sec interval it calls posix_disk_space_check to monitor disk space and set the flag in posix priv.In 5 sec timestamp user can create big file with fallocate that can reach posix reserve limit and no error is shown on terminal even limit has reached. To resolve the same call posix_disk_space for every fallocate fop instead to call by a thread after 5 second BUG: 1560411 Signed-off-by: Mohit Agrawal Change-Id: I39ba9390e2e6d084eedbf3bcf45cd6d708591577 --- xlators/storage/posix/src/posix-inode-fd-ops.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'xlators/storage/posix/src/posix-inode-fd-ops.c') diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index 62f2c2aa1ee..ff82eb19f2d 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -602,6 +602,15 @@ posix_do_fallocate (call_frame_t *frame, xlator_t *this, fd_t *fd, VALIDATE_OR_GOTO (fd, out); priv = this->private; + + /* fallocate case is special so call posix_disk_space_check separately + for every fallocate fop instead of calling posix_disk_space with + thread after every 5 sec sleep to working correctly storage.reserve + option behaviour + */ + if (priv->disk_reserve) + posix_disk_space_check (this); + DISK_SPACE_CHECK_AND_GOTO (frame, priv, xdata, ret, ret, out); ret = posix_fd_ctx_get (fd, this, &pfd, &op_errno); -- cgit