On Wed Nov 18, 2026 at 4:16 PM CET, Pali Rohár wrote: > On Wednesday 18 November 2026 15:58:02 koraynilay wrote: >> On Wed Nov 18, 2026 at 3:26 PM CET, Pali Rohár wrote: >> > Hello, >> > >> > I have just one issue with the userspace API. It does not allow me to >> > figure out what is the source of statx btime field. If it is fs ptime or >> > fs btime because this RFC implementation is mixing both fs ptime and >> > fs btime into the statx btime field. >> > >> > I have feeling that this is quite a mess in API and I would like to see >> > a clear distinguish between btime and ptime in the API, like there is a >> > difference in the fs storage. >> > >> > If the btime is used for forensic analysis then somehow I would expect >> > that the statx would not report / not fill changeable ptime value into >> > the statx btime. >> >> Hi, for native linux filesystems it will report ptime as PTIME and btime >> as BTIME (also semnatically). > > That is fine. > >> for the windows-like ones that only have >> ptime (semantically) I think it's reasonable to not expect btime to be >> immutable, since they are meant to be used with other OSs who lack btime >> semantics. > > The problem is here that the RFC statx API does not provide this > information that the fs lacks btime semantics and instead it fills > non-immutable ptime value there. > > I'm pointing only about this inconsistency. > >> > It would be really helpful if the statx API on inode can differ between: >> > >> > 1. btime is present and its value is ..., ptime is not supported >> > 2. btime is not supported, ptime is set to value ... >> > 3. btime is present and its value is ..., ptime is set to value ... >> > 4. both btime and ptime are not supported >> > >> > This should cover all cases of different filesystems and also allows >> > userspace to do proper backup of both ptime and btime fields (if it want >> > to do forensic analysis or anything else). >> >> These should already all be covered by STATX_BTIME/PTIME and their >> fields in struct statx, the only problems are windows-like filesystems, >> which IMO shuold be handled as mentioned above. > > Exactly, I pointed out about these problems. I somehow expect that the > new API would be generic and uniform across filesystem. IMHO it does not > matter if the filesystem is windows-like or not (there are also FreeBSD > fs and also others which allows to modify that time). So better > description is fs belongs to category 2. from my above description. Ah yes, I used windows-like to mean "only have ptime semantics", so same as your category 2. >> Of course, as in the other discussion, I'm open to changing ptime >> NTFS/exFAT/... support to remove btime altogether and only use ptime for >> their own crtime if that's what wanted (I'm fairly impartial on this >> specific issue). > > I'm giving some ideas how to possible handle this situation: > > 1. do not fill btime it at all when it is not available (remove btime > altogether - the case like you wrote above) This would be the most semantically correct option, but would break at least 1 script/program/use case. > 2. when userspace ask both ptime and btime, then do not fill btime > (remove btime altogether - but only for that new case) This probably is the best compromise. > 3. fill btime with ptime value, but add a new output flag indicating that > the btime is not present at all and instead kernel filled ptime value > into the statx btime field I don't really like this, it adds complexity and uses memory/1 flag big for a single specific field, IMO it's not worth it. > 4. let statx btime as currently is, and add two new statx fields: > immutable_btime and ptime. immutable_btime would be filled only if the > fs supports real btime (so not for ntfs/extfat crtime) and ptime would > be what is currently in RFC I think this is also too complex. > Ideas 2. 3. and 4. should be fully backward compatible as it would > affect statx output only when called with new flags. Then 2. is probably the best way to go forward (maybe I'll include it in some way in v5), but I think we should let each filesystem maintainer decide if they think their users want to have statx report their own crtime as btime, ptime or both (native linux ones would of course report btime as btime and ptime as ptime). Thanks, koraynilay >> Thanks, >> koraynilay >> >> > >> > Pali