fat: write: fix broken write at non-zero file offset
authorMarek Szyprowski <m.szyprowski@samsung.com>
Tue, 24 Sep 2019 08:50:34 +0000 (10:50 +0200)
committerJaehoon Chung <jh80.chung@samsung.com>
Thu, 10 Oct 2019 04:39:03 +0000 (13:39 +0900)
commit9dc7f18db2b1d164d0f426541500d8d152ab184d
treec061a3b3923f58b420bdd974b39f2d3bcc8018e6
parent4a4b413cb501eb16933990a5092a99c12355ed5f
fat: write: fix broken write at non-zero file offset

Handling of the start file offset was broken in the current code. Although
the code skipped the needed clusters, it then tried to continue write with
current cluster set to EOF, what caused assertion. It also lacked adjusting
filesize in case of writing at the end of file and adjusting in-cluster
offset for partial overwrite.

This patch fixes all those issues.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Change-Id: I24cf908407ef951920291e560db28e603799ae77
fs/fat/fat_write.c