Skip to content

Commit efa82ba

Browse files
committed
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6: NFS: Fix the mapping of the NFSERR_SERVERFAULT error NFS: Remove a redundant check for PageFsCache in nfs_migrate_page() NFS: Fix a bug in nfs_fscache_release_page()
2 parents 06a57f4 + fdcb457 commit efa82ba

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

fs/nfs/fscache.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -354,12 +354,11 @@ void nfs_fscache_reset_inode_cookie(struct inode *inode)
354354
*/
355355
int nfs_fscache_release_page(struct page *page, gfp_t gfp)
356356
{
357-
struct nfs_inode *nfsi = NFS_I(page->mapping->host);
358-
struct fscache_cookie *cookie = nfsi->fscache;
359-
360-
BUG_ON(!cookie);
361-
362357
if (PageFsCache(page)) {
358+
struct nfs_inode *nfsi = NFS_I(page->mapping->host);
359+
struct fscache_cookie *cookie = nfsi->fscache;
360+
361+
BUG_ON(!cookie);
363362
dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n",
364363
cookie, page, nfsi);
365364

fs/nfs/mount_clnt.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ static struct {
120120
{ .status = MNT3ERR_INVAL, .errno = -EINVAL, },
121121
{ .status = MNT3ERR_NAMETOOLONG, .errno = -ENAMETOOLONG, },
122122
{ .status = MNT3ERR_NOTSUPP, .errno = -ENOTSUPP, },
123-
{ .status = MNT3ERR_SERVERFAULT, .errno = -ESERVERFAULT, },
123+
{ .status = MNT3ERR_SERVERFAULT, .errno = -EREMOTEIO, },
124124
};
125125

126126
struct mountres {

fs/nfs/nfs2xdr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ static struct {
699699
{ NFSERR_BAD_COOKIE, -EBADCOOKIE },
700700
{ NFSERR_NOTSUPP, -ENOTSUPP },
701701
{ NFSERR_TOOSMALL, -ETOOSMALL },
702-
{ NFSERR_SERVERFAULT, -ESERVERFAULT },
702+
{ NFSERR_SERVERFAULT, -EREMOTEIO },
703703
{ NFSERR_BADTYPE, -EBADTYPE },
704704
{ NFSERR_JUKEBOX, -EJUKEBOX },
705705
{ -1, -EIO }

fs/nfs/nfs4xdr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4631,7 +4631,7 @@ static int decode_sequence(struct xdr_stream *xdr,
46314631
* If the server returns different values for sessionID, slotID or
46324632
* sequence number, the server is looney tunes.
46334633
*/
4634-
status = -ESERVERFAULT;
4634+
status = -EREMOTEIO;
46354635

46364636
if (memcmp(id.data, res->sr_session->sess_id.data,
46374637
NFS4_MAX_SESSIONID_LEN)) {
@@ -5774,7 +5774,7 @@ static struct {
57745774
{ NFS4ERR_BAD_COOKIE, -EBADCOOKIE },
57755775
{ NFS4ERR_NOTSUPP, -ENOTSUPP },
57765776
{ NFS4ERR_TOOSMALL, -ETOOSMALL },
5777-
{ NFS4ERR_SERVERFAULT, -ESERVERFAULT },
5777+
{ NFS4ERR_SERVERFAULT, -EREMOTEIO },
57785778
{ NFS4ERR_BADTYPE, -EBADTYPE },
57795779
{ NFS4ERR_LOCKED, -EAGAIN },
57805780
{ NFS4ERR_SYMLINK, -ELOOP },
@@ -5801,7 +5801,7 @@ nfs4_stat_to_errno(int stat)
58015801
}
58025802
if (stat <= 10000 || stat > 10100) {
58035803
/* The server is looney tunes. */
5804-
return -ESERVERFAULT;
5804+
return -EREMOTEIO;
58055805
}
58065806
/* If we cannot translate the error, the recovery routines should
58075807
* handle it.

fs/nfs/write.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1598,8 +1598,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
15981598
struct nfs_page *req;
15991599
int ret;
16001600

1601-
if (PageFsCache(page))
1602-
nfs_fscache_release_page(page, GFP_KERNEL);
1601+
nfs_fscache_release_page(page, GFP_KERNEL);
16031602

16041603
req = nfs_find_and_lock_request(page);
16051604
ret = PTR_ERR(req);

0 commit comments

Comments
 (0)