lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 11 Jun 2007 16:34:33 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Jens Axboe <jens.axboe@...cle.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: splice: move balance_dirty_pages_ratelimited() outside of
 splice actor

On Mon, 11 Jun 2007 21:59:15 GMT
Linux Kernel Mailing List <linux-kernel@...r.kernel.org> wrote:

> Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=20d698db67059a63d217030dfd02872cb5f88dfb
> Commit:     20d698db67059a63d217030dfd02872cb5f88dfb
> Parent:     17374ff1aa9ce2a0597416a16729474b538af443
> Author:     Jens Axboe <jens.axboe@...cle.com>
> AuthorDate: Tue Jun 5 11:05:11 2007 +0200
> Committer:  Jens Axboe <jens.axboe@...cle.com>
> CommitDate: Fri Jun 8 08:33:59 2007 +0200
> 
>     splice: move balance_dirty_pages_ratelimited() outside of splice actor
>     
>     I've seen inode related deadlocks, so move this call outside of the
>     actor itself, which may hold the inode lock.
>     

eh?  If the pipe_to_file() caller holds inode_lock, our problems are large.

I doubt if that's true, so what problem is this patch really fixing??

> ---
>  fs/splice.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/splice.c b/fs/splice.c
> index b78a7f0..6349d31 100644
> --- a/fs/splice.c
> +++ b/fs/splice.c
> @@ -652,7 +652,6 @@ find_page:
>  	 * accessed, we are now done!
>  	 */
>  	mark_page_accessed(page);
> -	balance_dirty_pages_ratelimited(mapping);
>  out:
>  	page_cache_release(page);
>  	unlock_page(page);
> @@ -823,6 +822,7 @@ generic_file_splice_write_nolock(struct pipe_inode_info *pipe, struct file *out,
>  			if (err)
>  				ret = err;
>  		}
> +		balance_dirty_pages_ratelimited(mapping);
>  	}
>  
>  	return ret;
> @@ -876,6 +876,7 @@ generic_file_splice_write(struct pipe_inode_info *pipe, struct file *out,
>  			if (err)
>  				ret = err;
>  		}
> +		balance_dirty_pages_ratelimited(mapping);
>  	}
>  

balance_dirty_pages_ratelimited() is supposed to be called
once-per-dirtied-page.  This caller can dirty an arbitrarily large amount
of memory and hence should use balance_dirty_pages_ratelimited_nr().

As things stand, a large splice() could potentially cause the dirty limits
to be exceeded.

btw, can we please arrange to get patches reviewed prior to them being
merged?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ