From ec39508321085b29365a1eabe1d5441f8d454561 Mon Sep 17 00:00:00 2001 From: Lukas Czerner Date: Mon, 11 Jul 2011 18:47:04 -0400 Subject: [PATCH] --- yaml --- r: 262103 b: refs/heads/master c: afb86178cb9b6a7329cf8709aa210fb0a245b606 h: refs/heads/master i: 262101: 3b4519f792eb6c3dbbc078b79647865c15156e19 262099: 97f8c21b4e790550e9ea7a4ff5320a985bcdff8d 262095: 0a6fc1dcbf04715c54bfce75fd4ea2bd3b31d3b3 v: v3 --- [refs] | 2 +- trunk/fs/ext4/namei.c | 17 +++++------------ 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 9b1f858611a0..1995da8be7ea 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: caaf7a29d31da21bb8d8200d5e42d1c93d3c6e00 +refs/heads/master: afb86178cb9b6a7329cf8709aa210fb0a245b606 diff --git a/trunk/fs/ext4/namei.c b/trunk/fs/ext4/namei.c index b754b7721f51..8dde5ab239cc 100644 --- a/trunk/fs/ext4/namei.c +++ b/trunk/fs/ext4/namei.c @@ -1989,18 +1989,11 @@ int ext4_orphan_add(handle_t *handle, struct inode *inode) if (!list_empty(&EXT4_I(inode)->i_orphan)) goto out_unlock; - /* Orphan handling is only valid for files with data blocks - * being truncated, or files being unlinked. */ - - /* @@@ FIXME: Observation from aviro: - * I think I can trigger J_ASSERT in ext4_orphan_add(). We block - * here (on s_orphan_lock), so race with ext4_link() which might bump - * ->i_nlink. For, say it, character device. Not a regular file, - * not a directory, not a symlink and ->i_nlink > 0. - * - * tytso, 4/25/2009: I'm not sure how that could happen; - * shouldn't the fs core protect us from these sort of - * unlink()/link() races? + /* + * Orphan handling is only valid for files with data blocks + * being truncated, or files being unlinked. Note that we either + * hold i_mutex, or the inode can not be referenced from outside, + * so i_nlink should not be bumped due to race */ J_ASSERT((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode) || S_ISLNK(inode->i_mode)) || inode->i_nlink == 0);