Re: [PATCH 2/2] vfs: don't allow writes to swap files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux