Re: [PATCH 1/7] userfaultfd: require UFFDIO_API before other ioctls

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

 




On Jun 15, 2015 11:43 AM, "Andrea Arcangeli" <aarcange@xxxxxxxxxx> wrote:
>
> Several times I got very hardly reproducible bugs noticed purely
> because of BUG_ON (not VM_BUG_ON)

Feel free to use them while developing. Don't send me patches with your broken debug code, though.

For users, a dead machine means that it is less likely you will ever get a bug report. People set "reboot on oops", and when running X is not always something that can be seen anyway. They'll just see a rebooting or a dead machine, and not send you any debug output.

This is not negotiable. Seriously. Get rid of the BUG_ON if you expect your patches to be merged mainline.

Also, even for debugging, using something like

    if (WARN_ON_ONCE(...))
         return -EINVAL;

is the right thing to do. Then you can unwind locks etc, and return cleanly, and you'll only get one warning rather than a stream of them etc.

So stop making excuses for your bad BUG_ON use. Do it in private where nobody can see your perversions, or do it right.

        Linus


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]