[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b8f7dd35-7702-4c70-be4f-0704abc1976d@bsbernd.com>
Date: Fri, 9 Jan 2026 15:05:36 +0100
From: Bernd Schubert <bernd@...ernd.com>
To: Jingbo Xu <jefflexu@...ux.alibaba.com>, miklos@...redi.hu,
linux-fsdevel@...r.kernel.org, bschubert@....com
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] fuse: invalidate the page cache after direct write
On 1/9/26 08:01, Jingbo Xu wrote:
> - return err ?: ia->write.out.size;
> + /*
> + * As in generic_file_direct_write(), invalidate after the write, to
> + * invalidate read-ahead cache that may have competed with the write.
> + * Without FOPEN_DIRECT_IO, generic_file_direct_write() does the
> + * invalidation for synchronous write.
> + */
> + if (!err && written && mapping->nrpages &&
> + ((ff->open_flags & FOPEN_DIRECT_IO) || !ia->io->blocking)) {
> + invalidate_inode_pages2_range(mapping, pos >> PAGE_SHIFT,
> + (pos + written - 1) >> PAGE_SHIFT);
> + }
> +
> + return err ?: written;
> }
Sorry, but I'm confused about "|| !ia->io->blocking". When we go into this
code path it either via generic_file_direct_write(), which then
already invalidates or directly and then
(ff->open_flags & FOPEN_DIRECT_IO) is set?
Thanks,
Bernd
Powered by blists - more mailing lists