[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YwTfPRDq04/DGTVT@casper.infradead.org>
Date: Tue, 23 Aug 2022 15:07:57 +0100
From: Matthew Wilcox <willy@...radead.org>
To: David Howells <dhowells@...hat.com>
Cc: sfrench@...ba.org, linux-cifs@...r.kernel.org, lsahlber@...hat.com,
jlayton@...nel.org, dchinner@...hat.com,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
samba-technical@...ts.samba.org
Subject: Re: [PATCH 3/5] smb3: fix temporary data corruption in collapse range
On Tue, Aug 23, 2022 at 02:07:41PM +0100, David Howells wrote:
>
> + filemap_invalidate_lock(inode->i_mapping);
> filemap_write_and_wait(inode->i_mapping);
> + truncate_pagecache_range(inode, off, old_eof);
It's a bit odd to writeback the entire file but then truncate only part
of it. XFS does the same part:
error = filemap_write_and_wait_range(inode->i_mapping, start, end);
if (error)
return error;
truncate_pagecache_range(inode, start, end);
... and presumably, you'd also want the error check?
> rc = smb2_copychunk_range(xid, cfile, cfile, off + len,
> - i_size_read(inode) - off - len, off);
> + old_eof - off - len, off);
Powered by blists - more mailing lists