Re: [PATCH v2] mm, swap: disallow swapon() on zoned block devices

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

 



On Tue, Oct 15, 2019 at 05:58:14PM +0900, Naohiro Aota wrote:
> A zoned block device consists of a number of zones. Zones are either
> conventional and accepting random writes or sequential and requiring that
> writes be issued in LBA order from each zone write pointer position. For
> the write restriction, zoned block devices are not suitable for a swap
> device. Disallow swapon on them.
> 
> Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx>
> ---
> v2: add comments according to Christoph's feedback, reformat chengelog.
> ---
>  mm/swapfile.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/mm/swapfile.c b/mm/swapfile.c
> index dab43523afdd..f2c4224d1f8a 100644
> --- a/mm/swapfile.c
> +++ b/mm/swapfile.c
> @@ -2887,6 +2887,14 @@ static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)
>  		error = set_blocksize(p->bdev, PAGE_SIZE);
>  		if (error < 0)
>  			return error;
> +		/*
> +		 * Zoned block device contains zones that have
> +		 * sequential write only restriction. For the restriction,
> +		 * zoned block devices are not suitable for a swap device.
> +		 * Disallow them here.
> +		 */
> +		if (blk_queue_is_zoned(p->bdev->bd_queue))

Please use up all 80 chars per line  Otherwise this looks fine:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux