lkml.org 
[lkml]   [2019]   [Aug]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 3/2] fstests: check that we can't write to swap files
On Thu, Aug 15, 2019 at 02:26:03PM -0700, Andrew Morton wrote:
> On Thu, 15 Aug 2019 09:34:34 -0700 "Darrick J. Wong" <darrick.wong@oracle.com> wrote:
>
> > While active, the media backing a swap file is leased to the kernel.
> > Userspace has no business writing to it. Make sure we can't do this.
>
> I don't think this tests the case where a file was already open for
> writing and someone does swapon(that file)?
>
> And then does swapoff(that file), when writes should start working again?
>
> Ditto all the above, with s/open/mmap/.

Heh, ok. I'll start working on a C program to do that.

> Do we handle (and test!) the case where there's unwritten dirty
> pagecache at the time of swapon()? Ditto pte-dirty MAP_SHARED pages?

One of the tests I wrote for iomap_swapfile_activate way back when
checks that. The iomap version calls vfs_fsync, but AFAICT
generic_swapfile_activate doesn't do that.

--D

\
 
 \ /
  Last update: 2019-08-16 04:14    [W:0.107 / U:0.096 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site