]> git.karo-electronics.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>
Tue, 16 Oct 2012 10:07:40 +0000 (11:07 +0100)
commitb0780d7a1a2fb7e7cbf78cc22f04b78b8d35c45c
tree64a989c82972a215b149b052c997182be5a544c3
parentd9a0c38e1777dae49fd5e05586fc16457f88d22c
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