On Tue, May 6, 2025 at 4:09 AM Miklos Szeredi <miklos@xxxxxxxxxx> wrote: > > On Fri, 18 Apr 2025 at 23:06, Joanne Koong <joannelkoong@xxxxxxxxx> wrote: > > > > Use a bitfield for tracking initialized, blocked, aborted, and io_uring > > state of the fuse connection. Track connected state using a bool instead > > of an unsigned. > > > > On a 64-bit system, this shaves off 16 bytes from the size of struct > > fuse_conn. > > > > No functional changes. > > Not sure about that. > > AFAIK aligned int or long is supposed to be independent from > neighboring fields on all architectures. But that's definitely not > true of bitfields and I'm not sure about bool. Maybe > READ_ONCE()/WRITE_ONCE() make accessing bool safe, but I haven't found > any documentation about that. Ohh interesting. That's a great point about race conditions from modifying values that might be packed together. I will drop this patch then. Thanks, Joanne > > Previous rule about bitfields in fuse_conn have been that they are either > > - only set at INIT reply time, or > - losing a setting due to a race is a non-issue > > The new ones are not so clear cut, so it definitely needs some more > explanation why they are safe (if they are safe). > > Thanks, > Miklos