1. 13 12月, 2016 23 次提交
  2. 28 10月, 2016 1 次提交
  3. 20 10月, 2016 3 次提交
    • R
      ubifs: Abort readdir upon error · c83ed4c9
      Richard Weinberger 提交于
      If UBIFS is facing an error while walking a directory, it reports this
      error and ubifs_readdir() returns the error code. But the VFS readdir
      logic does not make the getdents system call fail in all cases. When the
      readdir cursor indicates that more entries are present, the system call
      will just return and the libc wrapper will try again since it also
      knows that more entries are present.
      This causes the libc wrapper to busy loop for ever when a directory is
      corrupted on UBIFS.
      A common approach do deal with corrupted directory entries is
      skipping them by setting the cursor to the next entry. On UBIFS this
      approach is not possible since we cannot compute the next directory
      entry cursor position without reading the current entry. So all we can
      do is setting the cursor to the "no more entries" position and make
      getdents exit.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      c83ed4c9
    • R
      ubifs: Fix xattr_names length in exit paths · 843741c5
      Richard Weinberger 提交于
      When the operation fails we also have to undo the changes
      we made to ->xattr_names. Otherwise listxattr() will report
      wrong lengths.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      843741c5
    • R
      ubifs: Rename ubifs_rename2 · 390975ac
      Richard Weinberger 提交于
      Since ->rename2 is gone, rename ubifs_rename2() to ubifs_rename().
      Suggested-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      390975ac
  4. 08 10月, 2016 1 次提交
  5. 03 10月, 2016 6 次提交
    • J
      UBIFS: improve function-level documentation · ec037dfc
      Julia Lawall 提交于
      Fix various inconsistencies in the documentation associated with various
      functions.
      
      In the case of fs/ubifs/lprops.c, the second parameter of
      ubifs_get_lp_stats was renamed from st to lst in commit 84abf972
      ("UBIFS: add re-mount debugging checks")
      
      In the case of fs/ubifs/lpt_commit.c, the excess variables have never
      existed in the associated functions since the code was introduced into the
      kernel.
      
      The others appear to be straightforward typos.
      
      Issues detected using Coccinelle (http://coccinelle.lip6.fr/)
      Signed-off-by: NJulia Lawall <Julia.Lawall@lip6.fr>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      ec037dfc
    • P
      ubifs: fix host xattr_len when changing xattr · 74e9c700
      Pascal Eberhard 提交于
      When an extended attribute is changed, xattr_len of host inode is
      recalculated. ui->data_len is updated before computation and result
      is wrong. This patch adds a temporary variable to fix computation.
      
      To reproduce the issue:
      
      ~# > a.txt
      ~# attr -s an-attr -V a-value a.txt
      ~# attr -s an-attr -V a-bit-bigger-value a.txt
      
      Now host inode xattr_len is wrong. Forcing dbg_check_filesystem()
      generates the following error:
      
      [  130.620140] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 565
      [  131.470790] UBIFS error (ubi0:2 pid 564): check_inodes: inode 646 has xattr size 240, but calculated size is 256
      [  131.481697] UBIFS (ubi0:2): dump of the inode 646 sitting in LEB 29:114688
      [  131.488953]  magic          0x6101831
      [  131.492876]  crc            0x9fce9091
      [  131.496836]  node_type      0 (inode node)
      [  131.501193]  group_type     1 (in node group)
      [  131.505788]  sqnum          9278
      [  131.509191]  len            160
      [  131.512549]  key            (646, inode)
      [  131.516688]  creat_sqnum    9270
      [  131.520133]  size           0
      [  131.523264]  nlink          1
      [  131.526398]  atime          1053025857.0
      [  131.530574]  mtime          1053025857.0
      [  131.534714]  ctime          1053025906.0
      [  131.538849]  uid            0
      [  131.542009]  gid            0
      [  131.545140]  mode           33188
      [  131.548636]  flags          0x1
      [  131.551977]  xattr_cnt      1
      [  131.555108]  xattr_size     240
      [  131.558420]  xattr_names    12
      [  131.561670]  compr_type     0x1
      [  131.564983]  data len       0
      [  131.568125] UBIFS error (ubi0:2 pid 564): dbg_check_filesystem: file-system check failed with error -22
      [  131.578074] CPU: 0 PID: 564 Comm: mount Not tainted 4.4.12-g3639bea54a #24
      [  131.585352] Hardware name: Generic AM33XX (Flattened Device Tree)
      [  131.591918] [<c00151c0>] (unwind_backtrace) from [<c0012acc>] (show_stack+0x10/0x14)
      [  131.600177] [<c0012acc>] (show_stack) from [<c01c950c>] (dbg_check_filesystem+0x464/0x4d0)
      [  131.608934] [<c01c950c>] (dbg_check_filesystem) from [<c019f36c>] (ubifs_mount+0x14f8/0x2130)
      [  131.617991] [<c019f36c>] (ubifs_mount) from [<c00d7088>] (mount_fs+0x14/0x98)
      [  131.625572] [<c00d7088>] (mount_fs) from [<c00ed674>] (vfs_kern_mount+0x4c/0xd4)
      [  131.633435] [<c00ed674>] (vfs_kern_mount) from [<c00efb5c>] (do_mount+0x988/0xb50)
      [  131.641471] [<c00efb5c>] (do_mount) from [<c00f004c>] (SyS_mount+0x74/0xa0)
      [  131.648837] [<c00f004c>] (SyS_mount) from [<c000fe20>] (ret_fast_syscall+0x0/0x3c)
      [  131.665315] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" stops
      Signed-off-by: NPascal Eberhard <pascal.eberhard@gmail.com>
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      74e9c700
    • R
      ubifs: Use move variable in ubifs_rename() · 1e039533
      Richard Weinberger 提交于
      ...to make the code more consistent since we use
      move already in other places.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      1e039533
    • R
      ubifs: Implement RENAME_EXCHANGE · 9ec64962
      Richard Weinberger 提交于
      Adds RENAME_EXCHANGE to UBIFS, the operation itself
      is completely disjunct from a regular rename() that's
      why we dispatch very early in ubifs_reaname().
      
      RENAME_EXCHANGE used by the renameat2() system call
      allows the caller to exchange two paths atomically.
      Both paths have to exist and have to be on the same
      filesystem.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      9ec64962
    • R
      ubifs: Implement RENAME_WHITEOUT · 9e0a1fff
      Richard Weinberger 提交于
      Adds RENAME_WHITEOUT support to UBIFS, we implement
      it in the same way as ext4 and xfs do.
      For an overview of other ways to implement it please
      refere to commit 7dcf5c3e ("xfs: add RENAME_WHITEOUT support").
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      9e0a1fff
    • R
      ubifs: Implement O_TMPFILE · 474b9370
      Richard Weinberger 提交于
      This patchs adds O_TMPFILE support to UBIFS.
      A temp file is a reference to an unlinked inode, a user
      holding the reference can use it. As soon it is being closed
      all data vanishes.
      Signed-off-by: NRichard Weinberger <richard@nod.at>
      474b9370
  6. 27 9月, 2016 2 次提交
  7. 22 9月, 2016 1 次提交
  8. 24 8月, 2016 2 次提交
  9. 30 7月, 2016 1 次提交