public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: dhowells@redhat.com,
	Jaswinder Singh Rajput <jaswinder@kernel.org>,
	torvalds@osdl.org, akpm@linux-foundation.org,
	linux-afs@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] AFS: Fix compilation warning
Date: Tue, 14 Jul 2009 17:17:26 +0100	[thread overview]
Message-ID: <5554.1247588246@redhat.com> (raw)
In-Reply-To: <1247561220.2473.0.camel@ht.satnam>


Hi Artem,

Can you try Jaswinder's patch?  I don't see the warning even without your
patch, so I can't test it.

David
---
diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index 9bd7577..09cb5bb 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -607,53 +607,56 @@ static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd)
 
 	/* search the directory for this vnode */
 	ret = afs_do_lookup(&dir->vfs_inode, dentry, &fid, key);
-	switch (ret) {
-	case 0:
-		/* the filename maps to something */
-		if (!dentry->d_inode)
-			goto out_bad;
-		if (is_bad_inode(dentry->d_inode)) {
-			printk("kAFS: afs_d_revalidate: %s/%s has bad inode\n",
-			       parent->d_name.name, dentry->d_name.name);
+	if (ret < 0) {
+		switch (ret) {
+		case -ENOENT:
+			/* the filename is unknown */
+			_debug("%s: dirent not found", dentry->d_name.name);
+			if (dentry->d_inode)
+				goto not_found;
+			goto out_valid;
+
+		default:
+			_debug("failed to iterate dir %s: %d",
+			       parent->d_name.name, ret);
 			goto out_bad;
 		}
+	}
 
-		/* if the vnode ID has changed, then the dirent points to a
-		 * different file */
-		if (fid.vnode != vnode->fid.vnode) {
-			_debug("%s: dirent changed [%u != %u]",
-			       dentry->d_name.name, fid.vnode,
-			       vnode->fid.vnode);
-			goto not_found;
-		}
-
-		/* if the vnode ID uniqifier has changed, then the file has
-		 * been deleted and replaced, and the original vnode ID has
-		 * been reused */
-		if (fid.unique != vnode->fid.unique) {
-			_debug("%s: file deleted (uq %u -> %u I:%llu)",
-			       dentry->d_name.name, fid.unique,
-			       vnode->fid.unique,
-			       (unsigned long long)dentry->d_inode->i_version);
-			spin_lock(&vnode->lock);
-			set_bit(AFS_VNODE_DELETED, &vnode->flags);
-			spin_unlock(&vnode->lock);
-			goto not_found;
-		}
-		goto out_valid;
-
-	case -ENOENT:
-		/* the filename is unknown */
-		_debug("%s: dirent not found", dentry->d_name.name);
-		if (dentry->d_inode)
-			goto not_found;
-		goto out_valid;
-
-	default:
-		_debug("failed to iterate dir %s: %d",
-		       parent->d_name.name, ret);
+	/* the filename maps to something */
+	if (!dentry->d_inode)
 		goto out_bad;
+	if (is_bad_inode(dentry->d_inode)) {
+		printk("kAFS: afs_d_revalidate: %s/%s has bad inode\n",
+		       parent->d_name.name, dentry->d_name.name);
+		goto out_bad;
+	}
+
+	/*
+	 * if the vnode ID has changed, then the dirent points to a
+	 * different file
+	 */
+	if (fid.vnode != vnode->fid.vnode) {
+		_debug("%s: dirent changed [%u != %u]",
+		       dentry->d_name.name, fid.vnode, vnode->fid.vnode);
+		goto not_found;
+	}
+
+	/*
+	 * if the vnode ID uniqifier has changed, then the file has been
+	 * deleted and replaced, and the original vnode ID has been reused
+	 */
+	if (fid.unique != vnode->fid.unique) {
+		_debug("%s: file deleted (uq %u -> %u I:%llu)",
+		       dentry->d_name.name, fid.unique,
+		       vnode->fid.unique,
+		       (unsigned long long)dentry->d_inode->i_version);
+		spin_lock(&vnode->lock);
+		set_bit(AFS_VNODE_DELETED, &vnode->flags);
+		spin_unlock(&vnode->lock);
+		goto not_found;
 	}
+	goto out_valid;
 
 out_valid:
 	dentry->d_fsdata = dir_version;

  parent reply	other threads:[~2009-07-14 16:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-09  9:44 [PATCH] AFS: Fix compilation warning David Howells
2009-07-14  8:47 ` Jaswinder Singh Rajput
2009-07-14  8:58   ` Jaswinder Singh Rajput
2009-07-14 13:10     ` David Howells
2009-07-14 13:49       ` Jaswinder Singh Rajput
2009-07-14 14:16         ` David Howells
2009-07-14 16:17   ` David Howells [this message]
2009-07-14 16:36     ` Artem Bityutskiy
2009-07-14 17:22       ` David Howells
  -- strict thread matches above, loose matches on Subject: below --
2009-07-09  8:04 [PATCH] AFS: fix " Artem Bityutskiy

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=5554.1247588246@redhat.com \
    --to=dhowells@redhat.com \
    --cc=Artem.Bityutskiy@nokia.com \
    --cc=akpm@linux-foundation.org \
    --cc=jaswinder@kernel.org \
    --cc=linux-afs@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@osdl.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