Re: [Patch 07/18] fs/logfs/dir.c

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Jörn
Date: Friday, June 15, 2007 - 4:57 am

On Fri, 15 June 2007 12:59:27 +0400, Evgeniy Polyakov wrote:

I am not sure here.  What is definitely needed is crc protection for
dentries and inodes.  Those 4 bytes are well-spent.

With crc protection, there are only two reasons why dd->namelen would
ever be zero.  One is a maliciously prepared image, the other a bug when
writing the dentry.

Maybe I should do something like this:

		ret = logfs_data_check(dd->namelen == 0);
		if (ret)
			return ret;

And in some header:

static inline int logfs_data_check(int cond)
{
#ifdef CONFIG_LOGFS_EXTRA_DATA_CHECKS
	if (unlikely(cond))
		return -EIO;
#endif
	return 0;
}

Then the user can decide whether crc checks are sufficient or not.


Then let me change it before more time is wasted on it.


Yep.


Moral considerations aside, I don't see how LogFS could remove user DNA
from the gene pool.  What I could remove is the BUG_ON.


This is indeed crap.  While the format may cope with blocksize dentries,
the code puts them on the kernel stack and would suffer accordingly.
That should be LOGFS_MAX_NAMELEN, as it once used to be.


Yes.  I should have a version of LOGFS_BUG_ON() without the actual BUG()
and a slightly less threatening name.


Where?


Fair enough.


Are your thinking something insulting behind that smile? ;)
Yep, same as above.

Jörn

-- 
Everything should be made as simple as possible, but not simpler.
-- Albert Einstein
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
LogFS take four, Jörn, (Sun Jun 3, 11:38 am)
[Patch 01/18] fs/Kconfig, Jörn, (Sun Jun 3, 11:40 am)
[Patch 02/18] fs/Makefile, Jörn, (Sun Jun 3, 11:40 am)
[Patch 03/18] fs/logfs/Makefile, Jörn, (Sun Jun 3, 11:41 am)
[Patch 04/18] include/linux/logfs.h, Jörn, (Sun Jun 3, 11:42 am)
[Patch 05/18] fs/logfs/logfs.h, Jörn, (Sun Jun 3, 11:43 am)
[Patch 06/18] fs/logfs/compr.c, Jörn, (Sun Jun 3, 11:43 am)
[Patch 07/18] fs/logfs/dir.c, Jörn, (Sun Jun 3, 11:44 am)
[Patch 08/18] fs/logfs/file.c, Jörn, (Sun Jun 3, 11:45 am)
[Patch 09/18] fs/logfs/gc.c, Jörn, (Sun Jun 3, 11:46 am)
[Patch 10/18] fs/logfs/inode.c, Jörn, (Sun Jun 3, 11:46 am)
[Patch 11/18] fs/logfs/journal.c, Jörn, (Sun Jun 3, 11:47 am)
[Patch 12/18] fs/logfs/memtree.c, Jörn, (Sun Jun 3, 11:47 am)
[Patch 13/18] fs/logfs/readwrite.c, Jörn, (Sun Jun 3, 11:48 am)
[Patch 14/18] fs/logfs/segment.c, Jörn, (Sun Jun 3, 11:48 am)
[Patch 15/18] fs/logfs/super.c, Jörn, (Sun Jun 3, 11:49 am)
[Patch 16/18] fs/logfs/progs/fsck.c, Jörn, (Sun Jun 3, 11:50 am)
[Patch 17/18] fs/logfs/progs/mkfs.c, Jörn, (Sun Jun 3, 11:50 am)
[Patch 18/18] fs/logfs/Locking, Jörn, (Sun Jun 3, 11:51 am)
Re: LogFS take four, Jan-Benedict Glaw, (Sun Jun 3, 12:17 pm)
Re: LogFS take four, Jörn, (Sun Jun 3, 12:19 pm)
Re: [Patch 04/18] include/linux/logfs.h, Arnd Bergmann, (Sun Jun 3, 2:42 pm)
Re: [Patch 06/18] fs/logfs/compr.c, Arnd Bergmann, (Sun Jun 3, 2:58 pm)
Re: LogFS take four, Arnd Bergmann, (Sun Jun 3, 3:18 pm)
Re: [Patch 14/18] fs/logfs/segment.c, Arnd Bergmann, (Sun Jun 3, 3:21 pm)
Re: [Patch 06/18] fs/logfs/compr.c, Jörn, (Mon Jun 4, 1:54 am)
Re: LogFS take four, Jörn, (Mon Jun 4, 2:05 am)
Re: [Patch 14/18] fs/logfs/segment.c, Jörn, (Mon Jun 4, 2:07 am)
Re: [Patch 04/18] include/linux/logfs.h, Jörn, (Mon Jun 4, 2:12 am)
Re: [Patch 04/18] include/linux/logfs.h, David Woodhouse, (Mon Jun 4, 6:38 am)
Re: [Patch 06/18] fs/logfs/compr.c, David Woodhouse, (Mon Jun 4, 6:53 am)
Re: [Patch 04/18] include/linux/logfs.h, Jörn, (Mon Jun 4, 7:02 am)
Re: [Patch 04/18] include/linux/logfs.h, Segher Boessenkool, (Tue Jun 5, 8:49 am)
Re: [Patch 04/18] include/linux/logfs.h, David Woodhouse, (Tue Jun 5, 8:53 am)
Re: [Patch 04/18] include/linux/logfs.h, Segher Boessenkool, (Tue Jun 5, 11:49 am)
Re: [Patch 04/18] include/linux/logfs.h, Bill Davidsen, (Tue Jun 5, 1:39 pm)
Re: [Patch 04/18] include/linux/logfs.h, David Woodhouse, (Wed Jun 6, 1:50 am)
Re: [Patch 04/18] include/linux/logfs.h, Andreas Schwab, (Wed Jun 6, 1:59 am)
Re: [Patch 05/18] fs/logfs/logfs.h, Jörn, (Wed Jun 6, 4:29 am)
Re: [Patch 05/18] fs/logfs/logfs.h, Paulo Marques, (Wed Jun 6, 4:29 am)
Re: [Patch 04/18] include/linux/logfs.h, Arnd Bergmann, (Wed Jun 6, 5:42 am)
Re: [Patch 15/18] fs/logfs/super.c, Arnd Bergmann, (Sun Jun 10, 9:27 am)
Re: [Patch 15/18] fs/logfs/super.c, Jörn, (Sun Jun 10, 10:38 am)
Re: [Patch 15/18] fs/logfs/super.c, Arnd Bergmann, (Sun Jun 10, 11:33 am)
Re: [Patch 15/18] fs/logfs/super.c, Jörn, (Sun Jun 10, 12:10 pm)
Re: [Patch 15/18] fs/logfs/super.c, Willy Tarreau, (Sun Jun 10, 12:20 pm)
Re: LogFS take four, Evgeniy Polyakov, (Fri Jun 15, 1:37 am)
Re: [Patch 07/18] fs/logfs/dir.c, Evgeniy Polyakov, (Fri Jun 15, 1:59 am)
Re: [Patch 09/18] fs/logfs/gc.c, Evgeniy Polyakov, (Fri Jun 15, 2:03 am)
Re: LogFS take four, Jörn, (Fri Jun 15, 4:10 am)
Re: [Patch 09/18] fs/logfs/gc.c, Jörn, (Fri Jun 15, 4:14 am)
Re: [Patch 07/18] fs/logfs/dir.c, Jörn, (Fri Jun 15, 4:57 am)
Re: [Patch 09/18] fs/logfs/gc.c, Evgeniy Polyakov, (Fri Jun 15, 6:03 am)