From: Alain Renaud <arenaud@sgi.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH V2] xfs: prevent xfs_bmap_extsize_align() to exceed maximum extent size.
Date: Fri, 20 Jul 2012 10:05:01 +0200 [thread overview]
Message-ID: <5009112D.4090106@sgi.com> (raw)
In-Reply-To: <20120720014454.GI23387@dastard>
On 12-07-20 03:44 AM, Dave Chinner wrote:
>
>>>
>> If you look in the function where I put this code is it AFTER the
>> head/len alignment so the HEAD is already align so I do not need to
>> account for it.
> No need to shout. I did look at the code, and IMO you do need to
> account for both head and tail extension and you definitely can't do
> it there.....
Sorry for the cap I did not intend to shout.
However the problem does exist. the len limitation in xfs_bmapi_write is
not sufficient
if you set the extsize.
Here is what I see.
xfs_bmapi_write() <= lenght limited to MAXEXTLEN;
xfs_bmapi_allocate()
xfs_bmap_alloc()
xfs_bmap_btalloc()
xfs_bmap_extsize_align() <== Align the offest / len
Since the alignment is outward like you explain bellow we return len >
MAXEXTLEN
causing failure to report ENOSPC.
You can reproduce the problem the following way.
# uname -r
3.5.0-rc1-0.2-default+
# mkfs.xfs -f -b size=512 -d agcount=1,size=4294967296 /dev/sdb5
meta-data=/dev/sdb5 isize=256 agcount=1, agsize=8388608 blks
= sectsz=512 attr=2, projid32bit=0
data = bsize=512 blocks=8388608, imaxpct=25
= sunit=0 swidth=0 blks
naming =version 2 bsize=4096 ascii-ci=0
log =internal log bsize=512 blocks=20480, version=2
= sectsz=512 sunit=0 blks, lazy-count=1
realtime =none extsz=4096 blocks=0, rtextents=0
# mount /dev/sdb5 /a
# xfs_io -f -c "extsize 2m" -c "resvsp 0 1g" /a/data1
XFS_IOC_RESVSP64: No space left on device
So Maybe the fix is to limit the bma.length in xfs_bmapi_write to MAXEXTLEN
- (2 * extsz - 1) like you do in xfs_bmapi_reserve_delalloc().
Hope this is making sense.
--
===============================================
Alain Renaud - Cluster File System Engineer
arenaud@sgi.com - SGI
===============================================
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-07-20 8:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20120712154554.377970666@sgi.com>
2012-07-13 10:09 ` [PATCH] xfs: prevent xfs_bmap_extsize_align() to exceed maximum extent size Alain Renaud
2012-07-17 16:35 ` [PATCH V2] " Alain Renaud
2012-07-19 3:30 ` Dave Chinner
2012-07-19 8:20 ` Alain Renaud
2012-07-20 1:44 ` Dave Chinner
2012-07-20 8:05 ` Alain Renaud [this message]
2012-08-23 16:52 ` [PATCH V3] xfs: prevent xfs_bmapi_write() " Alain Renaud
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=5009112D.4090106@sgi.com \
--to=arenaud@sgi.com \
--cc=david@fromorbit.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