Fix the long time ioctl problem.
On some boards ioctl() takes a long time (several seconds) to perform
discarding blocks for a few hundred MB (which might be expected). This
causes the UE (which is single threaded) to block for ioctl for several
seconds and prevents the message loop from responding to dbus requests.
'update_engine_client --status' relies on dbus signals to get the status
of the update engine. This can cause 'cros flash' or provisionning of
devices to fail due error returned from ssh invokation of
update_engine_client. This CL fixes the issue by doing
BLKDISCARD before BLKSECDISCARD.
Discarding the end of partition were originally added for b/28744609.
Also, BLKSECDISCARD never works on our android devices anyway; and it
causes a selinux denial to sys_rawio.
670 W update_engine: [0708/111132:WARNING:delta_performer.cc(154)] Error discarding
the last 152 KiB using ioctl(4733)
670 W update_engine: type=1400 audit(0.0:159): avc: denied { sys_rawio } for
capability=17 scontext=u:r:update_engine:s0 tcontext=u:r:update_engine:s0
tclass=capability permissive=0
BUG: 30035671
Test: unit tests pass
(cherry picked from https://chromium-review.googlesource.com/547015)
Change-Id: I91ea559910bfb39ddb3f824a5504983a8d553cc9
1 file changed