Have nfs ->d_revalidate() report errors properly
authorAl Viro <viro@ZenIV.linux.org.uk>
Wed, 7 Apr 2010 23:06:07 +0000 (00:06 +0100)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 7 Apr 2010 23:10:16 +0000 (16:10 -0700)
If nfs atomic open implementation ends up doing open request from
->d_revalidate() codepath and gets an error from server, return that error
to caller explicitly and don't bother with lookup_instantiate_filp() at all.
->d_revalidate() can return an error itself just fine...

See
http://bugzilla.kernel.org/show_bug.cgi?id=15674
http://marc.info/?l=linux-kernel&m=126988782722711&w=2

for original report.

Reported-by: Daniel J Blueman <daniel.blueman@gmail.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/nfs/nfs4proc.c

index d79a7b37e56c41bd196af57548d9865b7514acc0..fe0cd9eb1d4db1680f74ca530118b34ff8b24afd 100644 (file)
@@ -2068,8 +2068,7 @@ nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, st
                        case -EDQUOT:
                        case -ENOSPC:
                        case -EROFS:
-                               lookup_instantiate_filp(nd, (struct dentry *)state, NULL);
-                               return 1;
+                               return PTR_ERR(state);
                        default:
                                goto out_drop;
                }