Re: [RFC PATCH 25/26] UBIFS: add debugging stuff

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pekka Enberg <penberg@...>
Cc: Artem Bityutskiy <dedekind@...>, LKML <linux-kernel@...>, Adrian Hunter <ext-adrian.hunter@...>
Date: Tuesday, April 1, 2008 - 4:32 am

Pekka, I still do not see why you are opposed to assertions so much :-)

Pekka Enberg wrote:

Because we want to have a way to catch bugs and to quickly fix them. This
is why we injected many assertions all over the place. Enabling them by
default is inefficient and makes the code larger, which is not good
especially for small embedded systems.

If someone reports us an obscure oops, and we have no idea why it happened,
and we cannot reproduce it on our setup, we ask the reporter to enable
debugging and report us results. This helps us to figure out what was the
reason and to quickly fix the bug. I do not see why you want to prevent
us from doing this.

We handle all errors. Errors are things like I/O failures, memory allocation
failures, unexpected behavior. We do handle this. Assertion are about
_debugging_, when you already know you have a problem.

Indeed, bugs may be tricky. An oops may happen because half an hour ago a
function craped out something. Assertions allow us to catch problems on
_early_ stage, instead of dealing with consequences and scratching the head
what was the reason.

But I do agree we have too much of that. We will lessen the amount of
course.


I am not sure what you mean. I would not want to delve into a general
discussion of the debugging stuff. I would better talk about specific
things. I'll just point you examples of debugging stuff in the kernel
in other subsystems which exists and does not hurt anyone. And I believe
it is helpful. It is compiled out by default and is enable when it is
needed to hunt a bug.

fs/ext2: ea_idebug(), EXT2FS_DEBUG
fs/xfs: #ifdef DEBUG, XFS_LOUD_RECOVERY and so on
fs/ocfs2: OCFS2_DEBUG_FS
fs/jfs: CONFIG_JFS_DEBUG, assert(), etc
fs: DEBUG_EPOLL, #ifdef DEBUG
fs/jbd2: assert_spin_locked(), CONFIG_JBD2_DEBUG, etc
mm: CONFIG_SLUB_DEBUG, SLABDEBUG, CONFIG_DEBUG_VM, and so on


Of course. People who are not familiar with the code send bug reports and
we have to fix the problem quickly, and debugging stuff helps.


It is OK to have few BUG_ON() checks, and we should probably turn few
assertions into BUG_ON(). But only few.


If something unexpected happens, UBIFS will just return -EINVAL in the
most cases, because one of the function will find out that something is
going wrong. Assertions have nothing to do with this. The help to _fix_
bugs which were hit in certain circumstances.

We have heavy checks, right. They are expensive, so disabled by default.
Why can't assertions be similar?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[RFC PATCH] UBIFS - new flash file system, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
Re: [RFC PATCH] UBIFS - new flash file system, Thomas Gleixner, (Fri Apr 18, 5:05 am)
Re: [RFC PATCH] UBIFS - new flash file system, Jan Engelhardt, (Mon Mar 31, 8:29 am)
Re: [RFC PATCH] UBIFS - new flash file system, Jörn, (Mon Mar 31, 9:40 am)
Re: [RFC PATCH] UBIFS - new flash file system, Adrian Hunter, (Mon Mar 31, 8:47 am)
Re: [RFC PATCH] UBIFS - new flash file system, Jörn, (Mon Mar 31, 9:20 am)
Re: [RFC PATCH] UBIFS - new flash file system, Artem Bityutskiy, (Mon Mar 31, 10:00 am)
Re: [RFC PATCH] UBIFS - new flash file system, Jörn, (Mon Mar 31, 1:17 pm)
Re: [RFC PATCH] UBIFS - new flash file system, Pekka Enberg, (Mon Mar 31, 4:49 pm)
Re: [RFC PATCH] UBIFS - new flash file system, Jörn, (Mon Mar 31, 5:21 pm)
Re: [RFC PATCH] UBIFS - new flash file system, Artem Bityutskiy, (Tue Apr 1, 2:00 am)
Re: [RFC PATCH] UBIFS - new flash file system, Artem Bityutskiy, (Fri Mar 28, 2:45 am)
Re: [RFC PATCH] UBIFS - new flash file system, Josh Boyer, (Thu Mar 27, 12:20 pm)
Re: [RFC PATCH] UBIFS - new flash file system, Artem Bityutskiy, (Fri Mar 28, 2:17 am)
[RFC PATCH 09/26] UBIFS: add key helpers, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 26/26] UBIFS: include FS to compilation, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Pekka Enberg, (Tue Apr 1, 3:39 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Artem Bityutskiy, (Tue Apr 1, 4:51 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Christoph Hellwig, (Sat Apr 26, 5:35 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Adrian Hunter, (Mon Apr 28, 3:09 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, ext Christoph Hellwig, (Mon Apr 28, 5:00 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Adrian Hunter, (Mon Apr 28, 7:23 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, ext ext Christoph Hellwig..., (Mon Apr 28, 7:39 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Adrian Hunter, (Mon Apr 28, 8:25 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Christoph Hellwig, (Mon Apr 28, 9:02 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Pekka Enberg, (Tue Apr 1, 5:15 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Artem Bityutskiy, (Tue Apr 1, 5:25 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Pekka Enberg, (Tue Apr 1, 6:04 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Artem Bityutskiy, (Tue Apr 1, 6:26 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Pekka Enberg, (Tue Apr 1, 7:33 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Christoph Hellwig, (Sat Apr 26, 5:37 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Adrian Hunter, (Mon Apr 28, 3:10 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, ext Christoph Hellwig, (Mon Apr 28, 5:03 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Adrian Hunter, (Wed Apr 30, 3:04 am)
Re: [RFC PATCH 26/26] UBIFS: include FS to compilation, Artem Bityutskiy, (Tue Apr 1, 7:56 am)
[RFC PATCH 22/26] UBIFS: add extended attribute support, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 04/26] UBIFS: add journal replay, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 03/26] UBIFS: add flash scanning, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 18/26] UBIFS: add LEB find subsystem, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 16/26] UBIFS: add LEB properties tree, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 08/26] UBIFS: add compression support, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 07/26] UBIFS: add file-system recovery, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 06/26] UBIFS: add superblock and master node, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 05/26] UBIFS: add file-system build, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
Re: [RFC PATCH 05/26] UBIFS: add file-system build, Andrew Morton, (Fri Mar 28, 6:12 am)
Re: [RFC PATCH 05/26] UBIFS: add file-system build, Artem Bityutskiy, (Fri Mar 28, 7:04 am)
[RFC PATCH 02/26] UBIFS: add I/O sub-system, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 25/26] UBIFS: add debugging stuff, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Pekka Enberg, (Mon Mar 31, 5:00 pm)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Artem Bityutskiy, (Tue Apr 1, 2:20 am)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Pekka Enberg, (Tue Apr 1, 3:43 am)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Pekka Enberg, (Tue Apr 1, 3:33 am)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Adrian Hunter, (Tue Apr 1, 4:34 am)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Artem Bityutskiy, (Tue Apr 1, 4:32 am)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Pekka Enberg, (Tue Apr 1, 5:00 am)
Re: [RFC PATCH 25/26] UBIFS: add debugging stuff, Artem Bityutskiy, (Tue Apr 1, 5:04 am)
[RFC PATCH 24/26] UBIFS: add header files, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 23/26] UBIFS: add orphans handling sub-system, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 21/26] UBIFS: add budgeting, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 20/26] UBIFS: add VFS operations, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
Re: [RFC PATCH 20/26] UBIFS: add VFS operations, Pekka Enberg, (Tue Apr 1, 8:08 am)
Re: [RFC PATCH 20/26] UBIFS: add VFS operations, Artem Bityutskiy, (Tue Apr 1, 8:42 am)
Re: [RFC PATCH 20/26] UBIFS: add VFS operations, Pekka Enberg, (Tue Apr 1, 9:12 am)
Re: [RFC PATCH 20/26] UBIFS: add VFS operations, Artem Bityutskiy, (Tue Apr 1, 10:04 am)
Re: [RFC PATCH 20/26] UBIFS: add VFS operations, Adrian Hunter, (Tue Apr 1, 11:14 am)
Re: [RFC PATCH 20/26] UBIFS: add VFS operations, Andi Kleen, (Thu Mar 27, 9:36 am)
Re: [RFC PATCH 20/26] UBIFS: add VFS operations, Artem Bityutskiy, (Thu Mar 27, 9:42 am)
[RFC PATCH 19/26] UBIFS: add Garbage Collector, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
Re: [RFC PATCH 19/26] UBIFS: add Garbage Collector, Arnd Bergmann, (Mon Mar 31, 10:11 pm)
[RFC PATCH 01/26] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 17/26] UBIFS: add LEB properties tree, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 15/26] UBIFS: add LEB properties, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 14/26] UBIFS: add TNC shrinker, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 13/26] UBIFS: add TNC commit implementation, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 12/26] UBIFS: add TNC implementation, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 11/26] UBIFS: add commit functionality, Artem Bityutskiy, (Thu Mar 27, 10:55 am)
[RFC PATCH 10/26] UBIFS: add the journal, Artem Bityutskiy, (Thu Mar 27, 10:55 am)