fs/signalfd: fix build error for BUS_MCEERR_AR
PATCH 1/1 fs/signalfd: fix build error for BUS_MCEERR_AR
From: Randy Dunlap <[email protected]>
Fix build error in fs/signalfd.c by using same method that is used in kernel/signal.c: separate blocks for different signal si_code values.
./fs/signalfd.c: error: 'BUS_MCEERR_AR' undeclared (first use in this function)
--- fs/signalfd.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
Applies to mainline 4.16-rc1.
fs/signalfd.c +12 -3
@@ -118,13 +118,22 @@ static int signalfd_copyinfo(struct sign err |=__put_user (kinfo->si_trapno, &uinfo->ssi_trapno);#endif #ifdef BUS_MCEERR_AO -/* +/* * Other callers might not initialize the si_lsb field, * so check explicitly for the right codes here. */ if (kinfo->si_signo ==SIGBUS && - (kinfo->si_code ==BUS_MCEERR_AR || - kinfo->si_code ==BUS_MCEERR_AO )) + kinfo->si_code ==BUS_MCEERR_AO ) + err |=__put_user ((short ) kinfo->si_addr_lsb, + &uinfo->ssi_addr_lsb); +#endif +#ifdef BUS_MCEERR_AR +/* +* Other callers might not initialize the si_lsb field, +* so check explicitly for the right codes here. +*/ +if (kinfo->si_signo ==SIGBUS && + kinfo->si_code ==BUS_MCEERR_AR ) err |=__put_user ((short ) kinfo->si_addr_lsb, &uinfo->ssi_addr_lsb);#endif
Quoted 11 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix build error in
fs/signalfd.cby using same method that is used inkernel/signal.c: separate blocks for different signalsi_codevalues.
./fs/signalfd.c: error: 'BUS_MCEERR_AR' undeclared (first use in this function)Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by Randy Dunlap <[email protected]>Cc Eric Biederman <[email protected]>Cc Alexander Viro <[email protected]>
Do you want to me to pick this one up? Or does it have another path into mainline?
Eric
Quoted 34 lines
--- fs/signalfd.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)Applies to mainline 4.16-rc1.
fs/signalfd.c +12
-3@@ -118,13 +118,22 @@ static int signalfd_copyinfo(struct sign err |=__put_user (kinfo->si_trapno, &uinfo->ssi_trapno);#endif #ifdef BUS_MCEERR_AO -/* +/* * Other callers might not initialize the si_lsb field, * so check explicitly for the right codes here. */ if (kinfo->si_signo ==SIGBUS && - (kinfo->si_code ==BUS_MCEERR_AR || - kinfo->si_code ==BUS_MCEERR_AO )) + kinfo->si_code ==BUS_MCEERR_AO ) + err |=__put_user ((short ) kinfo->si_addr_lsb, + &uinfo->ssi_addr_lsb); +#endif +#ifdef BUS_MCEERR_AR +/* +* Other callers might not initialize the si_lsb field, +* so check explicitly for the right codes here. +*/ +if (kinfo->si_signo ==SIGBUS && + kinfo->si_code ==BUS_MCEERR_AR ) err |=__put_user ((short ) kinfo->si_addr_lsb, &uinfo->ssi_addr_lsb);#endif
Quoted 14 lines · Eric W. Biederman
Quoted 11 lines · Randy Dunlap
From: Randy Dunlap <[email protected]>
Fix build error in
fs/signalfd.cby using same method that is used inkernel/signal.c: separate blocks for different signalsi_codevalues.
./fs/signalfd.c: error: 'BUS_MCEERR_AR' undeclared (first use in this function)Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by Randy Dunlap <[email protected]>Cc Eric Biederman <[email protected]>Cc Alexander Viro <[email protected]>
Quoted 5 lines
Do you want to me to pick this one up? Or does it have another path into mainline?
Just via you or Al. You might as well take it.
Thanks.
Quoted 35 lines
Quoted 35 lines
--- fs/signalfd.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)Applies to mainline 4.16-rc1.
fs/signalfd.c +12
-3@@ -118,13 +118,22 @@ static int signalfd_copyinfo(struct sign err |=__put_user (kinfo->si_trapno, &uinfo->ssi_trapno);#endif #ifdef BUS_MCEERR_AO -/* +/* * Other callers might not initialize the si_lsb field, * so check explicitly for the right codes here. */ if (kinfo->si_signo ==SIGBUS && - (kinfo->si_code ==BUS_MCEERR_AR || - kinfo->si_code ==BUS_MCEERR_AO )) + kinfo->si_code ==BUS_MCEERR_AO ) + err |=__put_user ((short ) kinfo->si_addr_lsb, + &uinfo->ssi_addr_lsb); +#endif +#ifdef BUS_MCEERR_AR +/* +* Other callers might not initialize the si_lsb field, +* so check explicitly for the right codes here. +*/ +if (kinfo->si_signo ==SIGBUS && + kinfo->si_code ==BUS_MCEERR_AR ) err |=__put_user ((short ) kinfo->si_addr_lsb, &uinfo->ssi_addr_lsb);#endif
Signature · 1 line
~Randy