Commit 0250c8e0 authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfsv3: do not log client errors with error level

parent 4c2fa99f
......@@ -33,4 +33,9 @@ public class ChimeraNFSException extends java.io.IOException {
public int getStatus() {
return nfsStatus;
}
@Override
public String toString() {
return super.toString() + " NFS status: " + nfsStatus;
}
}
......@@ -253,6 +253,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resok.access = new uint32(realAccess);
} catch (ChimeraNFSException hne) {
_log.error("ACCESS: {}", hne);
res.status = hne.getStatus();
res.resfail = new ACCESS3resfail();
res.resfail.obj_attributes = defaultPostOpAttr();
......@@ -268,11 +269,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.obj_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.error("Access failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
@Override
......@@ -394,11 +391,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.dir_wcc = defaultWccData();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.error("create failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
@Override
......@@ -460,11 +453,6 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.obj_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.error("FSinfo failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
......@@ -509,12 +497,6 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.obj_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.error("FSSTAT ({}) failed: {}",
new Object[]{new String(arg1.fsroot.data),
HimeraNfsUtils.nfsErr2String(res.status)
});
}
return res;
}
......@@ -537,6 +519,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
HimeraNfsUtils.fill_attributes(inode.stat(), res.resok.obj_attributes);
} catch (FileNotFoundHimeraFsException fnf) {
_log.debug("GETATTR: file does not exists: {}", fnf.toString());
res.status = nfsstat3.NFS3ERR_NOENT;
} catch (ChimeraFsException e) {
_log.error("GETATTR", e);
......@@ -546,10 +529,6 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
}
if (res.status != nfsstat3.NFS3_OK) {
_log.error("Getattr failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
......@@ -666,6 +645,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
HimeraNfsUtils.fill_attributes(parent.stat(), res.resok.dir_attributes.attributes);
} catch (ChimeraNFSException hne) {
_log.debug("lookup {}", hne.toString());
res.status = hne.getStatus();
res.resfail = new LOOKUP3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
......@@ -681,11 +661,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.dir_attributes = defaultPostOpAttr();
}
if ((res.status != nfsstat3.NFS3_OK) && (res.status != nfsstat3.NFS3ERR_NOENT)) {
_log.error("lookup {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
@Override
......@@ -984,6 +960,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resok.reply.eof = true;
} catch (ChimeraNFSException hne) {
_log.debug("READDIRPLUS3 status: {}", hne.toString());
res.resfail = new READDIRPLUS3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
res.status = hne.getStatus();
......@@ -999,9 +976,6 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.dir_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.error("READDIRPLUS3 status - {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
......@@ -1120,6 +1094,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resok.reply.eof = true;
} catch (ChimeraNFSException hne) {
_log.error("READDIR: {}", hne.toString());
res.resfail = new READDIR3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
res.status = hne.getStatus();
......@@ -1135,11 +1110,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.dir_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.error("READDIR status - {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
@Override
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment