Skip to contentSkip to conversation

nfsd_symlink() failpath fix

PATCH New Andreas Gruenbacher 1 participant 1 message Mar 17, 2003

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 nfsd_symlink() failpath fix

Hello,

In both 2.5 and 2.4, the fs/nfsd/vfs.c:nfsd_symlink() function calls down to notify_change(). If notify_change fails for some reason, the error code is not converted to an nfs no-the-wire error code as is should. The attached patches fix that (one for 2.4, the other for 2.5).

Marcelo, could you please apply the patch?
Andrew, could you please batch that up in your next update for Linus?

Thanks,
Andreas.

------------------------------------------------------------------
Andreas Gruenbacher SuSE Linux AG
mailto:[email protected] Deutschherrnstr. 15-19
http://www.suse.de/ D-90429 Nuernberg, Germany

fs/nfsd/vfs.c +3 -1
@@ -1190,7 +1190,9 @@
 				iap->ia_mode = (iap->ia_mode&S_IALLUGO)
 					| S_IFLNK;
 				err = notify_change(dnew, iap);
-				if (!err && EX_ISSYNC(fhp->fh_export))
+				if (err)
+					err = nfserrno(err);
+				else if (EX_ISSYNC(fhp->fh_export))
 					write_inode_now(dentry->d_inode, 1);
 		       }
 		}
fs/nfsd/vfs.c +3 -1
@@ -1151,7 +1151,9 @@
 				iap->ia_mode = (iap->ia_mode&S_IALLUGO)
 					| S_IFLNK;
 				err = notify_change(dnew, iap);
-				if (!err && EX_ISSYNC(fhp->fh_export))
+				if (err)
+					err = nfserrno(err);
+				else if (EX_ISSYNC(fhp->fh_export))
 					write_inode_now(dentry->d_inode, 1);
 		       }
 		}