From: Dan Carpenter <dan.carpenter@oracle.com>
To: darrick.wong@oracle.com
Cc: linux-xfs@vger.kernel.org
Subject: [bug report] xfs: scrub directory freespace
Date: Sat, 4 Nov 2017 10:54:57 +0300 [thread overview]
Message-ID: <20171104075457.izv6ylypgjwhf6uy@mwanda> (raw)
Hello Darrick J. Wong,
The patch df481968f33b: "xfs: scrub directory freespace" from Oct 17,
2017, leads to the following static checker warning:
fs/xfs/scrub/dir.c:446 xfs_scrub_directory_check_freesp()
info: ignoring unreachable code.
fs/xfs/scrub/dir.c
431 STATIC void
432 xfs_scrub_directory_check_freesp(
433 struct xfs_scrub_context *sc,
434 xfs_dablk_t lblk,
435 struct xfs_buf *dbp,
436 unsigned int len)
437 {
438 struct xfs_dir2_data_free *bf;
439 struct xfs_dir2_data_free *dfp;
440 int offset;
441
442 if (len == 0)
443 return;
444
445 bf = sc->ip->d_ops->data_bestfree_p(dbp->b_addr);
446 for (dfp = &bf[0]; dfp < &bf[XFS_DIR2_DATA_FD_COUNT]; dfp++) {
^^^^^
This looks like a loop
447 offset = be16_to_cpu(dfp->offset);
448 if (offset == 0)
449 break;
450 if (len == be16_to_cpu(dfp->length))
451 return;
452 /* Didn't find the best length in the bestfree data */
453 break;
^^^^^^
but we always either break or return on the first iteration. What's
going on?
454 }
455
456 xfs_scrub_fblock_set_corrupt(sc, XFS_DATA_FORK, lblk);
457 }
regards,
dan carpenter
next reply other threads:[~2017-11-04 7:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-04 7:54 Dan Carpenter [this message]
2017-11-06 19:34 ` [bug report] xfs: scrub directory freespace Darrick J. Wong
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=20171104075457.izv6ylypgjwhf6uy@mwanda \
--to=dan.carpenter@oracle.com \
--cc=darrick.wong@oracle.com \
--cc=linux-xfs@vger.kernel.org \
/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).