Patchwork [01/25] libext2fs: stop iterating dirents when done linking

login
register
mail settings
Submitter Darrick J. Wong
Date Oct. 18, 2013, 4:49 a.m.
Message ID <20131018044901.7339.55731.stgit@birch.djwong.org>
Download mbox | patch
Permalink /patch/284408/
State Accepted
Headers show

Comments

Darrick J. Wong - Oct. 18, 2013, 4:49 a.m.
When we've succesfully linked an inode into a directory, we can stop
iterating the directory.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 lib/ext2fs/link.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)



--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Theodore Ts'o - Oct. 23, 2013, 11:39 p.m.
On Thu, Oct 17, 2013 at 09:49:01PM -0700, Darrick J. Wong wrote:
> When we've succesfully linked an inode into a directory, we can stop
> iterating the directory.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Applied, thanks.

					- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/lib/ext2fs/link.c b/lib/ext2fs/link.c
index 2a44575..09e6cb4 100644
--- a/lib/ext2fs/link.c
+++ b/lib/ext2fs/link.c
@@ -45,7 +45,7 @@  static int link_proc(struct ext2_dir_entry *dirent,
 	struct ext2_dir_entry_tail *t;
 
 	if (ls->done)
-		return 0;
+		return DIRENT_ABORT;
 
 	rec_len = EXT2_DIR_REC_LEN(ls->namelen);