1. 24 12月, 2015 2 次提交
    • J
      udf: Fix lost indirect extent block · 6c371578
      Jan Kara 提交于
      When inode ends with empty indirect extent block and we extended that
      file, udf_do_extend_file() ended up just overwriting pointer to it with
      another extent and thus effectively leaking the block and also
      corruptiong length of allocation descriptors.
      
      Fix the problem by properly following into next indirect extent when it
      is present.
      Signed-off-by: NJan Kara <jack@suse.cz>
      6c371578
    • J
      udf: Factor out code for creating indirect extent · fcea62ba
      Jan Kara 提交于
      Factor out code for creating indirect extent from udf_add_aext(). It was
      mostly duplicated in two places. Also remove some opencoded versions
      of udf_write_aext().
      Signed-off-by: NJan Kara <jack@suse.cz>
      fcea62ba
  2. 23 12月, 2015 1 次提交
  3. 15 12月, 2015 1 次提交
  4. 20 8月, 2015 1 次提交
    • J
      udf: Don't modify filesystem for read-only mounts · 9181f8bf
      Jan Kara 提交于
      When read-write mount of a filesystem is requested but we find out we
      can mount the filesystem only in read-only mode, we still modify
      LVID in udf_close_lvid(). That is both unnecessary and contrary to
      expectation that when we fall back to read-only mount we don't modify
      the filesystem.
      
      Make sure we call udf_close_lvid() only if we called udf_open_lvid() so
      that filesystem gets modified only if we verified we are allowed to
      write to it.
      Reported-by: NKarel Zak <kzak@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.com>
      9181f8bf
  5. 09 7月, 2015 1 次提交
    • S
      udf: Don't corrupt unalloc spacetable when writing it · 70f19f58
      Steven J. Magnani 提交于
      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: NSteven J. Magnani <steve@digidescorp.com>
      Signed-off-by: NJan Kara <jack@suse.com>
      70f19f58
  6. 24 6月, 2015 1 次提交
  7. 21 5月, 2015 1 次提交
  8. 18 5月, 2015 10 次提交
  9. 16 4月, 2015 1 次提交
  10. 12 4月, 2015 8 次提交
  11. 01 4月, 2015 2 次提交
  12. 26 3月, 2015 1 次提交
  13. 16 3月, 2015 1 次提交
    • F
      udf: use int for allocated blocks instead of sector_t · 1be440de
      Fabian Frederick 提交于
      Fix the following warnings:
      
      fs/udf/balloc.c:768:15: warning: conversion to 'sector_t' from 'int'
      may change the sign of the result [-Wsign-conversion]
         allocated = udf_bitmap_prealloc_blocks(sb,
                     ^
      fs/udf/balloc.c:773:15: warning: conversion to 'sector_t' from 'int'
      may change the sign of the result [-Wsign-conversion]
         allocated = udf_table_prealloc_blocks(sb,
                     ^
      fs/udf/balloc.c:778:15: warning: conversion to 'sector_t' from 'int'
      may change the sign of the result [-Wsign-conversion]
         allocated = udf_bitmap_prealloc_blocks(sb,
                     ^
      fs/udf/balloc.c:783:15: warning: conversion to 'sector_t' from 'int'
      may change the sign of the result [-Wsign-conversion]
         allocated = udf_table_prealloc_blocks(sb,
                     ^
      fs/udf/balloc.c:791:26: warning: conversion to 'loff_t' from 'sector_t'
      may change the sign of the result [-Wsign-conversion]
         inode_add_bytes(inode, allocated << sb->s_blocksize_bits);
                                ^
      fs/udf/balloc.c:792:2: warning: conversion to 'int' from 'sector_t'
      may alter its value [-Wconversion]
        return allocated;
      Suggested-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NFabian Frederick <fabf@skynet.be>
      Signed-off-by: NJan Kara <jack@suse.cz>
      1be440de
  14. 14 3月, 2015 3 次提交
  15. 13 3月, 2015 1 次提交
  16. 05 2月, 2015 2 次提交
  17. 28 1月, 2015 1 次提交
    • J
      udf: Release preallocation on last writeable close · b07ef352
      Jan Kara 提交于
      Commit 6fb1ca92 "udf: Fix race between write(2) and close(2)"
      changed the condition when preallocation is released. The idea was that
      we don't want to release the preallocation for an inode on close when
      there are other writeable file descriptors for the inode. However the
      condition was written in the opposite way so we released preallocation
      only if there were other writeable file descriptors. Fix the problem by
      changing the condition properly.
      
      CC: stable@vger.kernel.org
      Fixes: 6fb1ca92Reported-by: NFabian Frederick <fabf@skynet.be>
      Signed-off-by: NJan Kara <jack@suse.cz>
      b07ef352
  18. 12 1月, 2015 1 次提交
  19. 07 1月, 2015 1 次提交