From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Tue, 13 Mar 2018 00:14:40 -0700 From: Christoph Hellwig To: Dave Chinner Cc: Christoph Hellwig , "Darrick J. Wong" , "Besogonov, Aleksei" , "linux-fsdevel@vger.kernel.org" , "linux-mm@kvack.org" , xfs Subject: Re: fallocate on XFS for swap Message-ID: <20180313071440.GA23797@infradead.org> References: <8C28C1CB-47F1-48D1-85C9-5373D29EA13E@amazon.com> <20180309234422.GA4860@magnolia> <20180310005850.GW18129@dastard> <20180310093844.GA23306@infradead.org> <20180312214626.GZ18129@dastard> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180312214626.GZ18129@dastard> Sender: owner-linux-mm@kvack.org List-ID: On Tue, Mar 13, 2018 at 08:46:26AM +1100, Dave Chinner wrote: > > So maybe we want a layout based swap code instead of reinventing it, > > with the slight twist to the layout break code to never try a lease > > break and just return an error for the IS_SWAPFILE case. > > Hmmm - won't that change user visible behaviour on swapfiles? Not > that it would be a bad thing to reject read/write from root on swap > files, but it would make XFS different to everything else. We already can't writew to active swap files, thank god: root@testvm:~# dd if=/dev/zero of=swapfile bs=1M count=64 64+0 records in 64+0 records out 67108864 bytes (67 MB, 64 MiB) copied, 0.0458446 s, 1.5 GB/s mkswap swapfile mkswap: swapfile: insecure permissions 0644, 0600 suggested. Setting up swapspace version 1, size = 64 MiB (67104768 bytes) no label, UUID=bb42b883-f224-4627-8580-c1ba9f4569ab root@testvm:~# swapon swapfile swapon: /root/swapfile: insecure permissions 0644, 0600 suggested. [ 54.165439] Adding 65532k swap on /root/swapfile. Priority:-2 extents:1 across:65532k root@testvm:~# dd if=/dev/zero of=swapfile bs=1M count=64 dd: failed to open 'swapfile': Text file busy > > Speaking of which - we probably need to spend some time at LSFMM in > the fs track talking about the iomap infrastructure and long term > plans to migrate the major filesystems to it.... I won't be there, as I'll be busy working the local election ballot.