diff options
| author | Mateusz Guzik <mjguzik@gmail.com> | 2025-10-09 09:59:28 +0200 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-10-20 20:22:28 +0200 |
| commit | 2ed81b4bef9b74ae0f095ad4667dbe2ae0b86a91 (patch) | |
| tree | 25b85b1460f196b0d6c1f2ccffb860edf4863a65 /mm/filemap.c | |
| parent | 18c61399f6b9bae796e0a4a88e96967639fa8218 (diff) | |
fs: make plain ->i_state access fail to compile
... to make sure all accesses are properly validated.
Merely renaming the var to __i_state still lets the compiler make the
following suggestion:
error: 'struct inode' has no member named 'i_state'; did you mean '__i_state'?
Unfortunately some people will add the __'s and call it a day.
In order to make it harder to mess up in this way, hide it behind a
struct. The resulting error message should be convincing in terms of
checking what to do:
error: invalid operands to binary & (have 'struct inode_state_flags' and 'int')
Of course people determined to do a plain access can still do it, but
nothing can be done for that case.
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'mm/filemap.c')
0 files changed, 0 insertions, 0 deletions