zephyr/subsys
Dominik Ermel 32451230e2 storage/stream/flash: Failed write of reminder rewinds buffer offset
The stream_flash_buffered_write, when invoked to do flush write, will
attempt to write the tail bytes from the buffer, filling the required
minimal write block size with erase value bytes; after write it rewinds
the buffer offset, bytes_written, by number of the "filler bytes".
Doe to lack of return code processing from flash_sync call, two things
would happen to context in case of failure:
 1) the ctx->bytes_written would be rewind pass the value it had before
    function call as it gets decremented by "filler bytes" even if write
    failed;
 2) the ctx->buf_bytes offset would be accounting for added "filler
    bytes" which should not be counted as data in buffer.

Proper processing of return code has been added to remove effects
described above.

Unit tests have been expended to cover the scenarios.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2021-03-03 11:40:11 +03:00
..
bluetooth Bluetooth: controller: Fix ticker job_guard 2021-03-02 15:51:48 +01:00
canbus canbus: canopen: program: read flash in 32 byte chunks 2021-01-20 14:18:03 -06:00
console
cpp
debug spinlock: validate: fix the dependency with MP_NUM_CPUS 2021-01-26 08:43:45 -05:00
demand_paging mmu: backing stores reserve page fault room 2021-01-23 19:47:23 -05:00
dfu modules: introduce MCUBOOT_BOOTUTIL module 2021-01-14 18:03:38 +01:00
disk disk: stm32: Select USE_STM32_HAL_SD_EX on stm32l4 2021-02-24 18:10:09 -06:00
emul emul: Add an emulator for the eSPI Host 2021-01-20 17:49:19 -05:00
fb
fs fs: shell: cmd_read does should open file for read-only 2021-03-01 12:57:55 -06:00
ipc arm: Remove Musca-A SoC/board support 2021-02-15 21:04:23 +03:00
jwt
logging logging: Refactor msg_finalize 2021-02-28 17:12:29 -05:00
lorawan lorawan: add callback for datarate changes 2021-02-28 16:36:57 -05:00
mgmt net: coap: clean up token usage in samples and tests 2021-02-02 14:03:01 -05:00
net net: lwm2m: Make sure that endpoint string is NULL terminated 2021-03-02 09:16:01 -05:00
power power: Remove PM_STATE_LOCK option 2021-02-15 08:08:36 -05:00
random random: ctr_drbg: Fix the error path in sys_csrand_get 2020-12-01 10:20:06 -06:00
settings settings: Handle unhandled error 2021-02-03 08:37:11 -05:00
shell shell: add getopt library support 2021-03-01 09:50:32 -05:00
stats misc: Replace assert include and calls by sys/__assert.h equivalent 2020-10-02 11:42:40 +02:00
storage storage/stream/flash: Failed write of reminder rewinds buffer offset 2021-03-03 11:40:11 +03:00
testsuite testsuite: only enable TEST_ARM_CORTEX_M when building tests 2021-03-01 14:33:26 +03:00
timing timing: fix timing_stop() ref counting 2021-01-04 12:15:30 +01:00
tracing systemview: Use common function to get sysview thread name 2020-11-21 08:29:26 -05:00
usb usb: mass storage: add missing prompt to Kconfig 2021-03-01 09:27:57 -05:00
CMakeLists.txt demand_paging: add infra for demand paging modules 2021-01-23 19:47:23 -05:00
Kconfig demand_paging: add infra for demand paging modules 2021-01-23 19:47:23 -05:00