Commit 26f5c0f6 authored by Tigran Mkrtchyan's avatar Tigran Mkrtchyan
Browse files

nfsv41: switch to slf4j logging framework

changed NFS code to use slf4j.
The RPC part is still based on JUL.

Acked-By: Paul
parent c1f9d191
<?xml version="1.0" encoding="UTF-8" ?>
<configuration>
<jmxConfigurator />
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<layout class="ch.qos.logback.classic.PatternLayout">
<Pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %X{mdc.client} %logger{24} - %msg%n</Pattern>
</layout>
</appender>
<root level="INFO">
<appender-ref ref="STDOUT" />
</root>
</configuration>
......@@ -191,6 +191,16 @@
<artifactId>postgresql</artifactId>
<version>8.4-701.jdbc3</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.5.11</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>0.9.18</version>
</dependency>
<!--
LOCAL JARS
......
......@@ -4,25 +4,15 @@
package org.dcache.chimera.nfs;
import org.dcache.chimera.*;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.dcache.chimera.FileSystemProvider;
import org.dcache.chimera.FsInode;
import org.dcache.chimera.FsInodeType;
import org.dcache.chimera.FsInode_CONST;
import org.dcache.chimera.FsInode_ID;
import org.dcache.chimera.FsInode_NAMEOF;
import org.dcache.chimera.FsInode_PARENT;
import org.dcache.chimera.FsInode_PATHOF;
import org.dcache.chimera.FsInode_PGET;
import org.dcache.chimera.FsInode_PSET;
import org.dcache.chimera.FsInode_TAG;
import org.dcache.chimera.FsInode_TAGS;
public class NFSHandle {
private static final Logger _log = Logger.getLogger(NFSHandle.class.getName());
private static final Logger _log = LoggerFactory.getLogger(NFSHandle.class);
private NFSHandle() {
// no instance allowed
......@@ -34,7 +24,7 @@ public class NFSHandle {
String strHandle = new String(handle);
_log.log(Level.FINEST, "Processing FH: {0}", strHandle );
_log.debug("Processing FH: {}", strHandle );
StringTokenizer st = new StringTokenizer(strHandle, "[:]");
......@@ -125,8 +115,7 @@ public class NFSHandle {
}
} catch (IllegalArgumentException iae) {
_log.log(Level.INFO, "Failed to generate an inode from file handle : {0} : {1}",
new Object[] {strHandle, iae});
_log.info("Failed to generate an inode from file handle : {} : {}", strHandle, iae);
inode = null;
}
......
......@@ -21,8 +21,6 @@ import org.dcache.chimera.nfs.v3.xdr.time_how;
import org.dcache.chimera.nfs.v3.xdr.wcc_attr;
import java.util.concurrent.TimeUnit;
import org.apache.log4j.Logger;
import org.dcache.chimera.FsInode;
import org.dcache.chimera.ChimeraFsException;
import org.dcache.chimera.UnixPermission;
......@@ -32,6 +30,8 @@ import org.dcache.chimera.nfs.v3.xdr.wcc_data;
import org.dcache.xdr.RpcAuthType;
import org.dcache.xdr.RpcAuthTypeUnix;
import org.dcache.xdr.RpcCall;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class HimeraNfsUtils {
......@@ -39,7 +39,7 @@ public class HimeraNfsUtils {
private static final int MODE_MASK = 0770000;
private static final Logger _log = Logger.getLogger(HimeraNfsUtils.class.getName());
private static final Logger _log = LoggerFactory.getLogger(HimeraNfsUtils.class);
private HimeraNfsUtils() {
// no instance allowed
......
......@@ -20,8 +20,6 @@ package org.dcache.chimera.nfs.v3;
import java.io.File;
import java.net.InetAddress;
import java.util.logging.Logger;
import java.util.logging.Level;
import org.acplt.oncrpc.OncRpcPortmapClient;
import org.acplt.oncrpc.OncRpcProtocols;
......@@ -34,24 +32,26 @@ import org.dcache.chimera.nfs.v3.xdr.nfs3_prot;
import org.dcache.xdr.OncRpcSvc;
import org.dcache.xdr.OncRpcProgram;
import org.dcache.xdr.portmap.OncRpcEmbeddedPortmap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class Main {
private final static Logger _log = Logger.getLogger(Main.class.getName());
private final static Logger _log = LoggerFactory.getLogger(Main.class);
static final int DEFAULT_PORT = 2049;
public static void main(String[] args) throws Exception {
if (args.length != 1) {
_log.severe("Usage: Main <config>");
_log.error("Usage: Main <config>");
System.exit(1);
}
XMLconfig config = new XMLconfig(new File(args[0]));
FileSystemProvider fs = new JdbcFs(config);
_log.log(Level.CONFIG, "starting NFSv3 on: {0}", DEFAULT_PORT);
_log.info("starting NFSv3 on: {}", DEFAULT_PORT);
new OncRpcEmbeddedPortmap(2000);
......@@ -59,27 +59,27 @@ public class Main {
portmap.getOncRpcClient().setTimeout(2000);
if (!portmap.setPort(mount_prot.MOUNT_PROGRAM, mount_prot.MOUNT_V3, OncRpcProtocols.ONCRPC_TCP, 2049)) {
_log.log(Level.SEVERE, "Failed to register mountv1 service within portmap.");
_log.error("Failed to register mountv1 service within portmap.");
}
if (!portmap.setPort(mount_prot.MOUNT_PROGRAM, mount_prot.MOUNT_V3, OncRpcProtocols.ONCRPC_UDP, 2049)) {
_log.log(Level.SEVERE, "Failed to register mountv1 service within portmap.");
_log.error( "Failed to register mountv1 service within portmap.");
}
if (!portmap.setPort(mount_prot.MOUNT_PROGRAM, mount_prot.MOUNT_V1, OncRpcProtocols.ONCRPC_TCP, 2049)) {
_log.log(Level.SEVERE, "Failed to register mountv3 service within portmap.");
_log.error("Failed to register mountv3 service within portmap.");
}
if (!portmap.setPort(mount_prot.MOUNT_PROGRAM, mount_prot.MOUNT_V1, OncRpcProtocols.ONCRPC_UDP, 2049)) {
_log.log(Level.SEVERE, "Failed to register mountv3 service within portmap.");
_log.error("Failed to register mountv3 service within portmap.");
}
if (!portmap.setPort(nfs3_prot.NFS_PROGRAM, nfs3_prot.NFS_V3, OncRpcProtocols.ONCRPC_TCP, 2049)) {
_log.log(Level.SEVERE, "Failed to register NFSv3 service within portmap.");
_log.error("Failed to register NFSv3 service within portmap.");
}
if (!portmap.setPort(nfs3_prot.NFS_PROGRAM, nfs3_prot.NFS_V3, OncRpcProtocols.ONCRPC_UDP, 2049)) {
_log.log(Level.SEVERE, "Failed to register NFSv3 service within portmap.");
_log.error("Failed to register NFSv3 service within portmap.");
}
ExportFile exports = new ExportFile(new File("/etc/exports"));
......
......@@ -24,8 +24,6 @@ import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.dcache.chimera.ChimeraFsException;
import org.dcache.chimera.FileSystemProvider;
import org.dcache.chimera.FsInode;
......@@ -34,10 +32,12 @@ import org.dcache.chimera.nfs.ExportFile;
import org.dcache.chimera.nfs.FsExport;
import org.dcache.xdr.RpcAuthType;
import org.dcache.xdr.RpcCall;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class MountServer extends mount_protServerStub {
private static final Logger _log = Logger.getLogger(MountServer.class.getName());
private static final Logger _log = LoggerFactory.getLogger(MountServer.class);
private final ExportFile _exportFile;
private final Map<String, Set<String>> _mounts = new HashMap<String, Set<String>>();
private final FileSystemProvider _fs;
......@@ -61,11 +61,11 @@ public class MountServer extends mount_protServerStub {
java.io.File f = new java.io.File(arg1.value);
String mountPoint = f.getAbsolutePath();
_log.log(Level.FINE, "Mount request for: {0}", mountPoint);
_log.debug("Mount request for: {}", mountPoint);
if (!isAllowed(call$.getTransport().getRemoteSocketAddress().getAddress(), mountPoint)) {
m.fhs_status = mountstat3.MNT3ERR_ACCES;
_log.warning("Mount deny for: " + call$.getTransport().getRemoteSocketAddress().getHostName() + " " + mountPoint);
_log.info("Mount deny for: {}:{}", call$.getTransport().getRemoteSocketAddress().getHostName(), mountPoint);
return m;
}
......@@ -75,9 +75,9 @@ public class MountServer extends mount_protServerStub {
FsInode rootInode = null;
try {
_log.log(Level.FINEST, "asking chimera for the root inode");
_log.debug("asking chimera for the root inode");
rootInode = _fs.path2inode(mountPoint);
_log.log(Level.FINEST, "root inode: {0}", rootInode);
_log.debug("root inode: {}", rootInode);
} catch (ChimeraFsException e1) {
throw new ChimeraNFSException(mountstat3.MNT3ERR_NOENT, "Path not found");
}
......@@ -168,7 +168,7 @@ public class MountServer extends mount_protServerStub {
for (String path : _exportFile.getExports()) {
System.out.println("path: " + path);
FsExport export = _exportFile.getExport(path);
eList.value = new exportnode();
......
......@@ -112,8 +112,6 @@ import java.io.IOException;
import java.util.List;
import java.util.Random;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.dcache.chimera.ChimeraFsException;
import org.dcache.chimera.DirectoryStreamHelper;
import org.dcache.chimera.FileNotFoundHimeraFsException;
......@@ -138,6 +136,8 @@ import org.dcache.chimera.posix.UnixPermissionHandler;
import org.dcache.chimera.util.DirectoryListCache;
import org.dcache.xdr.OncRpcException;
import org.dcache.xdr.RpcCall;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import static org.dcache.chimera.nfs.v3.HimeraNfsUtils.defaultPostOpAttr;
import static org.dcache.chimera.nfs.v3.HimeraNfsUtils.defaultWccData;
......@@ -149,7 +149,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
private static final int ENTRYPLUS3_SIZE = 124;
private static final int READDIR3RESOK_SIZE = 104;
private static final int READDIRPLUS3RESOK_SIZE = 104;
private static final Logger _log = Logger.getLogger(NfsServerV3.class.getName());
private static final Logger _log = LoggerFactory.getLogger(NfsServerV3.class);
private static final AclHandler _permissionHandler = UnixPermissionHandler.getInstance();
private final FileSystemProvider _fs;
private final ExportFile _exports;
......@@ -172,7 +172,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request ACCESS uid: {0}", user);
_log.debug("NFS Request ACCESS uid: {}", user);
try {
......@@ -243,16 +243,16 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new ACCESS3resfail();
res.resfail.obj_attributes = defaultPostOpAttr();
_log.log(Level.SEVERE, "ACCESS", e);
_log.error("ACCESS", e);
} catch (Exception e) {
_log.log(Level.SEVERE, "ACCESS", e);
_log.error("ACCESS", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new ACCESS3resfail();
res.resfail.obj_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.log(Level.SEVERE, "Access failed : {0}", HimeraNfsUtils.nfsErr2String(res.status));
_log.error("Access failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
......@@ -273,7 +273,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request CREATE3 uid: {0}", user);
_log.debug("NFS Request CREATE3 uid: {}", user);
CREATE3res res = new CREATE3res();
......@@ -363,25 +363,25 @@ public class NfsServerV3 extends nfs3_protServerStub {
} catch (ChimeraNFSException hne) {
_log.log(Level.FINE, hne.getMessage());
_log.debug(hne.getMessage());
res.resfail = new CREATE3resfail();
res.resfail.dir_wcc = defaultWccData();
res.status = hne.getStatus();
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "Create {0}", path);
_log.error("Create {}", path);
res.status = nfsstat3.NFS3ERR_IO;
res.resfail = new CREATE3resfail();
res.resfail.dir_wcc = defaultWccData();
} catch (Exception e) {
_log.log(Level.SEVERE, "create", e);
_log.error("create", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new CREATE3resfail();
res.resfail.dir_wcc = defaultWccData();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.log(Level.SEVERE, "create failed : {0}", HimeraNfsUtils.nfsErr2String(res.status));
_log.error("create failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
......@@ -392,7 +392,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request FSINFO from: {0}", user);
_log.debug("NFS Request FSINFO from: {}", user);
FSINFO3res res = new FSINFO3res();
FsInode inode = NFSHandle.toFsInode(_fs, arg1.fsroot.data);
......@@ -439,16 +439,16 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail = new FSINFO3resfail();
res.resfail.obj_attributes = defaultPostOpAttr();
res.status = nfsstat3.NFS3ERR_IO;
_log.log(Level.SEVERE, "FSINFO", e);
_log.error("FSINFO", e);
} catch (Exception e) {
_log.log(Level.SEVERE, "FSINFO", e);
_log.error("FSINFO", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new FSINFO3resfail();
res.resfail.obj_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.log(Level.SEVERE, "FSinfo failed : {0}", HimeraNfsUtils.nfsErr2String(res.status));
_log.error("FSinfo failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
......@@ -457,8 +457,6 @@ public class NfsServerV3 extends nfs3_protServerStub {
@Override
public FSSTAT3res NFSPROC3_FSSTAT_3(RpcCall call$, FSSTAT3args arg1) {
// org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$, _fs);
// JSyslog.log(JSyslog.LOG_DEBUG, "NFS Request FSSTAT3 uid: {0}", user);
FSSTAT3res res = new FSSTAT3res();
......@@ -487,19 +485,19 @@ public class NfsServerV3 extends nfs3_protServerStub {
HimeraNfsUtils.fill_attributes(inode.stat(), res.resok.obj_attributes.attributes);
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "FSSTAT", e);
_log.error("FSSTAT", e);
res.status = nfsstat3.NFS3ERR_IO;
res.resfail = new FSSTAT3resfail();
res.resfail.obj_attributes = defaultPostOpAttr();
} catch (Exception e) {
_log.log(Level.SEVERE, "FSSTAT", e);
_log.error("FSSTAT", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new FSSTAT3resfail();
res.resfail.obj_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.log(Level.SEVERE, "FSSTAT ({0}) failed: {1}",
_log.error("FSSTAT ({}) failed: {}",
new Object[]{new String(arg1.fsroot.data),
HimeraNfsUtils.nfsErr2String(res.status)
});
......@@ -512,12 +510,12 @@ public class NfsServerV3 extends nfs3_protServerStub {
public GETATTR3res NFSPROC3_GETATTR_3(RpcCall call$, GETATTR3args arg1) {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request GETTATTR3 uid: {0}", user);
_log.debug("NFS Request GETTATTR3 uid: {}", user);
GETATTR3res res = new GETATTR3res();
FsInode inode = NFSHandle.toFsInode(_fs, arg1.object.data);
_log.log(Level.FINEST, "NFS Request GETATTR for inode: {0}", inode.toString());
_log.debug("NFS Request GETATTR for inode: {}", inode.toString());
try {
res.status = nfsstat3.NFS3_OK;
......@@ -529,15 +527,15 @@ public class NfsServerV3 extends nfs3_protServerStub {
} catch (FileNotFoundHimeraFsException fnf) {
res.status = nfsstat3.NFS3ERR_NOENT;
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "GETATTR", e);
_log.error("GETATTR", e);
res.status = nfsstat3.NFS3ERR_IO;
} catch (Exception e) {
_log.log(Level.SEVERE, "GETATTR", e);
_log.error("GETATTR", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
}
if (res.status != nfsstat3.NFS3_OK) {
_log.log(Level.SEVERE, "Getattr failed : {0}", HimeraNfsUtils.nfsErr2String(res.status));
_log.error("Getattr failed : {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
......@@ -547,7 +545,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
public LINK3res NFSPROC3_LINK_3(RpcCall call$, LINK3args arg1) {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request LINK3 uid: {0}", user);
_log.debug("NFS Request LINK3 uid: {}", user);
LINK3res res = new LINK3res();
......@@ -608,12 +606,12 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.file_attributes = defaultPostOpAttr();
res.resfail.linkdir_wcc = defaultWccData();
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "LINK", e);
_log.error("LINK", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail.file_attributes = defaultPostOpAttr();
res.resfail.linkdir_wcc = defaultWccData();
} catch (Exception e) {
_log.log(Level.SEVERE, "LINK", e);
_log.error("LINK", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail.file_attributes = defaultPostOpAttr();
res.resfail.linkdir_wcc = defaultWccData();
......@@ -664,22 +662,22 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail = new LOOKUP3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "LOOKUP", e);
_log.error("LOOKUP", e);
res.status = nfsstat3.NFS3ERR_IO;
res.resfail = new LOOKUP3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
} catch (Exception e) {
_log.log(Level.SEVERE, "LOOKUP", e);
_log.error("LOOKUP", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new LOOKUP3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
}
_log.log(Level.FINEST, "LOOKUP for {0} in {1}: {2}",
_log.debug("LOOKUP for {} in {}: {}",
new Object[]{name, parent.toString(), inode});
if ((res.status != nfsstat3.NFS3_OK) && (res.status != nfsstat3.NFS3ERR_NOENT)) {
_log.log(Level.SEVERE, "lookup {0}", HimeraNfsUtils.nfsErr2String(res.status));
_log.error("lookup {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
......@@ -689,7 +687,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
public MKDIR3res NFSPROC3_MKDIR_3(RpcCall call$, MKDIR3args arg1) {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request MKDIR3 uid: {0}", user);
_log.debug("NFS Request MKDIR3 uid: {}", user);
MKDIR3res res = new MKDIR3res();
......@@ -758,12 +756,12 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.dir_wcc = defaultWccData();
res.status = hne.getStatus();
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "MKDIR", e);
_log.error("MKDIR", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new MKDIR3resfail();
res.resfail.dir_wcc = defaultWccData();
} catch (Exception e) {
_log.log(Level.SEVERE, "MKDIR", e);
_log.error("MKDIR", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new MKDIR3resfail();
res.resfail.dir_wcc = defaultWccData();
......@@ -821,7 +819,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
public READDIRPLUS3res NFSPROC3_READDIRPLUS_3(RpcCall call$, READDIRPLUS3args arg1) {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request READDIRPLUS3 uid: {0}", user);
_log.debug("NFS Request READDIRPLUS3 uid: {}", user);
READDIRPLUS3res res = new READDIRPLUS3res();
......@@ -858,10 +856,10 @@ public class NfsServerV3 extends nfs3_protServerStub {
cookieverf = arg1.cookieverf;
dirList = _dlCacheFull.get(cookieverf);
if (dirList == null) {
_log.log(Level.FINEST, "updating dirlist from db");
_log.debug("updating dirlist from db");
dirList = DirectoryStreamHelper.listOf(dir);
} else {
_log.log(Level.FINEST, "using dirlist from cache");
_log.debug("using dirlist from cache");
}
} else {
......@@ -929,7 +927,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resok.reply.eof = false;
lastEntry.nextentry = null;
_log.log(Level.FINEST, "Sending {0} entries ( {1} bytes from {2}, dircount = {3} from {4} ) cookie = {5} total {6}",
_log.debug("Sending {} entries ( {} bytes from {}, dircount = {} from {} ) cookie = {} total {}",
new Object[]{(i - startValue), currcount,
arg1.maxcount.value.value, dircount,
arg1.dircount.value.value,
......@@ -950,26 +948,26 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resok.reply.eof = true;
// all entries sent to client, remove cache
_dlCacheFull.remove(cookieverf);
_log.log(Level.FINEST, "Cleaning cache");
_log.debug("Cleaning cache");
} catch (ChimeraNFSException hne) {
res.resfail = new READDIRPLUS3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
res.status = hne.getStatus();
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "READDIRPLUS3", e);
_log.error("READDIRPLUS3", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new READDIRPLUS3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
} catch (Exception e) {
_log.log(Level.SEVERE, "READDIRPLUS3", e);
_log.error("READDIRPLUS3", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new READDIRPLUS3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();
}
if (res.status != nfsstat3.NFS3_OK) {
_log.log(Level.SEVERE, "READDIRPLUS3 status - {0}", HimeraNfsUtils.nfsErr2String(res.status));
_log.error("READDIRPLUS3 status - {}", HimeraNfsUtils.nfsErr2String(res.status));
}
return res;
}
......@@ -978,7 +976,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
public READDIR3res NFSPROC3_READDIR_3(RpcCall call$, READDIR3args arg1) {
org.dcache.chimera.posix.UnixUser user = HimeraNfsUtils.remoteUser(call$,
_exports.isTrusted(call$.getTransport().getRemoteSocketAddress().getAddress()));
_log.log(Level.FINEST, "NFS Request READDIR3 uid: {0}", user);
_log.debug("NFS Request READDIR3 uid: {}", user);
READDIR3res res = new READDIR3res();
......@@ -1066,7 +1064,7 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resok.reply.eof = false;
_log.log(Level.FINEST, "Sending {0} entries ( {1} bytes from {2}) cookie = {3} total {4}",
_log.debug("Sending {} entries ( {} bytes from {}) cookie = {} total {}",
new Object[]{(i - startValue), currcount,
arg1.count.value.value,
startValue, dirList.size()
......@@ -1092,19 +1090,19 @@ public class NfsServerV3 extends nfs3_protServerStub {
res.resfail.dir_attributes = defaultPostOpAttr();
res.status = hne.getStatus();
} catch (ChimeraFsException e) {
_log.log(Level.SEVERE, "READDIR", e);
_log.error("READDIR", e);
res.status = nfsstat3.NFS3ERR_SERVERFAULT;
res.resfail = new READDIR3resfail();
res.resfail.dir_attributes = defaultPostOpAttr();