* [PATCH] ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs()
@ 2011-06-22 8:51 Lukas Czerner
2011-06-22 18:26 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Lukas Czerner @ 2011-06-22 8:51 UTC (permalink / raw)
To: linux-ext4; +Cc: Lukas Czerner, Jan Kara
We should return -EINVAL when the FITRIM parameters are not sane, but
currently we are exiting silently if start is beyond the end of the
file system. This commit fixes this so we return -EINVAL as other file
systems do.
Signed-off-by: Lukas Czerner <lczerner@redhat.com>
CC: Jan Kara <jack@suse.cz>
---
fs/ext3/balloc.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
index fe52297..790cdf3 100644
--- a/fs/ext3/balloc.c
+++ b/fs/ext3/balloc.c
@@ -2100,7 +2100,7 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)
if (unlikely(minlen > EXT3_BLOCKS_PER_GROUP(sb)))
return -EINVAL;
if (start >= max_blks)
- goto out;
+ return -EINVAL;
if (start + len > max_blks)
len = max_blks - start;
--
1.7.4.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs()
2011-06-22 8:51 [PATCH] ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs() Lukas Czerner
@ 2011-06-22 18:26 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2011-06-22 18:26 UTC (permalink / raw)
To: Lukas Czerner; +Cc: linux-ext4, Jan Kara
On Wed 22-06-11 10:51:09, Lukas Czerner wrote:
> We should return -EINVAL when the FITRIM parameters are not sane, but
> currently we are exiting silently if start is beyond the end of the
> file system. This commit fixes this so we return -EINVAL as other file
> systems do.
Thanks. Merged.
Honza
>
> Signed-off-by: Lukas Czerner <lczerner@redhat.com>
> CC: Jan Kara <jack@suse.cz>
> ---
> fs/ext3/balloc.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ext3/balloc.c b/fs/ext3/balloc.c
> index fe52297..790cdf3 100644
> --- a/fs/ext3/balloc.c
> +++ b/fs/ext3/balloc.c
> @@ -2100,7 +2100,7 @@ int ext3_trim_fs(struct super_block *sb, struct fstrim_range *range)
> if (unlikely(minlen > EXT3_BLOCKS_PER_GROUP(sb)))
> return -EINVAL;
> if (start >= max_blks)
> - goto out;
> + return -EINVAL;
> if (start + len > max_blks)
> len = max_blks - start;
>
> --
> 1.7.4.4
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-06-22 18:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-22 8:51 [PATCH] ext3: Return -EINVAL when start is beyond the end of fs in ext3_trim_fs() Lukas Czerner
2011-06-22 18:26 ` Jan Kara
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).