* [PATCH] xfs: fix potential infinite loop in xfs_iomap_prealloc_size()
@ 2013-02-22 18:32 Brian Foster
2013-02-23 0:56 ` Dave Chinner
2013-03-07 18:43 ` Ben Myers
0 siblings, 2 replies; 3+ messages in thread
From: Brian Foster @ 2013-02-22 18:32 UTC (permalink / raw)
To: xfs
If freesp == 0, we could end up in an infinite loop while squashing
the preallocation. Break the loop when we've killed the prealloc
entirely.
Signed-off-by: Brian Foster <bfoster@redhat.com>
---
Hi all,
Mark caught this while reviewing the quota throttling patchset. I figured
it better that my set depend on this rather than vice versa, so I'll plan on a
v5 for at least a rebase, but I'll wait a bit for further comments on v4.
Brian
fs/xfs/xfs_iomap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/xfs_iomap.c b/fs/xfs/xfs_iomap.c
index 912d83d..b0b0f44 100644
--- a/fs/xfs/xfs_iomap.c
+++ b/fs/xfs/xfs_iomap.c
@@ -413,7 +413,7 @@ xfs_iomap_prealloc_size(
* have a large file on a small filesystem and the above
* lowspace thresholds are smaller than MAXEXTLEN.
*/
- while (alloc_blocks >= freesp)
+ while (alloc_blocks && alloc_blocks >= freesp)
alloc_blocks >>= 4;
}
--
1.7.7.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: fix potential infinite loop in xfs_iomap_prealloc_size()
2013-02-22 18:32 [PATCH] xfs: fix potential infinite loop in xfs_iomap_prealloc_size() Brian Foster
@ 2013-02-23 0:56 ` Dave Chinner
2013-03-07 18:43 ` Ben Myers
1 sibling, 0 replies; 3+ messages in thread
From: Dave Chinner @ 2013-02-23 0:56 UTC (permalink / raw)
To: Brian Foster; +Cc: xfs
On Fri, Feb 22, 2013 at 01:32:56PM -0500, Brian Foster wrote:
> If freesp == 0, we could end up in an infinite loop while squashing
> the preallocation. Break the loop when we've killed the prealloc
> entirely.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
Looks good.
Reviewed-by: Dave Chinner <dchinner@redhat.com>
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] xfs: fix potential infinite loop in xfs_iomap_prealloc_size()
2013-02-22 18:32 [PATCH] xfs: fix potential infinite loop in xfs_iomap_prealloc_size() Brian Foster
2013-02-23 0:56 ` Dave Chinner
@ 2013-03-07 18:43 ` Ben Myers
1 sibling, 0 replies; 3+ messages in thread
From: Ben Myers @ 2013-03-07 18:43 UTC (permalink / raw)
To: Brian Foster; +Cc: xfs
On Fri, Feb 22, 2013 at 01:32:56PM -0500, Brian Foster wrote:
> If freesp == 0, we could end up in an infinite loop while squashing
> the preallocation. Break the loop when we've killed the prealloc
> entirely.
>
> Signed-off-by: Brian Foster <bfoster@redhat.com>
Applied.
-Ben
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-03-07 18:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-22 18:32 [PATCH] xfs: fix potential infinite loop in xfs_iomap_prealloc_size() Brian Foster
2013-02-23 0:56 ` Dave Chinner
2013-03-07 18:43 ` Ben Myers
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.