* [PATCH 0/2] xfs: minor inode unlink debug enhancements
@ 2013-04-25 15:41 Brian Foster
2013-04-25 15:41 ` [PATCH 1/2] xfs: tracepoints for xfs_iunlink() and xfs_iunlink_remove() Brian Foster
2013-04-25 15:41 ` [PATCH 2/2] xfs: enhance warning on xfs_imap() failure in xfs_iunlink_remove() Brian Foster
0 siblings, 2 replies; 5+ messages in thread
From: Brian Foster @ 2013-04-25 15:41 UTC (permalink / raw)
To: xfs
The following couple of patches provide a bit more debug info in the inode
unlink code paths. This data proved useful for the investigation around a
recent (downstream/distro) link/unlink race problem:
http://oss.sgi.com/archives/xfs/2013-04/msg00342.html
Brian
Brian Foster (1):
xfs: tracepoints for xfs_iunlink() and xfs_iunlink_remove()
Eric Sandeen (1):
xfs: enhance warning on xfs_imap() failure in xfs_iunlink_remove()
fs/xfs/xfs_inode.c | 10 ++++++++--
fs/xfs/xfs_trace.h | 2 ++
2 files changed, 10 insertions(+), 2 deletions(-)
--
1.7.7.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH 1/2] xfs: tracepoints for xfs_iunlink() and xfs_iunlink_remove()
2013-04-25 15:41 [PATCH 0/2] xfs: minor inode unlink debug enhancements Brian Foster
@ 2013-04-25 15:41 ` Brian Foster
2013-04-26 2:19 ` Dave Chinner
2013-04-25 15:41 ` [PATCH 2/2] xfs: enhance warning on xfs_imap() failure in xfs_iunlink_remove() Brian Foster
1 sibling, 1 reply; 5+ messages in thread
From: Brian Foster @ 2013-04-25 15:41 UTC (permalink / raw)
To: xfs
Add tracepoints for xfs_iunlink() and xfs_iunlink_remove(). These
tracepoints are useful for debugging inode link (and unlinked list
issues).
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
fs/xfs/xfs_inode.c | 4 ++++
fs/xfs/xfs_trace.h | 2 ++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 4f20165..c22f980 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1519,6 +1519,8 @@ xfs_iunlink(
mp = tp->t_mountp;
+ trace_xfs_iunlink(ip);
+
/*
* Get the agi buffer first. It ensures lock ordering
* on the list.
@@ -1598,6 +1600,8 @@ xfs_iunlink_remove(
mp = tp->t_mountp;
agno = XFS_INO_TO_AGNO(mp, ip->i_ino);
+ trace_xfs_iunlink_remove(ip);
+
/*
* Get the agi buffer first. It ensures lock ordering
* on the list.
diff --git a/fs/xfs/xfs_trace.h b/fs/xfs/xfs_trace.h
index aa4db33..43bd572 100644
--- a/fs/xfs/xfs_trace.h
+++ b/fs/xfs/xfs_trace.h
@@ -586,6 +586,8 @@ DEFINE_INODE_EVENT(xfs_file_fsync);
DEFINE_INODE_EVENT(xfs_destroy_inode);
DEFINE_INODE_EVENT(xfs_evict_inode);
DEFINE_INODE_EVENT(xfs_update_time);
+DEFINE_INODE_EVENT(xfs_iunlink);
+DEFINE_INODE_EVENT(xfs_iunlink_remove);
DEFINE_INODE_EVENT(xfs_dquot_dqalloc);
DEFINE_INODE_EVENT(xfs_dquot_dqdetach);
--
1.7.7.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH 2/2] xfs: enhance warning on xfs_imap() failure in xfs_iunlink_remove()
2013-04-25 15:41 [PATCH 0/2] xfs: minor inode unlink debug enhancements Brian Foster
2013-04-25 15:41 ` [PATCH 1/2] xfs: tracepoints for xfs_iunlink() and xfs_iunlink_remove() Brian Foster
@ 2013-04-25 15:41 ` Brian Foster
2013-04-26 2:25 ` Dave Chinner
1 sibling, 1 reply; 5+ messages in thread
From: Brian Foster @ 2013-04-25 15:41 UTC (permalink / raw)
To: xfs
From: Eric Sandeen <sandeen@redhat.com>
Include the global ino, ag number and agino in the warning message
emitted should xfs_imap() fail in the xfs_iunlink_remove() code
path.
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
fs/xfs/xfs_inode.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index c22f980..a4fe989 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1678,8 +1678,10 @@ xfs_iunlink_remove(
error = xfs_imap(mp, tp, next_ino, &imap, 0);
if (error) {
xfs_warn(mp,
- "%s: xfs_imap returned error %d.",
- __func__, error);
+ "%s: xfs_imap() returned error %d "
+ "for inode 0x%llx ag %d agino 0x%x",
+ __func__, error, ip->i_ino, agno, agino);
+
return error;
}
--
1.7.7.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH 1/2] xfs: tracepoints for xfs_iunlink() and xfs_iunlink_remove()
2013-04-25 15:41 ` [PATCH 1/2] xfs: tracepoints for xfs_iunlink() and xfs_iunlink_remove() Brian Foster
@ 2013-04-26 2:19 ` Dave Chinner
0 siblings, 0 replies; 5+ messages in thread
From: Dave Chinner @ 2013-04-26 2:19 UTC (permalink / raw)
To: Brian Foster; +Cc: xfs
On Thu, Apr 25, 2013 at 11:41:29AM -0400, Brian Foster wrote:
> Add tracepoints for xfs_iunlink() and xfs_iunlink_remove(). These
> tracepoints are useful for debugging inode link (and unlinked list
> issues).
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
Looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH 2/2] xfs: enhance warning on xfs_imap() failure in xfs_iunlink_remove()
2013-04-25 15:41 ` [PATCH 2/2] xfs: enhance warning on xfs_imap() failure in xfs_iunlink_remove() Brian Foster
@ 2013-04-26 2:25 ` Dave Chinner
0 siblings, 0 replies; 5+ messages in thread
From: Dave Chinner @ 2013-04-26 2:25 UTC (permalink / raw)
To: Brian Foster; +Cc: xfs
On Thu, Apr 25, 2013 at 11:41:30AM -0400, Brian Foster wrote:
> From: Eric Sandeen <sandeen@redhat.com>
>
> Include the global ino, ag number and agino in the warning message
> emitted should xfs_imap() fail in the xfs_iunlink_remove() code
> path.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
> ---
> fs/xfs/xfs_inode.c | 6 ++++--
> 1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index c22f980..a4fe989 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -1678,8 +1678,10 @@ xfs_iunlink_remove(
> error = xfs_imap(mp, tp, next_ino, &imap, 0);
> if (error) {
> xfs_warn(mp,
> - "%s: xfs_imap returned error %d.",
> - __func__, error);
> + "%s: xfs_imap() returned error %d "
> + "for inode 0x%llx ag %d agino 0x%x",
> + __func__, error, ip->i_ino, agno, agino);
> +
The fact the format string is now split across 2 lines makes it hard
to grep for. The indentation should be a clue that the warning code
is intentionally formatted that way so that long format strings
don't get wrapped. i.e:
xfs_warn(mp,
- "%s: xfs_imap returned error %d.",
- __func__, error);
+ "%s: xfs_imap() returned error %d for inode 0x%llx ag %d agino 0x%x",
+ __func__, error, ip->i_ino,
+ agno, agino);
fits into 80 columns and is much easier to read than the highly
indented version split across 2 lines....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2013-04-26 2:25 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-25 15:41 [PATCH 0/2] xfs: minor inode unlink debug enhancements Brian Foster
2013-04-25 15:41 ` [PATCH 1/2] xfs: tracepoints for xfs_iunlink() and xfs_iunlink_remove() Brian Foster
2013-04-26 2:19 ` Dave Chinner
2013-04-25 15:41 ` [PATCH 2/2] xfs: enhance warning on xfs_imap() failure in xfs_iunlink_remove() Brian Foster
2013-04-26 2:25 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox