Re: [PATCH 4/5] xfs: log file size updates as part of unwritten extent conversion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 10, 2011 at 04:43:02PM -0600, Ben Myers wrote:
> > +		/*
> > +		 * Log the updated inode size as we go.  We have to be careful
> > +		 * to only log it up to the actual write offset if it is
> > +		 * halfway into a block.
> > +		 */
> > +		i_size = XFS_FSB_TO_B(mp, offset_fsb + count_fsb);
> > +		if (i_size > offset + count)
> > +			i_size = offset + count;
> > +
> 
> I'm missing something here.  Why wouldn't you just 
> 
> i_size = xfs_new_eof(ip, offset + count);
> 
> It's not clear to me why offset_fsb and count_fsb should be involved in
> this calculation.  Can you enlighten me?

Because at this point we don't have the full length allocated yet.
Every loop iteration has it's own transaction, and we might as well
crash before the final one.

The alternatively would be to only log a file size update during
the final loop iteration, but this variant seems a tad cleaner.

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


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux