From 0b3e608859b836ed4b0809771986343ef2bf798a Mon Sep 17 00:00:00 2001 From: Tristan Ye Date: Fri, 19 Mar 2010 09:21:10 +0800 Subject: [PATCH] --- yaml --- r: 189230 b: refs/heads/master c: b54c2ca475fa7d7450a45b6d778dae9dbe0bcbfe h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ocfs2/inode.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 4f8185cbb945..326f46ba4711 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 3939fda4b389993caf8741df5739b3e49f33a263 +refs/heads/master: b54c2ca475fa7d7450a45b6d778dae9dbe0bcbfe diff --git a/trunk/fs/ocfs2/inode.c b/trunk/fs/ocfs2/inode.c index 278a223aae14..ab207901d32a 100644 --- a/trunk/fs/ocfs2/inode.c +++ b/trunk/fs/ocfs2/inode.c @@ -891,6 +891,21 @@ static int ocfs2_query_inode_wipe(struct inode *inode, /* Do some basic inode verification... */ di = (struct ocfs2_dinode *) di_bh->b_data; if (!(di->i_flags & cpu_to_le32(OCFS2_ORPHANED_FL))) { + /* + * Inodes in the orphan dir must have ORPHANED_FL. The only + * inodes that come back out of the orphan dir are reflink + * targets. A reflink target may be moved out of the orphan + * dir between the time we scan the directory and the time we + * process it. This would lead to HAS_REFCOUNT_FL being set but + * ORPHANED_FL not. + */ + if (di->i_dyn_features & cpu_to_le16(OCFS2_HAS_REFCOUNT_FL)) { + mlog(0, "Reflinked inode %llu is no longer orphaned. " + "it shouldn't be deleted\n", + (unsigned long long)oi->ip_blkno); + goto bail; + } + /* for lack of a better error? */ status = -EEXIST; mlog(ML_ERROR,