From: Lukas Czerner <lczerner@redhat.com>
To: xfs@oss.sgi.com
Cc: Lukas Czerner <lczerner@redhat.com>
Subject: [PATCH 2/2] 251: Do not allow step to be zero
Date: Tue, 16 Oct 2012 11:41:34 +0200 [thread overview]
Message-ID: <1350380494-17482-2-git-send-email-lczerner@redhat.com> (raw)
In-Reply-To: <1350380494-17482-1-git-send-email-lczerner@redhat.com>
Currently 'step' variable which is used as length of the range to
discard can be zero. However it would result in error returned by the
fstrim.
Fix this by forcing 'step' to be at least 4KB.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
---
251 | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/251 b/251
index f46b6e2..373afd0 100755
--- a/251
+++ b/251
@@ -98,7 +98,7 @@ fstrim_loop()
mmlen=$(_guess_max_minlen)
while true ; do
- step=$((RANDOM*$RANDOM))
+ step=$((RANDOM*$RANDOM+4))
minlen=$(((RANDOM*($RANDOM%2+1))%$mmlen))
start=$RANDOM
if [ $((RANDOM%10)) -gt 7 ]; then
--
1.7.7.6
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2012-10-16 9:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-16 9:41 [PATCH 1/2] 286: Test FITRIM where length is smaller than FSB Lukas Czerner
2012-10-16 9:41 ` Lukas Czerner [this message]
2012-10-16 20:18 ` [PATCH 2/2] 251: Do not allow step to be zero Dave Chinner
2012-10-24 20:43 ` Rich Johnston
2012-10-16 20:16 ` [PATCH 1/2] 286: Test FITRIM where length is smaller than FSB Dave Chinner
2012-10-16 20:48 ` Ben Myers
2012-10-24 20:39 ` Rich Johnston
2012-10-24 20:44 ` Rich Johnston
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=1350380494-17482-2-git-send-email-lczerner@redhat.com \
--to=lczerner@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