1. 05 9月, 2014 3 次提交
    • 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
    • A
      udf: merge the pieces inserting a new non-directory object into directory · d2be51cb
      Al Viro 提交于
      boilerplate code in udf_{create,mknod,symlink} taken to new helper
      
      symlink case converted to unique id calculated by udf_new_inode() - no
      point finding a new one.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NJan Kara <jack@suse.cz>
      d2be51cb
    • J
      udf: Make udf_read_inode() and udf_iget() return error · 6d3d5e86
      Jan Kara 提交于
      Currently __udf_read_inode() wasn't returning anything and we found out
      whether we succeeded reading inode by checking whether inode is bad or
      not. udf_iget() returned NULL on failure and inode pointer otherwise.
      Make these two functions properly propagate errors up the call stack and
      use the return value in callers.
      Signed-off-by: NJan Kara <jack@suse.cz>
      6d3d5e86
  2. 20 8月, 2014 1 次提交
  3. 24 12月, 2013 1 次提交
    • J
      udf: Fix lockdep warning from udf_symlink() · 4ea7772f
      Jan Kara 提交于
      Lockdep is complaining about UDF:
      =============================================
      [ INFO: possible recursive locking detected ]
      3.12.0+ #16 Not tainted
      ---------------------------------------------
      ln/7386 is trying to acquire lock:
       (&ei->i_data_sem){+.+...}, at: [<ffffffff8142f06d>] udf_get_block+0x8d/0x130
      
      but task is already holding lock:
       (&ei->i_data_sem){+.+...}, at: [<ffffffff81431a8d>] udf_symlink+0x8d/0x690
      
      other info that might help us debug this:
       Possible unsafe locking scenario:
      
             CPU0
             ----
        lock(&ei->i_data_sem);
        lock(&ei->i_data_sem);
      
       *** DEADLOCK ***
      
      This is because we hold i_data_sem of the symlink inode while calling
      udf_add_entry() for the directory. I don't think this can ever lead to
      deadlocks since we never hold i_data_sem for two inodes in any other
      place.
      
      The fix is simple - move unlock of i_data_sem for symlink inode up. We
      don't need it for anything when linking symlink inode to directory.
      Reported-by: NChristoph Hellwig <hch@infradead.org>
      Signed-off-by: NJan Kara <jack@suse.cz>
      4ea7772f
  4. 29 6月, 2013 1 次提交
  5. 26 2月, 2013 1 次提交
  6. 14 7月, 2012 2 次提交
  7. 13 7月, 2012 1 次提交
  8. 30 5月, 2012 1 次提交
  9. 11 5月, 2012 1 次提交
    • L
      vfs: make it possible to access the dentry hash/len as one 64-bit entry · 26fe5750
      Linus Torvalds 提交于
      This allows comparing hash and len in one operation on 64-bit
      architectures.  Right now only __d_lookup_rcu() takes advantage of this,
      since that is the case we care most about.
      
      The use of anonymous struct/unions hides the alternate 64-bit approach
      from most users, the exception being a few cases where we initialize a
      'struct qstr' with a static initializer.  This makes the problematic
      cases use a new QSTR_INIT() helper function for that (but initializing
      just the name pointer with a "{ .name = xyzzy }" initializer remains
      valid, as does just copying another qstr structure).
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      26fe5750
  10. 21 3月, 2012 1 次提交
  11. 04 1月, 2012 3 次提交
  12. 02 11月, 2011 2 次提交
  13. 11 10月, 2011 1 次提交
  14. 28 5月, 2011 1 次提交
  15. 26 5月, 2011 2 次提交
  16. 14 3月, 2011 1 次提交
  17. 03 3月, 2011 1 次提交
  18. 07 1月, 2011 5 次提交
  19. 26 10月, 2010 1 次提交
  20. 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
  21. 22 5月, 2010 1 次提交
  22. 08 4月, 2010 1 次提交
  23. 05 3月, 2010 2 次提交
    • 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: move dquot initialization responsibility into the filesystem · 907f4554
      Christoph Hellwig 提交于
      Currently various places in the VFS call vfs_dq_init directly.  This means
      we tie the quota code into the VFS.  Get rid of that and make the
      filesystem responsible for the initialization.   For most metadata operations
      this is a straight forward move into the methods, but for truncate and
      open it's a bit more complicated.
      
      For truncate we currently only call vfs_dq_init for the sys_truncate case
      because open already takes care of it for ftruncate and open(O_TRUNC) - the
      new code causes an additional vfs_dq_init for those which is harmless.
      
      For open the initialization is moved from do_filp_open into the open method,
      which means it happens slightly earlier now, and only for regular files.
      The latter is fine because we don't need to initialize it for operations
      on special files, and we already do it as part of the namespace operations
      for directories.
      
      Add a dquot_file_open helper that filesystems that support generic quotas
      can use to fill in ->open.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJan Kara <jack@suse.cz>
      907f4554
  24. 04 3月, 2010 1 次提交
  25. 15 12月, 2009 1 次提交
    • J
      udf: Avoid IO in udf_clear_inode · 2c948b3f
      Jan Kara 提交于
      It is not very good to do IO in udf_clear_inode. First, VFS does not really
      expect inode to become dirty there and thus we have to write it ourselves,
      second, memory reclaim gets blocked waiting for IO when it does not really
      expect it, third, the IO pattern (e.g. on umount) resulting from writes in
      udf_clear_inode is bad and it slows down writing a lot.
      
      The reason why UDF needed to do IO in udf_clear_inode is that UDF standard
      mandates extent length to exactly match inode size. But when we allocate
      extents to a file or directory, we don't really know what exactly the final
      file size will be and thus temporarily set it to block boundary and later
      truncate it to exact length in udf_clear_inode. Now, this is changed to
      truncate to final file size in udf_release_file for regular files. For
      directories and symlinks, we do the truncation at the moment when learn
      what the final file size will be.
      Signed-off-by: NJan Kara <jack@suse.cz>
      2c948b3f
  26. 15 9月, 2009 1 次提交
  27. 02 4月, 2009 2 次提交