]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
journal: don't assert on mmap'ed object type
authorLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 09:53:51 +0000 (11:53 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 23 Apr 2020 10:12:55 +0000 (12:12 +0200)
Mappings canbe replaced by all zeroes under our feet if vacuuming
decides to unallocate some file. Hence let's not check for this kind of
stuff in an assert.

(Typically, we should genreate runtime errors in this case, in
particular EBADMSG, which the callers generally look for. But in this
case this is just an extra precaution check anyway, so let's just remove
it.)

src/journal/sd-journal.c

index 720ec3614524f3c0c6ec65c48b1adaec45dc0ce9..ca80eb2f1c6dc04c1d7db9d392b657144085365d 100644 (file)
@@ -119,7 +119,6 @@ static void init_location(Location *l, LocationType type, JournalFile *f, Object
         assert(l);
         assert(IN_SET(type, LOCATION_DISCRETE, LOCATION_SEEK));
         assert(f);
-        assert(o->object.type == OBJECT_ENTRY);
 
         *l = (Location) {
                 .type = type,