1. 20 5月, 2007 2 次提交
    • D
      [JFFS2] Fix potential memory leak of dead xattrs on unmount. · 2ad8ee71
      David Woodhouse 提交于
      An xattr_datum which ends up orphaned should be freed by the GC 
      thread. But if we umount before the GC thread is finished, or if we 
      mount read-only and the GC thread never runs, they might never be 
      freed. Clean them up during unmount, if there are any left.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      2ad8ee71
    • D
      [JFFS2] Fix BUG() caused by failing to discard xattrs on deleted files. · 8ae5d312
      David Woodhouse 提交于
      When we cannot mark nodes as obsolete, such as on NAND flash, we end up 
      having to delete inodes with !nlink in jffs2_build_remove_unlinked_inode().
      However, jffs2_build_xattr_subsystem() runs later than this, and will
      attach an xref to the dead inode. Then later when the last nodes of that
      dead inode are erased we hit a BUG() in jffs2_del_ino_cache() 
      because we're not supposed to get there with an xattr still attached to 
      the inode which is being killed.
      
      The simple fix is to refrain from attaching xattrs to inodes with zero 
      nlink, in jffs2_build_xattr_subsystem(). It's it's OK to trust nlink 
      here because the file system isn't actually mounted yet, so there's no 
      chance that a zero-nlink file could actually be alive still because 
      it's open.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      8ae5d312
  2. 25 4月, 2007 1 次提交
    • D
      [JFFS2] Tidy up licensing/copyright boilerplate. · c00c310e
      David Woodhouse 提交于
      In particular, remove the bit in the LICENCE file about contacting
      Red Hat for alternative arrangements. Their errant IS department broke
      that arrangement a long time ago -- the policy of collecting copyright
      assignments from contributors came to an end when the plug was pulled on
      the servers hosting the project, without notice or reason.
      
      We do still dual-license it for use with eCos, with the GPL+exception
      licence approved by the FSF as being GPL-compatible. It's just that nobody
      has the right to license it differently.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      c00c310e
  3. 04 10月, 2006 1 次提交
    • J
      [JFFS2] kill warning RE debug-only variables · a6b1d82d
      Jeff Garzik 提交于
      gcc emits the following warning on a 'allmodconfig' build:
      
      fs/jffs2/xattr.c: In function ‘unrefer_xattr_datum’:
      fs/jffs2/xattr.c:402: warning: unused variable ‘version’
      fs/jffs2/xattr.c:402: warning: unused variable ‘xid’
      
      Given that these variables are only used in the debug printk, and they
      merely remove a deref, we can easily kill the warning by adding the
      derefs to the debug printk.
      Signed-off-by: NJeff Garzik <jeff@garzik.org>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      a6b1d82d
  4. 16 8月, 2006 1 次提交
  5. 29 6月, 2006 1 次提交
    • K
      [JFFS2][XATTR] Fix xd->refcnt race condition · c6e8c6cc
      KaiGai Kohei 提交于
      When xd->refcnt is checked whether this xdatum should be released
      or not, atomic_dec_and_lock() is used to ensure holding the
      c->erase_completion_lock.
      
      This fix change a specification of delete_xattr_datum().
      Previously, it's only called when xd->refcnt equals zero.
      (calling it with positive xd->refcnt cause a BUG())
      If you applied this patch, the function checks whether
      xd->refcnt is zero or not under the spinlock if necessary.
      Then, it marks xd DEAD flahs and links with xattr_dead_list
      or releases it immediately when xd->refcnt become zero.
      Signed-off-by: NKaiGai Kohei <kaigai@ak.jp.nec.com>
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      c6e8c6cc
  6. 27 6月, 2006 3 次提交
  7. 25 5月, 2006 1 次提交
  8. 24 5月, 2006 1 次提交
    • D
      [JFFS2] Reduce visibility of raw_node_ref to upper layers of JFFS2 code. · 2f785402
      David Woodhouse 提交于
      As the first step towards eliminating the ref->next_phys member and saving
      memory by using an _array_ of struct jffs2_raw_node_ref per eraseblock,
      stop the write functions from allocating their own refs; have them just
      _reserve_ the appropriate number instead. Then jffs2_link_node_ref() can
      just fill them in.
      
      Use a linked list of pre-allocated refs in the superblock, for now. Once
      we switch to an array, it'll just be a case of extending that array.
      Signed-off-by: NDavid Woodhouse <dwmw2@infradead.org>
      2f785402
  9. 23 5月, 2006 1 次提交
  10. 22 5月, 2006 1 次提交
  11. 21 5月, 2006 1 次提交
  12. 13 5月, 2006 5 次提交