All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Monakhov <dmonakhov@openvz.org>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] fs: make generic_block_fiemap sig-tolerant PING...
Date: Tue, 02 Dec 2014 17:43:51 +0300	[thread overview]
Message-ID: <871toikt7c.fsf@openvz.org> (raw)
In-Reply-To: <1413552269-32203-1-git-send-email-dmonakhov@openvz.org>

[-- Attachment #1: Type: text/plain, Size: 964 bytes --]

Andrew can you please get this patch. IMHO it is simple and clean.
BTW: W/o patch unprivileged may abuse system resources simply by spawning
wast number of unkilable busyloops (works on ext2/ext3):

truncate --size 1T test
for ((i=0;i<1024;i++))
do
        filefrag test > /dev/null &
done

> __generic_block_fiemap may spin very long time for large sparse files.
>
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
>  fs/ioctl.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/fs/ioctl.c b/fs/ioctl.c
> index 8ac3fad..6fbeb68 100644
> --- a/fs/ioctl.c
> +++ b/fs/ioctl.c
> @@ -379,6 +379,11 @@ int __generic_block_fiemap(struct inode *inode,
>  				past_eof = true;
>  		}
>  		cond_resched();
> +		if (fatal_signal_pending(current)) {
> +			ret = -EINTR;
> +			break;
> +		}
> +
>  	} while (1);
>  
>  	/* If ret is 1 then we just hit the end of the extent array */
> -- 
> 1.7.1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]

  reply	other threads:[~2014-12-02 14:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-17 13:24 [PATCH] fs: make generic_block_fiemap sig-tolerant Dmitry Monakhov
2014-12-02 14:43 ` Dmitry Monakhov [this message]
2014-12-10 13:49   ` [PATCH] fs: make generic_block_fiemap sig-tolerant PING2 Dmitry Monakhov
2014-12-18 23:12     ` Andrew Morton
2014-12-19  9:13       ` Dmitry Monakhov
2014-12-19 21:33         ` Andrew Morton
2014-12-19 23:38           ` Andreas Dilger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871toikt7c.fsf@openvz.org \
    --to=dmonakhov@openvz.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.