From: David Howells Date: Mon, 9 Apr 2018 20:12:30 +0000 (+0100) Subject: vfs: Remove the const from dir_context::actor X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a09acf4b43b90581bf53b0c03cc84ed693bf27e2;p=openwrt%2Fstaging%2Fblogic.git 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: ac6614b76478 ("[readdir] constify ->actor") Signed-off-by: David Howells Reviewed-by: Al Viro --- diff --git a/include/linux/fs.h b/include/linux/fs.h index 1ee7f592e239..3a5c19d9f651 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -1667,7 +1667,7 @@ typedef int (*filldir_t)(struct dir_context *, const char *, int, loff_t, u64, unsigned); struct dir_context { - const filldir_t actor; + filldir_t actor; loff_t pos; };