Re: [PATCH take 2] UBIFS - new flash file system

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Artem Bityutskiy <Artem.Bityutskiy@...>
Cc: LKML <linux-kernel@...>, Adrian Hunter <ext-adrian.hunter@...>
Date: Friday, May 16, 2008 - 6:40 am

General comment:

 - not supporting a flash page size different from the system page
   size is a horrible thing for people trying to use the same storage
   on multiple systems.  For a block based filesystem that alone would
   be enough reason not to merge it.  For a flash filesystem I'm not
   entirely sure given that flash isn't moved between systems all that
   often.

VFS/VM interaction comments:

 - splitting most of the mount code out to build.c is rather odd.
   Most filesystems have this in super.c
 - calling convention for mount_ubifs is nasty because it doesn't
   clean up it's own errors.  You might think it's easier to do
   all that in ubifs_umount but beeing in the process of untangling
   that mess for xfs I'd recomment against it.  Unless there's
   a very good reason for it functions should always clean up
   the resources they allocated in the error case.
 - ubifs_get_sb would benefit from splitting out a ubifs_fill_super
   routine that allocates a new sb when it's actually needed.
 - why do you do the commit_on_unmount in your own ->shutdown_super
   instead of the normal ->put_super?  If there's a good reason
   this at least needs a big comment explaining why.
 - ubifs_lookup doesn't really need to use d_splice_alias unless
   you want to support nfs exporting
 - in ubifs_new_inode you inherit the inode flags from the parent.
   This probably wants splitting out in a helper that documents
   explicitly what flags are inherited and what not.  Given that
   you store the general indoe flags settable by chattr in there
   it seems like a bad idea to inherit them by default.
 - the read dir implementation won't ever support nfs exporting
   due to having to keep per open file state.  Nor would it support
   thing like checkpoint and restart.
 - just opencode you mmap routine, there's nothing helpful
   in generic_file_mmap if you set your own vm_ops.
 - ubifs_trunc should never be called on anything but a regular
   file, so the check for it seems superflous.  Having it after
   the S_ISREG is rather odd too even if you want to have
   an assertation.
 - please implement the unlocked_ioctl file operation instead of
   the old ioctl operation that comes with the BKL locked.

Misc comments:

 - ubifs_bg_thread shouldn't set a nice level, especially when it's the
   default one anyway.
 - the mainoop of ubifs_bg_thread looks a bit odd either, when you
   first to an interruotible sleep and then possible one while you
   still have TASK_RUNNING set.  Also the need_bgt flag is not needed
   because the thrad is only woken up to perform it's action.
   In the end the main loop should look something like:

	while (1) {
		if (kthread_should_stop())
			break;
		if (try_to_freeze())
			continue;

		run_bg_commit(c);

		set_current_state(TASK_INTERRUPTIBLE);
		schedule();
		__set_current_state(TASK_RUNNING);
	}

			


Same comments on naming in the code:

 - bgt is not very descriptive for your kernel thread.  These are per
   defintion in the background, so just call them thread or
   <somethinginformative>_thread.  In this case it would probably
   be commit_thread.
 - any chance you could spell out journal instead of jrn?  jrn always
   sounds like joern with the wovel eaten by a mailer.. :)
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH take 2] UBIFS - new flash file system, Artem Bityutskiy, (Tue May 6, 6:35 am)
Re: [PATCH take 2] UBIFS - new flash file system, Christoph Hellwig, (Fri May 16, 6:40 am)
Re: [PATCH take 2] UBIFS - new flash file system, Artem Bityutskiy, (Fri May 23, 11:18 am)
Re: [PATCH take 2] UBIFS - new flash file system, Artem Bityutskiy, (Mon May 19, 7:30 am)
Re: [PATCH take 2] UBIFS - new flash file system, Andi Kleen, (Mon May 19, 8:36 am)
Re: [PATCH take 2] UBIFS - new flash file system, Adrian Hunter, (Fri May 16, 9:10 am)
Re: [PATCH take 2] UBIFS - new flash file system, Christoph Hellwig, (Wed May 7, 4:01 am)
Re: [PATCH take 2] UBIFS - new flash file system, Artem Bityutskiy, (Wed May 7, 4:07 am)
Re: [PATCH take 2] UBIFS - new flash file system, Christoph Hellwig, (Wed May 7, 4:10 am)
Re: [PATCH take 2] UBIFS - new flash file system, Artem Bityutskiy, (Wed May 7, 6:31 am)
Re: [PATCH take 2] UBIFS - new flash file system, Artem Bityutskiy, (Wed May 7, 4:32 am)
Re: [PATCH take 2] UBIFS - new flash file system, Artem Bityutskiy, (Wed May 7, 4:11 am)
[PATCH take 2 21/28] UBIFS: add Garbage Collector, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 27/28] UBIFS: add debugging stuff, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 26/28] UBIFS: add header files, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 18/28] UBIFS: add LEB properties tree, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 23/28] UBIFS: add budgeting, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 22/28] UBIFS: add VFS operations, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 24/28] UBIFS: add extended attribute support, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 28/28] UBIFS: include FS to compilation, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 25/28] UBIFS: add orphans handling sub-system, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 20/28] UBIFS: add LEB find subsystem, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 19/28] UBIFS: add LEB properties tree, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 17/28] UBIFS: add LEB properties, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 15/28] UBIFS: add TNC commit implementation, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 02/28] do_mounts: allow UBI root device name, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Tue May 6, 6:35 am)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Tue May 20, 8:45 am)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Thu May 22, 6:53 am)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Thu May 22, 7:00 am)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Wed May 7, 12:55 pm)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Christoph Hellwig, (Wed May 7, 4:00 am)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Tue May 13, 4:31 am)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Christoph Hellwig, (Tue May 13, 4:59 am)
Re: [PATCH take 2 01/28] VFS: introduce writeback_inodes_sb(), Artem Bityutskiy, (Tue May 13, 5:22 am)
[PATCH take 2 05/28] UBIFS: add flash scanning, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 03/28] UBIFS: add brief documentation, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 16/28] UBIFS: add TNC shrinker, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 14/28] UBIFS: add TNC implementation, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 12/28] UBIFS: add the journal, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 13/28] UBIFS: add commit functionality, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 11/28] UBIFS: add key helpers, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 09/28] UBIFS: add file-system recovery, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 08/28] UBIFS: add superblock and master node, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 04/28] UBIFS: add I/O sub-system, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 07/28] UBIFS: add file-system build, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 10/28] UBIFS: add compression support, Artem Bityutskiy, (Tue May 6, 6:35 am)
[PATCH take 2 06/28] UBIFS: add journal replay, Artem Bityutskiy, (Tue May 6, 6:35 am)
Re: [PATCH take 2 06/28] UBIFS: add journal replay, Marcin Slusarz, (Tue May 6, 6:05 pm)
Re: [PATCH take 2 06/28] UBIFS: add journal replay, Artem Bityutskiy, (Wed May 7, 1:57 am)