summaryrefslogtreecommitdiff
path: root/src/journal/managed-journal-file.c
Commit message (Collapse)AuthorAgeFilesLines
* journal: handle EADDRNOTAVAIL in two more cases gracefullyLennart Poettering2023-05-031-0/+1
| | | | Follow-up for #27488.
* copy: Move chattr arguments to full function signaturesDaan De Meyer2023-03-211-4/+5
| | | | | These are almost never used, so let's move them to the _full() functions signatures.
* journal-file: drop checking if files are from the future at time of openLennart Poettering2023-02-211-2/+1
| | | | | | | | We nowadays check for ordering anyway at time of writing entries, hence we don't have to do that at moment of opening, too. Benefit of dropping this check: we can safely archive files from the future instead of marking them as broken.
* journald: some minor modernizationsLennart Poettering2023-02-011-8/+27
|
* journald: don't check for -EREMCHG on open, given that open doesn't generate itLennart Poettering2023-01-271-2/+1
| | | | | We generate EREMCHG when writing entries, but not during open, hence don't bother with checking for it.
* journal: handle clock rollback error in managed_journal_file_open_reliablymsizanoen12023-01-091-1/+2
| | | | | -EREMCHG was introduced to denote a clock rollback detection error. Handle this in managed_journal_file_open_reliably.
* journal: fix indentation in managed_journal_file_open_reliablymsizanoen12022-10-161-2/+2
|
* journald: harden against forward clock jumps before unclean shutdownmsizanoen12022-10-161-0/+14
| | | | | | | | | Try harder to inherit the sequence number and ID from the old journal file before rotating it away. This helps the libsystemd journal file selection code make better decisions even in the face of massive incorrect forward clock jumps prior to an unclean shutdown.
* journal: Use 32-bit entry array offsets in compact modeDaan De Meyer2022-10-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: OBJECT TYPE ENTRIES SIZE Unused 0 0B Data 3610336 595.7M Field 5310 285.2K Entry 3498326 1.2G Data Hash Table 29 103.1M Field Hash Table 29 151.3K Entry Array 605991 1011.6M Tag 0 0B Total 7720021 2.9G After: OBJECT TYPE ENTRIES SIZE Unused 0 0B Data 3562667 591.0M Field 3971 213.6K Entry 3498566 1.2G Data Hash Table 20 71.1M Field Hash Table 20 104.3K Entry Array 582647 505.0M Tag 0 0B Total 7647891 2.4G
* journal: replace __sync intrinsics with __atomicmatoro2022-07-141-17/+42
|
* sd-event: allow sd_event_source_is_enabled() to return false for NULLZbigniew Jędrzejewski-Szmek2022-06-301-6/+3
| | | | | | | | | | | This is a natural use case, and instead of defining a wrapper to do this for us, let's just make this part of the API. Calling with NULL was not allowed, so this is not a breaking change to the interface. (After sd_event_source_is_enabled was originally added, we introduced sd_event_source_disable_unref() and other similar functions which accept NULL. So not accepting NULL here is likely to confuse people. Let's just make the API usable with minimal fuss.)
* journal: return & log in one statementFrantisek Sumsal2022-05-301-4/+3
|
* journal: Use header macros everywhere instead of JournalFile fieldsDaan De Meyer2022-05-031-3/+3
| | | | | Let's standardize on the journal header as a single source of truth and remove redundant information from the JournalFile struct.
* journal-file: merge compress/seal bool args into a single flags paramLennart Poettering2022-03-251-16/+12
| | | | | | | Just some modernization/refactoring. No change in behaviour, just let's do how we do things these days: use flags param instead of list of bools.
* journal: preserve acls when rotating user journals with NOCOW attribute setFranck Bui2022-03-141-1/+4
| | | | | | | When restoring the COW flag for journals on BTRFS, the full journal contents are copied into new files. But during these operations, the acls of the previous files were lost and users were not able to access to their old journal contents anymore.
* journal-file: explicitly handle file systems that do not support hole punchingLennart Poettering2022-02-041-3/+14
| | | | | | | | Apparently the error code fallocate() returns if hole punching is not supported is not too well defined (man page just says "an error is returned"), hence let's accept the usual set of errors, and the normalize it to EOPNOTSUPP, and generate a clear error message in this case.
* journal-file: fix error handling of pread() in journald_file_punch_holes()Lennart Poettering2022-02-041-3/+10
|
* journal: when copying journal file to undo NOCOW flag, go via fdLennart Poettering2022-02-031-1/+1
| | | | | | | | | | | | We have the journal file open already, hence reference it via the fd insted of the file name. After all, some other tool might have renamed/deleted it already. Let's not actually reuse the fd though, since we want a separate file offset for the copying, hence just make it simply and reopen via /proc/self/fd/. Follow-up for d71ece3f0b85c7a3decc50143b68ac07fc5831ae
* journal: Rename JournaldFile to ManagedJournalFileDaan De Meyer2022-02-021-0/+509
JournalFile and JournaldFile are hard to distinguish from each other. Let's use ManagedJournalFile instead to make the distinction more clear.