mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Altaparmakov <aia21@cantab.net>
To: Andrew Morton <akpm@zip.com.au>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH-2.5.13] NTFS 2.0.6 Bugfix/adapt to 2.5.12 changes
Date: Sun, 05 May 2002 01:41:20 +0100	[thread overview]
Message-ID: <5.1.0.14.2.20020505010101.048d74e0@pop.cus.cam.ac.uk> (raw)
In-Reply-To: <3CD47511.79846141@zip.com.au>

At 00:56 05/05/02, Andrew Morton wrote:
>Anton Altaparmakov wrote:
> > I have just sent the below NTFS update to Linus for inclusion. Andrew
> > Morton's changes to 2.5.12 broke NTFS because they added fields to
> > struct address_space which ntfs obviously wasn't initializing...
>
>Sorry about that, Chief.  ra_pages, presumably.  That's one
>which *has* to be initialised.

np, we are in a development kernel after all. (-; It was oopsing in 
ntfs_put_super->truncate_inode_pages->clean_list_pages() with a NULL 
pointer dereference... I didn't investigate further as it was immediately 
obvious what was going wrong once I added a printk in the right place so I 
knew mftbmp_mapping was the problem child.

>I've added quite a lot of "if you didn't provide one then I'll
>do the default" code, but that's an interim step - later, all
>the address_spaces need to be populated with the right stuff.
>
> > ...
> > +       /* Initialize the mftbmp address space mapping.  */
> > +       INIT_RADIX_TREE(&vol->mftbmp_mapping.page_tree, GFP_ATOMIC);
> > +       rwlock_init(&vol->mftbmp_mapping.page_lock);
> > +       INIT_LIST_HEAD(&vol->mftbmp_mapping.clean_pages);
> > +       INIT_LIST_HEAD(&vol->mftbmp_mapping.dirty_pages);
> > +       INIT_LIST_HEAD(&vol->mftbmp_mapping.locked_pages);
> > +       INIT_LIST_HEAD(&vol->mftbmp_mapping.io_pages);
> > +       vol->mftbmp_mapping.nrpages = 0;
> > +       vol->mftbmp_mapping.a_ops = NULL;
> > +       vol->mftbmp_mapping.host = NULL;
> > +       INIT_LIST_HEAD(&vol->mftbmp_mapping.i_mmap);
> > +       INIT_LIST_HEAD(&vol->mftbmp_mapping.i_mmap_shared);
> > +       spin_lock_init(&vol->mftbmp_mapping.i_shared_lock);
> > +       vol->mftbmp_mapping.dirtied_when = 0;
> > +       vol->mftbmp_mapping.gfp_mask = GFP_HIGHUSER;
>
>That's all generic code.   It's initialising core
>kernel fields.  If should be done in the core kernel.

Exactly my sentiments! (-:

>It would be better to split the address_space initialisation
>parts out of inode_init_once(), and export the new function...

Yes, I thought about that but the ntfs patch was rather urgent as people 
were reporting hangs and I saw oopses on umount so I wanted to just fix it 
asap without entering in possible discussions of generic code...

The only problem is that inode_init_once() doesn't set all the above 
because part of the initialization happens in alloc_inode(), so not to 
sacrifice this optimization we would need two inline helpers, one called by 
alloc_inode() and one called by inode_init_once(), and both called by the 
new exported function init_address_space().

I will whip up a patch and send it for comments...

Best regards,

         Anton


-- 
   "I've not lost my mind. It's backed up on tape somewhere." - Unknown
-- 
Anton Altaparmakov <aia21 at cantab.net> (replace at with @)
Linux NTFS Maintainer / IRC: #ntfs on irc.openprojects.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/


      reply	other threads:[~2002-05-05  0:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-04 22:25 Anton Altaparmakov
2002-05-04 23:56 ` Andrew Morton
2002-05-05  0:41   ` Anton Altaparmakov [this message]

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=5.1.0.14.2.20020505010101.048d74e0@pop.cus.cam.ac.uk \
    --to=aia21@cantab.net \
    --cc=akpm@zip.com.au \
    --cc=linux-kernel@vger.kernel.org \
    /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®