]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
GFS2: Fix FITRIM argument handling
authorLukas Czerner <lczerner@redhat.com>
Tue, 16 Oct 2012 09:39:08 +0000 (11:39 +0200)
committerSteven Whitehouse <swhiteho@redhat.com>
Wed, 7 Nov 2012 09:41:58 +0000 (09:41 +0000)
commit076f0faa764ab3a5a32fc726ae05e2de0e66151d
tree044f34fe4c73b9c79191b6dfce1770980b4e9b41
parent3a238adefb8c5b8cb8cde0ce689d513306176ff4
GFS2: Fix FITRIM argument handling

Currently implementation in gfs2 uses FITRIM arguments as it were in
file system blocks units which is wrong. The FITRIM arguments
(fstrim_range.start, fstrim_range.len and fstrim_range.minlen) are
actually in bytes.

Moreover, check for start argument beyond the end of file system, len
argument being smaller than file system block and minlen argument being
bigger than biggest resource group were missing.

This commit converts the code to convert FITRIM argument to file system
blocks and also adds appropriate checks mentioned above.

All the problems were recognised by xfstests 251 and 260.

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/rgrp.c