Skip to contentSkip to conversation

set relay file can not be read by pread(2)

PATCH In review Lai Jiangshan 2 participants 2 messages Mar 26, 2008 Relay

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 set relay file can not be read by pread(2)

Hi:
I found that relay files can be read by pread(2). I fix it,
for relay files are not capable of seeking.

kernel/relay.c renamed from kernel/relay.c.org +1 -1
@@ -741,7 +741,7 @@ static int relay_file_open(struct inode 
 	kref_get(&buf->kref);
 	filp->private_data = buf;
 
-	return 0;
+	return nonseekable_open(inode, filp);
 }
 
 /**
#1 lore raw
Quoted 9 lines · Lai Jiangshan

Hi:
I found that relay files can be read by pread(2). I fix it,
for relay files are not capable of seeking.

kernel/relay.c static int relay_file_open(struct inode · line 747

Quoted 8 lines
kernel/relay.c renamed from kernel/relay.c.org +1 -1
@@ -741,7 +741,7 @@ static int relay_file_open(struct inode 
 	kref_get(&buf->kref);
 	filp->private_data = buf;
 
-	return 0;
+	return nonseekable_open(inode, filp);
 }
 
 /**

Good catch. I'll add it for 2.6.25.

Signature · 1 line
Jens Axboe