OSDN Git Service

resize2fs: add debugging code to test the old online resizing interfaces
authorTheodore Ts'o <tytso@mit.edu>
Sat, 12 Jan 2013 22:33:44 +0000 (17:33 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 14 Jan 2013 21:53:50 +0000 (16:53 -0500)
commit5a760d4906c620ef84886378db5eff28bdbd2e96
tree323d4a551a13011f14d142803fd95574e74e678d
parent85a24385b6702ca207165a18bc08fb92f5e6c986
resize2fs: add debugging code to test the old online resizing interfaces

The old online resize ioctl interfaces are still present in the
kernel, and we want to make it easy to test both the kernel code for
those older interfaces, and resize2fs's use of those interfaces in a
relatively easy manner.

To do this, resize2fs will now check the environment variable
RESIZE2FS_KERNEL_VERSION.  If the version given is less than 3.3, then
do not try using the new resizing ioctl, but instead use the resizing
ioctls that were used before Linux version 3.3.

If the version given is less than 3.7, then emulate sanity checks
which get done to protect against the fact that the new resizing ioctl
prior to 3.7 did not handle meta_bg resizing.  (This was previously
tested via the presence of the RESIZE2FS_NO_META_BG_RESIZE environment
variable.  But the new environment variable, RESIZE2FS_KERNEL_VERISON,
is more general.)

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
resize/online.c