1. 03 4月, 2009 33 次提交
  2. 02 4月, 2009 7 次提交
    • J
      udf: Don't write integrity descriptor too often · 146bca72
      Jan Kara 提交于
      We update information in logical volume integrity descriptor after each
      allocation (as LVID contains free space, number of directories and files on
      disk etc.). If the filesystem is on some phase change media, this leads to its
      quick degradation as such media is able to handle only 10000 overwrites or so.
      We solve the problem by writing new information into LVID only on umount,
      remount-ro and sync. This solves the problem at the price of longer media
      inconsistency (previously media became consistent after pdflush flushed dirty
      LVID buffer) but that should be acceptable.
      
      Report by and patch written in cooperation with
      Rich Coe <Richard.Coe@med.ge.com>.
      Signed-off-by: NJan Kara <jack@suse.cz>
      146bca72
    • J
      udf: Try anchor in block 256 first · 40346005
      Jan Kara 提交于
      Anchor block can be located at several places on the medium. Two of the
      locations are relative to media end which is problematic to detect. Also
      some drives report some block as last but are not able to read it or any
      block nearby before it. So let's first try block 256 and if it is all fine,
      don't look at other possible locations of anchor blocks to avoid IO errors.
      This change required a larger reorganization of code but the new code is
      hopefully more readable and definitely shorter.
      Signed-off-by: NJan Kara <jack@suse.cz>
      40346005
    • J
      udf: Some type fixes and cleanups · 225feded
      Jan Kara 提交于
      Make udf_check_valid() return 1 if the validity check passed and 0 otherwise.
      So far it was the other way around which was a bit confusing. Also make
      udf_vrs() return loff_t which is really the type it should return (not int).
      Signed-off-by: NJan Kara <jack@suse.cz>
      225feded
    • C
      udf: use hardware sector size · 1197e4df
      Clemens Ladisch 提交于
      This patch makes the UDF FS driver use the hardware sector size as the
      default logical block size, which is required by the UDF specifications.
      While the previous default of 2048 bytes was correct for optical disks,
      it was not for hard disks or USB storage devices, and made it impossible
      to use such a device with the default mount options.  (The Linux mkudffs
      tool uses a default block size of 2048 bytes even on devices with
      smaller hardware sectors, so this bug is unlikely to be noticed unless
      UDF-formatted USB storage devices are exchanged with other OSs.)
      
      To avoid regressions for people who use loopback optical disk images or
      who used the (sometimes wrong) defaults of mkudffs, we also try with
      a block size of 2048 bytes if no anchor was found with the hardware
      sector size.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      1197e4df
    • C
      udf: fix novrs mount option · 4136801a
      Clemens Ladisch 提交于
      The novrs mount option was broken due to a missing break.
      Signed-off-by: NClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4136801a
    • J
      udf: Fix oops when invalid character in filename occurs · 59285c28
      Jan Kara 提交于
      Functions udf_CS0toNLS() and udf_NLStoCS0() didn't count with the fact that
      NLS can return negative length when invalid character is given to it for
      conversion. Thus interesting things could happen (such as overwriting random
      memory with the rest of filename). Add appropriate checks.
      Signed-off-by: NJan Kara <jack@suse.cz>
      59285c28
    • C
      udf: return f_fsid for statfs(2) · 557f5a14
      Coly Li 提交于
      This patch makes udf return f_fsid info for statfs(2).
      Signed-off-by: NColy Li <coly.li@suse.de>
      Cc: Jan Kara <jack@suse.cz>
      Signed-off-by: NJan Kara <jack@suse.cz>
      557f5a14