lib/pattern: Support short repeated read calls when loading from file
authorLogan Gunthorpe <logang@deltatee.com>
Fri, 18 Nov 2022 23:15:58 +0000 (16:15 -0700)
committerVincent Fu <vincent.fu@samsung.com>
Sat, 19 Nov 2022 00:36:10 +0000 (19:36 -0500)
commitaccccb191e6c20242e3f7ad7b5f705dcba118a11
treec248062933695be10aa223be7b910102c2d87b74
parent6c9397396eb83a6ce64a998795e7a50552e4337e
lib/pattern: Support short repeated read calls when loading from file

Once a pattern file can be much larger, it will be possible that
kernel will return a short read while loading the file and thus may
randomly only load part of the file.

Fix this by putting the read in a loop so the entire file will be
read.

Signed-off-by: Logan Gunthorpe <logang@deltatee.com>
Signed-off-by: Vincent Fu <vincent.fu@samsung.com>
lib/pattern.c