chattr: allow clearing the extent flag

In order to support kernels which support conversion of extent-mapped
files to direct/indirect mapped files, remove the sanity check which
prevented clearing the extent flag in chattr.  Kernels which don't
support this will simply give an Operation Not Supported error.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
debian-1.42.9
Theodore Ts'o 2013-02-22 22:23:05 -05:00
parent 7c1384c324
commit bb21ddf596
1 changed files with 0 additions and 17 deletions

View File

@ -194,7 +194,6 @@ static int change_attributes(const char * name)
{
unsigned long flags;
STRUCT_STAT st;
int extent_file = 0;
if (LSTAT (name, &st) == -1) {
if (!silent)
@ -209,16 +208,7 @@ static int change_attributes(const char * name)
_("while reading flags on %s"), name);
return -1;
}
if (flags & EXT4_EXTENTS_FL)
extent_file = 1;
if (set) {
if (extent_file && !(sf & EXT4_EXTENTS_FL)) {
if (!silent)
com_err(program_name, 0,
_("Clearing extent flag not supported on %s"),
name);
return -1;
}
if (verbose) {
printf (_("Flags of %s set as "), name);
print_flags (stdout, sf, 0);
@ -231,13 +221,6 @@ static int change_attributes(const char * name)
flags &= ~rf;
if (add)
flags |= af;
if (extent_file && !(flags & EXT4_EXTENTS_FL)) {
if (!silent)
com_err(program_name, 0,
_("Clearing extent flag not supported on %s"),
name);
return -1;
}
if (verbose) {
printf(_("Flags of %s set as "), name);
print_flags(stdout, flags, 0);