From: Geoffrey Wehrman <gwehrman@sgi.com>
To: Carlos Maiolino <cmaiolino@redhat.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH] xfs: re-organize XFS_ILOCK asserts in xfs_itruncate_extents()
Date: Mon, 28 Jan 2013 10:52:57 -0600 [thread overview]
Message-ID: <20130128165257.GB7124@sgi.com> (raw)
In-Reply-To: <1359391710-3862-1-git-send-email-cmaiolino@redhat.com>
On Mon, Jan 28, 2013 at 11:48:30AM -0500, Carlos Maiolino wrote:
| An logically OR'red assert for check an inode locked in XFS_ILOCK_EXCL and
| XFS_IOLOCK_EXCL looks better than the old way, avoiding possible mistakes while
| readin the code
|
| Signed-off-by: Carlos Maiolino <cmaiolino@redhat.com>
| ---
| fs/xfs/xfs_inode.c | 5 +++--
| 1 file changed, 3 insertions(+), 2 deletions(-)
|
| diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
| index 66282dc..f7efe77 100644
| --- a/fs/xfs/xfs_inode.c
| +++ b/fs/xfs/xfs_inode.c
| @@ -1395,9 +1395,10 @@ xfs_itruncate_extents(
| int error = 0;
| int done = 0;
|
| - ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL));
| - ASSERT(!atomic_read(&VFS_I(ip)->i_count) ||
| + ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL) ||
| xfs_isilocked(ip, XFS_IOLOCK_EXCL));
| + ASSERT(!atomic_read(&VFS_I(ip)->i_count));
| + 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);
| --
| 1.8.1
NACK. You are changing the logic of the asserts. The original first
assert indicates that the ILOCK is always locked. The modified asserts
allow eith the ILOCK or the IOLOCK to be locked. This is not correct.
Geoffrey
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-01-28 16:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-28 16:48 [PATCH] xfs: re-organize XFS_ILOCK asserts in xfs_itruncate_extents() Carlos Maiolino
2013-01-28 16:52 ` Geoffrey Wehrman [this message]
2013-01-28 16:56 ` Carlos Maiolino
2013-01-28 16:53 ` Carlos Maiolino
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=20130128165257.GB7124@sgi.com \
--to=gwehrman@sgi.com \
--cc=cmaiolino@redhat.com \
--cc=xfs@oss.sgi.com \
/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