linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.com>
To: linux-ext4@vger.kernel.org
Cc: Ted Tso <tytso@mit.edu>,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	Jan Kara <jack@suse.com>
Subject: [PATCH 10/21] ext2fs: Fixup inline directory test
Date: Wed, 26 Aug 2015 18:22:25 +0200	[thread overview]
Message-ID: <1440606156-5754-11-git-send-email-jack@suse.com> (raw)
In-Reply-To: <1440606156-5754-1-git-send-email-jack@suse.com>

Inline directory test had hardwired number of reserved inodes. Fix the
test to read the first available inode number from the superblock.

Signed-off-by: Jan Kara <jack@suse.com>
---
 lib/ext2fs/inline_data.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/ext2fs/inline_data.c b/lib/ext2fs/inline_data.c
index 6260c5f35c1a..98c732bb2e3c 100644
--- a/lib/ext2fs/inline_data.c
+++ b/lib/ext2fs/inline_data.c
@@ -706,22 +706,23 @@ static errcode_t dir_test(ext2_filsys fs)
 	errcode_t retval;
 	char dirname[PATH_MAX];
 	int i;
+	ext2_ino_t ino = EXT2_FIRST_INO(fs->super);
 
-	retval = ext2fs_mkdir(fs, 11, 11, stub_name);
+	retval = ext2fs_mkdir(fs, ino, ino, stub_name);
 	if (retval) {
 		com_err("dir_test", retval, "while creating %s dir", stub_name);
 		return retval;
 	}
 
-	retval = ext2fs_mkdir(fs, 11, 0, parent_name);
+	retval = ext2fs_mkdir(fs, ino, 0, parent_name);
 	if (retval) {
 		com_err("dir_test", retval,
 			"while creating %s dir", parent_name);
 		return retval;
 	}
 
-	retval = ext2fs_lookup(fs, 11, parent_name, strlen(parent_name),
-			       0, &parent);
+	retval = ext2fs_lookup(fs, ino, parent_name,
+			       strlen(parent_name), 0, &parent);
 	if (retval) {
 		com_err("dir_test", retval,
 			"while looking up %s dir", parent_name);
@@ -742,7 +743,7 @@ static errcode_t dir_test(ext2_filsys fs)
 		return 1;
 	}
 
-	for (i = 0, dir = 13; i < 4; i++, dir++) {
+	for (i = 0, dir = ino + 2; i < 4; i++, dir++) {
 		tmp = 0;
 		snprintf(dirname, sizeof(dirname), "%d", i);
 		retval = ext2fs_mkdir(fs, parent, 0, dirname);
-- 
2.1.4


  parent reply	other threads:[~2015-08-26 16:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-26 16:22 [PATCH 00/21 v2] e2fsprogs: Resizing rewrite Jan Kara
2015-08-26 16:22 ` [PATCH 01/21] ext2fs: Add pointer to allocator private data into ext2_filsys Jan Kara
2015-08-26 16:22 ` [PATCH 02/21] ext2fs: Implement ext2fs_allocate_group_table2() Jan Kara
2015-08-26 16:22 ` [PATCH 03/21] resize2fs: Use ext2fs_allocate_group_table2() Jan Kara
2015-08-26 16:22 ` [PATCH 04/21] ext2fs: Provide helper for wiping resize inode Jan Kara
2015-08-26 16:22 ` [PATCH 05/21] ext2fs: Implement block moving in libext2fs Jan Kara
2015-08-26 16:22 ` [PATCH 06/21] ext2fs: Implement inode " Jan Kara
2015-08-26 16:22 ` [PATCH 07/21] tune2fs: Implement setting and disabling of 64-bit feature Jan Kara
2015-08-26 16:22 ` [PATCH 08/21] tests: Convert tests for 64bit feature to use tune2fs Jan Kara
2015-08-26 16:22 ` [PATCH 09/21] mke2fs: Allow specifying number of reserved inodes Jan Kara
2015-08-26 16:22 ` Jan Kara [this message]
2015-08-26 16:22 ` [PATCH 11/21] tests: Specify number of reserved inodes for tests where it matters Jan Kara
2015-08-26 16:22 ` [PATCH 12/21] libext2fs: Bump default number of reserved inodes to 64 Jan Kara
2015-08-26 16:22 ` [PATCH 13/21] tune2fs: Add support for changing number of reserved inodes Jan Kara
2015-08-26 16:22 ` [PATCH 14/21] mke2fs, tune2fs: Tests for handling reserved_inodes option Jan Kara
2015-08-26 16:22 ` [PATCH 15/21] resize2fs: Rip out 64-bit feature handling from resize2fs Jan Kara
2015-08-26 16:22 ` [PATCH 16/21] ext2fs: Remove old block mapping function Jan Kara
2015-08-26 16:22 ` [PATCH 17/21] resize2fs: Remove duplicate condition Jan Kara
2015-08-26 16:22 ` [PATCH 18/21] ext2fs: Add extent dumping function to extent mapping code Jan Kara
2015-08-26 16:22 ` [PATCH 19/21] resize2fs: Remove " Jan Kara
2015-08-26 16:22 ` [PATCH 20/21] ext2fs: Move extent mapping test Jan Kara
2015-08-26 16:22 ` [PATCH 21/21] resize2fs: Use libextfs2 helpers for resizing Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1440606156-5754-11-git-send-email-jack@suse.com \
    --to=jack@suse.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).