public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Stephan von Krawczynski <skraw@ithnet.com>
To: trond.myklebust@fys.uio.no
Cc: green@namesys.com, sneakums@zork.net, linux-kernel@vger.kernel.org
Subject: Re: BUG REPORT: kernel nfs between 2.4.19-pre2 (server) and 2.2.21-pre3 (client)
Date: Fri, 22 Mar 2002 14:19:42 +0100	[thread overview]
Message-ID: <20020322141942.14518fc6.skraw@ithnet.com> (raw)
In-Reply-To: <15515.4235.679887.998891@charged.uio.no>

On Fri, 22 Mar 2002 12:07:55 +0100
Trond Myklebust <trond.myklebust@fys.uio.no> wrote:

> >>>>> " " == Stephan von Krawczynski <skraw@ithnet.com> writes:
>      > The files are obviously not deleted from the server. Can you
>      > give me a short hint in where to look after this specific case
>      > (source location). I will try to do some debugging around the
>      > place to see what is going on.
> 
> Those decisions are supposed to be made in the fh_to_dentry()
> 'struct super_operations' method. For ReiserFS, that would be in
> fs/reiserfs/inode.c:reiserfs_fh_to_dentry().
> 
> It would indeed be a good idea to try sticking some debugging
> 'printk's in there in order to see what is failing...

Well, I seem to be really stupid, watch this:

struct dentry *reiserfs_fh_to_dentry(struct super_block *sb, __u32 *data,
				     int len, int fhtype, int parent) {
    struct cpu_key key ;
    struct inode *inode = NULL ;
    struct list_head *lp;
    struct dentry *result;

    /* fhtype happens to reflect the number of u32s encoded.
     * due to a bug in earlier code, fhtype might indicate there
     * are more u32s then actually fitted.
     * so if fhtype seems to be more than len, reduce fhtype.
     * Valid types are:
     *   2 - objectid + dir_id - legacy support
     *   3 - objectid + dir_id + generation
     *   4 - objectid + dir_id + objectid and dirid of parent - legacy
     *   5 - objectid + dir_id + generation + objectid and dirid of parent
     *   6 - as above plus generation of directory
     * 6 does not fit in NFSv2 handles
     */
    if (fhtype > len) {
	    if (fhtype != 6 || len != 5)
		    printk(KERN_WARNING "nfsd/reiserfs, fhtype=%d, len=%d - odd\n",
			   fhtype, len);
	    fhtype = 5;
    }
    if (fhtype < 2 || (parent && fhtype < 4)) {
	printk(KERN_WARNING "fh: 1\n");
	goto out ;
	}

    if (! parent) {
	    /* this works for handles from old kernels because the default
	    ** reiserfs generation number is the packing locality.
	    */
	    key.on_disk_key.k_objectid = data[0] ;
	    key.on_disk_key.k_dir_id = data[1] ;
	    inode = reiserfs_iget(sb, &key) ;
	    if (!inode)
		    printk(KERN_WARNING "fh: 2a\n");
	    	
	    if (inode && !IS_ERR(inode) && (fhtype == 3 || fhtype >= 5) &&
		data[2] != inode->i_generation) {
		    iput(inode) ;
		    printk(KERN_WARNING "fh: 2\n");
		    inode = NULL ;
	    }
    } else {
	    key.on_disk_key.k_objectid = data[fhtype>=5?3:2] ;
	    key.on_disk_key.k_dir_id = data[fhtype>=5?4:3] ;
	    inode = reiserfs_iget(sb, &key) ;
	    if (!inode)
		    printk(KERN_WARNING "fh: 3a\n");
	    
	    if (inode && !IS_ERR(inode) && fhtype == 6 &&
		data[5] != inode->i_generation) {
		    iput(inode) ;
		    printk(KERN_WARNING "fh: 3\n");
		    inode = NULL ;
	    }
    }
out:
    if (IS_ERR(inode))
	return ERR_PTR(PTR_ERR(inode));
    if (!inode)
        return ERR_PTR(-ESTALE) ;

    /* now to find a dentry.
     * If possible, get a well-connected one
     */
    spin_lock(&dcache_lock);
    for (lp = inode->i_dentry.next; lp != &inode->i_dentry ; lp=lp->next) {
	    result = list_entry(lp,struct dentry, d_alias);
	    
	    if (! (result->d_flags & DCACHE_NFSD_DISCONNECTED)) {
		    dget_locked(result);
		    result->d_vfs_flags |= DCACHE_REFERENCED;
		    spin_unlock(&dcache_lock);
		    iput(inode);
		    return result;
	    }
    }
    spin_unlock(&dcache_lock);
    result = d_alloc_root(inode);
    if (result == NULL) {
	    iput(inode);
	    printk(KERN_WARNING "fh: 4\n");
	    
	    return ERR_PTR(-ENOMEM);
    }
    result->d_flags |= DCACHE_NFSD_DISCONNECTED;
    return result;

}

As you can see I put printks just around everywhere, where a false exit seems possible. Only I get _no_ output from it in my testcase.

Is this really the correct spot to look at?

What else can I do?

Regards,
Stephan


  reply	other threads:[~2002-03-22 13:20 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-09 12:19 BUG REPORT: kernel nfs between 2.4.19-pre2 (server) and 2.2.21-pre3 (client) Stephan von Krawczynski
2002-03-09 19:10 ` Alan Cox
2002-03-10 17:50   ` Stephan von Krawczynski
2002-03-10 22:39 ` Trond Myklebust
2002-03-11  0:18   ` Stephan von Krawczynski
2002-03-11  0:28     ` Trond Myklebust
2002-03-11  6:14       ` Oleg Drokin
2002-03-11 10:46         ` Stephan von Krawczynski
2002-03-11 10:52           ` Oleg Drokin
2002-03-11 11:00             ` Stephan von Krawczynski
2002-03-11 11:11               ` Oleg Drokin
2002-03-11 11:24                 ` Stephan von Krawczynski
2002-03-11 12:47                 ` Stephan von Krawczynski
2002-03-11 12:59                   ` Oleg Drokin
2002-03-11 14:48                     ` Stephan von Krawczynski
2002-03-11 13:51                       ` Oleg Drokin
2002-03-11 13:59                         ` Trond Myklebust
2002-03-11 14:03                           ` Trond Myklebust
2002-03-11 15:57                           ` Stephan von Krawczynski
2002-03-11 16:31                             ` Hans Reiser
2002-03-15 10:32                             ` Oleg Drokin
2002-03-15 11:02                               ` Stephan von Krawczynski
2002-03-15 11:13                                 ` Oleg Drokin
2002-03-15 11:30                                   ` Stephan von Krawczynski
2002-03-15 11:36                                     ` Sean Neakums
2002-03-15 12:03                                       ` Stephan von Krawczynski
2002-03-15 12:05                                         ` Oleg Drokin
2002-03-15 14:07                                           ` Stephan von Krawczynski
2002-03-21 14:45                                           ` Stephan von Krawczynski
2002-03-21 14:57                                             ` Stephan von Krawczynski
2002-03-21 15:01                                               ` Oleg Drokin
2002-03-21 15:05                                                 ` Stephan von Krawczynski
2002-03-21 15:07                                                   ` Oleg Drokin
2002-03-21 17:15                                                     ` Stephan von Krawczynski
2002-03-22  5:48                                                       ` Oleg Drokin
2002-03-22  0:19                                             ` Trond Myklebust
2002-03-22 11:00                                               ` Stephan von Krawczynski
2002-03-22 11:07                                                 ` Trond Myklebust
2002-03-22 13:19                                                   ` Stephan von Krawczynski [this message]
2002-03-15 11:37                                     ` Oleg Drokin
2002-03-18  7:07       ` NIIBE Yutaka
2002-03-18  8:15         ` Trond Myklebust
2002-03-18  9:33           ` NIIBE Yutaka
2002-03-18  9:56             ` Trond Myklebust
2002-03-18 23:57               ` NIIBE Yutaka
2002-03-19 14:45                 ` Trond Myklebust
2002-03-20  0:42                   ` NIIBE Yutaka
2002-03-20  8:30                     ` Trond Myklebust
2002-03-19 15:42               ` Ton Hospel
2002-03-19 18:31                 ` BUG REPORT: kernel nfs between 2.4.19-pre2 (server) and Alan Cox
2002-03-19 22:10                 ` BUG REPORT: kernel nfs between 2.4.19-pre2 (server) and 2.2.21-pre3 (client) Trond Myklebust
2002-03-22 10:33                   ` David Woodhouse
2002-03-22 11:03                     ` Trond Myklebust

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=20020322141942.14518fc6.skraw@ithnet.com \
    --to=skraw@ithnet.com \
    --cc=green@namesys.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sneakums@zork.net \
    --cc=trond.myklebust@fys.uio.no \
    /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