1. 05 9月, 2014 3 次提交
    • A
      udf: saner calling conventions for udf_new_inode() · 0b93a92b
      Al Viro 提交于
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      0b93a92b
    • A
      udf: fix the udf_iget() vs. udf_new_inode() races · b2315096
      Al Viro 提交于
      Currently udf_iget() (triggered by NFS) can race with udf_new_inode()
      leading to two inode structures with the same inode number:
      
      nfsd: iget_locked() creates inode
      nfsd: try to read from disk, block on that.
      udf_new_inode(): allocate inode with that inumber
      udf_new_inode(): insert it into icache, set it up and dirty
      udf_write_inode(): write inode into buffer cache
      nfsd: get CPU again, look into buffer cache, see nice and sane on-disk
        inode, set the in-core inode from it
      
      Fix the problem by putting inode into icache in locked state (I_NEW set)
      and unlocking it only after it's fully set up.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      b2315096
    • J
      udf: Set i_generation field · 470cca56
      Jan Kara 提交于
      Currently UDF doesn't initialize i_generation in any way and thus NFS
      can easily get reallocated inodes from stale file handles. Luckily UDF
      already has a unique object identifier associated with each inode -
      i_unique. Use that for initialization of i_generation.
      Signed-off-by: NJan Kara <jack@suse.cz>
      470cca56
  2. 24 9月, 2013 1 次提交
    • J
      udf: Fortify LVID loading · 69d75671
      Jan Kara 提交于
      A user has reported an oops in udf_statfs() that was caused by
      numOfPartitions entry in LVID structure being corrupted. Fix the problem
      by verifying whether numOfPartitions makes sense at least to the extent
      that LVID fits into a single block as it should.
      Reported-by: NJuergen Weigert <jw@suse.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      69d75671
  3. 01 3月, 2012 1 次提交
  4. 04 1月, 2012 1 次提交
    • A
      udf: propagate umode_t · faa17292
      Al Viro 提交于
      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: NAl Viro <viro@zeniv.linux.org.uk>
      faa17292
  5. 07 1月, 2011 1 次提交
  6. 10 8月, 2010 1 次提交
  7. 24 5月, 2010 1 次提交
    • J
      udf: Remove dead quota code · 36350462
      Jan Kara 提交于
      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: NJan Kara <jack@suse.cz>
      36350462
  8. 22 5月, 2010 1 次提交
  9. 05 3月, 2010 3 次提交
    • C
      dquot: cleanup dquot initialize routine · 871a2931
      Christoph Hellwig 提交于
      Get rid of the initialize dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_initialize helper to __dquot_initialize
      and vfs_dq_init to dquot_initialize to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      871a2931
    • C
      dquot: cleanup dquot drop routine · 9f754758
      Christoph Hellwig 提交于
      Get rid of the drop dquot operation - it is now always called from
      the filesystem and if a filesystem really needs it's own (which none
      currently does) it can just call into it's own routine directly.
      
      Rename the now static low-level dquot_drop helper to __dquot_drop
      and vfs_dq_drop to dquot_drop to have a consistent namespace.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      9f754758
    • C
      dquot: cleanup inode allocation / freeing routines · 63936dda
      Christoph Hellwig 提交于
      Get rid of the alloc_inode and free_inode dquot operations - they are
      always called from the filesystem and if a filesystem really needs
      their own (which none currently does) it can just call into it's
      own routine directly.
      
      Also get rid of the vfs_dq_alloc/vfs_dq_free wrappers and always
      call the lowlevel dquot_alloc_inode / dqout_free_inode routines
      directly, which now lose the number argument which is always 1.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      63936dda
  10. 02 4月, 2009 2 次提交
  11. 26 3月, 2009 1 次提交
  12. 14 11月, 2008 1 次提交
  13. 19 8月, 2008 2 次提交
    • J
      udf: Fix error paths in udf_new_inode() · 97e1cfb0
      Jan Kara 提交于
      I case we failed to allocate memory for inode when creating it, we did not
      properly free block already allocated for this inode. Move memory allocation
      before the block allocation which fixes this issue (thanks for the idea go to
      Ingo Oeser <ioe-lkml@rameria.de>). Also remove a few superfluous
      initializations already done in udf_alloc_inode().
      Reviewed-by: NIngo Oeser <ioe-lkml@rameria.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      97e1cfb0
    • J
      udf: Fix lock inversion between iprune_mutex and alloc_mutex (v2) · db0badc5
      Jan Kara 提交于
      A memory allocation inside alloc_mutex must not recurse back into the
      filesystem itself because that leads to lock inversion between iprune_mutex and
      alloc_mutex (and thus to deadlocks - see traces below). alloc_mutex is actually
      needed only to update allocation statistics in the superblock so we can drop it
      before we start allocating memory for the inode.
      
      tar           D ffff81015b9c8c90     0  6614   6612
       ffff8100d5a21a20 0000000000000086 0000000000000000 00000000ffff0000
       ffff81015b9c8c90 ffff81015b8f0cd0 ffff81015b9c8ee0 0000000000000000
       0000000000000003 0000000000000000 0000000000000000 0000000000000000
      Call Trace:
       [<ffffffff803c1d8a>] __mutex_lock_slowpath+0x64/0x9b
       [<ffffffff803c1bef>] mutex_lock+0xa/0xb
       [<ffffffff8027f8c2>] shrink_icache_memory+0x38/0x200
       [<ffffffff80257742>] shrink_slab+0xe3/0x15b
       [<ffffffff802579db>] try_to_free_pages+0x221/0x30d
       [<ffffffff8025657e>] isolate_pages_global+0x0/0x31
       [<ffffffff8025324b>] __alloc_pages_internal+0x252/0x3ab
       [<ffffffff8026b08b>] cache_alloc_refill+0x22e/0x47b
       [<ffffffff8026ae37>] kmem_cache_alloc+0x3b/0x61
       [<ffffffff8026b15b>] cache_alloc_refill+0x2fe/0x47b
       [<ffffffff8026b34e>] __kmalloc+0x76/0x9c
       [<ffffffffa00751f2>] :udf:udf_new_inode+0x202/0x2e2
       [<ffffffffa007ae5e>] :udf:udf_create+0x2f/0x16d
       [<ffffffffa0078f27>] :udf:udf_lookup+0xa6/0xad
      ...
      kswapd0       D ffff81015b9d9270     0   125      2
       ffff81015b903c28 0000000000000046 ffffffff8028cbb0 00000000fffffffb
       ffff81015b9d9270 ffff81015b8f0cd0 ffff81015b9d94c0 000000000271b490
       ffffe2000271b458 ffffe2000271b420 ffffe20002728dc8 ffffe20002728d90
      Call Trace:
       [<ffffffff8028cbb0>] __set_page_dirty+0xeb/0xf5
       [<ffffffff8025403a>] get_dirty_limits+0x1d/0x22f
       [<ffffffff803c1d8a>] __mutex_lock_slowpath+0x64/0x9b
       [<ffffffff803c1bef>] mutex_lock+0xa/0xb
       [<ffffffffa0073f58>] :udf:udf_bitmap_free_blocks+0x47/0x1eb
       [<ffffffffa007df31>] :udf:udf_discard_prealloc+0xc6/0x172
       [<ffffffffa007875a>] :udf:udf_clear_inode+0x1e/0x48
       [<ffffffff8027f121>] clear_inode+0x6d/0xc4
       [<ffffffff8027f7f2>] dispose_list+0x56/0xee
       [<ffffffff8027fa5a>] shrink_icache_memory+0x1d0/0x200
       [<ffffffff80257742>] shrink_slab+0xe3/0x15b
       [<ffffffff80257e93>] kswapd+0x346/0x447
      ...
      Reported-by: NTibor Tajti <tibor.tajti@gmail.com>
      Reviewed-by: NIngo Oeser <ioe-lkml@rameria.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      db0badc5
  14. 17 4月, 2008 2 次提交
    • M
      udf: replace all adds to little endians variables with le*_add_cpu · c2104fda
      marcin.slusarz@gmail.com 提交于
      replace all:
      	little_endian_variable = cpu_to_leX(leX_to_cpu(little_endian_variable) +
      	                                    expression_in_cpu_byteorder);
      with:
      	leX_add_cpu(&little_endian_variable, expression_in_cpu_byteorder);
      sparse didn't generate any new warning with this patch
      
      Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com
      Signed-off-by: NJan Kara <jack@suse.cz>
      c2104fda
    • C
      udf: move headers out include/linux/ · 15aebd28
      Christoph Hellwig 提交于
      There's really no reason to keep udf headers in include/linux as they're
      not used by anything but fs/udf/.
      
      This patch merges most of include/linux/udf_fs_i.h into fs/udf/udf_i.h,
      include/linux/udf_fs_sb.h into fs/udf/udf_sb.h and
      include/linux/udf_fs.h into fs/udf/udfdecl.h.
      
      The only thing remaining in include/linux/ is a stub of udf_fs_i.h
      defining the four user-visible udf ioctls.  It's also moved from
      unifdef-y to headers-y because it can be included unconditionally now.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      15aebd28
  15. 09 2月, 2008 4 次提交
  16. 22 7月, 2007 1 次提交
  17. 20 7月, 2007 1 次提交
  18. 17 7月, 2007 1 次提交
  19. 27 9月, 2006 2 次提交
  20. 06 8月, 2006 1 次提交
    • E
      [PATCH] udf: initialize parts of inode earlier in create · 225add61
      Eric Sandeen 提交于
      I saw an oops down this path when trying to create a new file on a UDF
      filesystem which was internally marked as readonly, but mounted rw:
      
      udf_create
              udf_new_inode
                      new_inode
                              alloc_inode
                              	udf_alloc_inode
                      udf_new_block
                              returns EIO due to readonlyness
                      iput (on error)
                              udf_put_inode
                                      udf_discard_prealloc
                                              udf_next_aext
                                                      udf_current_aext
                                                              udf_get_fileshortad
                                                                      OOPS
      
      the udf_discard_prealloc() path was examining uninitialized fields of the
      udf inode.
      
      udf_discard_prealloc() already has this code to short-circuit the discard
      path if no extents are preallocated:
      
              if (UDF_I_ALLOCTYPE(inode) == ICBTAG_FLAG_AD_IN_ICB ||
                      inode->i_size == UDF_I_LENEXTENTS(inode))
              {
                      return;
              }
      
      so if we initialize UDF_I_LENEXTENTS(inode) = 0 earlier in udf_new_inode,
      we won't try to free the (not) preallocated blocks, since this will match
      the i_size = 0 set when the inode was initialized.
      Signed-off-by: NEric Sandeen <sandeen@sandeen.net>
      Signed-off-by: NAndrew Morton <akpm@osdl.org>
      Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
      225add61
  21. 23 3月, 2006 1 次提交
  22. 03 1月, 2006 1 次提交
  23. 17 4月, 2005 1 次提交
    • L
      Linux-2.6.12-rc2 · 1da177e4
      Linus Torvalds 提交于
      Initial git repository build. I'm not bothering with the full history,
      even though we have it. We can create a separate "historical" git
      archive of that later if we want to, and in the meantime it's about
      3.2GB when imported into git - space that would just make the early
      git days unnecessarily complicated, when we don't have a lot of good
      infrastructure for it.
      
      Let it rip!
      1da177e4