Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lading/src/generator/file_gen/logrotate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ impl Child {
}
}

#[expect(
clippy::expect_used,
reason = "self.names is constructed non-empty at LogrotateGenerator startup"
)]
async fn spin(mut self) -> Result<(), Error> {
let mut handle = self.block_cache.handle();
let buffer_capacity = self
Expand Down
28 changes: 28 additions & 0 deletions lading/src/generator/file_gen/logrotate_fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ impl Server {
/// # Panics
///
/// Function will panic if the filesystem cannot be started.
#[expect(
clippy::expect_used,
reason = "FIXME: fuse_mount2 spawn failure should propagate as an Error variant rather than panic; tracked for follow-up"
)]
pub fn new(
_: generator::General,
config: Config,
Expand Down Expand Up @@ -340,6 +344,10 @@ impl Filesystem for LogrotateFS {
}

#[tracing::instrument(skip(self, reply))]
#[expect(
clippy::expect_used,
reason = "the inner state mutex is held only briefly within fuse callbacks; poisoning indicates a panic during a prior callback and is unrecoverable"
)]
fn lookup(&mut self, _: &Request, parent: u64, name: &OsStr, reply: ReplyEntry) {
let tick = self.get_current_tick();
let mut state = self.state.lock().expect("lock poisoned");
Expand All @@ -362,6 +370,10 @@ impl Filesystem for LogrotateFS {
}

#[tracing::instrument(skip(self, reply))]
#[expect(
clippy::expect_used,
reason = "the inner state mutex is held only briefly within fuse callbacks; poisoning indicates a panic during a prior callback and is unrecoverable"
)]
fn getattr(&mut self, _: &Request, ino: u64, _: Option<u64>, reply: ReplyAttr) {
let tick = self.get_current_tick();
let mut state = self.state.lock().expect("lock poisoned");
Expand All @@ -377,6 +389,10 @@ impl Filesystem for LogrotateFS {
}

#[tracing::instrument(skip(self, reply))]
#[expect(
clippy::expect_used,
reason = "the inner state mutex is held only briefly within fuse callbacks; poisoning indicates a panic during a prior callback and is unrecoverable"
)]
fn read(
&mut self,
_: &Request,
Expand Down Expand Up @@ -416,6 +432,10 @@ impl Filesystem for LogrotateFS {
}

#[tracing::instrument(skip(self, reply))]
#[expect(
clippy::expect_used,
reason = "the inner state mutex is held only briefly within fuse callbacks; poisoning indicates a panic during a prior callback and is unrecoverable"
)]
fn release(
&mut self,
_: &Request,
Expand Down Expand Up @@ -448,6 +468,10 @@ impl Filesystem for LogrotateFS {
}

#[tracing::instrument(skip(self, reply))]
#[expect(
clippy::expect_used,
reason = "the inner state mutex is held only briefly within fuse callbacks; mutex poisoning, parent-inode lookup, file-type lookup, and name lookup are all internal invariants maintained by the fs model"
)]
fn readdir(&mut self, _: &Request, ino: u64, _: u64, offset: i64, mut reply: ReplyDirectory) {
let tick = self.get_current_tick();
let mut state = self.state.lock().expect("lock poisoned");
Expand Down Expand Up @@ -510,6 +534,10 @@ impl Filesystem for LogrotateFS {
}

#[tracing::instrument(skip(self, _req, reply))]
#[expect(
clippy::expect_used,
reason = "the inner state mutex is held only briefly within fuse callbacks; poisoning indicates a panic during a prior callback and is unrecoverable"
)]
fn open(&mut self, _req: &Request, ino: u64, flags: i32, reply: fuser::ReplyOpen) {
let tick = self.get_current_tick();
let mut state = self.state.lock().expect("lock poisoned");
Expand Down
8 changes: 8 additions & 0 deletions lading/src/generator/file_gen/logrotate_fs/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,10 @@ impl State {

#[inline]
#[expect(clippy::too_many_lines)]
#[expect(
clippy::expect_used,
reason = "node/inode lookups operate on entries the model itself just inserted; invariants enforced inside `State`"
)]
fn advance_time_inner(&mut self, now: Tick) {
assert!(now >= self.now);

Expand Down Expand Up @@ -972,6 +976,10 @@ impl State {
/// be advanced -- and a slice up to `size` bytes will be returned or `None`
/// if no bytes are available to be read.
#[tracing::instrument(skip(self))]
#[expect(
clippy::expect_used,
reason = "the bytes-written value is bounded by usize and cannot exceed a machine word here"
)]
pub(crate) fn read(
&mut self,
file_handle: FileHandle,
Expand Down
Loading