diff options
author | trasz <trasz@FreeBSD.org> | 2009-01-13 22:35:26 +0000 |
---|---|---|
committer | trasz <trasz@FreeBSD.org> | 2009-01-13 22:35:26 +0000 |
commit | d1a4f985b97954be6dd37da424c1c125c9dcdac2 (patch) | |
tree | c9cbea04991852af887c88658a5f96f4351c44fc | |
parent | 308074876c274a4453aa69d44b08752f281bfa3a (diff) | |
download | FreeBSD-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
-rw-r--r-- | sys/fs/msdosfs/msdosfs_conv.c | 7 |
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]; |