Skip to content

Commit

Permalink
utarfs: implement the enumeration of xattrs
Browse files Browse the repository at this point in the history
containerd needs this in some cases when using volume mounts, so
implement it to unblock containerd.

Signed-off-by: Wedson Almeida Filho <[email protected]>
  • Loading branch information
wedsonaf committed Nov 29, 2023
1 parent a6927d1 commit d661b42
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/utarfs/src/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -263,4 +263,21 @@ impl fuser::Filesystem for Tar {
reply.data(b"y");
}
}

fn listxattr(&mut self, _req: &Request<'_>, ino: u64, size: u32, reply: fuser::ReplyXattr) {
let inode = match self.inode(ino) {
Ok(i) => i,
Err(e) => return reply.error(e),
};
if inode.flags & inode_flags::OPAQUE == 0 {
return reply.data(&[]);
}
const DATA: &[u8] = b"trusted.overlay.opaque\0";
const DATA_SIZE: u32 = DATA.len() as u32;
if size < DATA_SIZE {
reply.size(DATA_SIZE);
} else {
reply.data(DATA);
}
}
}

0 comments on commit d661b42

Please sign in to comment.