Skip to content

Commit

Permalink
Merge branch 'bugfixes' of git://git.linux-nfs.org/projects/trondmy/n…
Browse files Browse the repository at this point in the history
…fs-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()
  • Loading branch information
torvalds committed Feb 11, 2010
2 parents 06a57f4 + fdcb457 commit efa82ba
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
9 changes: 4 additions & 5 deletions fs/nfs/fscache.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,11 @@ void nfs_fscache_reset_inode_cookie(struct inode *inode)
*/
int nfs_fscache_release_page(struct page *page, gfp_t gfp)
{
struct nfs_inode *nfsi = NFS_I(page->mapping->host);
struct fscache_cookie *cookie = nfsi->fscache;

BUG_ON(!cookie);

if (PageFsCache(page)) {
struct nfs_inode *nfsi = NFS_I(page->mapping->host);
struct fscache_cookie *cookie = nfsi->fscache;

BUG_ON(!cookie);
dfprintk(FSCACHE, "NFS: fscache releasepage (0x%p/0x%p/0x%p)\n",
cookie, page, nfsi);

Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/mount_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ static struct {
{ .status = MNT3ERR_INVAL, .errno = -EINVAL, },
{ .status = MNT3ERR_NAMETOOLONG, .errno = -ENAMETOOLONG, },
{ .status = MNT3ERR_NOTSUPP, .errno = -ENOTSUPP, },
{ .status = MNT3ERR_SERVERFAULT, .errno = -ESERVERFAULT, },
{ .status = MNT3ERR_SERVERFAULT, .errno = -EREMOTEIO, },
};

struct mountres {
Expand Down
2 changes: 1 addition & 1 deletion fs/nfs/nfs2xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ static struct {
{ NFSERR_BAD_COOKIE, -EBADCOOKIE },
{ NFSERR_NOTSUPP, -ENOTSUPP },
{ NFSERR_TOOSMALL, -ETOOSMALL },
{ NFSERR_SERVERFAULT, -ESERVERFAULT },
{ NFSERR_SERVERFAULT, -EREMOTEIO },
{ NFSERR_BADTYPE, -EBADTYPE },
{ NFSERR_JUKEBOX, -EJUKEBOX },
{ -1, -EIO }
Expand Down
6 changes: 3 additions & 3 deletions fs/nfs/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -4631,7 +4631,7 @@ static int decode_sequence(struct xdr_stream *xdr,
* If the server returns different values for sessionID, slotID or
* sequence number, the server is looney tunes.
*/
status = -ESERVERFAULT;
status = -EREMOTEIO;

if (memcmp(id.data, res->sr_session->sess_id.data,
NFS4_MAX_SESSIONID_LEN)) {
Expand Down Expand Up @@ -5774,7 +5774,7 @@ static struct {
{ NFS4ERR_BAD_COOKIE, -EBADCOOKIE },
{ NFS4ERR_NOTSUPP, -ENOTSUPP },
{ NFS4ERR_TOOSMALL, -ETOOSMALL },
{ NFS4ERR_SERVERFAULT, -ESERVERFAULT },
{ NFS4ERR_SERVERFAULT, -EREMOTEIO },
{ NFS4ERR_BADTYPE, -EBADTYPE },
{ NFS4ERR_LOCKED, -EAGAIN },
{ NFS4ERR_SYMLINK, -ELOOP },
Expand All @@ -5801,7 +5801,7 @@ nfs4_stat_to_errno(int stat)
}
if (stat <= 10000 || stat > 10100) {
/* The server is looney tunes. */
return -ESERVERFAULT;
return -EREMOTEIO;
}
/* If we cannot translate the error, the recovery routines should
* handle it.
Expand Down
3 changes: 1 addition & 2 deletions fs/nfs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -1598,8 +1598,7 @@ int nfs_migrate_page(struct address_space *mapping, struct page *newpage,
struct nfs_page *req;
int ret;

if (PageFsCache(page))
nfs_fscache_release_page(page, GFP_KERNEL);
nfs_fscache_release_page(page, GFP_KERNEL);

req = nfs_find_and_lock_request(page);
ret = PTR_ERR(req);
Expand Down

0 comments on commit efa82ba

Please sign in to comment.