From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Gruenbacher Subject: [PATCH] nfsd_symlink() failpath fix Date: Mon, 17 Mar 2003 12:00:43 +0100 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <200303171200.43254.agruen@suse.de> Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_brad+Hb6ru0xWkc" Cc: linux-fsdevel@vger.kernel.org Return-path: To: Marcelo Tossati , Andrew Morton List-Id: linux-fsdevel.vger.kernel.org --Boundary-00=_brad+Hb6ru0xWkc Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline 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:agruen@suse.de Deutschherrnstr. 15-19 http://www.suse.de/ D-90429 Nuernberg, Germany --Boundary-00=_brad+Hb6ru0xWkc Content-Type: text/x-diff; charset="us-ascii"; name="nfsd-symlink-failpath-2.5.64.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="nfsd-symlink-failpath-2.5.64.diff" --- linux-2.5.64.orig/fs/nfsd/vfs.c 2003-03-17 11:36:39.000000000 +0100 +++ linux-2.5.64/fs/nfsd/vfs.c 2003-03-17 11:37:32.000000000 +0100 @@ -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); } } --Boundary-00=_brad+Hb6ru0xWkc Content-Type: text/x-diff; charset="us-ascii"; name="nfsd-symlink-failpath-2.4.21-pre5.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="nfsd-symlink-failpath-2.4.21-pre5.diff" --- linux-2.4.21-pre5.orig/fs/nfsd/vfs.c 2003-03-17 11:49:27.000000000 +0100 +++ linux-2.4.21-pre5/fs/nfsd/vfs.c 2003-03-17 11:50:01.000000000 +0100 @@ -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); } } --Boundary-00=_brad+Hb6ru0xWkc--