xfs
[Top] [All Lists]

Re: TAKE 988255 - fix instant oops with tracing enabled

To: Lachlan McIlroy <lachlan@xxxxxxx>, xfs@xxxxxxxxxxx
Subject: Re: TAKE 988255 - fix instant oops with tracing enabled
From: Lachlan McIlroy <lachlan@xxxxxxx>
Date: Tue, 14 Oct 2008 15:33:06 +1000
In-reply-to: <20081014020556.GH10716@disturbed>
References: <20081014011747.AC14E58FA1E9@xxxxxxxxxxxxxxxxxxxxxxx> <20081014020556.GH10716@disturbed>
Reply-to: lachlan@xxxxxxx
User-agent: Thunderbird 2.0.0.17 (X11/20080914)
Dave Chinner wrote:
On Tue, Oct 14, 2008 at 12:17:47PM +1100, Lachlan McIlroy wrote:
fix instant oops with tracing enabled

We can only read inode->i_count if the inode is actually there and not
a NULL pointer.  This was introduced in one of the recent sync patches.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

BTW, this now means that other pending patches won't apply cleanly....


Yeah this patch hunk didn't apply but was easy to hand merge.  It also
didn't compile because of a missing comma from the 4th last line.  Can
you please make sure each of your patch series compile on their own?

@@ -84,25 +84,12 @@ vn_ioerror(

#ifdef  XFS_INODE_TRACE

-/*
- * Reference count of Linux inode if present, -1 if the xfs_inode
- * has no associated Linux inode.
- */
-static inline int xfs_icount(struct xfs_inode *ip)
-{
-       struct inode *inode = VFS_I(ip);
-
-       if (!inode)
-               return atomic_read(&inode->i_count);
-       return -1;
-}
-
#define KTRACE_ENTER(ip, vk, s, line, ra)                       \
        ktrace_enter(   (ip)->i_trace,                               \
/*  0 */                (void *)(__psint_t)(vk),                \
/*  1 */                (void *)(s),                            \
/*  2 */                (void *)(__psint_t) line,               \
-/*  3 */               (void *)(__psint_t)xfs_icount(ip),      \
+/*  3 */               (void *)(__psint_t)atomic_read(&VFS_I(ip)->i_count) \
/*  4 */                (void *)(ra),                           \
/*  5 */                NULL,                                   \
/*  6 */                (void *)(__psint_t)current_cpu(),       \

<Prev in Thread] Current Thread [Next in Thread>