ANDROID: rename struct task_struct.in_eventfd to fix ABI
In commitf8e80792c1("eventfd: guard wake_up in eventfd fs calls as well"), the field in_eventfd_signal in struct task_struct was renamed to in_eventfd which breaks the stable kernel ABI in android. Rename it back to preserve the ABI. Bug: 161946584 Fixes:f8e80792c1("eventfd: guard wake_up in eventfd fs calls as well") Signed-off-by: Greg Kroah-Hartman <gregkh@google.com> Change-Id: If076bdc4baa3a460c9512403c8f4ea1da8848a13
This commit is contained in:
14
fs/eventfd.c
14
fs/eventfd.c
@@ -69,17 +69,17 @@ __u64 eventfd_signal(struct eventfd_ctx *ctx, __u64 n)
|
||||
* it returns false, the eventfd_signal() call should be deferred to a
|
||||
* safe context.
|
||||
*/
|
||||
if (WARN_ON_ONCE(current->in_eventfd))
|
||||
if (WARN_ON_ONCE(current->in_eventfd_signal))
|
||||
return 0;
|
||||
|
||||
spin_lock_irqsave(&ctx->wqh.lock, flags);
|
||||
current->in_eventfd = 1;
|
||||
current->in_eventfd_signal = 1;
|
||||
if (ULLONG_MAX - ctx->count < n)
|
||||
n = ULLONG_MAX - ctx->count;
|
||||
ctx->count += n;
|
||||
if (waitqueue_active(&ctx->wqh))
|
||||
wake_up_locked_poll(&ctx->wqh, EPOLLIN);
|
||||
current->in_eventfd = 0;
|
||||
current->in_eventfd_signal = 0;
|
||||
spin_unlock_irqrestore(&ctx->wqh.lock, flags);
|
||||
|
||||
return n;
|
||||
@@ -253,10 +253,10 @@ static ssize_t eventfd_read(struct kiocb *iocb, struct iov_iter *to)
|
||||
__set_current_state(TASK_RUNNING);
|
||||
}
|
||||
eventfd_ctx_do_read(ctx, &ucnt);
|
||||
current->in_eventfd = 1;
|
||||
current->in_eventfd_signal = 1;
|
||||
if (waitqueue_active(&ctx->wqh))
|
||||
wake_up_locked_poll(&ctx->wqh, EPOLLOUT);
|
||||
current->in_eventfd = 0;
|
||||
current->in_eventfd_signal = 0;
|
||||
spin_unlock_irq(&ctx->wqh.lock);
|
||||
if (unlikely(copy_to_iter(&ucnt, sizeof(ucnt), to) != sizeof(ucnt)))
|
||||
return -EFAULT;
|
||||
@@ -303,10 +303,10 @@ static ssize_t eventfd_write(struct file *file, const char __user *buf, size_t c
|
||||
}
|
||||
if (likely(res > 0)) {
|
||||
ctx->count += ucnt;
|
||||
current->in_eventfd = 1;
|
||||
current->in_eventfd_signal = 1;
|
||||
if (waitqueue_active(&ctx->wqh))
|
||||
wake_up_locked_poll(&ctx->wqh, EPOLLIN);
|
||||
current->in_eventfd = 0;
|
||||
current->in_eventfd_signal = 0;
|
||||
}
|
||||
spin_unlock_irq(&ctx->wqh.lock);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ void eventfd_ctx_do_read(struct eventfd_ctx *ctx, __u64 *cnt);
|
||||
|
||||
static inline bool eventfd_signal_allowed(void)
|
||||
{
|
||||
return !current->in_eventfd;
|
||||
return !current->in_eventfd_signal;
|
||||
}
|
||||
|
||||
#else /* CONFIG_EVENTFD */
|
||||
|
||||
@@ -951,7 +951,7 @@ struct task_struct {
|
||||
#endif
|
||||
#ifdef CONFIG_EVENTFD
|
||||
/* Recursion prevention for eventfd_signal() */
|
||||
unsigned in_eventfd:1;
|
||||
unsigned in_eventfd_signal:1;
|
||||
#endif
|
||||
|
||||
unsigned long atomic_flags; /* Flags requiring atomic access. */
|
||||
|
||||
Reference in New Issue
Block a user