public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Ben Myers <bpm@sgi.com>
Cc: Christoph Hellwig <hch@infradead.org>, xfs@oss.sgi.com
Subject: Re: [PATCH 01/11] xfs: remove xfs_itruncate_data
Date: Wed, 4 Jan 2012 04:27:28 -0500	[thread overview]
Message-ID: <20120104092728.GA27447@infradead.org> (raw)
In-Reply-To: <20120103215345.GA6390@sgi.com>

> You've tossed xfs_isize_check in the round filer, but you didn't mention
> that in your commit message.  Isn't this still useful code?

It falls under the removal of a few asserts in the debug build.  I don't
think it's a useful check.

> > -	if (ip->i_size != new_size) {
> > -		ip->i_d.di_size = new_size;
> > -		ip->i_size = new_size;
> > -	}
> > -
> > -	ASSERT(new_size != 0 || ip->i_delayed_blks == 0);
> 
> You didn't pull this assert along with 
> 
> > -	ASSERT(new_size != 0 || ip->i_d.di_nextents == 0);
> 
> this one into xfs_qm_scall_trunc_qfile.  Was that intentional?


We never have delayed blocks on the quota files, so there's not much
of a point to have this assert.

> > -	error = xfs_itruncate_data(&tp, ip, 0);
> > +	ip->i_d.di_size = 0;
> > +	ip->i_size = 0;
> > +	xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
> > +
> > +	error = xfs_itruncate_extents(&tp, ip, XFS_DATA_FORK, 0);
> 
> It it worth a comment that you log the size here because of the
> possibility of another file being allocated these extents in the face of
> a crash?

I don't think there's a point in duplicating that comment.  Eventually
I'll see if we can simply use the existing truncate code for the quota
files anyway.

> > -		error = xfs_itruncate_data(&tp, ip, 0);
> > +		ip->i_d.di_size = 0;
> > +		ip->i_size = 0;
> > +		xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
> 
> Maybe a comment here too?

We log inodes in tons of places without adding a comment ever time.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-01-04  9:27 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-18 20:00 [PATCH 00/11] inode shrink and misc updates V2 Christoph Hellwig
2011-12-18 20:00 ` [PATCH 01/11] xfs: remove xfs_itruncate_data Christoph Hellwig
2012-01-03 21:53   ` Ben Myers
2012-01-04  9:27     ` Christoph Hellwig [this message]
2011-12-18 20:00 ` [PATCH 02/11] xfs: cleanup xfs_iomap_eof_align_last_fsb Christoph Hellwig
2012-01-04 20:32   ` Ben Myers
2011-12-18 20:00 ` [PATCH 03/11] xfs: remove the unused dm_attrs structure Christoph Hellwig
2012-01-04 21:13   ` Ben Myers
2011-12-18 20:00 ` [PATCH 04/11] xfs: remove the if_ext_max field in struct xfs_ifork Christoph Hellwig
2012-01-06 16:58   ` Ben Myers
2012-01-16 22:45     ` Ben Myers
2012-01-17 15:16       ` Ben Myers
2012-01-17 17:04         ` Mark Tinguely
2011-12-18 20:00 ` [PATCH 05/11] xfs: make i_flags an unsigned long Christoph Hellwig
2011-12-18 20:00 ` [PATCH 06/11] xfs: replace i_flock with a sleeping bitlock Christoph Hellwig
2012-01-13 21:49   ` Ben Myers
2011-12-18 20:00 ` [PATCH 07/11] xfs: replace i_pin_wait with a bit waitqueue Christoph Hellwig
2012-01-13 22:42   ` Ben Myers
2011-12-18 20:00 ` [PATCH 08/11] xfs: remove the i_size field in struct xfs_inode Christoph Hellwig
2012-01-16 18:32   ` Ben Myers
2012-01-16 19:45     ` Ben Myers
2011-12-18 20:00 ` [PATCH 09/11] xfs: remove the i_new_size " Christoph Hellwig
2011-12-18 22:13   ` Dave Chinner
2012-01-16 22:41   ` Ben Myers
2012-01-17 20:14   ` Ben Myers
2011-12-18 20:00 ` [PATCH 10/11] xfs: always return with the iolock held from xfs_file_aio_write_checks Christoph Hellwig
2012-01-17 20:18   ` Ben Myers
2012-01-20 12:51     ` Jeff Liu
2011-12-18 20:00 ` [PATCH 11/11] xfs: cleanup xfs_file_aio_write Christoph Hellwig
2012-01-17 20:42   ` Ben Myers
  -- strict thread matches above, loose matches on Subject: below --
2011-12-08 15:57 [PATCH 00/11] inode shrink and misc updates Christoph Hellwig
2011-12-08 15:57 ` [PATCH 01/11] xfs: remove xfs_itruncate_data Christoph Hellwig
2011-12-13 21:23   ` Dave Chinner

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=20120104092728.GA27447@infradead.org \
    --to=hch@infradead.org \
    --cc=bpm@sgi.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