Re: [patch added to the 3.12 stable tree] shmem: fix splicing from a hole while it's punched

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

 



On 07/25/2014 09:01 AM, Jiri Slaby wrote:
> From: Hugh Dickins <hughd@xxxxxxxxxx>
> 
> This patch has been added to the 3.12 stable tree. If you have any
> objections, please let us know.
> 
> ===============
> 
> commit b1a366500bd537b50c3aad26dc7df083ec03a448 upstream.
...
> --- a/mm/shmem.c
> +++ b/mm/shmem.c
> @@ -534,22 +534,19 @@ static void shmem_undo_range(struct inode *inode, loff_t lstart, loff_t lend,
>  		return;
>  
>  	index = start;
> -	for ( ; ; ) {
> +	while (index < end) {
>  		cond_resched();
>  		pvec.nr = shmem_find_get_pages_and_swap(mapping, index,
>  				min(end - index, (pgoff_t)PAGEVEC_SIZE),
>  							pvec.pages, indices);
>  		if (!pvec.nr) {
> -			if (index == start || unfalloc)
> +			/* If all gone or hole-punch or unfalloc, we're done */
> +			if (index == start || end != -1)
>  				break;
> +			/* But if truncating, restart to make sure all gone */
>  			index = start;
>  			continue;
>  		}
> -		if ((index == start || unfalloc) && indices[0] >= end) {
> -			shmem_deswap_pagevec(&pvec);
> -			pagevec_release(&pvec);
> -			break;
> -		}

Hi, I had to fix this by hand. Is this correct?

Look at shmem_deswap_pagevec vs. pagevec_remove_exceptionals.

thanks,
-- 
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]