mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: manjunathg.kondaiah@wipro.com
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: question on fs/read_write.c modification from 2.6.7 to 2.6.8.1
Date: Fri, 10 Sep 2004 11:02:31 +0100	[thread overview]
Message-ID: <1094810550.17094.15.camel@localhost.localdomain> (raw)
In-Reply-To: <93AC2F9171509C4C9CFC01009A820FA00177D7D9@blr-ec-msg05.wipro.com>

On Gwe, 2004-09-10 at 11:45, manjunathg.kondaiah@wipro.com wrote:
> and In the implementation, the driver would be interested in checking
> the sanity of pointers by doing a check like if (ppos !=  &(file->fpos)
> { printk( KERN_ERR "Pointers not matching\n");return -EPERM;}

It now has nonseekable_open() to call.

> 1.  "so that the VFS layer is responsible for updating that offset
> rather than individual drivers." By not passing ppos as file->fops, the
> drivers should not try and do a (*ppos)++ anymore. Well the determined
> rogue driver can still do a file->fpos++ coz the file structure is still
> being exposed by the kernel to the driver (verified with printks). So
> this option does not sound logical!

This is the reason - plus better enforcement of pread/pwrite return
values. Any code touching file->f_pos in a driver is generally broken
anyway. It doesn't prevent such use but it makes the default behaviour
for a driver correct so makes it easier to write drivers correctly


  reply	other threads:[~2004-09-10 11:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-10 10:45 manjunathg.kondaiah
2004-09-10 10:02 ` Alan Cox [this message]
2004-09-10 11:15 manjunathg.kondaiah

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1094810550.17094.15.camel@localhost.localdomain \
    --to=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manjunathg.kondaiah@wipro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome