Skip to content

Commit a09acf4

Browse files
committed
vfs: Remove the const from dir_context::actor
Remove the const marking from the actor function pointer in the dir_context struct. The const prevents the structure from being used as part of a kmalloc'd object as it makes the compiler require that the actor member be set at object initialisation time (or not at all), incuring something like the following error if you try and set it later: fs/afs/dir.c:556:20: error: assignment of read-only member 'actor' Marking the member const like this adds very little in the way of sanity checking as the type checking system is likely to provide sufficient - and if not, the kernel is very likely to oops repeatably in this case. Fixes: ac6614b ("[readdir] constify ->actor") Signed-off-by: David Howells <dhowells@redhat.com> Reviewed-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent fd3b36d commit a09acf4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎include/linux/fs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1667,7 +1667,7 @@ typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64,
16671667
unsigned);
16681668

16691669
struct dir_context {
1670-
const filldir_t actor;
1670+
filldir_t actor;
16711671
loff_t pos;
16721672
};
16731673

0 commit comments

Comments
 (0)