1. 19 12月, 2009 1 次提交
    • T
      ocfs2: Add reflinked file's inode to inode hash eariler. · c7d260af
      Tao Ma 提交于
      We used to add reflinked file's inode to inode hash when
      we add it to the dest dir. But actually there is a race.
      Consider the following sequence.
      1. reflink happens and create the inode in orphan dir.
      2. reflink thread is scheduled out because of some io.
      3. recovery begins to work and calls ocfs2_recover_orphans.
         It calls ocfs2_iget and get a new inode and i_count = 1.
         It calls iput then and delete inode. the buffer's
         uptodate state is cleared.
      
      This patch move insert_inode_hash to the create function so
      that it can be found by step 3 and prevented from deleting
      because i_count > 1.
      
      This resolves the bug
      http://oss.oracle.com/bugzilla/show_bug.cgi?id=1183.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      c7d260af
  2. 23 9月, 2009 2 次提交
    • T
      ocfs2: Create reflinked file in orphan dir. · bc13d347
      Tao Ma 提交于
      reflink is a very complicated process, so it can't be integrated
      into one transaction. So if the system panic in the operation, we
      may leave a unfinished inode in the destication directory.
      
      So we will try to create an inode in orphan_dir first, reflink it
      to the src file and then move it to the destication file in the end.
      In that way we won't be afraid of any corruption during the reflink.
      
      This patch adds 2 functions for orphan_dir operation:
      1. Create a new inode in orphand dir.
      2. Move an inode to a target dir.
      
      Note:
      fsck.ocfs2 should work for us to remove the unfinished file in the
      orphan_dir.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      bc13d347
    • T
      ocfs2: Use proper parameter for some inode operation. · 19bd341f
      Tao Ma 提交于
      In order to make the original function more suitable for reflink,
      we modify the following inode operations. Both are tiny.
      
      1. ocfs2_mknod_locked only use dentry for mlog, so move it to
         the caller so that reflink can use it without dentry.
      2. ocfs2_prepare_orphan_dir only want inode to get its ip_blkno.
         So use ip_blkno instead.
      Signed-off-by: NTao Ma <tao.ma@oracle.com>
      19bd341f
  3. 05 9月, 2009 2 次提交
  4. 23 6月, 2009 1 次提交
  5. 30 4月, 2009 1 次提交
  6. 04 4月, 2009 6 次提交
  7. 13 3月, 2009 1 次提交
  8. 06 1月, 2009 6 次提交
    • J
      ocfs2: Use metadata-specific ocfs2_journal_access_*() functions. · 13723d00
      Joel Becker 提交于
      The per-metadata-type ocfs2_journal_access_*() functions hook up jbd2
      commit triggers and allow us to compute metadata ecc right before the
      buffers are written out.  This commit provides ecc for inodes, extent
      blocks, group descriptors, and quota blocks.  It is not safe to use
      extened attributes and metaecc at the same time yet.
      
      The ocfs2_extent_tree and ocfs2_path abstractions in alloc.c both hide
      the type of block at their root.  Before, it didn't matter, but now the
      root block must use the appropriate ocfs2_journal_access_*() function.
      To keep this abstract, the structures now have a pointer to the matching
      journal_access function and a wrapper call to call it.
      
      A few places use naked ocfs2_write_block() calls instead of adding the
      blocks to the journal.  We make sure to calculate their checksum and ecc
      before the write.
      
      Since we pass around the journal_access functions.  Let's typedef them
      in ocfs2.h.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      13723d00
    • J
      ocfs2: Add quota calls for allocation and freeing of inodes and space · a90714c1
      Jan Kara 提交于
      Add quota calls for allocation and freeing of inodes and space, also update
      estimates on number of needed credits for a transaction. Move out inode
      allocation from ocfs2_mknod_locked() because vfs_dq_init() must be called
      outside of a transaction.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      a90714c1
    • J
      ocfs2: Wrap inode block reads in a dedicated function. · b657c95c
      Joel Becker 提交于
      The ocfs2 code currently reads inodes off disk with a simple
      ocfs2_read_block() call.  Each place that does this has a different set
      of sanity checks it performs.  Some check only the signature.  A couple
      validate the block number (the block read vs di->i_blkno).  A couple
      others check for VALID_FL.  Only one place validates i_fs_generation.  A
      couple check nothing.  Even when an error is found, they don't all do
      the same thing.
      
      We wrap inode reading into ocfs2_read_inode_block().  This will validate
      all the above fields, going readonly if they are invalid (they never
      should be).  ocfs2_read_inode_block_full() is provided for the places
      that want to pass read_block flags.  Every caller is passing a struct
      inode with a valid ip_blkno, so we don't need a separate blkno argument
      either.
      
      We will remove the validation checks from the rest of the code in a
      later commit, as they are no longer necessary.
      Signed-off-by: NJoel Becker <joel.becker@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      b657c95c
    • T
      ocfs2: add ocfs2_init_acl in mknod · 89c38bd0
      Tiger Yang 提交于
      We need to get the parent directories acls and let the new child inherit it.
      To this, we add additional calculations for data/metadata allocation.
      Signed-off-by: NTiger Yang <tiger.yang@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      89c38bd0
    • T
      ocfs2: add ocfs2_init_security in during file create · 534eaddd
      Tiger Yang 提交于
      Security attributes must be set when creating a new inode.
      
      We do this in three steps.
      
      - First, get security xattr's name and value by security_operation
      
      - Calculate and reserve the meta data and clusters needed by this security
        xattr before starting transaction
      
      - Finally, we set it before add_entry
      Signed-off-by: NTiger Yang <tiger.yang@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      534eaddd
    • T
      ocfs2: move new inode allocation out of the transaction · f5d36202
      Tiger Yang 提交于
      Move out inode allocation from ocfs2_mknod_locked() because
      vfs_dq_init() must be called outside of a transaction.
      Signed-off-by: NJan Kara <jack@suse.cz>
      Signed-off-by: NTiger Yang <tiger.yang@oracle.com>
      Signed-off-by: NMark Fasheh <mfasheh@suse.com>
      f5d36202
  9. 14 11月, 2008 1 次提交
  10. 11 11月, 2008 2 次提交
  11. 15 10月, 2008 2 次提交
  12. 14 10月, 2008 3 次提交
  13. 18 4月, 2008 2 次提交
  14. 26 1月, 2008 3 次提交
  15. 07 11月, 2007 1 次提交
  16. 13 10月, 2007 4 次提交
  17. 10 8月, 2007 1 次提交
  18. 11 7月, 2007 1 次提交