public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] firewire: nosy: char device is not seekable
@ 2010-10-13 12:25 Stefan Richter
  2010-10-13 12:31 ` Stefan Richter
  2010-10-13 13:54 ` Arnd Bergmann
  0 siblings, 2 replies; 6+ messages in thread
From: Stefan Richter @ 2010-10-13 12:25 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel, Arnd Bergmann

Amend .open handler accordingly and add .llseek = no_llseek handler.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
Arnd, is your mega-patch which adds legions of .llseek handlers done and
to be merged soon as-is, or do you regenerate it regularly?  (linux-next
commit 9711569d "llseek: automatically add .llseek fop")

 drivers/firewire/nosy.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: b/drivers/firewire/nosy.c
===================================================================
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -302,7 +302,7 @@ nosy_open(struct inode *inode, struct fi
 
 	file->private_data = client;
 
-	return 0;
+	return nonseekable_open(inode, file);
 fail:
 	kfree(client);
 	lynx_put(lynx);
@@ -400,6 +400,7 @@ nosy_ioctl(struct file *file, unsigned i
 
 static const struct file_operations nosy_ops = {
 	.owner =		THIS_MODULE,
+	.llseek =		no_llseek,
 	.read =			nosy_read,
 	.unlocked_ioctl =	nosy_ioctl,
 	.poll =			nosy_poll,

-- 
Stefan Richter
-=====-==-=- =-=- -==-=
http://arcgraph.de/sr/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] firewire: nosy: char device is not seekable
  2010-10-13 12:25 [PATCH] firewire: nosy: char device is not seekable Stefan Richter
@ 2010-10-13 12:31 ` Stefan Richter
  2010-10-13 13:54 ` Arnd Bergmann
  1 sibling, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2010-10-13 12:31 UTC (permalink / raw)
  To: linux1394-devel; +Cc: linux-kernel, Arnd Bergmann

Stefan Richter wrote:
>  static const struct file_operations nosy_ops = {
>  	.owner =		THIS_MODULE,
> +	.llseek =		no_llseek,
>  	.read =			nosy_read,
>  	.unlocked_ioctl =	nosy_ioctl,
>  	.poll =			nosy_poll,

PS; this is safe since the only client that uses this interface is
nosy-dump in linux/tools/firewire and it knows not to seek in this char
dev.
-- 
Stefan Richter
-=====-==-=- =-=- -==-=
http://arcgraph.de/sr/


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] firewire: nosy: char device is not seekable
  2010-10-13 12:25 [PATCH] firewire: nosy: char device is not seekable Stefan Richter
  2010-10-13 12:31 ` Stefan Richter
@ 2010-10-13 13:54 ` Arnd Bergmann
  2010-10-22 23:08   ` [PATCH update] " Stefan Richter
  1 sibling, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2010-10-13 13:54 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linux1394-devel, linux-kernel

On Wednesday 13 October 2010, Stefan Richter wrote:
> Amend .open handler accordingly and add .llseek = no_llseek handler.
> 
> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
> ---
> Arnd, is your mega-patch which adds legions of .llseek handlers done and
> to be merged soon as-is, or do you regenerate it regularly?  (linux-next
> commit 9711569d "llseek: automatically add .llseek fop")

I initially planned to regenerate it, but the flux is very small, so
I have decided to keep the version I have today and only do manual updates
to remove the conflicts and add the changes for new files that are missing
the .llseek pointers.

Your patch looks good, and I'll remove my change for this file accordingly.

Thanks!

	Arnd

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH update] firewire: nosy: char device is not seekable
  2010-10-13 13:54 ` Arnd Bergmann
@ 2010-10-22 23:08   ` Stefan Richter
  2010-10-23  8:57     ` Arnd Bergmann
  0 siblings, 1 reply; 6+ messages in thread
From: Stefan Richter @ 2010-10-22 23:08 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux1394-devel, linux-kernel

Remove unnecessary .llseek handler that came in via an automated mass conversion.
.llseek = NULL means no_llseek since commit 776c163b1b93.

The only client that uses this interface is nosy-dump in linux/tools/firewire
and it knows not to seek in this char dev.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
I left out the addition of return nonseekable_open(...) in nosy_open in
this update.  This works for nosy, but is it also formally correct?

 drivers/firewire/nosy.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index bf184fb..8528b10 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -405,7 +405,6 @@ static const struct file_operations nosy_ops = {
 	.poll =			nosy_poll,
 	.open =			nosy_open,
 	.release =		nosy_release,
-	.llseek =		noop_llseek,
 };
 
 #define PHY_PACKET_SIZE 12 /* 1 payload, 1 inverse, 1 ack = 3 quadlets */
-- 
Stefan Richter
-=====-==-=- =-=- =-===
http://arcgraph.de/sr/


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH update] firewire: nosy: char device is not seekable
  2010-10-22 23:08   ` [PATCH update] " Stefan Richter
@ 2010-10-23  8:57     ` Arnd Bergmann
  2010-10-23 11:47       ` Stefan Richter
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2010-10-23  8:57 UTC (permalink / raw)
  To: Stefan Richter; +Cc: linux1394-devel, linux-kernel

On Saturday 23 October 2010, Stefan Richter wrote:
> Remove unnecessary .llseek handler that came in via an automated mass conversion.
> .llseek = NULL means no_llseek since commit 776c163b1b93.
> 
> The only client that uses this interface is nosy-dump in linux/tools/firewire
> and it knows not to seek in this char dev.
> 
> Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
> ---
> I left out the addition of return nonseekable_open(...) in nosy_open in
> this update.  This works for nosy, but is it also formally correct?
> 

Most likely you also want the nonseekeable_open, which would prevent
both llseek and pread/pwrite, whereas leaving out llseek currently
only prevents llseek.

	Arnd


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH update] firewire: nosy: char device is not seekable
  2010-10-23  8:57     ` Arnd Bergmann
@ 2010-10-23 11:47       ` Stefan Richter
  0 siblings, 0 replies; 6+ messages in thread
From: Stefan Richter @ 2010-10-23 11:47 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linux1394-devel, linux-kernel

Arnd Bergmann wrote:
> Most likely you also want the nonseekeable_open, which would prevent
> both llseek and pread/pwrite, whereas leaving out llseek currently
> only prevents llseek.

Right, thanks for the reminder.
-- 
Stefan Richter
-=====-==-=- =-=- =-===
http://arcgraph.de/sr/

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-10-23 11:48 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-13 12:25 [PATCH] firewire: nosy: char device is not seekable Stefan Richter
2010-10-13 12:31 ` Stefan Richter
2010-10-13 13:54 ` Arnd Bergmann
2010-10-22 23:08   ` [PATCH update] " Stefan Richter
2010-10-23  8:57     ` Arnd Bergmann
2010-10-23 11:47       ` Stefan Richter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox