xfs
[Top] [All Lists]

Re: [PATCH] xfs: remove unneeded ASSERT from xfs_itruncate_extents

To: Carlos Maiolino <cmaiolino@xxxxxxxxxx>
Subject: Re: [PATCH] xfs: remove unneeded ASSERT from xfs_itruncate_extents
From: Mark Tinguely <tinguely@xxxxxxx>
Date: Mon, 28 Jan 2013 08:14:12 -0600
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1359381870-30908-1-git-send-email-cmaiolino@xxxxxxxxxx>
References: <1359381870-30908-1-git-send-email-cmaiolino@xxxxxxxxxx>
User-agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120122 Thunderbird/9.0
On 01/28/13 08:04, Carlos Maiolino wrote:
There is no reason to ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL)); twice, so,
remove one of these ASSERT calls

Signed-off-by: Carlos Maiolino<cmaiolino@xxxxxxxxxx>
---
  fs/xfs/xfs_inode.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index 66282dc..25226ea 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -1396,8 +1396,7 @@ xfs_itruncate_extents(
        int                     done = 0;

        ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
-       ASSERT(!atomic_read(&VFS_I(ip)->i_count) ||
-              xfs_isilocked(ip, XFS_IOLOCK_EXCL));
+       ASSERT(!atomic_read(&VFS_I(ip)->i_count));
        ASSERT(new_size<= XFS_ISIZE(ip));
        ASSERT(tp->t_flags&  XFS_TRANS_PERM_LOG_RES);
        ASSERT(ip->i_itemp != NULL);

You removed an XFS_IOLOCK_EXCL assert not a duplicate
XFS_ILOCK_EXCL assert. It maybe more obvious if the
first assert read:

        ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL) ||
               xfs_isilocked(ip, XFS_IOLOCK_EXCL));
        ASSERT(!atomic_read(&VFS_I(ip)->i_count));
...

--Mark Tinguely.

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