File Expiration Using BPF
hondu.co
File Expiration Using BPF
1–10 of 24 posts
Re: File Expiration Using BPF
#2Maybe this comment will save you a google. But probably not.
Re: File Expiration Using BPF
#3I get that it's fun to experiment with BPF, but it's also useful to see how many tools already exist. BPF is powerful, yes - maybe too powerful, and it's often not the best tool for the job.
Re: File Expiration Using BPF
#4This seems a little roundabout. Why is this preferable over using `inotify(7)`? That's an existing system which can notify your userspace driver program about any time `setxattr(2)` is called. I get that it's fun to experiment with BPF, but it's also useful to see how many tools already exist. BPF is powerful, yes - maybe too powerful, and it's often not the best tool for the job.
https://man7.org/linux/man-pages/man7/fanotify.7.html
I think fanotify does xattrs, but I haven't tested.
Re: File Expiration Using BPF
#5If one ever happenes to casually find 'several petabytes of old logs that were not deleted', whoever's in charge should consider having several people fired over that.
Re: File Expiration Using BPF
#6The aim of this proof-of-concept was to showcase how BPF enables the kernel to be programmable. Many behaviours can be retrofitted without having to submit changes upstream. In some cases the overhead may be lower than using other methods (due to avoiding context switches, etc). Even if you decide that the changes can be useful for the broader community, the new feature can be first implemented in BPF, where it’s faster (and safer!) to evolve it.
Re: File Expiration Using BPF
#7This seems a little roundabout. Why is this preferable over using `inotify(7)`? That's an existing system which can notify your userspace driver program about any time `setxattr(2)` is called. I get that it's fun to experiment with BPF, but it's also useful to see how many tools already exist. BPF is powerful, yes - maybe too powerful, and it's often not the best tool for the job.
Here you probably want fanotify, not inotify. The later would require setting up a lot of inotify entries, recursing through the filesystem. https://man7.org/linux/man-pages/man7/fanotify.7.html I think fanotify does xattrs, but I haven't tested.
Would be interesting to compare the chances of race conditions with inotify vs BPF for this contrived use-case.
Re: File Expiration Using BPF
#8BPF --> Berkley Packet Filter Maybe this comment will save you a google. But probably not. https://en.wikipedia.org/wiki/Berkeley_Packet_Filter
Re: File Expiration Using BPF
#9Quite clearly from the "solution looking for a problem" dept. If one ever happenes to casually find 'several petabytes of old logs that were not deleted', whoever's in charge should consider having several people fired over that.
Re: File Expiration Using BPF
#10Quite clearly from the "solution looking for a problem" dept. If one ever happenes to casually find 'several petabytes of old logs that were not deleted', whoever's in charge should consider having several people fired over that.