debugfs: fix printing of inline data during symlink inode dump

When we're dumping a fast symlink inode, we print some odd things to
stdout.  To clean this up, first don't print inline data EA, since the
inode dump doesn't display file and directory contents.  Then, teach
the inode dump function how to print out either an inline data fast
symlink or a non-inline data fast symlink.

(This is a follow-up to the earlier patch "debugfs: Only print the
first 60 bytes from i_block on a fast symlink")

[ Modified by tytso so that the d_inline_dump test works when build
  directory is different from the source directory --- i.e., when
  doing a VPATH build. ]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
diff --git a/tests/d_inline_dump/script b/tests/d_inline_dump/script
new file mode 100644
index 0000000..8d97729
--- /dev/null
+++ b/tests/d_inline_dump/script
@@ -0,0 +1,43 @@
+if ! test -x $DEBUGFS_EXE; then
+	echo "$test_name: $test_description: skipped"
+	exit 0
+fi
+
+OUT=$test_name.log
+EXP=$test_dir/expect
+VERIFY_FSCK_OPT=-yf
+
+ZIMAGE=$test_dir/image.gz
+gzip -d < $ZIMAGE > $TMPFILE
+
+echo "*** long file" > $OUT
+$DEBUGFS -R 'stat /file' $TMPFILE >> $OUT 2>&1
+echo "*** short file" >> $OUT
+$DEBUGFS -R 'stat /shortfile' $TMPFILE >> $OUT 2>&1
+echo >> $OUT
+
+echo "*** long dir" >> $OUT
+$DEBUGFS -R 'stat /dir' $TMPFILE >> $OUT 2>&1
+echo "*** short dir" >> $OUT
+$DEBUGFS -R 'stat /shortdir' $TMPFILE >> $OUT 2>&1
+echo >> $OUT
+
+echo "*** long link" >> $OUT
+$DEBUGFS -R 'stat /link' $TMPFILE >> $OUT 2>&1
+echo "*** short link" >> $OUT
+$DEBUGFS -R 'stat /shortlink' $TMPFILE >> $OUT 2>&1
+
+echo "*** end test" >> $OUT
+
+cmp -s $OUT $EXP
+status=$?
+
+if [ "$status" = 0 ] ; then
+	echo "$test_name: $test_description: ok"
+	touch $test_name.ok
+else
+	echo "$test_name: $test_description: failed"
+	diff $DIFF_OPTS $EXP $OUT > $test_name.failed
+fi
+
+unset VERIFY_FSCK_OPT NATIVE_FSCK_OPT OUT EXP TEST_DATA VERIFY_DATA ZIMAGE