On Fri, 16 Oct 2015 08:40:27 +0200 Jan Kara <jack@xxxxxxx> wrote: > > > balance_dirty_pages_ratelimited(mapping); > > > - if (fatal_signal_pending(current)) { > > > - status = -EINTR; > > > - break; > > > - } > > > } while (iov_iter_count(i)); > > > > > > return written ? written : status; > > > > This won't work, will it? If user hits ^C after we've written a few > > pages, `written' is non-zero and the same thing happens? > > It does work - I've tested it :). Sure, the generic_perform_write() call > that is running when the signal is delivered will return with value > 0. > But the interesting thing is what happens after that: Either we return to > userspace (and then we are fine) or generic_perform_write() gets called > again because there's more to write and *that* call will return -EINTR > which ends up terminating the whole sendfile syscall. OK. I guess that's better behaviour than overwriting a non-zero `written' when signalled. I'm going to tag this one for -stable. It's a bit of a DoS. -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html