summaryrefslogtreecommitdiffstats
path: root/sys/fs
diff options
context:
space:
mode:
authortrasz <trasz@FreeBSD.org>2009-01-13 22:35:26 +0000
committertrasz <trasz@FreeBSD.org>2009-01-13 22:35:26 +0000
commitd1a4f985b97954be6dd37da424c1c125c9dcdac2 (patch)
treec9cbea04991852af887c88658a5f96f4351c44fc /sys/fs
parent308074876c274a4453aa69d44b08752f281bfa3a (diff)
downloadFreeBSD-src-d1a4f985b97954be6dd37da424c1c125c9dcdac2.zip
FreeBSD-src-d1a4f985b97954be6dd37da424c1c125c9dcdac2.tar.gz
Turn a "panic: non-decreasing id" into an error printf. This seems
to be caused by a metadata corruption that occurs quite often after unplugging a pendrive during write activity. Reviewed by: scottl Approved by: rwatson (mentor) Sponsored by: FreeBSD Foundation
Diffstat (limited to 'sys/fs')
-rw-r--r--sys/fs/msdosfs/msdosfs_conv.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/fs/msdosfs/msdosfs_conv.c b/sys/fs/msdosfs/msdosfs_conv.c
index 25efcc5..50dc1a0 100644
--- a/sys/fs/msdosfs/msdosfs_conv.c
+++ b/sys/fs/msdosfs/msdosfs_conv.c
@@ -1060,8 +1060,11 @@ mbnambuf_write(struct mbnambuf *nbp, char *name, int id)
char *slot;
size_t count, newlen;
- KASSERT(nbp->nb_len == 0 || id == nbp->nb_last_id - 1,
- ("non-decreasing id: id %d, last id %d", id, nbp->nb_last_id));
+ if (nbp->nb_len != 0 && id != nbp->nb_last_id - 1) {
+ printf("msdosfs: non-decreasing id: id %d, last id %d\n",
+ id, nbp->nb_last_id);
+ return;
+ }
/* Will store this substring in a WIN_CHARS-aligned slot. */
slot = &nbp->nb_buf[id * WIN_CHARS];
OpenPOWER on IntegriCloud