From: Nikita Danilov <Nikita@Namesys.COM>
To: Anton Altaparmakov <aia21@cantab.net>
Cc: viro@math.psu.edu, Jan Harkes <jaharkes@cs.cmu.edu>,
linux-kernel@vger.kernel.org
Subject: Re: [prepatch] address_space-based writeback
Date: Mon, 29 Apr 2002 15:59:41 +0400 [thread overview]
Message-ID: <15565.13742.140693.146727@laputa.namesys.com> (raw)
In-Reply-To: <5.1.0.14.2.20020429115231.00b1d900@pop.cus.cam.ac.uk>
Anton Altaparmakov writes:
> Hi,
>
> I am cc:-ing Al Viro, perhaps Al could comment on approach as this would
> affect the future of read_inode2 in VFS?
>
> At 10:03 29/04/02, Nikita Danilov wrote:
> >Anton Altaparmakov writes:
> > > At 16:53 27/04/02, Jan Harkes wrote:
> > > >You could have all additional IO streams use the same inode number and
> > > >use iget4. Several inodes can have the same i_ino and the additional
> > > >argument would be a stream identifier that selects the correct 'IO
> > > >identity'.
> > >
> > > Great idea! I quickly looked into the implementation details and using
> > > iget4/read_inode2 perfectly reconciles my ideas of using an address space
> > > mapping for each ntfs attribute with the kernels requirement of using
> > > inodes as the i/o entity by allowing a clean and unique mapping between
> > > multiple inodes with the same inode numbers and their attributes and
> > > address spaces.
> >
> >Please note that ->read_inode2() is reiserfs-specific hack. Adding more
> >users for it would make it permanent. The only reason for ->read_inode2
> >existence was that iget() was called by code external to the
> >file-system, knfsd used to do this, now it can call ->fh_to_dentry() in
> >stead. As iget() is never called outside of file-ssytem, you can set
> >ntfs->read_inode to no-op and write your own function ntfs_iget(...) to
> >be called from ntfs_lookup() and ntfs_fill_super().
> >
> >ntfs_iget() calls iget() (->read_inode is no-op, hence iget doesn't
> >access disk) and, if new inode were allocated, reads data from the disk
> >and initializes inode, etc.
> >
> >I guess coda_iget() is example of this.
>
> This will not work AFAICS.
>
> coda_iget() -> iget4() -> get_new_inode(), which calls ->read_inode or
> ->read_inode2, and then unlocks the inode and wakes up the waiting tasks.
>
> If ->read_inode and ->read_inode2 are NULL as you suggest for NTFS it means
> that as soon as ntfs_iget() has called iget4() there will be an
> uninitialized yet unlocked inode in memory which is guaranteed to cause
> NTFS to oops... (And any other fs using this approach.)
I see. While this can be worked around by adding flag set up after inode
initialization, this would become ugly shortly.
>
> Before the inode is unlocked it MUST be initialized. And the only way
> to do this in the framework of the current VFS is to use ->read_inode
> or ->read_inode2.
>
> Al, would you agree with NTFS using ->read_inode2 as well as ReiserFS?
>
->read_inode2 is a hack. And especially so is having both ->read_inode
and ->read_inode2. iget() interface was based on the assumption that
inodes can be located (and identified) by inode number. It is not so at
least for the reiserfs and ->read_inode2 works around this by passing
"cookie" with information sufficient for file system to locate inode.
I am concerned that (ab)using this cookie and ->read_inode2 to bypass
rigid iget() is not right way to go. What about VFS exporting function
that checks hash table, creates new inode if not there and returns it
still locked? This way each file system would be able to locate and load
inodes in a way it likes without encoding/decoding information in the
cookie.
> Best regards,
>
> Anton
>
Nikita.
>
> --
next prev parent reply other threads:[~2002-04-29 11:59 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-04-10 11:21 Andrew Morton
2002-04-10 11:34 ` Alexander Viro
2002-04-10 19:16 ` Andrew Morton
2002-04-10 20:53 ` Alexander Viro
2002-04-10 22:12 ` Jan Harkes
2002-04-10 21:44 ` Andrew Morton
2002-04-10 22:56 ` Anton Altaparmakov
2002-04-10 22:31 ` Andrew Morton
2002-04-11 20:20 ` Linus Torvalds
2002-04-11 20:41 ` Alexander Viro
2002-04-11 21:27 ` Andrew Morton
2002-04-11 22:55 ` Andreas Dilger
2002-04-11 22:49 ` Andrew Morton
2002-04-12 0:12 ` Linus Torvalds
2002-04-11 23:10 ` Christoph Hellwig
2002-04-11 23:22 ` Anton Altaparmakov
2002-04-11 23:03 ` Andrew Morton
2002-04-12 4:19 ` Bill Davidsen
2002-04-12 1:15 ` Anton Altaparmakov
2002-04-12 1:37 ` Linus Torvalds
2002-04-12 7:57 ` Anton Altaparmakov
2002-04-27 15:53 ` Jan Harkes
2002-04-28 3:03 ` Anton Altaparmakov
2002-04-29 9:03 ` Nikita Danilov
2002-04-29 11:11 ` Anton Altaparmakov
2002-04-29 11:59 ` Nikita Danilov [this message]
2002-04-29 12:34 ` Anton Altaparmakov
2002-04-29 13:01 ` Christoph Hellwig
2002-04-30 17:19 ` Denis Vlasenko
2002-04-30 13:15 ` john slee
2002-04-30 13:24 ` Billy O'Connor
2002-04-30 13:36 ` jlnance
2002-04-30 13:40 ` Keith Owens
2002-05-01 19:18 ` Denis Vlasenko
2002-05-02 8:49 ` Anton Altaparmakov
2002-05-03 15:35 ` Denis Vlasenko
2002-05-03 12:49 ` Helge Hafting
2002-05-03 22:47 ` Denis Vlasenko
2002-05-03 21:50 ` Anton Altaparmakov
2002-05-05 0:46 ` Denis Vlasenko
2002-05-03 7:56 ` Pavel Machek
2002-05-03 14:48 ` Rob Landley
2002-05-05 0:42 ` Denis Vlasenko
2002-04-30 16:12 ` Peter Wächtler
2002-04-10 23:02 ` Jan Harkes
2002-04-10 19:29 ` Jeremy Jackson
2002-04-10 19:41 ` Andrew Morton
2002-04-15 8:47 ` Andrew Morton
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=15565.13742.140693.146727@laputa.namesys.com \
--to=nikita@namesys.com \
--cc=aia21@cantab.net \
--cc=jaharkes@cs.cmu.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@math.psu.edu \
/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
all inboxes | Powered by JetHome®