[PATCH] btrfs-progs: mkfs: Fix traverse_directory() silently failing on some dirs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When traverse_directory() encounters an inode item that already exists
and has a normal amount of hardlinks - it just continues with a next one,
w/o clearing the ret value (set to -EEXIST).

But, if the last file traverse_directory() processes already has an
inode item - traverse_directory() will silently exit with a
bad return code, causing the prints like the following:

    unable to traverse directory initial-directory: 1
    error wihle filling filesystem: 1

Fix this by clearing ret value before continuing with a next file.

Signed-off-by: Yevgeny Popovych <yevgenyp@xxxxxxxxxxxxx>
---
 mkfs/rootdir.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mkfs/rootdir.c b/mkfs/rootdir.c
index ff00bb0..834aacc 100644
--- a/mkfs/rootdir.c
+++ b/mkfs/rootdir.c
@@ -553,6 +553,7 @@ static int traverse_directory(struct btrfs_trans_handle *trans,
 						(unsigned long)st.st_nlink);
 					goto fail;
 				}
+				ret = 0;
 				continue;
 			}
 			if (ret) {
-- 
2.7.4

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



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux