Gitweb:
http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=...
Commit: 54807e352deb5267b0a3a8a49652fe39cb8abd5a
Parent: 5155e0a2fd30e9a3ee3b0b9d27b7418b9cdb71d4
Author: Abhijith Das <adas(a)redhat.com>
AuthorDate: Mon Mar 1 19:00:41 2010 -0600
Committer: Abhijith Das <adas(a)redhat.com>
CommitterDate: Mon Mar 1 19:00:41 2010 -0600
gfs2_quota: fix uninitialized fiemap flags
This patch zeroes out the fmap.fm_flags field before
calling the fiemap ioctl. Uninitialized flags will
cause gfs2 to throw the "Invalid request descriptor"
error.
rhbz#536902
---
gfs2/quota/check.c | 2 ++
gfs2/quota/main.c | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/gfs2/quota/check.c b/gfs2/quota/check.c
index ac3e9bf..7476629 100644
--- a/gfs2/quota/check.c
+++ b/gfs2/quota/check.c
@@ -220,6 +220,7 @@ read_quota_file(struct gfs2_sbd *sdp, commandline_t *comline,
}
quota_file_size = statbuf.st_size;
/* First find the number of extents in the quota file */
+ fmap.fm_flags = 0;
fmap.fm_start = 0;
fmap.fm_length = (~0ULL);
error = ioctl(fd, FS_IOC_FIEMAP, &fmap);
@@ -233,6 +234,7 @@ read_quota_file(struct gfs2_sbd *sdp, commandline_t *comline,
fprintf(stderr, "malloc error (%d): %s\n", errno, strerror(errno));
goto out;
}
+ fmap2->fm_flags = 0;
fmap2->fm_start = 0;
fmap2->fm_length = (~0ULL);
fmap2->fm_extent_count = fmap.fm_mapped_extents;
diff --git a/gfs2/quota/main.c b/gfs2/quota/main.c
index fa8f4c3..06176db 100644
--- a/gfs2/quota/main.c
+++ b/gfs2/quota/main.c
@@ -367,8 +367,8 @@ do_reset(struct gfs2_sbd *sdp, commandline_t *comline)
if (!*comline->filesystem)
die("need a filesystem to work on\n");
- printf("This operation will permanently erase all quota information. "
- "You will have to re-assign all quota limit/warn values. "
+ printf("This operation will permanently erase all quota information.\n"
+ "You will have to re-assign all quota limit/warn values.\n"
"Proceed [y/N]? ");
c = getchar();
if (c != 'y' && c != 'Y')
@@ -476,6 +476,7 @@ do_list(struct gfs2_sbd *sdp, commandline_t *comline)
}
quota_file_size = statbuf.st_size;
/* First find the number of extents in the quota file */
+ fmap.fm_flags = 0;
fmap.fm_start = 0;
fmap.fm_length = (~0ULL);
error = ioctl(fd, FS_IOC_FIEMAP, &fmap);
@@ -489,6 +490,7 @@ do_list(struct gfs2_sbd *sdp, commandline_t *comline)
fprintf(stderr, "malloc error (%d): %s\n", errno, strerror(errno));
goto out;
}
+ fmap2->fm_flags = 0;
fmap2->fm_start = 0;
fmap2->fm_length = (~0ULL);
fmap2->fm_extent_count = fmap.fm_mapped_extents;