Linux filesystem development
 help / color / mirror / Atom feed
From: Shaya Potter <spotter@cs.columbia.edu>
To: Eli Carter <eli.carter@inet.com>
Cc: Nikita Danilov <Nikita@Namesys.COM>, linux-fsdevel@vger.kernel.org
Subject: Re: file struct's dentry being null?
Date: 02 Jul 2003 12:32:29 -0400	[thread overview]
Message-ID: <1057163549.7361.19.camel@zaphod> (raw)
In-Reply-To: <3F0305CD.40100@inet.com>

On Wed, 2003-07-02 at 12:18, Eli Carter wrote:
> Shaya Potter wrote:
> > On Wed, 2003-07-02 at 11:58, Nikita Danilov wrote:
> > 
> >>Shaya Potter writes:
> >> > I decided to do an experiment, in fput, I did a 
> >> > 
> >> > struct file * next;
> >> > next = (struct file *) file->f_list.next;
> >>
> >>->f_list.next points to the ->f_list member of next struct file rather
> >>than to the struct file itself. This is how it works for all struct
> >>list_head embedded into objects.
> > 
> > 
> > yes, I understand that, the idea being that it's the first entry in the
> > struct that you want to link list, so can get the next struct by just
> > dereferencing the list_head (as &list_head == &struct)
> 
> No, his point was that &list_head != $struct, but rather &struct == 
> &list_head - some_offset.
> 
> So the code you'd need would look like:
> struct file *next;
> next = list_entry( <address of the list_head>, file, f_list );

ok, even with that fix, I'm still getting the same sort of output

I'm printing out 6 different distinct memory locations whose next entry
in the file list has a null dentry.

The system operates normally like this, so just trying to figure out
what its dereferencing.

this is the block of code I stick in fput()

{
	struct file * next;
	next = list_entry(file->f_list.next, struct file, f_list);
	if ( !next->f_dentry )
	{
		printk("deleting dentry whose next is null!, next = %d\n",next);
	}

}




      parent reply	other threads:[~2003-07-02 16:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-02 15:49 file struct's dentry being null? Shaya Potter
2003-07-02 15:58 ` Nikita Danilov
2003-07-02 16:00   ` Shaya Potter
2003-07-02 16:18     ` Eli Carter
2003-07-02 16:26       ` Shaya Potter
2003-07-02 16:32       ` Shaya Potter [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=1057163549.7361.19.camel@zaphod \
    --to=spotter@cs.columbia.edu \
    --cc=Nikita@Namesys.COM \
    --cc=eli.carter@inet.com \
    --cc=linux-fsdevel@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