Re: [PATCH] coredump: Retry writes where appropriate

From: Alan Cox
Date: Tue Jun 02 2009 - 04:22:45 EST


> Perhaps it is easier to change dump_write() to clear TIF_SIGPENDING
> unless fatal_signal_pending(),

If you are receiving a continuous stream of SIGIO's say then how do you
guarantee the code below will make progress ?

>
> int coredump_file_write(struct file *file, const void *addr, int nr)
> {
> while (nr > 0) {
> int res = file->f_op->write(file, addr, nr, &file->f_pos);
>
> if (res > 0) {
> nr -= res;
> continue;
> }
>
> if (!signal_pending(current))
> break;
> if (__fatal_signal_pending(current))
> break;
> clear_thread_flag(TIF_SIGPENDING);
> }
>
> return !nr;
> }
>

> Of course, this all assumes f_op->write() does not do recalc_sigpending().

Which is itself a dangerous assumption that shouldn't be propogated.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/