]> git.baikalelectronics.ru Git - kernel.git/commit
fs/adfs: dir: improve update failure handling
authorRussell King <rmk+kernel@armlinux.org.uk>
Mon, 9 Dec 2019 11:10:01 +0000 (11:10 +0000)
committerAl Viro <viro@zeniv.linux.org.uk>
Tue, 21 Jan 2020 01:12:41 +0000 (20:12 -0500)
commit0b562e05cd1b8bc069d40592eaf03f0d612946d3
tree1940350c9ba18ed956b9c94db8e398edf5398777
parentbdfb6c91febd7266e5a75acaf91ea2301d33f67a
fs/adfs: dir: improve update failure handling

When we update a directory, a number of errors may happen. If we failed
to find the entry to update, we can just release the directory buffers
as normal.

However, if we have some other error, we may have partially updated the
buffers, resulting in an invalid directory. In this case, we need to
discard the buffers to avoid writing the contents back to the media, and
later re-read the directory from the media.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/adfs/dir.c