From: Theodore Ts'o Date: Tue, 19 Aug 2014 12:27:59 +0000 (-0400) Subject: debugfs: fix set_inode_field block[IND|DIND|TIND] X-Git-Tag: v1.42.12~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59a591f6b50e88100f22666d3ce28087a1ff24f0;p=thirdparty%2Fe2fsprogs.git debugfs: fix set_inode_field block[IND|DIND|TIND] After we determine that we can't parse the array value as an integer, we need to restore the square brackets to the field name, so that we can find a match with block[IND], block[DIND], and block[TIND] in the inode field table. Reported-by: Jun He Signed-off-by: Theodore Ts'o --- diff --git a/debugfs/set_fields.c b/debugfs/set_fields.c index 40dc5e7c5..6104b2be7 100644 --- a/debugfs/set_fields.c +++ b/debugfs/set_fields.c @@ -321,8 +321,11 @@ static struct field_set_info *find_field(struct field_set_info *fields, */ if (idx) { array_idx = strtol(idx, &tmp, 0); - if (*tmp) + if (*tmp) { + *(--idx) = '['; + *delim = ']'; idx = 0; + } } /*