[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170811233323.GU21024@dastard>
Date: Sat, 12 Aug 2017 09:33:24 +1000
From: Dave Chinner <david@...morbit.com>
To: Dan Williams <dan.j.williams@...el.com>
Cc: darrick.wong@...cle.com, linux-nvdimm@...ts.01.org,
linux-api@...r.kernel.org,
Trond Myklebust <trond.myklebust@...marydata.com>,
linux-kernel@...r.kernel.org, linux-xfs@...r.kernel.org,
linux-mm@...ck.org, luto@...nel.org, linux-fsdevel@...r.kernel.org,
Andrew Morton <akpm@...ux-foundation.org>,
Anna Schumaker <anna.schumaker@...app.com>
Subject: Re: [PATCH v3 6/6] mm, xfs: protect swapfile contents with immutable
+ unwritten extents
On Thu, Aug 10, 2017 at 11:39:49PM -0700, Dan Williams wrote:
> ifp = XFS_IFORK_PTR(ip, whichfork);
> diff --git a/fs/xfs/libxfs/xfs_bmap.h b/fs/xfs/libxfs/xfs_bmap.h
> index 851982a5dfbc..a0f099289520 100644
> --- a/fs/xfs/libxfs/xfs_bmap.h
> +++ b/fs/xfs/libxfs/xfs_bmap.h
> @@ -113,6 +113,15 @@ struct xfs_extent_free_item
> /* Only convert delalloc space, don't allocate entirely new extents */
> #define XFS_BMAPI_DELALLOC 0x400
>
> +/*
> + * Permit extent manipulations even if S_IOMAP_IMMUTABLE is set on the
> + * inode. This is only expected to be used in the swapfile activation
> + * case where we want to mark all swap space as unwritten so that reads
> + * return zero and writes fail with ETXTBSY. Storage access in this
> + * state can only occur via swap operations.
> + */
> +#define XFS_BMAPI_FORCE 0x800
Urk. No. Immutable means immutable.
And, as a matter of policy, we should not be changing the on disk
layout of the swapfile that is provided inside the kernel. If the
swap file is already allocated as unwritten, great. If not, we
should not force it to be unwritten to be because then if the user
downgrades their kernel the swapfile suddenly can not be used by the
older kernel.
Cheers,
Dave.
--
Dave Chinner
david@...morbit.com
Powered by blists - more mailing lists