diff options
author | Mark Fasheh <mfasheh@suse.com> | 2010-08-13 15:15:19 -0700 |
---|---|---|
committer | Tao Ma <tao.ma@oracle.com> | 2010-09-08 14:26:00 +0800 |
commit | 97b8f4a9dfd932997677136e11980eb2fafea91d (patch) | |
tree | 63f1a6555c61f4ce421c7b9d7358a34a6e919c6a /kernel/rtmutex.h | |
parent | dd43bcde23c527f64897eef41aa1fed2c9905ea9 (diff) | |
download | kernel_goldelico_gta04-97b8f4a9dfd932997677136e11980eb2fafea91d.zip kernel_goldelico_gta04-97b8f4a9dfd932997677136e11980eb2fafea91d.tar.gz kernel_goldelico_gta04-97b8f4a9dfd932997677136e11980eb2fafea91d.tar.bz2 |
ocfs2: Fix orphan add in ocfs2_create_inode_in_orphan
ocfs2_create_inode_in_orphan() is used by reflink to create the newly
reflinked inode simultaneously in the orphan dir. This allows us to easily
handle partially-reflinked files during recovery cleanup.
We have a problem though - the orphan dir stringifies inode # to determine
a unique name under which the orphan entry dirent can be created. Since
ocfs2_create_inode_in_orphan() needs the space allocated in the orphan dir
before it can allocate the inode, we currently call into the orphan code:
/*
* We give the orphan dir the root blkno to fake an orphan name,
* and allocate enough space for our insertion.
*/
status = ocfs2_prepare_orphan_dir(osb, &orphan_dir,
osb->root_blkno,
orphan_name, &orphan_insert);
Using osb->root_blkno might work fine on unindexed directories, but the
orphan dir can have an index. When it has that index, the above code fails
to allocate the proper index entry. Later, when we try to remove the file
from the orphan dir (using the actual inode #), the reflink operation will
fail.
To fix this, I created a function ocfs2_alloc_orphaned_file() which uses the
newly split out orphan and inode alloc code to figure out what the inode
block number will be (once allocated) and then prepare the orphan dir from
that data.
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
Signed-off-by: Tao Ma <tao.ma@oracle.com>
Diffstat (limited to 'kernel/rtmutex.h')
0 files changed, 0 insertions, 0 deletions