rpms/readahead/devel readahead-1.4.2-cleanup-ld.patch, NONE, 1.1 readahead-1.4.2-null-name.patch, NONE, 1.1 readahead.spec, 1.40, 1.41 sources, 1.7, 1.8
Karel Zak (kzak)
fedora-extras-commits at redhat.com
Wed Oct 17 09:31:01 UTC 2007
Author: kzak
Update of /cvs/pkgs/rpms/readahead/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv27096
Modified Files:
readahead.spec sources
Added Files:
readahead-1.4.2-cleanup-ld.patch
readahead-1.4.2-null-name.patch
Log Message:
* Wed Oct 17 2007 Karel Zak <kzak at redhat.com> 1:1.4.2-3
- update default lists
- fix #327041 - readahead --sort generates file with "(null)"
- fix #326891 - readahead-collector doesn't collect binaries
readahead-1.4.2-cleanup-ld.patch:
--- NEW FILE readahead-1.4.2-cleanup-ld.patch ---
>From c00ad110b62ba18fd30a97e107cf644c35abc417 Mon Sep 17 00:00:00 2001
From: Karel Zak <kzak at redhat.com>
Date: Tue, 16 Oct 2007 14:38:02 +0200
Subject: [PATCH] readahead: cleanup %ld usage
Signed-off-by: Karel Zak <kzak at redhat.com>
---
config/include-Makefile.am | 2 +-
src/readahead.c | 24 +++++++++++++-----------
2 files changed, 14 insertions(+), 12 deletions(-)
diff --git a/config/include-Makefile.am b/config/include-Makefile.am
index edb24e8..64b10ec 100644
--- a/config/include-Makefile.am
+++ b/config/include-Makefile.am
@@ -2,6 +2,6 @@
usrbinexecdir = ${exec_prefix}/bin
usrsbinexecdir = ${exec_prefix}/sbin
-AM_CPPFLAGS = -include $(top_builddir)/config.h -DLOCALEDIR=\"$(localedir)\"
+AM_CPPFLAGS = -Wall -include $(top_builddir)/config.h -DLOCALEDIR=\"$(localedir)\"
#AM_CFLAGS = -fsigned-char
diff --git a/src/readahead.c b/src/readahead.c
index 57ddfbd..9ed7502 100644
--- a/src/readahead.c
+++ b/src/readahead.c
@@ -195,7 +195,7 @@ list_new(struct file *files, char **lists, int nlists, int withsize)
continue; /* comment */
if (withsize) {
- file->size = (size_t) strtoll(buf, &path, 10);
+ file->size = (off_t) strtoll(buf, &path, 10);
if (*path != ' ') {
fprintf(stderr, _("%s: error: %s: "
"unexpected format of sorted file\n"),
@@ -322,8 +322,9 @@ list_read_blocks(struct file *files, int nfiles)
TIMEDIFF(t1, t2));
}
if (verbose)
- fprintf(stderr, _("Read blocks for %d/%d files (%ld KB)\n"),
- fcount, nfiles, total / 1024);
+ fprintf(stderr, _("Read blocks for %d/%d files (%llu KB)\n"),
+ fcount, nfiles,
+ (unsigned long long int) total / 1024);
}
static void
@@ -335,8 +336,8 @@ list_sort_by_blocks(struct file *files, int nfiles)
static void
list_do_readahead(struct file *files, int nfiles)
{
- int i;
- struct file *file;
+ int i;
+ struct file *file;
int fd = -1;
struct timeval t1, t2;
off_t total = 0;
@@ -360,15 +361,16 @@ list_do_readahead(struct file *files, int nfiles)
fprintf(stderr, _("Time (readahead): %ld ms\n"), TIMEDIFF(t1, t2));
}
if (verbose)
- fprintf(stderr, _("Preload %d/%d files (%ld KB)\n"),
- fcount, nfiles, total / 1024);
+ fprintf(stderr, _("Preload %d/%d files (%llu KB)\n"),
+ fcount, nfiles,
+ (unsigned long long int) total / 1024);
}
static int
list_write(struct file *files, int nfiles, const char *output)
{
- int i;
- struct file *file;
+ int i;
+ struct file *file;
FILE *out = stdout;
if (output && (out = fopen(output, "w")) == NULL) {
@@ -379,7 +381,7 @@ list_write(struct file *files, int nfiles, const char *output)
for (i = 0, file = files; i < nfiles; i++, file++) {
if (file == NULL || file->path == NULL || file->size == 0)
continue;
- fprintf(out, "%ld %s\n", file->size, file->path);
+ fprintf(out, "%llu %s\n", (unsigned long long int) file->size, file->path);
}
return 0;
}
@@ -453,7 +455,7 @@ main(int argc, char **argv)
if (timing)
gettimeofday(&t1, NULL);
- argc -= optind;
+ argc -= optind;
argv += optind;
if (!argv[0])
--
1.5.3.1
readahead-1.4.2-null-name.patch:
--- NEW FILE readahead-1.4.2-null-name.patch ---
>From 99b68343e7db8b5cefcf40fa2be66721e3aa9417 Mon Sep 17 00:00:00 2001
From: Eric Sandeen <esandeen at redhat.com>
Date: Tue, 16 Oct 2007 13:47:26 +0200
Subject: [PATCH] collector: "(null)" name in the 2nd PATH line overwrites real path
booting with init=/sbin/readahead-collector doesn't result in any binaries in
the custom readahead lists. This is because the audit logs like:
type=SYSCALL msg=audit(1191960691.470:14691): arch=40000003 syscall=11
success=yes exit=0 a0=a4fc9b8 a1=a229760 a2=9b89fd0 a3=0 items=2 ppid=3868
pid=24236 auid=4294967295 uid=0 gid=0 euid=0 suid=0 fsuid=0 egid=0 sgid=0
fsgid=0 tty=pts1 comm="kudzu" exe="/sbin/kudzu" key=(null)
type=CWD msg=audit(1191960691.470:14691):
cwd="/usr/src/redhat/BUILD/readahead-1.4.2"
type=PATH msg=audit(1191960691.470:14691): item=0 name="/sbin/kudzu"
inode=6029476 dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00
type=PATH msg=audit(1191960691.470:14691): item=1 name=(null) inode=720971
dev=fd:00 mode=0100755 ouid=0 ogid=0 rdev=00:00
and the "(null)" name in the 2nd PATH line overwrites the "/sbin/kudzu" name.
Signed-off-by: Eric Sandeen <esandeen at redhat.com>
Signed-off-by: Karel Zak <kzak at redhat.com>
---
src/readahead-collector.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/src/readahead-collector.c b/src/readahead-collector.c
index b66a422..16905d7 100644
--- a/src/readahead-collector.c
+++ b/src/readahead-collector.c
@@ -1039,8 +1039,11 @@ parse_events(RacStatus *rac, char **ary, int *_nfiles, int *sep)
(p = auparse_find_field(au, "cwd")))
strncpy(cwd, p + 1, sizeof(cwd));
else if (type == AUDIT_PATH &&
- (p = auparse_find_field(au, "name")))
+ (p = auparse_find_field(au, "name"))) {
+ if (!strcmp("(null)", p))
+ continue;
strncpy(path, p + 1, sizeof(path));
+ }
} while(auparse_next_record(au) > 0);
--
1.5.3.1
Index: readahead.spec
===================================================================
RCS file: /cvs/pkgs/rpms/readahead/devel/readahead.spec,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- readahead.spec 3 Oct 2007 09:28:30 -0000 1.40
+++ readahead.spec 17 Oct 2007 09:30:29 -0000 1.41
@@ -1,7 +1,7 @@
Summary: Read a preset list of files into memory
Name: readahead
Version: 1.4.2
-Release: 2%{?dist}
+Release: 3%{?dist}
Epoch: 1
Group: System Environment/Base
License: GPLv2+
@@ -17,6 +17,9 @@
BuildRequires: e2fsprogs-devel
BuildRequires: audit-libs-devel
+Patch1: readahead-1.4.2-cleanup-ld.patch
+Patch2: readahead-1.4.2-null-name.patch
+
%description
readahead reads the contents of a list of files into memory,
which causes them to be read from cache when they are actually
@@ -27,6 +30,9 @@
cp -f -t ./lists/ %{SOURCE1}
cp -f -t ./lists/ %{SOURCE2}
+%patch1 -p1
+%patch2 -p1
+
%build
%configure --sbindir=/sbin
make %{?_smp_mflags}
@@ -66,6 +72,11 @@
/sbin/readahead-collector
%changelog
+* Wed Oct 17 2007 Karel Zak <kzak at redhat.com> 1:1.4.2-3
+- update default lists
+- fix #327041 - readahead --sort generates file with "(null)"
+- fix #326891 - readahead-collector doesn't collect binaries
+
* Wed Oct 3 2007 Karel Zak <kzak at redhat.com> 1:1.4.2-2
- cleanup specfile (based on fedora merge review - #226360)
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/readahead/devel/sources,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- sources 1 Oct 2007 23:09:21 -0000 1.7
+++ sources 17 Oct 2007 09:30:29 -0000 1.8
@@ -1,3 +1,3 @@
5ab1b087681c06b66a4e4c7e944336db readahead-1.4.2.tar.bz2
-04862c95f34c96b04d9a67b5a2014bfb default.early
-c641b45b86174ff4218868bb9a6198bc default.later
+c49d5a223ff93931aee751cbe491e533 default.early
+2407fd6d06720de9e6b12ab41a9e96e4 default.later
More information about the fedora-extras-commits
mailing list