linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: ext4_orphan_add() remove unnecessary comments
@ 2011-06-28 14:50 Lukas Czerner
  2011-07-11 22:47 ` Ted Ts'o
  0 siblings, 1 reply; 2+ messages in thread
From: Lukas Czerner @ 2011-06-28 14:50 UTC (permalink / raw)
  To: linux-ext4; +Cc: tytso, Lukas Czerner

The comment from Al Viro about possible race in the ext4_orphan_add() is
not justified. There is no race possible as we always have either i_mutex
locked, or the inode can not be referenced from outside hence the
J_ASSERS should not be hit from the reason described in comment.

This commit replaces it with notion that we are holding i_mutex so it
should not be possible for i_nlink to be changed while waiting for
s_orphan_lock.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
 fs/ext4/namei.c |   17 +++++------------
 1 files changed, 5 insertions(+), 12 deletions(-)

diff --git a/fs/ext4/namei.c b/fs/ext4/namei.c
index b754b77..8dde5ab 100644
--- a/fs/ext4/namei.c
+++ b/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. */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-11 22:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-28 14:50 [PATCH] ext4: ext4_orphan_add() remove unnecessary comments Lukas Czerner
2011-07-11 22:47 ` Ted Ts'o

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).