linux/fs/udf
Steven J. Magnani 70f19f5869 udf: Don't corrupt unalloc spacetable when writing it
For a UDF filesystem configured with an Unallocated Space Table,
a filesystem operation that triggers an update to the table results
in on-disk corruption that prevents remounting:

  udf_read_tagged: tag version 0x0000 != 0x0002 || 0x0003, block 274

For example:
  1. Create a filesystem
      $ mkudffs --media-type=hd --blocksize=512 --lvid=BUGTEST \
              --vid=BUGTEST --fsid=BUGTEST --space=unalloctable \
              /dev/mmcblk0

  2. Mount it
      # mount /dev/mmcblk0 /mnt

  3. Create a file
      $ echo "No corruption, please" > /mnt/new.file

  4. Umount
      # umount /mnt

  5. Attempt remount
      # mount /dev/mmcblk0 /mnt

This appears to be a longstanding bug caused by zero-initialization of
the Unallocated Space Entry block buffer and only partial repopulation
of required fields before writing to disk.

Commit 0adfb339fd64 ("udf: Fix unalloc space handling in udf_update_inode")
addressed one such field, but several others are required.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
Signed-off-by: Jan Kara <jack@suse.com>
2015-07-09 16:38:57 +02:00
..
balloc.c
dir.c udf: Make udf_get_filename() return error instead of 0 length file name 2015-05-18 11:23:06 +02:00
directory.c
ecma_167.h
file.c udf: remove double err declaration in udf_file_write_iter() 2015-05-18 11:23:09 +02:00
ialloc.c
inode.c udf: Don't corrupt unalloc spacetable when writing it 2015-07-09 16:38:57 +02:00
Kconfig
lowlevel.c
Makefile
misc.c
namei.c UDF: support NFSv2 export 2015-05-18 11:23:08 +02:00
osta_udf.h
partition.c
super.c udf: fix udf_load_pvoldesc() 2015-05-21 15:19:15 +02:00
symlink.c udf: Return -ENOMEM when allocation fails in udf_get_filename() 2015-05-18 11:23:03 +02:00
truncate.c
udf_i.h fs: cleanup slight list_entry abuse 2015-06-23 18:01:59 -04:00
udf_sb.h
udfdecl.h
udfend.h
udftime.c
unicode.c udf: Make udf_get_filename() return error instead of 0 length file name 2015-05-18 11:23:06 +02:00