patch for 2.6.36-rc4?

Asked by andrew thomas

Is there a patch that applies to the upstream source of 2.6.36 that enables ureadahead to work?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu ureadahead Edit question
Assignee:
No assignee Edit question
Solved by:
andrew thomas
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

I'd log a bug (if one doesn't already exist)

Revision history for this message
andrew thomas (atswartz) said :
#2

ureadahead requires a kernel patch included in the Ubuntu kernel. It is not a bug that the upstream kernel does not work with ureadahead. I just wanted to get the patch that is applied to the Ubuntu kernel and apply it to the upstream source.

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#3

About two weeks ago I send an email asking the developer to update the patch included in the source tarball. He has yet to reply. The issue is that some functions in fs/open.c were moved into another file. I don't have much experience with C (in fact very little) but I could try editing the patch file.

Revision history for this message
andrew thomas (atswartz) said :
#4

I was able to the new natty branch here:

git://kernel.ubuntu.com/ubuntu/ubuntu-natty.git

which, I believe, has the ureadahead patches ( although I did have to apply the apparmor patches since they were dropped.)

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#5

Still waiting for a patch file.

Revision history for this message
Ronnie (ronnie-10) said :
#6

I edited the ureadahead patch to work with kernel 2.6.35 and 2.6.36. This edit is not official as its done by me and not the developer. All i did was compare the file fs/open.c from the patched ubuntu 2.6.35 kernel with the unpatched one of the same version and again with a file from patched 2.6.34 kernel. I found that they changed the line which the patch file uses in order to enter its information in the right place. therefore i just replaced the old line with the new one and thats it ! 2 lines edit. u can download it here:

http://www.mediafire.com/?kqawb3cx1ju11iy

i hope this helps some1

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#7

Ronnie: Thanks that works just fine. Now I need to make a howto for Gentoo

Revision history for this message
andrew thomas (atswartz) said :
#8

Ronnie: That patch may work on 2.6.35 but it is not right for 2.6.36. Changes need to be made for fs/exec.c & fs/open.c

http://pastebin.ubuntu.com/507730/

Revision history for this message
Ronnie (ronnie-10) said :
#9

I tested it on 2.6.36-rc6 and it was working but I will investigate the issue today. Maybe because i used the 2.6.36-rc6 patch over the 2.6.35 kernel and then applied it.

Revision history for this message
Oleg Borisenko (al-foo) said :
#10

Confirm, last patch from andrew thomas works for 2.6.36.
I have downloaded vanilla kernel 2.6.36, applied patches from ~kernel-ppa/mainline/ and then applied andrew thomas's patch and it works. Thanks!
Patch from tar.gz -- fails.

Revision history for this message
andrew thomas (atswartz) said :
#11

@ al_indigo : glad to be of help.

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#12

@al_indigo: What is the address for the 2.6.36 patches? I find Launchpad a major PITA to navigate and find stuff.

Revision history for this message
andrew thomas (atswartz) said :
#13
Revision history for this message
andrew thomas (atswartz) said :
#14

I think that was not totally right. Here is a revised one. http://pastebin.ubuntu.com/518511/

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#15

JORDAN-DESKTOP linux-2.6.36 # patch -p1 < ~/trace_events-00001.patch
patching file fs/exec.c
Hunk #1 succeeded at 55 (offset -1 lines).
missing header for unified diff at line 35 of patch
can't find file to patch at input line 35
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
--------------------------
File to patch: fs/open.c
patching file fs/open.c
Hunk #1 FAILED at 702.
1 out of 1 hunk FAILED -- saving rejects to file fs/open.c.rej
patching file fs/open.c
Hunk #1 succeeded at 33 (offset -2 lines).
Hunk #2 succeeded at 893 (offset -3 lines).
patching file include/trace/events/fs.h
JORDAN-DESKTOP linux-2.6.36 #

Okay fine. <_<

Revision history for this message
Oleg Borisenko (al-foo) said :
#16

It's strange -- I tried once more the last version of the patch on the other machine and everything worked

//BTW I think it would be better to try a patch with option --dry-run and to apply a patch only it doesn't fail with this option

Revision history for this message
andrew thomas (atswartz) said :
#17

That is strange. I just tried the second version out again : http://pastebin.ubuntu.com/518511/
It worked just fine on the latest git version from git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git.
[andrew@andrew-arch linux-git-build]$ patch -p1 < ../traceB.patch
patching file fs/exec.c
Hunk #1 succeeded at 55 (offset -1 lines).
patching file fs/open.c
Hunk #1 succeeded at 33 (offset -2 lines).
Hunk #2 succeeded at 893 (offset -3 lines).
patching file include/trace/events/fs.h

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#18

JORDAN-DESKTOP linux-2.6.36-rc8-git5 # patch -p1 < ~/trace_events-00001.patch
patching file fs/exec.c
Hunk #1 succeeded at 55 (offset -1 lines).
missing header for unified diff at line 35 of patch
can't find file to patch at input line 35
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
--------------------------
File to patch: fs/open.c
patching file fs/open.c
Hunk #1 FAILED at 702.
1 out of 1 hunk FAILED -- saving rejects to file fs/open.c.rej
patching file fs/open.c
Hunk #1 succeeded at 33 (offset -2 lines).
Hunk #2 succeeded at 893 (offset -3 lines).
patching file include/trace/events/fs.h
JORDAN-DESKTOP linux-2.6.36-rc8-git5 #

I'll try bypassing portage and clone the git tree directly.

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#19

This is using the git repo:

JORDAN-DESKTOP linux-2.6 # patch -p1 < ~/trace_events-00001.patch
patching file fs/exec.c
Hunk #1 succeeded at 55 (offset -1 lines).
missing header for unified diff at line 35 of patch
can't find file to patch at input line 35
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|
--------------------------
File to patch: fs/open.c
patching file fs/open.c
Hunk #1 FAILED at 702.
1 out of 1 hunk FAILED -- saving rejects to file fs/open.c.rej
patching file fs/open.c
Hunk #1 succeeded at 33 (offset -2 lines).
Hunk #2 succeeded at 893 (offset -3 lines).
patching file include/trace/events/fs.h
JORDAN-DESKTOP linux-2.6 #

Revision history for this message
andrew thomas (atswartz) said :
#20

You are using http://pastebin.ubuntu.com/518511/ patch right?

Could you post the contents of fs/open.c.rej?

Revision history for this message
Oleg Borisenko (al-foo) said :
#21

@jordan: Maybe you'll show:
1) exact version of the kernel
2) how do you get the kernel
3) how do you patch the kernel (ubuntu patches)
4) fs/open.c
5) open.c.rej

?

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#22

@andrew thomas: Yes that is the patch file I'm using.

@al_indigo:

1) straight from the git repo (the git source andrew posted earlier))
2) #cd /usr/src
#git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
#cd linux-2.6
3) I download the plain text file that andrew thomas posted and save it in ~/trace_events-0001.patch
#patch -p1 < ~/trace_events-0001.path
4) http://pastebin.ca/1971318
5) http://pastebin.ca/1971319

Revision history for this message
Oleg Borisenko (al-foo) said :
#23

Okay, I see what's the difference between our actions. I didn't use vanilla kernel eventually
Between 2) and 3) I did the following:
1) I have gone to http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.36-maverick/
2) Then I've downloaded patches 0001, 0002, 0003
3) Tried to apply them to sources with patch -p1 <patchname --dry-run
4) Applyed them with patch -p1 <patchname
5) Downloaded patch from andew_thomas (one more time: thanks:) ) -- any of them, both work perfect
6) Tried to apply that patches
7) Applied them
8) make -j8 && make-kpkg :)

I hope this would help.

Revision history for this message
andrew thomas (atswartz) said :
#24

When you copied the patch from the page there must have been some kind error. The segment that was saved in fs/open.c.rej is actually part of fs/exec.c Your fs/open.c is correct. Look in fs/exec.c and see if
@@ -700,6 +702,8 @@ struct file *open_exec(const char *name)

  fsnotify_open(file);

+ trace_open_exec(name);
+
  err = deny_write_access(file);
  if (err)
   goto exit;
is in there or not. I would try and save the patch again.

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#25

@andrew thomas: could you pastebin the patch file? Launchpad's pastebin service interferes with wget

@al_indigo: I'll try that on Wednesday when I get back from Toronto

Revision history for this message
andrew thomas (atswartz) said :
#26

@Jordan : here it is

http://pastebin.com/ABkDUDCY

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#27

JORDAN-DESKTOP linux-2.6 # patch -p1 < 0004-trace-events.patch
patching file fs/exec.c
patch: **** malformed patch at line 28:
JORDAN-DESKTOP linux-2.6 #

The three patch files al_indigo linked to indirectly were applied just fine

Revision history for this message
andrew thomas (atswartz) said :
#28

@ Jordan I just tried to apply that patch on Slackware and it gave me the same error that it gave you. I guess that the patch command is just a bit smarter on Arch than on Gentoo and Slack. I will generate a 'clean' patch in the next couple of days.

Revision history for this message
andrew thomas (atswartz) said :
#29

@ jordan : here is a patch that should apply cleanly.

http://pastebin.com/8ake6nzw

Revision history for this message
Jordan Bradley (jordan-w-bradley) said :
#30

JORDAN-DESKTOP linux-2.6 # patch --dry-run -p1 < ~/0004-trace-events
patching file fs/exec.c
Hunk #1 FAILED at 55.
Hunk #2 FAILED at 702.
2 out of 2 hunks FAILED -- saving rejects to file fs/exec.c.rej
patching file fs/open.c
Hunk #1 FAILED at 33.
Hunk #2 FAILED at 893.
2 out of 2 hunks FAILED -- saving rejects to file fs/open.c.rej
patching file include/trace/events/fs.h
patch unexpectedly ends in middle of line
patch: **** malformed patch at line 123:
JORDAN-DESKTOP linux-2.6 #

Oh dear.

Revision history for this message
andrew thomas (atswartz) said :
#31

OK, I created this patch on gentoo and it works for me. I hope that it will work for you.

http://pastebin.com/1dJjyrVX

Revision history for this message
andrew thomas (atswartz) said :
#32

That one didn't copy correctly to pastebin.

http://pastebin.com/nRNzWcFj

I am still getting
(Stripping trailing CRs from patch.)
patching file fs/exec.c
(Stripping trailing CRs from patch.)
patching file fs/open.c
(Stripping trailing CRs from patch.)
patching file include/trace/events/fs.h

but it does apply

Revision history for this message
andrew thomas (atswartz) said :
#33

The problem I was having was that I was using the download button to get the patch. When I use the raw button and copy the contents of http://pastebin.com/nRNzWcFj do apply cleanly.

Revision history for this message
andrew thomas (atswartz) said :
#34

This will work with wget.

wget http://github.com/andrewthomas/kernelPatches/raw/master/ureadahead/2.6.36-gentoo_trace_events.patch -O 0001-trace-add-trace-events-for-open-exec-an.patch