From 4b5bb6b7cd2b2e7fad8dae3c5e1e7a0bdc488f62 Mon Sep 17 00:00:00 2001 From: adilger Date: Fri, 6 Sep 2002 22:23:49 +0000 Subject: [PATCH] Make obdecho return 64-bit objids so we can check 64-bit paths better. --- lustre/obdecho/echo.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/lustre/obdecho/echo.c b/lustre/obdecho/echo.c index 74aad68..64b7114 100644 --- a/lustre/obdecho/echo.c +++ b/lustre/obdecho/echo.c @@ -12,8 +12,8 @@ * and Andreas Dilger */ -static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.32 2002/09/04 16:30:40 adilger Exp $"; -#define OBDECHO_VERSION "$Revision: 1.32 $" +static char rcsid[] __attribute ((unused)) = "$Id: echo.c,v 1.33 2002/09/06 22:23:49 adilger Exp $"; +#define OBDECHO_VERSION "$Revision: 1.33 $" #define EXPORT_SYMTAB @@ -42,6 +42,7 @@ static atomic_t echo_page_rws; static atomic_t echo_getattrs; #define ECHO_PROC_STAT "sys/obdecho" +#define ECHO_INIT_OBJID 0x1000000000000000ULL int echo_proc_read(char *page, char **start, off_t off, int count, int *eof, void *data) @@ -92,7 +93,7 @@ void echo_proc_fini(void) } static int echo_connect(struct lustre_handle *conn, struct obd_device *obd, - char *cluuid) + uuid_t cluuid) { int rc; @@ -169,8 +170,8 @@ int echo_destroy(struct lustre_handle *conn, struct obdo *oa, RETURN(-EINVAL); } - if (oa->o_id > obd->u.echo.eo_lastino) { - CERROR("bad destroy objid: %Ld\n", (long long)oa->o_id); + if (oa->o_id > obd->u.echo.eo_lastino || oa->o_id < ECHO_INIT_OBJID) { + CERROR("bad destroy objid: 0x"LPX64"\n", oa->o_id); RETURN(-EINVAL); } @@ -393,6 +394,7 @@ static int echo_setup(struct obd_device *obddev, obd_count len, void *buf) LBUG(); RETURN(-ENOMEM); } + obddev->u.echo.eo_lastino = ECHO_INIT_OBJID; RETURN(0); } -- 1.8.3.1