udf: Do not call udf_block_map() on ICB files
authorJan Kara <jack@suse.cz>
Wed, 18 Jan 2023 13:26:04 +0000 (14:26 +0100)
committerJan Kara <jack@suse.cz>
Thu, 26 Jan 2023 15:46:33 +0000 (16:46 +0100)
commitf33321b29b672d0d1e565e3c1a6886bfd14d4673
tree0dbb1c0dbfa918a61edb274501fc3cebe52526fb
parent08931b78932d56185753af77b93b8dcaace31e04
udf: Do not call udf_block_map() on ICB files

Currently udf_symlink_filler() called udf_block_map() even on files
which have data stored inside the ICB. This is invalid as we cannot map
blocks for such files (although so far the error got silently ignored).
The call happened because we could not call block mapping function once
we've acquired i_data_sem and determined whether the file has data
stored in the ICB. For symlinks the situation is luckily simple as they
get never modified so file type never changes once it is set. Hence we
can check the file type even without i_data_sem. Just drop the
i_data_sem locking and move block mapping to where it is needed.

Signed-off-by: Jan Kara <jack@suse.cz>
fs/udf/symlink.c