05 Jan, 2017

1 commit

  • UDF encodes symlinks in a more complex fashion and thus i_size of a
    symlink does not match the lenght of a string returned by readlink(2).
    This confuses some applications (see bug 191241) and may be considered a
    violation of POSIX. Fix the problem by reading the link into page cache
    in response to stat(2) call and report the length of the decoded path.

    Signed-off-by: Jan Kara

    Jan Kara
     

03 Jan, 2017

1 commit


25 Apr, 2016

1 commit

  • Commit 9293fcfbc1812a22ad5ce1b542eb90c1bbe01be1
    ("udf: Remove struct ustr as non-needed intermediate storage"),
    while getting rid of 'struct ustr', does not take any special care
    of 'dstring' fields and effectively use fixed field length instead
    of actual string length, encoded in the last byte of the field.

    Also, commit 484a10f49387e4386bf2708532e75bf78ffea2cb
    ("udf: Merge linux specific translation into CS0 conversion function")
    introduced checking of the length of the string being converted,
    requiring proper alignment to number of bytes constituing each
    character.

    The UDF volume identifier is represented as a 32-bytes 'dstring',
    and needs to be converted from CS0 to UTF8, while mounting UDF
    filesystem. The changes in mentioned commits can in some cases
    lead to incorrect handling of volume identifier:
    - if the actual string in 'dstring' is of maximal length and
    does not have zero bytes separating it from dstring encoded
    length in last byte, that last byte may be included in conversion,
    thus making incorrect resulting string;
    - if the identifier is encoded with 2-bytes characters (compression
    code is 16), the length of 31 bytes (32 bytes of field length minus
    1 byte of compression code), taken as the string length, is reported
    as an incorrect (unaligned) length, and the conversion fails, which
    in its turn leads to volume mounting failure.

    This patch introduces handling of 'dstring' encoded length field
    in udf_CS0toUTF8 function, that is used in all and only cases
    when 'dstring' fields are converted. Currently these cases are
    processing of Volume Identifier and Volume Set Identifier fields.
    The function is also renamed to udf_dstrCS0toUTF8 to distinctly
    indicate that it handles 'dstring' input.

    Signed-off-by: Andrew Gabbasov
    Signed-off-by: Jan Kara

    Andrew Gabbasov
     

09 Feb, 2016

3 commits

  • Although 'struct ustr' tries to structurize the data by combining
    the string and its length, it doesn't actually make much benefit,
    since it saves only one parameter, but introduces an extra copying
    of the whole buffer, serving as an intermediate storage. It looks
    quite inefficient and not actually needed.

    This commit gets rid of the struct ustr by changing the parameters
    of some functions appropriately.

    Also, it removes using 'dstring' type, since it doesn't make much
    sense too.

    Just using the occasion, add a 'const' qualifier to udf_get_filename
    to make consistent parameters sets.

    Signed-off-by: Andrew Gabbasov
    Signed-off-by: Jan Kara

    Andrew Gabbasov
     
  • Actual name length restriction is 254 bytes, this is used in 'ustr'
    structure, and this is what fits into UDF File Ident structures.
    And in most cases the constant is used as UDF_NAME_LEN-2.
    So, it's better to just modify the constant to make it closer
    to reality.

    Also, in some cases it's useful to have a separate constant for
    the maximum length of file name field in CS0 encoding in UDF File
    Ident structures.

    Also, remove the unused UDF_PATH_LEN constant.

    Signed-off-by: Andrew Gabbasov
    Signed-off-by: Jan Kara

    Andrew Gabbasov
     
  • Make the desired output length a parameter rather than have it
    hard-coded to UDF_NAME_LEN. Although all call sites still have
    this length the same, this parameterization will make the function
    more universal and also consistent with udf_get_filename.

    Signed-off-by: Andrew Gabbasov
    Signed-off-by: Jan Kara

    Andrew Gabbasov
     

16 Jan, 2016

1 commit

  • Pull UDF fixes and quota cleanups from Jan Kara:
    "Several UDF fixes and some minor quota cleanups"

    * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: Check output buffer length when converting name to CS0
    udf: Prevent buffer overrun with multi-byte characters
    quota: constify qtree_fmt_operations structures
    udf: avoid uninitialized variable use
    udf: Fix lost indirect extent block
    udf: Factor out code for creating indirect extent
    udf: limit the maximum number of indirect extents in a row
    udf: limit the maximum number of TD redirections
    fs: make quota/dquot.c explicitly non-modular
    fs: make quota/netlink.c explicitly non-modular

    Linus Torvalds
     

24 Dec, 2015

1 commit


07 Dec, 2015

1 commit


19 Dec, 2014

1 commit

  • Symlink reading code does not check whether the resulting path fits into
    the page provided by the generic code. This isn't as easy as just
    checking the symlink size because of various encoding conversions we
    perform on path. So we have to check whether there is still enough space
    in the buffer on the fly.

    CC: stable@vger.kernel.org
    Reported-by: Carl Henrik Lunde
    Signed-off-by: Jan Kara

    Jan Kara
     

09 Oct, 2014

1 commit

  • Some UDF media have special inodes (like VAT or metadata partition
    inodes) whose link_count is 0. Thus commit 4071b9136223 (udf: Properly
    detect stale inodes) broke loading these inodes because udf_iget()
    started returning -ESTALE for them. Since we still need to properly
    detect stale inodes queried by NFS, create two variants of udf_iget() -
    one which is used for looking up special inodes (which ignores
    link_count == 0) and one which is used for other cases which return
    ESTALE when link_count == 0.

    Fixes: 4071b913622316970d0e1919f7d82b4403fec5f2
    CC: stable@vger.kernel.org
    Signed-off-by: Jan Kara

    Jan Kara
     

05 Sep, 2014

2 commits


22 Jan, 2013

1 commit

  • This patch implements extent caching in case of file reading.
    While reading a file, currently, UDF reads metadata serially
    which takes a lot of time depending on the number of extents present
    in the file. Caching last accessd extent improves metadata read time.
    Instead of reading file metadata from start, now we read from
    the cached extent.

    This patch considerably improves the time spent by CPU in kernel mode.
    For example, while reading a 10.9 GB file using dd:
    Time before applying patch:
    11677022208 bytes (10.9GB) copied, 1529.748921 seconds, 7.3MB/s
    real 25m 29.85s
    user 0m 12.41s
    sys 15m 34.75s

    Time after applying patch:
    11677022208 bytes (10.9GB) copied, 1469.338231 seconds, 7.6MB/s
    real 24m 29.44s
    user 0m 15.73s
    sys 3m 27.61s

    [JK: Fix bh refcounting issues, simplify initialization]

    Signed-off-by: Namjae Jeon
    Signed-off-by: Ashish Sangwan
    Signed-off-by: Bonggil Bak
    Signed-off-by: Jan Kara

    Namjae Jeon
     

09 Jul, 2012

1 commit

  • The UDF file-system does not need the 's_dirt' superblock flag because it does
    not define the 'write_super()' method. This flag was set to 1 in few places and
    set to 0 in '->sync_fs()' and was basically useless. Stop using it because it
    is on its way out.

    Signed-off-by: Artem Bityutskiy
    Signed-off-by: Jan Kara

    Artem Bityutskiy
     

04 Jan, 2012

1 commit

  • note re mount options: fmask and dmask are explicitly truncated to 12bit,
    UDF_INVALID_MODE just needs to be guaranteed to differ from any such value.
    And umask is used only in &= with umode_t, so we ignore other bits anyway.

    Signed-off-by: Al Viro

    Al Viro
     

03 Nov, 2011

1 commit

  • * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
    udf: Cleanup metadata flags handling
    udf: Skip mirror metadata FE loading when metadata FE is ok
    ext3: Allow quota file use root reservation
    udf: Remove web reference from UDF MAINTAINERS entry
    quota: Drop path reference on error exit from quotactl
    udf: Neaten udf_debug uses
    udf: Neaten logging output, use vsprintf extension %pV
    udf: Convert printks to pr_
    udf: Rename udf_warning to udf_warn
    udf: Rename udf_error to udf_err
    udf: Promote some debugging messages to udf_error
    ext3: Remove the obsolete broken EXT3_IOC32_WAIT_FOR_READONLY.
    udf: Add readpages support for udf.
    ext3/balloc.c: local functions should be static
    ext2: fix the outdated comment in ext2_nfs_get_inode()
    ext3: remove deprecated oldalloc
    fs/ext3/balloc.c: delete useless initialization
    fs/ext2/balloc.c: delete useless initialization
    ext3: fix message in ext3_remount for rw-remount case
    ext3: Remove i_mutex from ext3_sync_file()

    Fix up trivial (printf format cleanup) conflicts in fs/udf/udfdecl.h

    Linus Torvalds
     

01 Nov, 2011

3 commits

  • Standardize the style for compiler based printf format verification.
    Standardized the location of __printf too.

    Done via script and a little typing.

    $ grep -rPl --include=*.[ch] -w "__attribute__" * | \
    grep -vP "^(tools|scripts|include/linux/compiler-gcc.h)" | \
    xargs perl -n -i -e 'local $/; while (<>) { s/\b__attribute__\s*\(\s*\(\s*format\s*\(\s*printf\s*,\s*(.+)\s*,\s*(.+)\s*\)\s*\)\s*\)/__printf($1, $2)/g ; print; }'

    [akpm@linux-foundation.org: revert arch bits]
    Signed-off-by: Joe Perches
    Cc: "Kirill A. Shutemov"
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • It is not necessary to load mirror metadata FE when metadata FE is OK. So try
    to read it only the first time udf_get_pblock_meta25() fails to map the block
    from metadata FE.

    Signed-off-by: Ashish Sangwan
    Signed-off-by: Namjae Jeon
    Signed-off-by: Jan Kara

    Namjae Jeon
     
  • Use the current logging styles.

    Convert a few printks that should have been udf_warn and udf_err.
    Coalesce formats. Add #define pr_fmt.
    Move an #include "udfdecls.h" above other includes in udftime.c
    so pr_fmt works correctly. Strip prefixes from conversions as appropriate.
    Reorder logging definitions in udfdecl.h

    Signed-off-by: Joe Perches
    Signed-off-by: Jan Kara

    Joe Perches
     

11 Oct, 2011

3 commits

  • Rename udf_warning to udf_warn for consistency with normal logging
    uses of pr_warn.

    Rename function udf_warning to _udf_warn.
    Remove __func__ from uses and move __func__ to a new udf_warn
    macro that calls _udf_warn.
    Add \n's to uses of udf_warn, remove \n from _udf_warn.
    Coalesce formats.

    Reviewed-by: NamJae Jeon
    Signed-off-by: Joe Perches
    Signed-off-by: Jan Kara

    Joe Perches
     
  • Rename udf_error to udf_err for consistency with normal logging
    uses of pr_err.

    Rename function udf_err to _udf_err.
    Remove __func__ from uses and move __func__ to a new udf_err
    macro that calls _udf_err.
    Some of the udf_error uses had \n terminations, some did not so
    standardize \n's to udf_err uses, remove \n from _udf_err function.
    Coalesce udf_err formats.
    One message prefixed with udf_read_super is now prefixed with
    udf_fill_super.

    Reviewed-by: NamJae Jeon
    Signed-off-by: Joe Perches
    Signed-off-by: Jan Kara

    Joe Perches
     
  • If there is a problem with a scratched disc or loader, it's valuable to know
    which error occurred.

    Convert some debug messages to udf_error, neaten those messages too.
    Add the calculated tag checksum and the read checksum to error message.
    Make udf_error a public function and move the logging prototypes together.

    Original-patch-by: NamJae Jeon
    Reviewed-by: NamJae Jeon
    Signed-off-by: Joe Perches
    Signed-off-by: Jan Kara

    Joe Perches
     

23 Feb, 2011

1 commit


07 Jan, 2011

3 commits


10 Aug, 2010

1 commit


24 May, 2010

1 commit

  • Quota on UDF is non-functional at least since 2.6.16 (I'm too lazy to
    do more archeology) because it does not provide .quota_write and .quota_read
    functions and thus quotaon(8) just returns EINVAL. Since nobody complained
    for all those years and quota support is not even in UDF standard just nuke
    it.

    Signed-off-by: Jan Kara

    Jan Kara
     

05 May, 2010

1 commit


08 Apr, 2010

1 commit


06 Mar, 2010

1 commit

  • This gives the filesystem more information about the writeback that
    is happening. Trond requested this for the NFS unstable write handling,
    and other filesystems might benefit from this too by beeing able to
    distinguish between the different callers in more detail.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     

12 Jun, 2009

1 commit


02 Apr, 2009

3 commits


16 Jun, 2008

1 commit


07 May, 2008

1 commit


17 Apr, 2008

2 commits