The NetBSD Project

CVS log for src/sbin/fsck_lfs/pass1.c

[BACK] Up to [cvs.NetBSD.org] / src / sbin / fsck_lfs

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.45.18.1 / (download) - annotate - [select for diffs], Mon Aug 17 10:30:22 2020 UTC (3 years, 8 months ago) by martin
Branch: netbsd-9
CVS Tags: netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored) next main 1.46 (colored) to selected 1.26 (colored)

Pull up following revision(s) (requested by riastradh in ticket #1050):

	sys/ufs/lfs/lfs_subr.c: revision 1.101
	sys/ufs/lfs/lfs_subr.c: revision 1.102
	sys/ufs/lfs/lfs_inode.c: revision 1.158
	sys/ufs/lfs/lfs_inode.h: revision 1.25
	sys/ufs/lfs/lfs_balloc.c: revision 1.95
	sys/ufs/lfs/lfs_pages.c: revision 1.21
	sys/ufs/lfs/lfs_vnops.c: revision 1.330
	sys/ufs/lfs/lfs_alloc.c: revision 1.140 (patch)
	sys/ufs/lfs/lfs_alloc.c: revision 1.141 (patch)
	lib/libp2k/p2k.c: revision 1.72
	sys/ufs/lfs/lfs.h: revision 1.205
	sys/ufs/lfs/lfs.h: revision 1.206
	sys/ufs/lfs/lfs_segment.c: revision 1.284
	sys/ufs/lfs/lfs.h: revision 1.207
	sys/ufs/lfs/lfs_segment.c: revision 1.285
	sys/ufs/lfs/lfs_debug.c: revision 1.55
	sys/ufs/lfs/lfs_rename.c: revision 1.23
	usr.sbin/dumplfs/dumplfs.c: revision 1.65
	sys/ufs/lfs/lfs_vfsops.c: revision 1.371
	sys/arch/i386/stand/efiboot/bootx64/Makefile: revision 1.3
	sys/ufs/lfs/lfs_vfsops.c: revision 1.372
	sys/ufs/lfs/lfs_vfsops.c: revision 1.373
	sbin/fsck_lfs/pass1.c: revision 1.46
	sys/ufs/lfs/lfs_vnops.c: revision 1.326
	sys/ufs/lfs/lfs_vnops.c: revision 1.327
	sys/ufs/lfs/lfs_vfsops.c: revision 1.375 (patch)
	sys/ufs/lfs/lfs_vnops.c: revision 1.328
	sys/ufs/lfs/lfs_subr.c: revision 1.98
	sys/ufs/lfs/lfs_extern.h: revision 1.116
	sys/ufs/lfs/lfs_vnops.c: revision 1.329
	sys/ufs/lfs/lfs_subr.c: revision 1.99
	sys/ufs/lfs/lfs_extern.h: revision 1.117
	sys/ufs/lfs/lfs_accessors.h: revision 1.49
	sys/ufs/lfs/lfs_extern.h: revision 1.118
	sys/rump/fs/lib/liblfs/Makefile: revision 1.15
	sys/ufs/lfs/lfs_bio.c: revision 1.146 (patch)
	sys/ufs/lfs/lfs_bio.c: revision 1.147
	sys/ufs/lfs/lfs_subr.c: revision 1.100

Fix kassert in lfs by initializing vp first.

Use a marker node to iterate lfs_dchainhd / i_lfs_dchain.

I believe elements can be removed while the lock is dropped,
including the next node we're hanging on to.

Just use VOP_BWRITE for lfs_bwrite_log.
Hope this doesn't cause trouble with vfs_suspend.

Teach lfs to transition ro<->rw.

Prevent new dirops while we issue lfs_flush_dirops.

lfs_flush_dirops assumes (by KASSERT((ip->i_state & IN_ADIROP) == 0))
that vnodes on the dchain will not become involved in active dirops
even while holding no other locks (lfs_lock, v_interlock), so we must
set lfs_writer here.  All other callers already set lfs_writer.

We set fs->lfs_writer++ without explicitly doing lfs_writer_enter
because
(a) we already waited for the dirops to drain, and
(b) we hold lfs_lock and cannot drop it before setting lfs_writer.

Assert lfs_writer where I think we can now prove it.

Serialize access to the splay tree with lfs_lock.

Change some cheap KDASSERT into KASSERT.

Take a reference and fix assertions in lfs_flush_dirops.
Fixes panic:
KASSERT((ip->i_state & IN_ADIROP) == 0) at lfs_vnops.c:1670
lfs_flush_dirops
lfs_check
lfs_setattr
VOP_SETATTR
change_mode
sys_fchmod
syscall

This assertion -- and the assertion that vp->v_uflag has VU_DIROP set
-- is valid only until we release lfs_lock, because we may race with
lfs_unmark_dirop which will remove the nodes and change the flags.

Further, vp itself is valid only as long as it is referenced, which it
is as long as it's on the dchain, but lfs_unmark_dirop drops the
dchain's reference.

Don't lfs_writer_enter while holding v_interlock.

There's no need to lfs_writer_enter at all here, as far as I can see.
lfs_flush_fs will do it for us.

Break deadlock in PR kern/52301.

The lock order is lfs_writer -> lfs_seglock.  The problem in 52301 is
that lfs_segwrite violates this lock order by sometimes doing
lfs_seglock -> lfs_writer, either (a) when doing a checkpoint or (b),
opportunistically, when there are no dirops pending.  Both cases can
deadlock, because dirops sometimes take the seglock (lfs_truncate,
lfs_valloc, lfs_vfree):
(a) There may be dirops pending, and they may be waiting for the
seglock, so we can't wait for them to complete while holding the
seglock.
(b) The test for fs->lfs_dirops == 0 happens unlocked, and the state
may change by the time lfs_writer_enter acquires lfs_lock.

To resolve this in each case:
(a) Do lfs_writer_enter before lfs_seglock, since we will need it
unconditionally anyway.  The worst performance impact of this should
be that some dirops get delayed a little bit.
(b) Create a new lfs_writer_tryenter to use at this point so that the
test for fs->lfs_dirops == 0 and the acquisition of lfs_writer happen
atomically under lfs_lock.

Initialize/destroy lfs_allclean_wakeup in modcmd, not lfs_mountfs.

Fixes reloading lfs.kmod.

In lfs_update, hold lfs_writer around lfs_vflush.

Otherwise, we might do
lfs_vflush
-> lfs_seglock
-> lfs_segwait(SEGM_CKP)
   -> lfs_writer_enter
which is the reverse of the lfs_writer -> lfs_seglock ordering.

Call lfs_orphan in lfs_rename while we're still in the dirop.
lfs_writer_enter can't fail; keep it simple and don't pretend it can.

Assert that mtsleep can't fail either -- it doesn't catch signals and
there's no timeout.

Teach LFS_ORPHAN_NEXTFREE about lfs64.

Dust off the orphan detection code and try to make it work.

Fix !DIAGNOSTIC compile

Fix userland references to LFS_ORPHAN_NEXTFREE.

Forgot to grep for these or do a full distribution build, oops!

Fix missing <sys/evcnt.h> by removing the evcnts instead.

Just wanted to confirm that a race might happen, and indeed it did.
These serve little diagnostic value otherwise.

OR into bp->b_cflags; don't overwrite.

CTASSERT lfs on-disk structure sizes.

Avoid misaligned access to lfs64 on-disk records in memory.
lfs64 directory entries are only 32-bit aligned in order to conserve
space in directory blocks, and we had a hack to stuff a 64-bit inode
in them.  This replaces the hack by __aligned(4) __packed, and goes
further:

1. It's not clear that all the other lfs64 data structures are 64-bit
   aligned on disk to begin with.  We can go through these later and
   upgrade them from
        struct foo64 {
                ...
        } __aligned(4) __packed;
        union foo {
                struct foo64 f64;
                ...
        };
   to
        struct foo64 {
                ...
        };
        union foo {
                struct foo64 f64 __aligned(8);
                ...
        } __aligned(4) __packed;
   if we really want to take advantage of 64-bit memory accesses.
   However, the __aligned(4) __packed must remain on the union
   because:
2. We access even the lfs32 data structures via a union that has
   lfs64 members, and it turns out that compilers will assume access
   through a union with 64-bit aligned members implies the whole
   union has 64-bit alignment, even if we're only accessing a 32-bit
   aligned member.

Fix clang build after packed lfs64 accessor change.

Suppress spurious address-of-packed error in rump lfs too.

Revision 1.45.16.1 / (download) - annotate - [select for diffs], Wed Apr 8 14:07:18 2020 UTC (4 years ago) by martin
Branch: phil-wifi
Changes since 1.45: +2 -3 lines
Diff to previous 1.45 (colored) next main 1.46 (colored) to selected 1.26 (colored)

Merge changes from current as of 20200406

Revision 1.47 / (download) - annotate - [select for diffs], Fri Apr 3 19:36:33 2020 UTC (4 years ago) by joerg
Branch: MAIN
CVS Tags: phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, HEAD
Changes since 1.46: +1 -2 lines
Diff to previous 1.46 (colored) to selected 1.26 (colored)

Avoid common symbols for fsck_lfs.

Revision 1.46 / (download) - annotate - [select for diffs], Sun Feb 23 15:11:33 2020 UTC (4 years, 1 month ago) by riastradh
Branch: MAIN
CVS Tags: is-mlppp-base, is-mlppp
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored) to selected 1.26 (colored)

Fix userland references to LFS_ORPHAN_NEXTFREE.

Forgot to grep for these or do a full distribution build, oops!

Revision 1.45 / (download) - annotate - [select for diffs], Sat Oct 3 08:30:13 2015 UTC (8 years, 6 months ago) by dholland
Branch: MAIN
CVS Tags: prg-localcount2-base3, prg-localcount2-base2, prg-localcount2-base1, prg-localcount2-base, prg-localcount2, phil-wifi-base, phil-wifi-20191119, phil-wifi-20190609, pgoyette-localcount-base, pgoyette-localcount-20170426, pgoyette-localcount-20170320, pgoyette-localcount-20170107, pgoyette-localcount-20161104, pgoyette-localcount-20160806, pgoyette-localcount-20160726, pgoyette-localcount, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-8-base, netbsd-8-2-RELEASE, netbsd-8-1-RELEASE, netbsd-8-1-RC1, netbsd-8-0-RELEASE, netbsd-8-0-RC2, netbsd-8-0-RC1, netbsd-8, matt-nb8-mediatek-base, matt-nb8-mediatek, localcount-20160914, bouyer-socketcan-base1, bouyer-socketcan-base, bouyer-socketcan
Branch point for: phil-wifi, netbsd-9
Changes since 1.44: +2 -2 lines
Diff to previous 1.44 (colored) to selected 1.26 (colored)

The per-inode state 'id_entryno' is used by pass1 for a block count,
so widen it to 'long long'. pass2 uses it for the number of entries in
a directory (IIUC) which does not need to be wider than int, but for
now let's not try to split into two fields. FUTURE...

Revision 1.44 / (download) - annotate - [select for diffs], Tue Sep 1 06:15:02 2015 UTC (8 years, 7 months ago) by dholland
Branch: MAIN
Changes since 1.43: +8 -11 lines
Diff to previous 1.43 (colored) to selected 1.26 (colored)

Use daddr_t, not ulfs_daddr_t, as the latter's 32 bits wide.
Don't use either for on-disk items.
Declare external data in header files.
Part 3 of 3.

Revision 1.43 / (download) - annotate - [select for diffs], Tue Sep 1 06:12:04 2015 UTC (8 years, 7 months ago) by dholland
Branch: MAIN
Changes since 1.42: +2 -2 lines
Diff to previous 1.42 (colored) to selected 1.26 (colored)

The ifile's inode number is constant. (it is always 1)

Therefore, storing the value in the superblock and reading it out
again is silly and offers the opportunity for it to become corrupted.
So, don't do that (most of the code already didn't) and use the
existing constant instead. Initialize new 32-bit superblocks with
the value for the sake of old userland programs, but don't keep the
value in the 64-bit superblock at all.

(approved by Margo Seltzer)

Revision 1.42 / (download) - annotate - [select for diffs], Wed Aug 12 18:28:00 2015 UTC (8 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.41: +67 -36 lines
Diff to previous 1.41 (colored) to selected 1.26 (colored)

Hack up dinode usage to be 64 vs. 32 as needed. Part 1.

(This part changes the native lfs code; the ufs-derived code already
has 64 vs. 32 logic, but as aspects of it are unsafe, and don't
entirely interoperate cleanly with the lfs 64/32 stuff, pass 2 will be
rehashing that.)

Revision 1.41 / (download) - annotate - [select for diffs], Wed Aug 12 18:25:52 2015 UTC (8 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.40: +4 -4 lines
Diff to previous 1.40 (colored) to selected 1.26 (colored)

Add IFILE32 and IFILE64 structures for the on-disk ifile entries.
Add and use accessors. There are also a bunch of places that cast and
I hope I've found them all...

Revision 1.40 / (download) - annotate - [select for diffs], Tue Jul 28 05:09:34 2015 UTC (8 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.39: +2 -1 lines
Diff to previous 1.39 (colored) to selected 1.26 (colored)

Add a new lfs header file: lfs_accessors.h.

This contains all the accessor functions and macros out of lfs.h.
Add an include of lfs_accessors.h after all uses of lfs.h... except
for code that wants to define its own struct lfs-alike that the
accessors are supposed to play along with. For these, set STRUCT_LFS
and include lfs_accessors.h after the necessary structure has been
defined, so that lfs_accessors.h can emit functions in terms of it.

Revision 1.39 / (download) - annotate - [select for diffs], Fri Jul 24 06:59:32 2015 UTC (8 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.38: +3 -3 lines
Diff to previous 1.38 (colored) to selected 1.26 (colored)

More lfs superblock accessors.
(This changes the rest of the code over; all the accessors were
already added.)

The difference between this commit and the previous one is arbitrary,
but the previous one passed the regression tests on its own so I'm
keeping it separate to help with any bisections that might be needed
in the future.

Revision 1.38 / (download) - annotate - [select for diffs], Fri Jul 24 06:56:41 2015 UTC (8 years, 8 months ago) by dholland
Branch: MAIN
Changes since 1.37: +7 -7 lines
Diff to previous 1.37 (colored) to selected 1.26 (colored)

Switch to accessor functions for elements of the LFS on-disk
superblock. This will allow switching between 32/64 bit forms on the
fly; it will also allow handling LFS_EI reasonably tidily. (That
currently doesn't work on the superblock.)

It also gets rid of cpp abuse in the form of fake structure member
macros.

Also, instead of doing sleep/wakeup on &lfs_avail and &lfs_nextseg
inside the on-disk superblock, add extra elements to the in-memory
struct lfs for this. (XXX: these should be changed to condvars, but
not right now)

XXX: this migrates a structure needed by the lfs code in libsa (struct
salfs) into lfs.h, where it doesn't belong, but for the time being
this is necessary in order to allow the accessors (and the various
lfs macros and other goop that relies on them) to compile.

Revision 1.30.6.2 / (download) - annotate - [select for diffs], Thu May 22 11:37:28 2014 UTC (9 years, 10 months ago) by yamt
Branch: yamt-pagecache
Changes since 1.30.6.1: +29 -30 lines
Diff to previous 1.30.6.1 (colored) to branchpoint 1.30 (colored) next main 1.31 (colored) to selected 1.26 (colored)

sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs.  ("Protocol error: too many arguments")

Revision 1.30.12.2 / (download) - annotate - [select for diffs], Sun Jun 23 06:28:51 2013 UTC (10 years, 9 months ago) by tls
Branch: tls-maxphys
Changes since 1.30.12.1: +29 -30 lines
Diff to previous 1.30.12.1 (colored) to branchpoint 1.30 (colored) next main 1.31 (colored) to selected 1.26 (colored)

resync from head

Revision 1.37 / (download) - annotate - [select for diffs], Tue Jun 18 18:18:58 2013 UTC (10 years, 10 months ago) by christos
Branch: MAIN
CVS Tags: yamt-pagecache-base9, tls-maxphys-base, tls-earlyentropy-base, tls-earlyentropy, riastradh-xf86-video-intel-2-7-1-pre-2-21-15, riastradh-drm2-base3, riastradh-drm2-base2, riastradh-drm2-base1, riastradh-drm2-base, riastradh-drm2, netbsd-7-nhusb-base-20170116, netbsd-7-nhusb-base, netbsd-7-nhusb, netbsd-7-base, netbsd-7-2-RELEASE, netbsd-7-1-RELEASE, netbsd-7-1-RC2, netbsd-7-1-RC1, netbsd-7-1-2-RELEASE, netbsd-7-1-1-RELEASE, netbsd-7-1, netbsd-7-0-RELEASE, netbsd-7-0-RC3, netbsd-7-0-RC2, netbsd-7-0-RC1, netbsd-7-0-2-RELEASE, netbsd-7-0-1-RELEASE, netbsd-7-0, netbsd-7
Changes since 1.36: +4 -4 lines
Diff to previous 1.36 (colored) to selected 1.26 (colored)

Prefix most of the cpp macros with lfs_ and LFS_ to avoid conflicts with ffs.
This was done so that boot blocks that want to compile both FFS and LFS in
the same file work.

Revision 1.36 / (download) - annotate - [select for diffs], Sat Jun 8 02:16:03 2013 UTC (10 years, 10 months ago) by dholland
Branch: MAIN
Changes since 1.35: +2 -4 lines
Diff to previous 1.35 (colored) to selected 1.26 (colored)

Tidy up the LFS userland build hacks.
Don't use -I${NETBSDSRCDIR}/sys; don't include files other than the
exported LFS headers, which are lfs.h, lfs_inode.h, and (for now)
lfs_extern.h.

Revision 1.35 / (download) - annotate - [select for diffs], Sat Jun 8 02:14:46 2013 UTC (10 years, 10 months ago) by dholland
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored) to selected 1.26 (colored)

DIRBLKSIZ -> LFS_DIRBLKSIZ
DIRECTSIZ -> LFS_DIRECTSIZ
DIRSIZ -> LFS_DIRSIZ
OLDDIRFMT -> LFS_OLDDIRFMT
NEWDIRFMT -> LFS_NEWDIRFMT
IFTODT -> LFS_IFTODT
DTTOIF -> LFS_DTTOIF

Revision 1.34 / (download) - annotate - [select for diffs], Sat Jun 8 02:11:11 2013 UTC (10 years, 10 months ago) by dholland
Branch: MAIN
Changes since 1.33: +9 -9 lines
Diff to previous 1.33 (colored) to selected 1.26 (colored)

Stick LFS_ in front of IFMT, IFIFO, IFREG, etc. so as not to conflict
with the UFS copies of these symbols. (Which themselves ought to have
UFS_ stuck on.)

Revision 1.33 / (download) - annotate - [select for diffs], Thu Jun 6 00:54:49 2013 UTC (10 years, 10 months ago) by dholland
Branch: MAIN
Changes since 1.32: +3 -2 lines
Diff to previous 1.32 (colored) to selected 1.26 (colored)

Cleanups and hacks to make lfs userland stuff build:
   - lfs_cksum.c doesn't actually need ulfs_inode.h any more.
   - neither does lfs_itimes.c.
   - add hacks to fsck_lfs to make it compile.
   - add hacks to newfs_lfs to make it compile.
   - fix warning in ulfs_quota.c when quotas are fully disabled
     (as I guess is happening with the rumpity version)

XXX: This commit adds -I${NETBSDSRCDIR}/sys to the Makefiles for
XXX: fsck_lfs, newfs_lfs, and lfs_cleanerd. This needs to be cleaned
XXX: up ASAP; but I consider this less problematic in the short term
XXX: than spewing ulfs_*.h into /usr/include.

Revision 1.32 / (download) - annotate - [select for diffs], Thu Jun 6 00:52:50 2013 UTC (10 years, 10 months ago) by dholland
Branch: MAIN
Changes since 1.31: +18 -18 lines
Diff to previous 1.31 (colored) to selected 1.26 (colored)

ufs -> ulfs for fsck_lfs.

Revision 1.30.12.1 / (download) - annotate - [select for diffs], Mon Feb 25 00:28:07 2013 UTC (11 years, 1 month ago) by tls
Branch: tls-maxphys
Changes since 1.30: +9 -9 lines
Diff to previous 1.30 (colored) to selected 1.26 (colored)

resync with head

Revision 1.30.6.1 / (download) - annotate - [select for diffs], Wed Jan 23 00:05:30 2013 UTC (11 years, 2 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.30: +9 -9 lines
Diff to previous 1.30 (colored) to selected 1.26 (colored)

sync with head

Revision 1.31 / (download) - annotate - [select for diffs], Tue Jan 22 09:39:12 2013 UTC (11 years, 2 months ago) by dholland
Branch: MAIN
CVS Tags: yamt-pagecache-base8, agc-symver-base, agc-symver
Changes since 1.30: +9 -9 lines
Diff to previous 1.30 (colored) to selected 1.26 (colored)

Stuff UFS_ in front of a few of ufs's symbols to reduce namespace
pollution. Specifically:
   ROOTINO -> UFS_ROOTINO
   WINO -> UFS_WINO
   NXADDR -> UFS_NXADDR
   NDADDR -> UFS_NDADDR
   NIADDR -> UFS_NIADDR
   MAXSYMLINKLEN -> UFS_MAXSYMLINKLEN
   MAXSYMLINKLEN_UFS[12] -> UFS[12]_MAXSYMLINKLEN (for consistency)

Sort out ext2fs's misuse of NDADDR and NIADDR; fortunately, these have
the same values in ext2fs and ffs.

No functional change intended.

Revision 1.30 / (download) - annotate - [select for diffs], Tue Feb 16 23:20:30 2010 UTC (14 years, 2 months ago) by mlelstv
Branch: MAIN
CVS Tags: yamt-pagecache-base7, yamt-pagecache-base6, yamt-pagecache-base5, yamt-pagecache-base4, yamt-pagecache-base3, yamt-pagecache-base2, yamt-pagecache-base, netbsd-6-base, netbsd-6-1-RELEASE, netbsd-6-1-RC4, netbsd-6-1-RC3, netbsd-6-1-RC2, netbsd-6-1-RC1, netbsd-6-1-5-RELEASE, netbsd-6-1-4-RELEASE, netbsd-6-1-3-RELEASE, netbsd-6-1-2-RELEASE, netbsd-6-1-1-RELEASE, netbsd-6-1, netbsd-6-0-RELEASE, netbsd-6-0-RC2, netbsd-6-0-RC1, netbsd-6-0-6-RELEASE, netbsd-6-0-5-RELEASE, netbsd-6-0-4-RELEASE, netbsd-6-0-3-RELEASE, netbsd-6-0-2-RELEASE, netbsd-6-0-1-RELEASE, netbsd-6-0, netbsd-6, matt-nb6-plus-nbase, matt-nb6-plus-base, matt-nb6-plus, matt-mips64-premerge-20101231, cherry-xenmp-base, cherry-xenmp, bouyer-quota2-nbase, bouyer-quota2-base, bouyer-quota2
Branch point for: yamt-pagecache, tls-maxphys
Changes since 1.29: +3 -3 lines
Diff to previous 1.29 (colored) to selected 1.26 (colored)

Three changes in a single commit.

- drop the notion of frags (LFS fragments) vs fsb (FFS fragments)
  The code uses a complicated unity function that just makes the
  code difficult to understand.

- support larger sector sizes. Fix disk address computations
  to use DEV_BSIZE in the kernel as required by device drivers
  and to use sector sizes in userland.

- Fix several locking bugs in lfs_bio.c and lfs_subr.c.

Revision 1.28.8.1 / (download) - annotate - [select for diffs], Tue Nov 6 23:12:35 2007 UTC (16 years, 5 months ago) by matt
Branch: matt-armv6
CVS Tags: matt-armv6-prevmlocking
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored) next main 1.29 (colored) to selected 1.26 (colored)

sync with HEAD

Revision 1.29 / (download) - annotate - [select for diffs], Mon Oct 8 21:39:49 2007 UTC (16 years, 6 months ago) by ad
Branch: MAIN
CVS Tags: yamt-pf42-baseX, yamt-pf42-base4, yamt-pf42-base3, yamt-pf42-base2, yamt-pf42-base, yamt-pf42, wrstuden-revivesa-base-3, wrstuden-revivesa-base-2, wrstuden-revivesa-base-1, wrstuden-revivesa-base, wrstuden-revivesa, netbsd-5-base, netbsd-5-2-RELEASE, netbsd-5-2-RC1, netbsd-5-2-3-RELEASE, netbsd-5-2-2-RELEASE, netbsd-5-2-1-RELEASE, netbsd-5-2, netbsd-5-1-RELEASE, netbsd-5-1-RC4, netbsd-5-1-RC3, netbsd-5-1-RC2, netbsd-5-1-RC1, netbsd-5-1-5-RELEASE, netbsd-5-1-4-RELEASE, netbsd-5-1-3-RELEASE, netbsd-5-1-2-RELEASE, netbsd-5-1-1-RELEASE, netbsd-5-1, netbsd-5-0-RELEASE, netbsd-5-0-RC4, netbsd-5-0-RC3, netbsd-5-0-RC2, netbsd-5-0-RC1, netbsd-5-0-2-RELEASE, netbsd-5-0-1-RELEASE, netbsd-5-0, netbsd-5, mjf-devfs2-base, mjf-devfs2, mjf-devfs-base, mjf-devfs, matt-premerge-20091211, matt-nb5-pq3-base, matt-nb5-pq3, matt-nb5-mips64-u2-k2-k4-k7-k8-k9, matt-nb5-mips64-u1-k1-k5, matt-nb5-mips64-premerge-20101231, matt-nb5-mips64-premerge-20091211, matt-nb5-mips64-k15, matt-nb5-mips64, matt-nb4-mips64-k7-u2a-k9b, matt-mips64-base2, matt-armv6-nbase, matt-armv6-base, keiichi-mipv6-base, keiichi-mipv6, jym-xensuspend-nbase, jym-xensuspend-base, jym-xensuspend, hpcarm-cleanup-nbase, hpcarm-cleanup-base, cube-autoconf-base, cube-autoconf
Changes since 1.28: +3 -3 lines
Diff to previous 1.28 (colored) to selected 1.26 (colored)

Give brelse() a second argument so that it matches the kernel.
fsck_lfs now compiles again.

Revision 1.28 / (download) - annotate - [select for diffs], Thu Nov 9 19:36:36 2006 UTC (17 years, 5 months ago) by christos
Branch: MAIN
CVS Tags: wrstuden-fixsa-newbase, wrstuden-fixsa-base-1, wrstuden-fixsa-base, wrstuden-fixsa, netbsd-4-base, netbsd-4-0-RELEASE, netbsd-4-0-RC5, netbsd-4-0-RC4, netbsd-4-0-RC3, netbsd-4-0-RC2, netbsd-4-0-RC1, netbsd-4-0-1-RELEASE, netbsd-4-0, netbsd-4, matt-mips64-base, matt-mips64, hpcarm-cleanup
Branch point for: matt-armv6
Changes since 1.27: +17 -46 lines
Diff to previous 1.27 (colored) to selected 1.26 (colored)

Fix malloc/realloc/calloc issues: always check and exit, use EEXIT instead
of 8.

Revision 1.27 / (download) - annotate - [select for diffs], Mon Oct 16 03:21:34 2006 UTC (17 years, 6 months ago) by christos
Branch: MAIN
Changes since 1.26: +3 -2 lines
Diff to previous 1.26 (colored)

comment out/delete impossible code

Revision 1.26 / (download) - annotate - [selected], Fri Sep 1 19:52:48 2006 UTC (17 years, 7 months ago) by perseant
Branch: MAIN
Changes since 1.25: +31 -3 lines
Diff to previous 1.25 (colored)

Several fixes to improve the reliability of the roll-forward agent.
Also, note "properly orphaned" files as distinct from corrupted files.

Revision 1.25 / (download) - annotate - [select for diffs], Tue Jul 18 23:37:13 2006 UTC (17 years, 9 months ago) by perseant
Branch: MAIN
CVS Tags: abandoned-netbsd-4-base, abandoned-netbsd-4
Changes since 1.24: +7 -7 lines
Diff to previous 1.24 (colored) to selected 1.26 (colored)

Various improvements to fsck_lfs, to wit:

* Add lfs_balloc capability to the lfs library.
* Extend the Ifile if we run out of free inodes when creating lost+found.
* Don't roll forward if we have allocated a lost+found, to avoid
  conflicts when adding new files in roll-forward.
* Make some messages slightly more verbose (e.g. include inode number,
  and use pwarn() instead of printf() so the messages include the device
  name when preening).
* Change superblock detection/avoidance to use the offset table in the
  primary superblock, rather than looking at the contents.
* Be more verbose about various operations when passed the -d flag,
  especially roll-forward.
* Be more careful about dirops during roll forward, since the cleaner can
  sometimes write blocks from dirop vnodes.  Detect and avoid this problem.
* Always check the free list, even if given -i; if we're going to write
  it we have to check it first.
* Mark inodes dirty when blocks are found during roll forward, so the
  inodes are written with the new block locations.
* Update size of inodes if blocks beyond EOF are found during roll
  forward.
* Fix segment accounting for blocks and inodes found during roll
  forward.
* Report statistics on roll forward: how many new/deleted/moved files
  and how many updated blocks (or "nothing new").
* Don't care if the device being checked is really a device, if we have
  been passed the -f flag (to facilitate automated testing).
* When writing to the disk, use the current time in the segment headers
  rathern than time 0.
* When passed the -i flag, locate the partial segment containing the
  Ifile inode and use that to calculate lfs_offset, lfs_curseg,
  lfs_nextseg.  (Again for automated testing.)

Revision 1.24 / (download) - annotate - [select for diffs], Fri Mar 17 15:53:46 2006 UTC (18 years, 1 month ago) by rumble
Branch: MAIN
Changes since 1.23: +5 -1 lines
Diff to previous 1.23 (colored) to selected 1.26 (colored)

Check for allocation failures in malloc, calloc, realloc, asprintf, and
vasprintf and try to handle them.

Revision 1.23 / (download) - annotate - [select for diffs], Tue Sep 13 04:14:17 2005 UTC (18 years, 7 months ago) by christos
Branch: MAIN
Changes since 1.22: +2 -2 lines
Diff to previous 1.22 (colored) to selected 1.26 (colored)

rename lfs.h to lfs_user.h so that it does not conflict.

Revision 1.22 / (download) - annotate - [select for diffs], Fri Aug 19 02:07:19 2005 UTC (18 years, 8 months ago) by christos
Branch: MAIN
Changes since 1.21: +11 -9 lines
Diff to previous 1.21 (colored) to selected 1.26 (colored)

64 bit inode changes

Revision 1.21 / (download) - annotate - [select for diffs], Mon Jun 27 02:48:28 2005 UTC (18 years, 9 months ago) by christos
Branch: MAIN
Changes since 1.20: +4 -4 lines
Diff to previous 1.20 (colored) to selected 1.26 (colored)

constify

Revision 1.20 / (download) - annotate - [select for diffs], Sun Feb 6 06:13:47 2005 UTC (19 years, 2 months ago) by perry
Branch: MAIN
CVS Tags: netbsd-3-base, netbsd-3-1-RELEASE, netbsd-3-1-RC4, netbsd-3-1-RC3, netbsd-3-1-RC2, netbsd-3-1-RC1, netbsd-3-1-1-RELEASE, netbsd-3-1, netbsd-3-0-RELEASE, netbsd-3-0-RC6, netbsd-3-0-RC5, netbsd-3-0-RC4, netbsd-3-0-RC3, netbsd-3-0-RC2, netbsd-3-0-RC1, netbsd-3-0-3-RELEASE, netbsd-3-0-2-RELEASE, netbsd-3-0-1-RELEASE, netbsd-3-0, netbsd-3
Changes since 1.19: +2 -2 lines
Diff to previous 1.19 (colored) to selected 1.26 (colored)

remove obsolete "register" declarations.

Revision 1.19 / (download) - annotate - [select for diffs], Wed Jan 19 19:41:59 2005 UTC (19 years, 3 months ago) by xtraeme
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored) to selected 1.26 (colored)

ANSIfy, WARNS=2

Revision 1.18 / (download) - annotate - [select for diffs], Sun Jul 18 20:51:30 2004 UTC (19 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.17: +5 -7 lines
Diff to previous 1.17 (colored) to selected 1.26 (colored)

zero-out dinode is not a proper way to 'clear' an lfs inode.

Revision 1.17 / (download) - annotate - [select for diffs], Thu Aug 7 10:04:23 2003 UTC (20 years, 8 months ago) by agc
Branch: MAIN
CVS Tags: netbsd-2-base, netbsd-2-1-RELEASE, netbsd-2-1-RC6, netbsd-2-1-RC5, netbsd-2-1-RC4, netbsd-2-1-RC3, netbsd-2-1-RC2, netbsd-2-1-RC1, netbsd-2-1, netbsd-2-0-base, netbsd-2-0-RELEASE, netbsd-2-0-RC5, netbsd-2-0-RC4, netbsd-2-0-RC3, netbsd-2-0-RC2, netbsd-2-0-RC1, netbsd-2-0-3-RELEASE, netbsd-2-0-2-RELEASE, netbsd-2-0-1-RELEASE, netbsd-2-0, netbsd-2
Changes since 1.16: +2 -6 lines
Diff to previous 1.16 (colored) to selected 1.26 (colored)

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22308, verified by myself.

Revision 1.16 / (download) - annotate - [select for diffs], Sat Jul 12 11:49:04 2003 UTC (20 years, 9 months ago) by yamt
Branch: MAIN
Changes since 1.15: +5 -2 lines
Diff to previous 1.15 (colored) to selected 1.26 (colored)

fix a null dereference on stale inode.

Revision 1.15 / (download) - annotate - [select for diffs], Wed Apr 2 10:39:28 2003 UTC (21 years ago) by fvdl
Branch: MAIN
Changes since 1.14: +4 -4 lines
Diff to previous 1.14 (colored) to selected 1.26 (colored)

Add support for UFS2. UFS2 is an enhanced FFS, adding support for
64 bit block pointers, extended attribute storage, and a few
other things.

This commit does not yet include the code to manipulate the extended
storage (for e.g. ACLs), this will be done later.

Originally written by Kirk McKusick and Network Associates Laboratories for
FreeBSD.

Revision 1.14 / (download) - annotate - [select for diffs], Fri Mar 28 08:09:54 2003 UTC (21 years ago) by perseant
Branch: MAIN
Changes since 1.13: +95 -138 lines
Diff to previous 1.13 (colored) to selected 1.26 (colored)

Add working writing ability to fsck_lfs, including roll-forward, based on
a partial-segment writer ported from the kernel.

Revision 1.13 / (download) - annotate - [select for diffs], Fri Jan 24 21:55:10 2003 UTC (21 years, 2 months ago) by fvdl
Branch: MAIN
Changes since 1.12: +6 -4 lines
Diff to previous 1.12 (colored) to selected 1.26 (colored)

Bump daddr_t to 64 bits. Replace it with int32_t in all places where
it was used on-disk, so that on-disk formats remain the same.
Remove ufs_daddr_t and ufs_lbn_t for the time being.

Revision 1.12 / (download) - annotate - [select for diffs], Tue Sep 25 00:03:25 2001 UTC (22 years, 6 months ago) by wiz
Branch: MAIN
CVS Tags: netbsd-1-6-base, netbsd-1-6-RELEASE, netbsd-1-6-RC3, netbsd-1-6-RC2, netbsd-1-6-RC1, netbsd-1-6-PATCH002-RELEASE, netbsd-1-6-PATCH002-RC4, netbsd-1-6-PATCH002-RC3, netbsd-1-6-PATCH002-RC2, netbsd-1-6-PATCH002-RC1, netbsd-1-6-PATCH002, netbsd-1-6-PATCH001-RELEASE, netbsd-1-6-PATCH001-RC3, netbsd-1-6-PATCH001-RC2, netbsd-1-6-PATCH001-RC1, netbsd-1-6-PATCH001, netbsd-1-6, fvdl_fs64_base
Changes since 1.11: +2 -2 lines
Diff to previous 1.11 (colored) to selected 1.26 (colored)

Add some \n to error messages.

Revision 1.11 / (download) - annotate - [select for diffs], Fri Jul 13 20:30:19 2001 UTC (22 years, 9 months ago) by perseant
Branch: MAIN
Changes since 1.10: +5 -6 lines
Diff to previous 1.10 (colored) to selected 1.26 (colored)

Merge the short-lived perseant-lfsv2 branch into the trunk.

Kernels and tools understand both v1 and v2 filesystems; newfs_lfs
generates v2 by default.  Changes for the v2 layout include:

- Segments of non-PO2 size and arbitrary block offset, so these can be
  matched to convenient physical characteristics of the partition (e.g.,
  stripe or track size and offset).

- Address by fragment instead of by disk sector, paving the way for
  non-512-byte-sector devices.  In theory fragments can be as large
  as you like, though in reality they must be smaller than MAXBSIZE in size.

- Use serial number and filesystem identifier to ensure that roll-forward
  doesn't get old data and think it's new.  Roll-forward is enabled for
  v2 filesystems, though not for v1 filesystems by default.

- The inode free list is now a tailq, paving the way for undelete (undelete
  is not yet implemented, but can be without further non-backwards-compatible
  changes to disk structures).

- Inode atime information is kept in the Ifile, instead of on the inode;
  that is, the inode is never written *just* because atime was changed.
  Because of this the inodes remain near the file data on the disk, rather
  than wandering all over as the disk is read repeatedly.  This speeds up
  repeated reads by a small but noticeable amount.

Other changes of note include:

- The ifile written by newfs_lfs can now be of arbitrary length, it is no
  longer restricted to a single indirect block.

- Fixed an old bug where ctime was changed every time a vnode was created.
  I need to look more closely to make sure that the times are only updated
  during write(2) and friends, not after-the-fact during a segment write,
  and certainly not by the cleaner.

Revision 1.10.2.1 / (download) - annotate - [select for diffs], Mon Jul 2 17:48:13 2001 UTC (22 years, 9 months ago) by perseant
Branch: perseant-lfsv2
Changes since 1.10: +5 -6 lines
Diff to previous 1.10 (colored) next main 1.11 (colored) to selected 1.26 (colored)

Change disk addressing unit to be the fragment, instead of the disk sector.
All quantities in the superblock, inodes, indirect blocks, etc. refer now
to this abstract unit (called "fsb" as it is in FFS) instead of disk sectors;
as a consequence segment summary blocks have to be multiples of a fragment in
size.  In v1 filesystems, compatibility code ensures that 1 fsb == 1 sector,
regardless of fragment size.

Fragments can now range in size between 512 and 32k; in the event that
LFS_LABELPAD (8k) is smaller than the disk address unit size, an extra
proto-superblock is kept at 8k from the beginning of the disk, to be used
*only* to locate the real superblocks.  (Not all of the userland knows about
this yet.)

Almost all of this was done not by me, but by joff.

Revision 1.10 / (download) - annotate - [select for diffs], Sat Jan 6 23:08:26 2001 UTC (23 years, 3 months ago) by joff
Branch: MAIN
CVS Tags: perseant-lfsv2-base
Branch point for: perseant-lfsv2
Changes since 1.9: +4 -5 lines
Diff to previous 1.9 (colored) to selected 1.26 (colored)

Fixed blockmap handling to properly use disk blocks rather than fragments.
Fixes an issue with fsck_lfs not detecting all duplicate blocks that may
exist in a corrupted filesystem.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Jan 5 02:02:58 2001 UTC (23 years, 3 months ago) by lukem
Branch: MAIN
Changes since 1.8: +5 -4 lines
Diff to previous 1.8 (colored) to selected 1.26 (colored)

use %ll_ instead of the less standard %q_

Revision 1.6.2.1 / (download) - annotate - [select for diffs], Thu Jun 22 16:05:26 2000 UTC (23 years, 10 months ago) by minoura
Branch: minoura-xpg4dl
Changes since 1.6: +11 -23 lines
Diff to previous 1.6 (colored) next main 1.7 (colored) to selected 1.26 (colored)

Sync w/ netbsd-1-5-base.

Revision 1.8 / (download) - annotate - [select for diffs], Wed Jun 14 18:43:59 2000 UTC (23 years, 10 months ago) by perseant
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5
Changes since 1.7: +8 -22 lines
Diff to previous 1.7 (colored) to selected 1.26 (colored)

Add "-i" flag to specify the location of the index file inode, to
examine alternate checkpoints.  Regularize usage of maxino.  Remove olf
debugging cruft.

Revision 1.7 / (download) - annotate - [select for diffs], Tue May 30 04:33:15 2000 UTC (23 years, 10 months ago) by perseant
Branch: MAIN
Changes since 1.6: +4 -2 lines
Diff to previous 1.6 (colored) to selected 1.26 (colored)

Check for cycles in the inode free list, and for free inodes not on the free
list.

Revision 1.6 / (download) - annotate - [select for diffs], Tue May 23 01:48:54 2000 UTC (23 years, 11 months ago) by perseant
Branch: MAIN
CVS Tags: minoura-xpg4dl-base
Branch point for: minoura-xpg4dl
Changes since 1.5: +85 -90 lines
Diff to previous 1.5 (colored) to selected 1.26 (colored)

Convert to NetBSD source code style

Revision 1.5 / (download) - annotate - [select for diffs], Tue May 16 04:55:59 2000 UTC (23 years, 11 months ago) by perseant
Branch: MAIN
Changes since 1.4: +71 -31 lines
Diff to previous 1.4 (colored) to selected 1.26 (colored)

fsck_lfs can now write to the filesystem, allowing it to correct most
(though still not all) errors in a damaged lfs.  Segment byte accounting
is corrected in pass 5.  "fsck_lfs -p" will do a partial roll-forward,
verifying the checkpoint from the newer superblock.  fscknames[] is
updated so that fsck knows about fsck_lfs.

Revision 1.2.2.1 / (download) - annotate - [select for diffs], Fri Jan 21 00:34:57 2000 UTC (24 years, 3 months ago) by he
Branch: netbsd-1-4
CVS Tags: netbsd-1-4-PATCH003, netbsd-1-4-PATCH002
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored) next main 1.3 (colored) to selected 1.26 (colored)

Pull up revision 1.4 (requested by perseant):
  Fix name collision error due to recent kernel prototype updates.
  Fixes PR#9253.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jan 20 21:32:32 2000 UTC (24 years, 3 months ago) by perseant
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored) to selected 1.26 (colored)

Rename lfs_ifind so that it does not conflict with new kernel prototype.
Addresses PR #9253.

Revision 1.3 / (download) - annotate - [select for diffs], Sat Jul 3 19:55:03 1999 UTC (24 years, 9 months ago) by kleink
Branch: MAIN
CVS Tags: wrstuden-devbsize-base, wrstuden-devbsize-19991221, wrstuden-devbsize, comdex-fall-1999-base, comdex-fall-1999
Changes since 1.2: +1 -1 lines
Diff to previous 1.2 (colored) to selected 1.26 (colored)

RCS Id police.

Revision 1.2 / (download) - annotate - [select for diffs], Wed Mar 24 05:32:23 1999 UTC (25 years, 1 month ago) by nathanw
Branch: MAIN
CVS Tags: netbsd-1-4-base, netbsd-1-4-RELEASE, netbsd-1-4-PATCH001
Branch point for: netbsd-1-4
Changes since 1.1: +6 -6 lines
Diff to previous 1.1 (colored) to selected 1.26 (colored)

printf format fixes for Alpha.

Revision 1.1 / (download) - annotate - [select for diffs], Thu Mar 18 02:02:19 1999 UTC (25 years, 1 month ago) by perseant
Branch: MAIN
Diff to selected 1.26 (colored)

Initial checkin of fsck_lfs.  This version cannot do any repair (-p flag
does nothing, and one of -p or -n is required) but can be useful as a
diagnostic tool.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.




CVSweb <webmaster@jp.NetBSD.org>