linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Alexander Viro <viro@zeniv.linux.org.uk>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>
Cc: Stefan Roesch <shr@fb.com>
Subject: [PATCH] fs: allow inode time modification with IOCB_NOWAIT
Date: Fri, 1 Jul 2022 14:09:32 -0600	[thread overview]
Message-ID: <39f8b446-dce3-373f-eb86-e3333b31122c@kernel.dk> (raw)

generic/471 complains because it expects any write done with RWF_NOWAIT
to succeed as long as the blocks for the write are already instantiated.
This isn't necessarily a correct assumption, as there are other conditions
that can cause an RWF_NOWAIT write to fail with -EAGAIN even if the range
is already there.

Since the risk of blocking off this path is minor, just allow inode
time updates with IOCB_NOWAIT set. Then we can later decide if we should
catch this further down the stack.

Fixes: 4faa13bd5d3b ("fs: Add async write file modification handling.")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
---
 fs/inode.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/fs/inode.c b/fs/inode.c
index 259ebf438893..98a48fbfa0ad 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -2150,8 +2150,6 @@ static int file_modified_flags(struct file *file, int flags)
 	ret = inode_needs_update_time(inode, &now);
 	if (ret <= 0)
 		return ret;
-	if (flags & IOCB_NOWAIT)
-		return -EAGAIN;
 
 	return __file_update_time(file, &now, ret);
 }
-- 
2.35.1

-- 
Jens Axboe


             reply	other threads:[~2022-07-01 20:09 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-01 20:09 Jens Axboe [this message]
2022-07-02  6:05 ` [PATCH] fs: allow inode time modification with IOCB_NOWAIT Christoph Hellwig
2022-07-02 15:45   ` Jens Axboe
2022-07-03  0:06     ` Dave Chinner
2022-07-03 12:45       ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=39f8b446-dce3-373f-eb86-e3333b31122c@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=shr@fb.com \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).