All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix bug in ext2fs_unlink
@ 2007-11-27 17:03 Jan Kara
  2007-12-01 12:08 ` Theodore Tso
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kara @ 2007-11-27 17:03 UTC (permalink / raw)
  To: tytso; +Cc: linux-ext4

  Hi,

  the patch below fixes a bug in ext2fs_unlink() I came across when testing
my changes to e2fsprogs for 64KB blocksize support... Please apply.

									Honza
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

----
Subject: Fix a bug in deletion of first directory entry in a second (or further) directory block

We cannot merge a removed directory entry to just arbitrary previous directory
entry. The previous entry must be in the same block. We check whether the current
entry is not the first one in the block and only if it isn't merge it to the
previous entry. 

Signed-off-by: Jan Kara <jack@suse.cz>

diff --git a/lib/ext2fs/unlink.c b/lib/ext2fs/unlink.c
index eb6527e..d459bbd 100644
--- a/lib/ext2fs/unlink.c
+++ b/lib/ext2fs/unlink.c
@@ -31,7 +31,7 @@ struct link_struct  {
  #pragma argsused
 #endif
 static int unlink_proc(struct ext2_dir_entry *dirent,
-		     int	offset EXT2FS_ATTR((unused)),
+		     int	offset,
 		     int	blocksize EXT2FS_ATTR((unused)),
 		     char	*buf EXT2FS_ATTR((unused)),
 		     void	*priv_data)
@@ -56,7 +56,7 @@ static int unlink_proc(struct ext2_dir_e
 			return 0;
 	}
 
-	if (prev)
+	if (offset)
 		/* We actually would not need to convert initial values as
 		 * they are certainly less than 64K but let's not try to be
 		 * too clever */

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

* Re: [PATCH] Fix bug in ext2fs_unlink
  2007-11-27 17:03 [PATCH] Fix bug in ext2fs_unlink Jan Kara
@ 2007-12-01 12:08 ` Theodore Tso
  0 siblings, 0 replies; 2+ messages in thread
From: Theodore Tso @ 2007-12-01 12:08 UTC (permalink / raw)
  To: Jan Kara; +Cc: linux-ext4

On Tue, Nov 27, 2007 at 06:03:06PM +0100, Jan Kara wrote:
>   Hi,
> 
>   the patch below fixes a bug in ext2fs_unlink() I came across when testing
> my changes to e2fsprogs for 64KB blocksize support... Please apply.

Thanks, applied.

						- Ted

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

end of thread, other threads:[~2007-12-01 17:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-27 17:03 [PATCH] Fix bug in ext2fs_unlink Jan Kara
2007-12-01 12:08 ` Theodore Tso

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.