[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190816064858.GG15186@magnolia>
Date: Thu, 15 Aug 2019 23:48:58 -0700
From: "Darrick J. Wong" <darrick.wong@...cle.com>
To: Christoph Hellwig <hch@...radead.org>
Cc: akpm@...ux-foundation.org, tytso@....edu, viro@...iv.linux.org.uk,
linux-xfs@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-mm@...ck.org
Subject: Re: [PATCH 2/2] vfs: don't allow writes to swap files
On Thu, Aug 15, 2019 at 11:41:21PM -0700, Christoph Hellwig wrote:
> The new checks look fine to me, but where does the inode_drain_writes()
> function come from, I can't find that in my tree anywhere.
Doh. Forgot to include that patch in the series. :(
/*
* Flush file data before changing attributes. Caller must hold any locks
* required to prevent further writes to this file until we're done setting
* flags.
*/
static inline int inode_drain_writes(struct inode *inode)
{
inode_dio_wait(inode);
return filemap_write_and_wait(inode->i_mapping);
}
> Also what does inode_drain_writes do about existing shared writable
> mapping? Do we even care about that corner case?
We probably ought to flush and invalidate the pagecache for the entire
file so that page_mkwrite can bounce off the swapfile.
--D
Powered by blists - more mailing lists