tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: clearing bogus journal
On Mon, Aug 17, 2009 at 11:52:26PM +0200, Manuel Bouyer wrote:
> # tunefs -l0 /usr
> tunefs: tuning /dev/rraid1e
> tunefs: Can't change size of non-in-filesystem log
>
> I think tunefs should be able to clear any kind of log (it looks like the
> kenrel can already do it), and the kernel should be able to clear the
> log even if fs->fs_journal_location is bogus. The attached patch does
> so. With these changes, I could clear the bogus log entry on first mount,
> and let mount -o log create a proper in-filesystem log on second mount.
> Any comment on this one ?
tunefs needs an extra patch to be able to create an in-filesystem
journal on a filesystem with no journal. Attached is an updated patch
--
Manuel Bouyer, LIP6, Universite Paris VI.
Manuel.Bouyer%lip6.fr@localhost
NetBSD: 26 ans d'experience feront toujours la difference
--
Index: tunefs.c
===================================================================
RCS file: /cvsroot/src/sbin/tunefs/tunefs.c,v
retrieving revision 1.37
diff -u -p -u -r1.37 tunefs.c
--- tunefs.c 31 Jul 2008 15:55:41 -0000 1.37
+++ tunefs.c 20 Aug 2009 17:05:07 -0000
@@ -389,15 +389,6 @@ change_log_info(long long logfilesize)
break;
}
- if (!in_fs_log)
- errx(1, "Can't change size of non-in-filesystem log");
-
- if (old_size == logfilesize && logfilesize > 0) {
- /* no action */
- warnx("log file size remains unchanged at %lld", logfilesize);
- return;
- }
-
if (logfilesize == 0) {
/*
* Don't clear out the locators - the kernel might need
@@ -410,6 +401,15 @@ change_log_info(long long logfilesize)
return;
}
+ if (!in_fs_log && logfilesize > 0 && old_size > 0)
+ errx(1, "Can't change size of non-in-filesystem log");
+
+ if (old_size == logfilesize && logfilesize > 0) {
+ /* no action */
+ warnx("log file size remains unchanged at %lld", logfilesize);
+ return;
+ }
+
if (old_size == 0) {
/* create new log of desired size next mount */
sblock.fs_journal_location = UFS_WAPBL_JOURNALLOC_IN_FILESYSTEM;
Home |
Main Index |
Thread Index |
Old Index