linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maneesh Soni <maneesh@in.ibm.com>
To: James W McMechan <mcmechanjw@juno.com>
Cc: hugh@veritas.com, linux-kernel@vger.kernel.org,
	wli@holomorphy.com, viro@parcelfarce.linux.theplanet.co.uk,
	akpm@osdl.org
Subject: Re: Oops with tmpfs on both 2.4.22 & 2.6.0-test11
Date: Wed, 3 Dec 2003 17:32:44 +0530	[thread overview]
Message-ID: <20031203120244.GA1311@in.ibm.com> (raw)
In-Reply-To: <20031203.030618.-346209.0.mcmechanjw@juno.com>

On Wed, Dec 03, 2003 at 03:06:14AM -0800, James W McMechan wrote:
[..]

> > 
> > The cursor adjustment in dcache_dir_lseek() (fs/libfs.c: line 90) 
> > always puts the cursor just before the last looked dentry in the
> > while loop. 
> > 
> > But it is problematic when we have an empty directory and 
> > (file->f_pos == 2)
> > In this case we have the loop counter p pointing to the cursor and 
> > doing list_del and list_add_tail of the same list node results in oops.
> > 
> This is where I get mildly lost, from what you are saying here I
> would have expected a test on list_empty rather than on
> fpos==2 also this occurs in every file, will starting in a different
> pos in the list cause problems?

The cursor dentry is added in d_subdirs list in the ->open call for 
the directory. So even if directory is empty from a user point
of view, the d_subdirs list will ateast have the cursor dentry. 
In other words when we come to ->lseek or ->readdir call, we will not have 
empty d_subdirs list.

> 
> With further testing it also Oops even when the dir is not empty
> I did a "touch /dev/shm/1 /dev/shm/2 /dev/shm/3" to put some
> entries in the dir first and the original still oops at offset 2
> 
> I should do more testing, to see if I can find out what happens
> on non empty dirs, because I was thinking it was due to the
> dir being empty, which now appears not to be true.

humm.. yeah.. the original case will always oops for offset 2 irrespective
of whether directory is empty or not. Because in case of non-empty dir
also we will have p pointing to cursor dentry for offset 2.
Thanks for letting me know one more fact.

> 
> > The following patch takes (file->f_post == 2) as a special case and 
> > adjusts the cursor dentry by putting it right at the beginning of the 
> > d_subdirs list.
> > 
> Also is the new variable dentry needed or just a optimization?
> It looks functionally equivalent, but perhaps it is needed for 
> something I am not seeing at the moment.
That's just to make code readable, without this it will have line beyond 80
columns and also it has to de-reference multiple levels of pointers.


Thanks
Maneesh

-- 
Maneesh Soni
Linux Technology Center, 
IBM Software Lab, Bangalore, India
email: maneesh@in.ibm.com
Phone: 91-80-5044999 Fax: 91-80-5268553
T/L : 9243696

  reply	other threads:[~2003-12-03 12:04 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-03 11:06 James W McMechan
2003-12-03 12:02 ` Maneesh Soni [this message]
     [not found] <20031207.140732.-1654081.3.mcmechanjw@juno.com>
2003-12-08  5:10 ` Maneesh Soni
  -- strict thread matches above, loose matches on Subject: below --
2003-12-07 22:48 James McMechan
2003-12-01  2:59 James W McMechan
2003-12-01 11:37 ` Maneesh Soni
2003-12-01  2:06 James W McMechan
2003-12-01  4:51 ` William Lee Irwin III
2003-12-01  1:06 James W McMechan
2003-12-01  3:43 ` William Lee Irwin III
2003-11-30 21:17 James W McMechan
2003-12-01  1:21 ` William Lee Irwin III
2003-12-01  7:58   ` Andries Brouwer
2003-12-01  8:00     ` William Lee Irwin III
2003-11-30 17:34 James W McMechan
2003-11-30 20:06 ` William Lee Irwin III
2003-11-30 21:21   ` Oleg Drokin
2003-11-30 16:57 James W McMechan
2003-11-30 19:27 ` William Lee Irwin III

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=20031203120244.GA1311@in.ibm.com \
    --to=maneesh@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mcmechanjw@juno.com \
    --cc=viro@parcelfarce.linux.theplanet.co.uk \
    --cc=wli@holomorphy.com \
    --subject='Re: Oops with tmpfs on both 2.4.22 & 2.6.0-test11' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).