From f70ef9b10acaddebbc44acf5b1444d373e3d10db Mon Sep 17 00:00:00 2001 From: adilger Date: Wed, 31 Mar 2004 22:36:42 +0000 Subject: [PATCH] Merge from HEAD to b1_2 select fixes for 1.2.2 b=2922, b=2948, b=1414 --- lnet/archdep.m4 | 38 ++++ lnet/include/lnet/lib-types.h | 5 +- lnet/include/lnet/list.h | 14 +- lustre/ChangeLog | 4 + lustre/configure.in | 5 +- lustre/include/Makefile.am | 2 +- lustre/include/config.h.in | 57 +++++- lustre/include/liblustre.h | 4 +- lustre/include/linux/Makefile.am | 3 - lustre/include/linux/lustre_idl.h | 3 +- lustre/include/linux/lustre_lite.h | 2 +- lustre/include/linux/lustre_net.h | 22 +++ lustre/include/linux/obd.h | 1 + lustre/include/lustre/Makefile.am | 7 + lustre/include/lustre/liblustreapi.h | 39 ++++ lustre/include/{linux => lustre}/lustre_user.h | 10 +- .../patches/linux-2.4.19-pre1-xattr-0.8.54.patch | 33 ++-- .../patches/linux-2.4.20-xattr-0.8.54-chaos.patch | 33 ++-- .../patches/linux-2.4.20-xattr-0.8.54-hp.patch | 2 +- .../patches/linux-2.4.20-xattr-0.8.54.patch | 33 ++-- .../patches/linux-2.4.21-xattr-0.8.54-suse.patch | 20 +- .../patches/linux-2.4.22-xattr-0.8.54.patch | 20 +- .../patches/linux-2.4.24-xattr-0.8.54.patch | 20 +- .../patches/xattr-0.8.54-2.4.22-rh.patch | 33 ++-- lustre/ldlm/l_lock.c | 4 +- lustre/ldlm/ldlm_internal.h | 9 +- lustre/ldlm/ldlm_lib.c | 2 +- lustre/ldlm/ldlm_lock.c | 8 +- lustre/ldlm/ldlm_lockd.c | 11 +- lustre/ldlm/ldlm_request.c | 21 ++- lustre/ldlm/ldlm_resource.c | 4 +- lustre/liblustre/Makefile.am | 44 ++--- lustre/liblustre/rw.c | 57 +++--- lustre/liblustre/tests/Makefile.am | 25 ++- lustre/llite/dir.c | 76 +++++++- lustre/llite/llite_lib.c | 1 + lustre/llite/rw.c | 2 +- lustre/llite/super.c | 1 + lustre/llite/super25.c | 1 + lustre/lov/lov_internal.h | 2 +- lustre/lov/lov_obd.c | 4 +- lustre/lov/lov_pack.c | 4 +- lustre/mds/handler.c | 63 +++++-- lustre/mds/mds_internal.h | 2 + lustre/mds/mds_open.c | 29 ++- lustre/mds/mds_reint.c | 24 ++- lustre/obdfilter/filter.c | 3 +- lustre/obdfilter/filter_lvb.c | 41 +---- lustre/osc/lproc_osc.c | 2 +- lustre/osc/osc_create.c | 9 +- lustre/osc/osc_internal.h | 7 - lustre/osc/osc_request.c | 29 ++- lustre/portals/archdep.m4 | 38 ++++ lustre/portals/include/portals/lib-types.h | 5 +- lustre/portals/include/portals/list.h | 14 +- lustre/ptlbd/blk.c | 2 +- lustre/ptlrpc/import.c | 41 ++--- lustre/ptlrpc/llog_net.c | 3 +- lustre/ptlrpc/niobuf.c | 2 +- lustre/tests/.RC_CURRENT.tag | 2 +- lustre/tests/.cvsignore | 2 + lustre/tests/Makefile.am | 3 +- lustre/tests/conf-sanity.sh | 29 +++ lustre/tests/ll_dirstripe_verify.c | 201 +++++++++++++++++++++ lustre/tests/open_delay.c | 2 +- lustre/tests/openclose.c | 2 +- lustre/tests/openfile.c | 2 + lustre/tests/recovery-small.sh | 78 +++++++- lustre/tests/replay-single.sh | 2 +- lustre/tests/sanity.sh | 58 +++++- lustre/tests/test-framework.sh | 12 ++ lustre/tests/write_append_truncate.c | 5 +- lustre/tests/write_disjoint.c | 33 ++-- lustre/utils/lconf | 17 +- lustre/utils/lfs.c | 12 +- lustre/utils/liblustreapi.c | 57 +++++- 76 files changed, 1115 insertions(+), 402 deletions(-) create mode 100644 lustre/include/lustre/Makefile.am create mode 100644 lustre/include/lustre/liblustreapi.h rename lustre/include/{linux => lustre}/lustre_user.h (90%) create mode 100644 lustre/tests/ll_dirstripe_verify.c diff --git a/lnet/archdep.m4 b/lnet/archdep.m4 index 65cfaff..e9eef5e 100644 --- a/lnet/archdep.m4 +++ b/lnet/archdep.m4 @@ -331,6 +331,9 @@ AC_SUBST(SCIMACNAL) CFLAGS="$KCFLAGS" CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac $with_ib" +if test $host_cpu == "lib" ; then +CPPFLAGS="$CPPFLAGS -fPIC -D_LARGEFILE64_SOURCE=1 -g" +fi AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) AC_SUBST(MOD_LINK) @@ -386,3 +389,38 @@ if test "$HAVE_DIO_FILE" != 0 ; then else AC_MSG_RESULT(no) fi + +# --- Check that ext3 and ext3 xattr are enabled in the kernel +if test "$host_cpu" != "lib" ; then + AC_MSG_CHECKING([that ext3 is enabled in the kernel]) + AC_TRY_COMPILE([ +#define __KERNEL__ +#include + ], + [ +#ifdef CONFIG_EXT3_FS + return 0; +#else +#error CONFIG_EXT3_FS not #defined +#endif + ],[AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)]) + ]) +# disable this check until our xattr patches define it! +# AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel]) +# AC_TRY_COMPILE([ +##define __KERNEL__ +##include +# ], +# [ +##ifdef CONFIG_EXT3_FS_XATTR +# return 0; +##else +##error CONFIG_EXT3_FS_XATTR not #defined +##endif +# ],[AC_MSG_RESULT([yes])], +# [AC_MSG_RESULT([no]) +# AC_MSG_ERROR([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR)]) +# ]) +fi diff --git a/lnet/include/lnet/lib-types.h b/lnet/include/lnet/lib-types.h index 904204b..d05d3fa 100644 --- a/lnet/include/lnet/lib-types.h +++ b/lnet/include/lnet/lib-types.h @@ -133,9 +133,8 @@ typedef struct { } lib_counters_t; /* temporary expedient: limit number of entries in discontiguous MDs */ -# define PTL_MTU (512<<10) -# define PTL_MD_MAX_IOV 128 -# define PTL_MD_MAX_PAGES min_t(int, PTL_MD_MAX_IOV, PTL_MTU / PAGE_SIZE) +#define PTL_MTU (512<<10) +#define PTL_MD_MAX_IOV 128 struct lib_msg_t { struct list_head msg_list; diff --git a/lnet/include/lnet/list.h b/lnet/include/lnet/list.h index 9cab047..37d9952 100644 --- a/lnet/include/lnet/list.h +++ b/lnet/include/lnet/list.h @@ -9,8 +9,6 @@ * using the generic single-entry routines. */ -#define prefetch(a) ((void)a) - struct list_head { struct list_head *next, *prev; }; @@ -194,8 +192,7 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each(pos, head) \ - for (pos = (head)->next, prefetch(pos->next); pos != (head); \ - pos = pos->next, prefetch(pos->next)) + for (pos = (head)->next ; pos != (head); pos = pos->next ) /** * list_for_each_prev - iterate over a list in reverse order @@ -203,8 +200,7 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ - for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ - pos = pos->prev, prefetch(pos->prev)) + for (pos = (head)->prev ; pos != (head); pos = pos->prev) /** * list_for_each_safe - iterate over a list safe against removal of list entry @@ -226,11 +222,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry(pos, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ &pos->member != (head); \ - pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + pos = list_entry(pos->member.next, typeof(*pos), member)) #endif #ifndef list_for_each_entry_safe diff --git a/lustre/ChangeLog b/lustre/ChangeLog index 7718b53..a0c33b6 100644 --- a/lustre/ChangeLog +++ b/lustre/ChangeLog @@ -2,10 +2,14 @@ tbd Cluster File Systems, Inc. * version 1.2.2 * bug fixes - don't copy lvb into (possibly NULL) reply on error (2983) + - don't deref dentry after dput, don't free lvb on error (2922) - use the kms to determine writeback rpc length (2947) + - increment oti_logcookies when osc is inactive (2948) - update client's i_blocks count via lvb messages (2543) - handle intent open/close of special files properly (1557) - mount MDS with errors=remount-ro, like obdfilter (2009) + * miscellania + - allow default OST striping configuration per directory (1414) 2004-03-22 Cluster File Systems, Inc. * version 1.2.1 diff --git a/lustre/configure.in b/lustre/configure.in index 4638e92..aec5d2e 100644 --- a/lustre/configure.in +++ b/lustre/configure.in @@ -67,7 +67,7 @@ if test x$enable_inkernel = xyes ; then sh -e -x -c '(cp -f $0.mk $0.in)' fi -AM_CONFIG_HEADER(portals/include/config.h) +AM_CONFIG_HEADER(include/config.h) AC_OUTPUT([Makefile lvfs/Makefile portals/Makefile portals/Kernelenv \ portals/libcfs/Makefile portals/portals/Makefile \ @@ -82,5 +82,6 @@ AC_OUTPUT([Makefile lvfs/Makefile portals/Makefile portals/Kernelenv \ cobd/Makefile ptlbd/Makefile conf/Makefile tests/Makefile \ utils/Makefile utils/Lustre/Makefile obdfilter/Makefile \ obdclass/Makefile smfs/Makefile snapfs/Makefile snapfs/utils/Makefile \ - include/Makefile include/linux/Makefile llite/Makefile doc/Makefile scripts/Makefile \ + include/Makefile include/linux/Makefile include/lustre/Makefile \ + llite/Makefile doc/Makefile scripts/Makefile \ scripts/lustre.spec]) diff --git a/lustre/include/Makefile.am b/lustre/include/Makefile.am index d532ab5..7c8201c 100644 --- a/lustre/include/Makefile.am +++ b/lustre/include/Makefile.am @@ -4,6 +4,6 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution -SUBDIRS = linux +SUBDIRS = linux lustre EXTRA_DIST = config.h.in ioctl.h liblustre.h include $(top_srcdir)/Rules diff --git a/lustre/include/config.h.in b/lustre/include/config.h.in index 14f0f3b..eca8fdd 100644 --- a/lustre/include/config.h.in +++ b/lustre/include/config.h.in @@ -1,10 +1,61 @@ -/* include/config.h.in. Generated automatically from configure.in by autoheader. */ +/* include/config.h.in. Generated from configure.in by autoheader. */ -/* Define if you have the `readline' library (-lreadline). */ -#undef HAVE_LIBREADLINE +/* Use the Pinger */ +#undef ENABLE_PINGER + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* IOCTL Buffer Size */ +#undef OBD_MAX_IOCTL_BUFFER /* Name of package */ #undef PACKAGE +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* The size of a `unsigned long long', as computed by sizeof. */ +#undef SIZEOF_UNSIGNED_LONG_LONG + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + /* Version number of package */ #undef VERSION diff --git a/lustre/include/liblustre.h b/lustre/include/liblustre.h index 064ac80..287f4f9 100644 --- a/lustre/include/liblustre.h +++ b/lustre/include/liblustre.h @@ -52,7 +52,7 @@ #define PAGE_SHIFT 12 #define PAGE_SIZE (1UL << PAGE_SHIFT) #define PAGE_MASK (~(PAGE_SIZE-1)) -#define loff_t __u64 +#define loff_t long long #define ERESTART 2001 typedef unsigned short umode_t; @@ -263,6 +263,8 @@ typedef int spinlock_t; typedef __u64 kdev_t; #define SPIN_LOCK_UNLOCKED 0 +#define LASSERT_SPIN_LOCKED(lock) do {} while(0) + static inline void spin_lock(spinlock_t *l) {return;} static inline void spin_unlock(spinlock_t *l) {return;} static inline void spin_lock_init(spinlock_t *l) {return;} diff --git a/lustre/include/linux/Makefile.am b/lustre/include/linux/Makefile.am index cd614f9..cb75fe5 100644 --- a/lustre/include/linux/Makefile.am +++ b/lustre/include/linux/Makefile.am @@ -3,9 +3,6 @@ # This code is issued under the GNU General Public License. # See the file COPYING in this distribution - -pkginclude_HEADERS = lustre_user.h - EXTRA_DIST = lprocfs_status.h lustre_debug.h lustre_ha.h lustre_lib.h \ lustre_mgmt.h obd_cache.h obd_lov.h lustre_dlm.h lustre_handles.h \ lustre_net.h obd_class.h obd_ost.h obd_support.h lustre_commit_confd.h \ diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 72804d1..39eaae3 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -68,7 +68,7 @@ #endif /* Defn's shared with user-space. */ -#include +#include /* * this file contains all data structures used in Lustre interfaces: @@ -379,6 +379,7 @@ struct lov_mds_md_v0 { /* LOV EA mds/wire data (little-endian) */ #define OBD_MD_FLIFID (0x02000000) /* ->ost write inline fid */ #define OBD_MD_FLEPOCH (0x04000000) /* ->ost write easize is epoch */ #define OBD_MD_FLGRANT (0x08000000) /* ost preallocation space grant */ +#define OBD_MD_FLDIREA (0x10000000) /* dir's extended attribute data */ #define OBD_MD_FLNOTOBD (~(OBD_MD_FLBLOCKS | OBD_MD_LINKNAME|\ OBD_MD_FLEASIZE | OBD_MD_FLHANDLE | OBD_MD_FLCKSUM|\ OBD_MD_FLQOS | OBD_MD_FLOSCOPQ | OBD_MD_FLCOOKIE)) diff --git a/lustre/include/linux/lustre_lite.h b/lustre/include/linux/lustre_lite.h index cd98fd1..1c66b53 100644 --- a/lustre/include/linux/lustre_lite.h +++ b/lustre/include/linux/lustre_lite.h @@ -147,6 +147,6 @@ enum { #include #endif /* __KERNEL__ */ -#include +#include #endif diff --git a/lustre/include/linux/lustre_net.h b/lustre/include/linux/lustre_net.h index 13ce57e..23e72f6 100644 --- a/lustre/include/linux/lustre_net.h +++ b/lustre/include/linux/lustre_net.h @@ -41,6 +41,28 @@ #include #include +/* Define some large-ish defaults for MTU and MAX_IOV if portals ones + * aren't defined (i.e. no limits) or too large */ +#if (defined(PTL_MTU) && (PTL_MTU <= (1 << 20))) +# define PTLRPC_MTU PTL_MTU +#else +# define PTLRPC_MTU (1 << 20) +#endif +#if (defined(PTL_MAX_IOV) && (PTL_MAX_IOV <= 512)) +# define PTLRPC_MAX_IOV PTL_MAX_IOV +#else +# define PTLRPC_MAX_IOV 512 +#endif + +/* Define consistent max bulk size/pages */ +#if (PTLRPC_MTU > PTLRPC_MAX_IOV * PAGE_SIZE) +# define PTLRPC_MAX_BRW_PAGES PTLRPC_MAX_IOV +# define PTLRPC_MAX_BRW_SIZE (PTLRPC_MAX_IOV * PAGE_SIZE) +#else +# define PTLRPC_MAX_BRW_PAGES (PTLRPC_MTU / PAGE_SIZE) +# define PTLRPC_MAX_BRW_SIZE PTLRPC_MTU +#endif + /* Size over which to OBD_VMALLOC() rather than OBD_ALLOC() service request * buffers */ #define SVC_BUF_VMALLOC_THRESHOLD (2*PAGE_SIZE) diff --git a/lustre/include/linux/obd.h b/lustre/include/linux/obd.h index d737760..b5d47f1 100644 --- a/lustre/include/linux/obd.h +++ b/lustre/include/linux/obd.h @@ -18,6 +18,7 @@ #define IOC_MDC_TYPE 'i' #define IOC_MDC_MIN_NR 20 #define IOC_MDC_LOOKUP _IOWR(IOC_MDC_TYPE, 20, struct obd_device *) +#define IOC_MDC_GETSTRIPE _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *) #define IOC_MDC_MAX_NR 50 #ifdef __KERNEL__ diff --git a/lustre/include/lustre/Makefile.am b/lustre/include/lustre/Makefile.am new file mode 100644 index 0000000..377bef6 --- /dev/null +++ b/lustre/include/lustre/Makefile.am @@ -0,0 +1,7 @@ +# Copyright (C) 2001 Cluster File Systems, Inc. +# +# This code is issued under the GNU General Public License. +# See the file COPYING in this distribution + + +pkginclude_HEADERS = lustre_user.h liblustreapi.h diff --git a/lustre/include/lustre/liblustreapi.h b/lustre/include/lustre/liblustreapi.h new file mode 100644 index 0000000..9f890a7 --- /dev/null +++ b/lustre/include/lustre/liblustreapi.h @@ -0,0 +1,39 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * Copyright (C) 2002 Cluster File Systems, Inc. + * Author: Peter J. Braam + * Author: Phil Schwan + * Author: Brian Behlendorf + * Author: Robert Read + * + * This file is part of Lustre, http://www.lustre.org. + * + * Lustre is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * Lustre is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Lustre; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * + */ +#ifndef _LIBLUSTREAPI_H_ +#define _LIBLUSTREAPI_H_ + +/* liblustreapi.c */ +int op_create_file(char *name, long stripe_size, int stripe_offset, + int stripe_count); +int op_find(char *path, struct obd_uuid *obduuid, int recursive, + int verbose, int quiet); +int op_check(int type_num, char **obd_type_p, char *dir); +int op_catinfo(char *dir, char *keyword, char *node_name); + + + +#endif diff --git a/lustre/include/linux/lustre_user.h b/lustre/include/lustre/lustre_user.h similarity index 90% rename from lustre/include/linux/lustre_user.h rename to lustre/include/lustre/lustre_user.h index 9866acf..ad55e05 100644 --- a/lustre/include/linux/lustre_user.h +++ b/lustre/include/lustre/lustre_user.h @@ -25,9 +25,6 @@ #define _LUSTRE_USER_H #include -#define IOC_MDC_TYPE 'i' -#define IOC_MDC_GETSTRIPE _IOWR(IOC_MDC_TYPE, 21, struct lov_mds_md *) - #define LL_IOC_GETFLAGS _IOR ('f', 151, long) #define LL_IOC_SETFLAGS _IOW ('f', 152, long) #define LL_IOC_CLRFLAGS _IOW ('f', 153, long) @@ -35,10 +32,13 @@ #define LL_IOC_LOV_GETSTRIPE _IOW ('f', 155, long) #define LL_IOC_LOV_SETEA _IOW ('f', 156, long) #define LL_IOC_RECREATE_OBJ _IOW ('f', 157, long) +#define LL_IOC_GROUP_LOCK _IOW ('f', 158, long) +#define LL_IOC_GROUP_UNLOCK _IOW ('f', 159, long) #define O_LOV_DELAY_CREATE 0100000000 /* hopefully this does not conflict */ #define LL_FILE_IGNORE_LOCK 0x00000001 +#define LL_FILE_GROUP_LOCKED 0x00000002 #define LOV_USER_MAGIC_V1 0x0BD10BD0 #define LOV_USER_MAGIC LOV_USER_MAGIC_V1 @@ -68,8 +68,4 @@ struct lov_user_md_v1 { /* LOV EA user data (host-endian) */ struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */ } __attribute__((packed)); -extern int op_create_file(char *name, long stripe_size, int stripe_offset, - int stripe_count); -extern int get_file_stripe(char *path, struct lov_user_md *lum); - #endif /* _LUSTRE_USER_H */ diff --git a/lustre/kernel_patches/patches/linux-2.4.19-pre1-xattr-0.8.54.patch b/lustre/kernel_patches/patches/linux-2.4.19-pre1-xattr-0.8.54.patch index 4107e70..4cf7592 100644 --- a/lustre/kernel_patches/patches/linux-2.4.19-pre1-xattr-0.8.54.patch +++ b/lustre/kernel_patches/patches/linux-2.4.19-pre1-xattr-0.8.54.patch @@ -156,7 +156,7 @@ Index: linux-2.4.19-pre1/arch/alpha/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -195,7 +195,7 @@ Index: linux-2.4.19-pre1/arch/arm/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -240,7 +240,7 @@ Index: linux-2.4.19-pre1/arch/i386/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -293,7 +293,7 @@ Index: linux-2.4.19-pre1/arch/ia64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -346,7 +346,7 @@ Index: linux-2.4.19-pre1/arch/m68k/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -364,7 +364,7 @@ Index: linux-2.4.19-pre1/arch/mips/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -382,7 +382,7 @@ Index: linux-2.4.19-pre1/arch/mips64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -396,18 +396,11 @@ Index: linux-2.4.19-pre1/arch/ppc/defconfig =================================================================== --- linux-2.4.19-pre1.orig/arch/ppc/defconfig 2004-01-14 01:10:36.000000000 +0300 +++ linux-2.4.19-pre1/arch/ppc/defconfig 2004-01-14 01:11:49.000000000 +0300 -@@ -1,6 +1,20 @@ +@@ -1,6 +1,13 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set -+# CONFIG_EXT3_FS_XATTR_SHARING is not set -+# CONFIG_EXT3_FS_XATTR_USER is not set -+# CONFIG_EXT2_FS_XATTR is not set -+# CONFIG_EXT2_FS_XATTR_SHARING is not set -+# CONFIG_EXT2_FS_XATTR_USER is not set -+# CONFIG_FS_MBCACHE is not set -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -425,7 +418,7 @@ Index: linux-2.4.19-pre1/arch/s390/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -469,7 +462,7 @@ Index: linux-2.4.19-pre1/arch/s390x/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -613,7 +606,7 @@ Index: linux-2.4.19-pre1/arch/sparc/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -652,7 +645,7 @@ Index: linux-2.4.19-pre1/arch/sparc64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-chaos.patch b/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-chaos.patch index 8c4da0b..811c40f 100644 --- a/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-chaos.patch +++ b/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-chaos.patch @@ -150,7 +150,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -187,7 +187,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -236,7 +236,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -252,7 +252,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -268,7 +268,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -284,7 +284,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -300,7 +300,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -312,18 +312,11 @@ CONFIG_MIPS64=y --- kernel-2.4.20-6chaos_18_7/arch/ppc/defconfig~linux-2.4.20-xattr-0.8.54-chaos 2003-05-15 21:12:20.000000000 -0600 +++ kernel-2.4.20-6chaos_18_7-braam/arch/ppc/defconfig 2003-07-12 15:34:44.000000000 -0600 -@@ -1,6 +1,20 @@ +@@ -1,6 +1,13 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set -+# CONFIG_EXT3_FS_XATTR_SHARING is not set -+# CONFIG_EXT3_FS_XATTR_USER is not set -+# CONFIG_EXT2_FS_XATTR is not set -+# CONFIG_EXT2_FS_XATTR_SHARING is not set -+# CONFIG_EXT2_FS_XATTR_USER is not set -+# CONFIG_FS_MBCACHE is not set -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -357,7 +350,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -406,7 +399,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -553,7 +546,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -588,7 +581,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-hp.patch b/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-hp.patch index ad36c0f..c9fb126 100644 --- a/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-hp.patch +++ b/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54-hp.patch @@ -125,7 +125,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54.patch b/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54.patch index 152e89a..2e4750b 100644 --- a/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54.patch +++ b/lustre/kernel_patches/patches/linux-2.4.20-xattr-0.8.54.patch @@ -152,7 +152,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -189,7 +189,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -238,7 +238,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -254,7 +254,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -303,7 +303,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -319,7 +319,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -335,7 +335,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -347,18 +347,11 @@ CONFIG_MIPS64=y --- linux-2.4.20/arch/ppc/defconfig~linux-2.4.20-xattr-0.8.54 2002-11-29 07:53:11.000000000 +0800 +++ linux-2.4.20-root/arch/ppc/defconfig 2003-05-07 18:08:03.000000000 +0800 -@@ -1,6 +1,20 @@ +@@ -1,6 +1,13 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set -+# CONFIG_EXT3_FS_XATTR_SHARING is not set -+# CONFIG_EXT3_FS_XATTR_USER is not set -+# CONFIG_EXT2_FS_XATTR is not set -+# CONFIG_EXT2_FS_XATTR_SHARING is not set -+# CONFIG_EXT2_FS_XATTR_USER is not set -+# CONFIG_FS_MBCACHE is not set -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -392,7 +385,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -441,7 +434,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -588,7 +581,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -623,7 +616,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/kernel_patches/patches/linux-2.4.21-xattr-0.8.54-suse.patch b/lustre/kernel_patches/patches/linux-2.4.21-xattr-0.8.54-suse.patch index 9318fc1..22dad3c 100644 --- a/lustre/kernel_patches/patches/linux-2.4.21-xattr-0.8.54-suse.patch +++ b/lustre/kernel_patches/patches/linux-2.4.21-xattr-0.8.54-suse.patch @@ -152,7 +152,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -189,7 +189,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -238,7 +238,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -254,7 +254,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -270,7 +270,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -286,7 +286,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -302,7 +302,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -318,7 +318,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -367,7 +367,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -514,7 +514,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/kernel_patches/patches/linux-2.4.22-xattr-0.8.54.patch b/lustre/kernel_patches/patches/linux-2.4.22-xattr-0.8.54.patch index 937aa40..b63cc2e 100644 --- a/lustre/kernel_patches/patches/linux-2.4.22-xattr-0.8.54.patch +++ b/lustre/kernel_patches/patches/linux-2.4.22-xattr-0.8.54.patch @@ -156,7 +156,7 @@ Index: linux-2.4.22-vanilla/arch/alpha/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -197,7 +197,7 @@ Index: linux-2.4.22-vanilla/arch/arm/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -250,7 +250,7 @@ Index: linux-2.4.22-vanilla/arch/i386/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -268,7 +268,7 @@ Index: linux-2.4.22-vanilla/arch/ia64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -286,7 +286,7 @@ Index: linux-2.4.22-vanilla/arch/m68k/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -304,7 +304,7 @@ Index: linux-2.4.22-vanilla/arch/mips/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -322,7 +322,7 @@ Index: linux-2.4.22-vanilla/arch/mips64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -340,7 +340,7 @@ Index: linux-2.4.22-vanilla/arch/s390/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -393,7 +393,7 @@ Index: linux-2.4.22-vanilla/arch/s390x/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -549,7 +549,7 @@ Index: linux-2.4.22-vanilla/arch/sparc64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/kernel_patches/patches/linux-2.4.24-xattr-0.8.54.patch b/lustre/kernel_patches/patches/linux-2.4.24-xattr-0.8.54.patch index 144ff3f..0109dd9 100644 --- a/lustre/kernel_patches/patches/linux-2.4.24-xattr-0.8.54.patch +++ b/lustre/kernel_patches/patches/linux-2.4.24-xattr-0.8.54.patch @@ -156,7 +156,7 @@ Index: linux-2.4.24-vanilla/arch/alpha/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -197,7 +197,7 @@ Index: linux-2.4.24-vanilla/arch/arm/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -250,7 +250,7 @@ Index: linux-2.4.24-vanilla/arch/i386/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -268,7 +268,7 @@ Index: linux-2.4.24-vanilla/arch/ia64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -286,7 +286,7 @@ Index: linux-2.4.24-vanilla/arch/m68k/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -304,7 +304,7 @@ Index: linux-2.4.24-vanilla/arch/mips/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -322,7 +322,7 @@ Index: linux-2.4.24-vanilla/arch/mips64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -340,7 +340,7 @@ Index: linux-2.4.24-vanilla/arch/s390/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -393,7 +393,7 @@ Index: linux-2.4.24-vanilla/arch/s390x/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -549,7 +549,7 @@ Index: linux-2.4.24-vanilla/arch/sparc64/defconfig # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/kernel_patches/patches/xattr-0.8.54-2.4.22-rh.patch b/lustre/kernel_patches/patches/xattr-0.8.54-2.4.22-rh.patch index a213a48..9d6bc19 100644 --- a/lustre/kernel_patches/patches/xattr-0.8.54-2.4.22-rh.patch +++ b/lustre/kernel_patches/patches/xattr-0.8.54-2.4.22-rh.patch @@ -64,7 +64,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -101,7 +101,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -150,7 +150,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -166,7 +166,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -182,7 +182,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -198,7 +198,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -214,7 +214,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -244,18 +244,11 @@ .llong .sys_perfmonctl /* Put this here for now ... */ --- linux-2.4.22-ac1/arch/ppc/defconfig~xattr-0.8.54-2.4.22-rh 2003-06-13 18:51:31.000000000 +0400 +++ linux-2.4.22-ac1-alexey/arch/ppc/defconfig 2003-09-25 23:57:02.000000000 +0400 -@@ -1,6 +1,20 @@ +@@ -1,6 +1,13 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set -+# CONFIG_EXT3_FS_XATTR_SHARING is not set -+# CONFIG_EXT3_FS_XATTR_USER is not set -+# CONFIG_EXT2_FS_XATTR is not set -+# CONFIG_EXT2_FS_XATTR_SHARING is not set -+# CONFIG_EXT2_FS_XATTR_USER is not set -+# CONFIG_FS_MBCACHE is not set -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -271,7 +264,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -320,7 +313,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -468,7 +461,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set @@ -484,7 +477,7 @@ # # Automatically generated make config: don't edit # -+# CONFIG_EXT3_FS_XATTR is not set ++CONFIG_EXT3_FS_XATTR=y +# CONFIG_EXT3_FS_XATTR_SHARING is not set +# CONFIG_EXT3_FS_XATTR_USER is not set +# CONFIG_EXT2_FS_XATTR is not set diff --git a/lustre/ldlm/l_lock.c b/lustre/ldlm/l_lock.c index d1f8c56..f9c5592 100644 --- a/lustre/ldlm/l_lock.c +++ b/lustre/ldlm/l_lock.c @@ -133,6 +133,8 @@ void l_check_no_ns_lock(struct ldlm_namespace *ns) #else void l_check_no_ns_lock(struct ldlm_namespace *ns) { -#warning "FIXME: check lock in user space??" + if (l_has_lock(&ns->ns_lock)) { + CERROR("namespace %s lock held illegally; tell phil\n", + ns->ns_name); } #endif /* __KERNEL__ */ diff --git a/lustre/ldlm/ldlm_internal.h b/lustre/ldlm/ldlm_internal.h index 4111cbe..edee657 100644 --- a/lustre/ldlm/ldlm_internal.h +++ b/lustre/ldlm/ldlm_internal.h @@ -1,5 +1,10 @@ /* ldlm_request.c */ -int ldlm_cancel_lru(struct ldlm_namespace *ns); +typedef enum { + LDLM_ASYNC, + LDLM_SYNC, +} ldlm_sync_t; + +int ldlm_cancel_lru(struct ldlm_namespace *ns, ldlm_sync_t sync); /* ldlm_lock.c */ void ldlm_grant_lock(struct ldlm_lock *lock, void *data, int datalen, @@ -22,6 +27,8 @@ int ldlm_run_ast_work(struct ldlm_namespace *, struct list_head *rpc_list); /* ldlm_lockd.c */ int ldlm_bl_to_thread(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld, struct ldlm_lock *lock); +void ldlm_handle_bl_callback(struct ldlm_namespace *ns, + struct ldlm_lock_desc *ld, struct ldlm_lock *lock); /* ldlm_plain.c */ int ldlm_process_plain_lock(struct ldlm_lock *lock, int *flags, int first_enq, diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 0d514db..02ad9f6 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -108,7 +108,7 @@ int client_obd_setup(struct obd_device *obddev, obd_count len, void *buf) spin_lock_init(&cli->cl_write_rpc_hist.oh_lock); spin_lock_init(&cli->cl_read_page_hist.oh_lock); spin_lock_init(&cli->cl_write_page_hist.oh_lock); - cli->cl_max_pages_per_rpc = PTL_MD_MAX_PAGES; + cli->cl_max_pages_per_rpc = PTLRPC_MAX_BRW_PAGES; cli->cl_max_rpcs_in_flight = OSC_MAX_RIF_DEFAULT; ldlm_get_ref(); diff --git a/lustre/ldlm/ldlm_lock.c b/lustre/ldlm/ldlm_lock.c index 7ae1295..ec55510 100644 --- a/lustre/ldlm/ldlm_lock.c +++ b/lustre/ldlm/ldlm_lock.c @@ -186,6 +186,7 @@ void ldlm_lock_destroy(struct ldlm_lock *lock) } if (!list_empty(&lock->l_res_link)) { + LDLM_ERROR(lock, "lock still on resource"); ldlm_lock_dump(D_ERROR, lock, 0); LBUG(); } @@ -477,8 +478,13 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) LDLM_LOCK_GET(lock); /* dropped by bl thread */ ldlm_lock_remove_from_lru(lock); +#ifdef __KERNEL__ ldlm_bl_to_thread(ns, NULL, lock); l_unlock(&ns->ns_lock); +#else + l_unlock(&ns->ns_lock); + ldlm_handle_bl_callback(ns, NULL, lock); +#endif } else if (ns->ns_client == LDLM_NAMESPACE_CLIENT && !lock->l_readers && !lock->l_writers) { /* If this is a client-side namespace and this was the last @@ -488,7 +494,7 @@ void ldlm_lock_decref_internal(struct ldlm_lock *lock, __u32 mode) list_add_tail(&lock->l_lru, &ns->ns_unused_list); ns->ns_nr_unused++; l_unlock(&ns->ns_lock); - ldlm_cancel_lru(ns); + ldlm_cancel_lru(ns, LDLM_ASYNC); } else { l_unlock(&ns->ns_lock); } diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index b456ff6..964af8d 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -794,9 +794,8 @@ int ldlm_handle_cancel(struct ptlrpc_request *req) RETURN(0); } -static void ldlm_handle_bl_callback(struct ldlm_namespace *ns, - struct ldlm_lock_desc *ld, - struct ldlm_lock *lock) +void ldlm_handle_bl_callback(struct ldlm_namespace *ns, + struct ldlm_lock_desc *ld, struct ldlm_lock *lock) { int do_ast; ENTRY; @@ -942,10 +941,10 @@ static int ldlm_callback_reply(struct ptlrpc_request *req, int rc) return ptlrpc_reply(req); } -#ifdef __KERNEL__ int ldlm_bl_to_thread(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld, struct ldlm_lock *lock) { +#ifdef __KERNEL__ struct ldlm_bl_pool *blp = ldlm_state->ldlm_bl_pool; struct ldlm_bl_work_item *blwi; ENTRY; @@ -963,10 +962,12 @@ int ldlm_bl_to_thread(struct ldlm_namespace *ns, struct ldlm_lock_desc *ld, list_add_tail(&blwi->blwi_entry, &blp->blp_list); wake_up(&blp->blp_waitq); spin_unlock(&blp->blp_lock); +#else + LBUG(); +#endif RETURN(0); } -#endif static int ldlm_callback_handler(struct ptlrpc_request *req) { diff --git a/lustre/ldlm/ldlm_request.c b/lustre/ldlm/ldlm_request.c index a996da6..bb1b32e 100644 --- a/lustre/ldlm/ldlm_request.c +++ b/lustre/ldlm/ldlm_request.c @@ -583,10 +583,16 @@ int ldlm_cli_cancel(struct lustre_handle *lockh) return rc; } -int ldlm_cancel_lru(struct ldlm_namespace *ns) +/* when called with LDLM_ASYNC the blocking callback will be handled + * in a thread and this function will return after the thread has been + * asked to call the callback. when called with LDLM_SYNC the blocking + * callback will be performed in this function. */ +int ldlm_cancel_lru(struct ldlm_namespace *ns, ldlm_sync_t sync) { struct list_head *tmp, *next; + struct ldlm_lock *lock; int count, rc = 0; + LIST_HEAD(cblist); ENTRY; l_lock(&ns->ns_lock); @@ -598,7 +604,7 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns) } list_for_each_safe(tmp, next, &ns->ns_unused_list) { - struct ldlm_lock *lock; + lock = list_entry(tmp, struct ldlm_lock, l_lru); LASSERT(!lock->l_readers && !lock->l_writers); @@ -612,12 +618,21 @@ int ldlm_cancel_lru(struct ldlm_namespace *ns) LDLM_LOCK_GET(lock); /* dropped by bl thread */ ldlm_lock_remove_from_lru(lock); - ldlm_bl_to_thread(ns, NULL, lock); + if (sync == LDLM_ASYNC) + ldlm_bl_to_thread(ns, NULL, lock); + else + list_add(&lock->l_lru, &cblist); if (--count == 0) break; } l_unlock(&ns->ns_lock); + + list_for_each_safe(tmp, next, &cblist) { + lock = list_entry(tmp, struct ldlm_lock, l_lru); + list_del_init(&lock->l_lru); + ldlm_handle_bl_callback(ns, NULL, lock); + } RETURN(rc); } diff --git a/lustre/ldlm/ldlm_resource.c b/lustre/ldlm/ldlm_resource.c index 80545d0..ad953e4 100644 --- a/lustre/ldlm/ldlm_resource.c +++ b/lustre/ldlm/ldlm_resource.c @@ -148,7 +148,7 @@ static int lprocfs_write_lru_size(struct file *file, const char *buffer, ns->ns_name); tmp = ns->ns_max_unused; ns->ns_max_unused = 0; - ldlm_cancel_lru(ns); + ldlm_cancel_lru(ns, LDLM_SYNC); ns->ns_max_unused = tmp; return count; } @@ -158,7 +158,7 @@ static int lprocfs_write_lru_size(struct file *file, const char *buffer, ns->ns_name, ns->ns_max_unused, (unsigned int)tmp); ns->ns_max_unused = (unsigned int)tmp; - ldlm_cancel_lru(ns); + ldlm_cancel_lru(ns, LDLM_ASYNC); return count; } diff --git a/lustre/liblustre/Makefile.am b/lustre/liblustre/Makefile.am index 6622485..438ebb4 100644 --- a/lustre/liblustre/Makefile.am +++ b/lustre/liblustre/Makefile.am @@ -3,44 +3,40 @@ DEFS= SUBDIRS = . tests -CFLAGS := -g -Wall -I$(top_srcdir)/utils -I$(top_srcdir)/portals/include \ - -I$(top_srcdir)/portals/unals -I$(SYSIO)/include +LL_CFLAGS = -I$(SYSIO)/include -CPPFLAGS = $(HAVE_EFENCE) -D_LARGEFILE64_SOURCE=1 LIBS = $(LIBEFENCE) LUSTRE_LIBS = libllite.a \ - $(top_srcdir)/lov/liblov.a \ - $(top_srcdir)/obdecho/libobdecho.a \ - $(top_srcdir)/osc/libosc.a \ - $(top_srcdir)/mdc/libmdc.a \ - $(top_srcdir)/ptlrpc/libptlrpc.a \ - $(top_srcdir)/obdclass/liblustreclass.a \ - $(top_srcdir)/lvfs/liblvfs.a - -PTL_LIBS = $(top_srcdir)/portals/utils/libuptlctl.a \ - $(top_srcdir)/portals/unals/libtcpnal.a \ - $(top_srcdir)/portals/portals/libportals.a - -SYSIO_LIBS = $(SYSIO)/drivers/native/libsysio_native.a \ - $(SYSIO)/drivers/sockets/libsysio_sockets.a \ - $(SYSIO)/src/libsysio.a \ - $(SYSIO)/dev/stdfd/libsysio_stdfd.a - -#SYSIO_LIBS = $(SYSIO)/lib/libsysio.a + $(top_builddir)/lov/liblov.a \ + $(top_builddir)/obdecho/libobdecho.a \ + $(top_builddir)/osc/libosc.a \ + $(top_builddir)/mdc/libmdc.a \ + $(top_builddir)/ptlrpc/libptlrpc.a \ + $(top_builddir)/obdclass/liblustreclass.a \ + $(top_builddir)/lvfs/liblvfs.a + +PTL_LIBS = $(top_builddir)/portals/utils/libuptlctl.a \ + $(top_builddir)/portals/unals/libtcpnal.a \ + $(top_builddir)/portals/portals/libportals.a + +SYSIO_LIBS = $(SYSIO)/drivers/native/libsysio_native.a \ + $(SYSIO)/drivers/sockets/libsysio_sockets.a \ + $(SYSIO)/src/libsysio.a \ + $(SYSIO)/dev/stdfd/libsysio_stdfd.a lib_LIBRARIES = liblustre.a noinst_LIBRARIES = libllite.a libllite_a_SOURCES = llite_lib.c super.c namei.c rw.c file.c dir.c -libllite_a_CFLAGS = -fPIC +libllite_a_CFLAGS = $(LL_CFLAGS) # for make rpms -- need cleanup liblustre_a_SOURCES = llite_lib.c super.c namei.c rw.c file.c dir.c -liblustre_a_CFLAGS = -fPIC +liblustre_a_CFLAGS = $(LL_CFLAGS) liblustre.a : $(LUSTRE_LIBS) $(PTL_LIBS) $(SYSIO_LIBS) - $(shell ./genlib.sh $(SYSIO) $(AR) $(LINK)) + $(shell $(top_srcdir)/liblustre/genlib.sh $(SYSIO) $(AR) $(LINK)) include $(top_srcdir)/Rules diff --git a/lustre/liblustre/rw.c b/lustre/liblustre/rw.c index 71fe4e9..1894e79 100644 --- a/lustre/liblustre/rw.c +++ b/lustre/liblustre/rw.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -89,12 +90,17 @@ static int llu_extent_lock_callback(struct ldlm_lock *lock, CERROR("ldlm_cli_cancel failed: %d\n", rc); break; case LDLM_CB_CANCELING: { - struct inode *inode = llu_inode_from_lock(lock); + struct inode *inode; struct llu_inode_info *lli; struct lov_stripe_md *lsm; __u32 stripe; __u64 kms; + /* This lock wasn't granted, don't try to evict pages */ + if (lock->l_req_mode != lock->l_granted_mode) + RETURN(0); + + inode = llu_inode_from_lock(lock); if (!inode) RETURN(0); lli= llu_i2info(inode); @@ -126,59 +132,44 @@ static int llu_glimpse_callback(struct ldlm_lock *lock, void *reqp) { struct ptlrpc_request *req = reqp; struct inode *inode = llu_inode_from_lock(lock); - struct obd_export *exp; struct llu_inode_info *lli; struct ost_lvb *lvb; - struct { - int stripe_number; - __u64 size; - struct lov_stripe_md *lsm; - } data; - __u32 vallen = sizeof(data); - int rc, size = sizeof(*lvb); + int rc, size = sizeof(*lvb), stripe = 0; ENTRY; if (inode == NULL) - RETURN(0); + GOTO(out, rc = -ELDLM_NO_LOCK_DATA); lli = llu_i2info(inode); if (lli == NULL) - goto iput; + GOTO(iput, rc = -ELDLM_NO_LOCK_DATA); if (lli->lli_smd == NULL) - goto iput; - exp = llu_i2obdexp(inode); + GOTO(iput, rc = -ELDLM_NO_LOCK_DATA); /* First, find out which stripe index this lock corresponds to. */ if (lli->lli_smd->lsm_stripe_count > 1) - data.stripe_number = llu_lock_to_stripe_offset(inode, lock); - else - data.stripe_number = 0; - - data.size = lli->lli_st_size; - data.lsm = lli->lli_smd; - - rc = obd_get_info(exp, strlen("size_to_stripe"), "size_to_stripe", - &vallen, &data); - if (rc != 0) { - CERROR("obd_get_info: rc = %d\n", rc); - LBUG(); - } - - LDLM_DEBUG(lock, "i_size: %Lu -> stripe number %d -> size %Lu", - lli->lli_st_size, data.stripe_number, data.size); + stripe = llu_lock_to_stripe_offset(inode, lock); rc = lustre_pack_reply(req, 1, &size, NULL); if (rc) { CERROR("lustre_pack_reply: %d\n", rc); - goto iput; + GOTO(iput, rc); } lvb = lustre_msg_buf(req->rq_repmsg, 0, sizeof(*lvb)); - lvb->lvb_size = data.size; - ptlrpc_reply(req); + lvb->lvb_size = lli->lli_smd->lsm_oinfo[stripe].loi_kms; + LDLM_DEBUG(lock, "i_size: %llu -> stripe number %u -> kms "LPU64, + lli->lli_st_size, stripe, lvb->lvb_size); iput: I_RELE(inode); - RETURN(0); + out: + /* These errors are normal races, so we don't want to fill the console + * with messages by calling ptlrpc_error() */ + if (rc == -ELDLM_NO_LOCK_DATA) + lustre_pack_reply(req, 0, NULL, NULL); + + req->rq_status = rc; + return rc; } __u64 lov_merge_size(struct lov_stripe_md *lsm, int kms); diff --git a/lustre/liblustre/tests/Makefile.am b/lustre/liblustre/tests/Makefile.am index 150678a..813c5e9 100644 --- a/lustre/liblustre/tests/Makefile.am +++ b/lustre/liblustre/tests/Makefile.am @@ -1,14 +1,7 @@ ## Liblustre excecutables & libraries Makefile DEFS= -CFLAGS := -g -Wall -I$(top_srcdir)/utils -I$(top_srcdir)/portals/include \ - -I$(top_srcdir)/portals/unals -I$(SYSIO)/include \ - -I/opt/lam/include -L/opt/lam/lib - -KFLAGS:= -CPPFLAGS = $(HAVE_EFENCE) -D_LARGEFILE64_SOURCE=1 -LIBS = $(LIBEFENCE) - +LL_CFLAGS = -I$(SYSIO)/include LLIB_EXEC= ../liblustre.a -lpthread @@ -24,27 +17,33 @@ bin_PROGRAMS = $(def_tests) endif echo_test_SOURCES = echo_test.c ../../utils/parser.c ../../utils/obd.c ../../utils/lustre_cfg.c +echo_test_CFLAGS = $(LL_CFLAGS) echo_test_LDADD = ../liblsupport.a $(LIBREADLINE) -lpthread -echo_test_DEPENDENCIES=$(top_srcdir)/liblustre/liblsupport.a +echo_test_DEPENDENCIES=$(top_builddir)/liblustre/liblsupport.a sanity_SOURCES = sanity.c +sanity_CFLAGS = $(LL_CFLAGS) sanity_LDADD := ./libtestcommon.a $(LLIB_EXEC) -sanity_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a ./libtestcommon.a +sanity_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a ./libtestcommon.a recovery_small_SOURCES = recovery_small.c +recovery_small_CFLAGS = $(LL_CFLAGS) recovery_small_LDADD := ./libtestcommon.a $(LLIB_EXEC) -recovery_small_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a +recovery_small_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a replay_single_SOURCES = replay_single.c +replay_single_CFLAGS = $(LL_CFLAGS) replay_single_LDADD := ./libtestcommon.a $(LLIB_EXEC) -replay_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a +replay_single_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a replay_ost_single_SOURCES = replay_ost_single.c +replay_ost_single_CFLAGS = $(LL_CFLAGS) replay_ost_single_LDADD := ./libtestcommon.a $(LLIB_EXEC) -replay_ost_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a +replay_ost_single_DEPENDENCIES = $(top_builddir)/liblustre/liblustre.a if MPITESTS test_lock_cancel_SOURCES = test_lock_cancel.c +test_lock_cancel_CFLAGS = $(LL_CFLAGS) -I/opt/lam/include -L/opt/lam/lib test_lock_cancel_LDADD := $(LLIB_EXEC) -lmpi -llam endif diff --git a/lustre/llite/dir.c b/lustre/llite/dir.c index 3f945a7..97fbf99 100644 --- a/lustre/llite/dir.c +++ b/lustre/llite/dir.c @@ -423,9 +423,79 @@ static int ll_dir_ioctl(struct inode *inode, struct file *file, obd_ioctl_freedata(buf, len); return rc; } - case LL_IOC_LOV_SETSTRIPE: - case LL_IOC_LOV_GETSTRIPE: - RETURN(-ENOTTY); + case LL_IOC_LOV_SETSTRIPE: { + struct ptlrpc_request *request = NULL; + struct mdc_op_data op_data; + struct iattr attr; + struct lov_user_md lum, *lump = (struct lov_user_md *)arg; + int rc = 0; + + ll_prepare_mdc_op_data(&op_data, inode, NULL, NULL, 0, 0); + + memset(&attr, 0x0, sizeof(attr)); + + LASSERT(sizeof(lum) == sizeof(*lump)); + LASSERT(sizeof(lum.lmm_objects[0]) + == sizeof(lump->lmm_objects[0])); + rc = copy_from_user(&lum, lump, sizeof(lum)); + if (rc) + return(-EFAULT); + + if (lum.lmm_magic != LOV_USER_MAGIC) + RETURN(-EINVAL); + + rc = mdc_setattr(sbi->ll_mdc_exp, &op_data, + &attr, &lum, sizeof(lum), NULL, 0, &request); + if (rc) { + ptlrpc_req_finished(request); + if (rc != -EPERM && rc != -EACCES) + CERROR("mdc_setattr fails: rc = %d\n", rc); + return rc; + } + ptlrpc_req_finished(request); + + return rc; + } + case LL_IOC_LOV_GETSTRIPE: { + struct ptlrpc_request *request = NULL; + struct lov_user_md *lump = (struct lov_user_md *)arg; + struct lov_mds_md *lmm; + struct ll_fid fid; + struct mds_body *body; + unsigned long valid = 0; + int rc, lmmsize; + + valid |= OBD_MD_FLDIREA; + + ll_inode2fid(&fid, inode); + rc = mdc_getattr(sbi->ll_mdc_exp, &fid, valid, + obd_size_diskmd(sbi->ll_osc_exp, NULL), + &request); + if (rc < 0) { + CDEBUG(D_INFO, "mdc_getattr failed: rc = %d\n", rc); + RETURN(rc); + } + + body = lustre_msg_buf(request->rq_repmsg, 0, sizeof(*body)); + LASSERT(body != NULL); /* checked by mdc_getattr_name */ + LASSERT_REPSWABBED(request, 0);/* swabbed by mdc_getattr_name */ + + lmmsize = body->eadatasize; + if (lmmsize == 0) + GOTO(out_get, rc = -ENODATA); + + lmm = lustre_msg_buf(request->rq_repmsg, 1, lmmsize); + LASSERT(lmm != NULL); + LASSERT_REPSWABBED(request, 1); + rc = copy_to_user(lump, lmm, lmmsize); + if (rc) + GOTO(out_get, rc = -EFAULT); + + EXIT; + out_get: + ptlrpc_req_finished(request); + RETURN(rc); + } case IOC_MDC_GETSTRIPE: { struct ptlrpc_request *request = NULL; struct ll_fid fid; diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index 8059325..89dcec9 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -24,6 +24,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include +#include #include #include diff --git a/lustre/llite/rw.c b/lustre/llite/rw.c index 338197c..e5a7c1e 100644 --- a/lustre/llite/rw.c +++ b/lustre/llite/rw.c @@ -615,7 +615,7 @@ static int ll_issue_page_read(struct obd_export *exp, RETURN(rc); } -#define LL_RA_MIN(inode) ((unsigned long)PTL_MD_MAX_PAGES / 2) +#define LL_RA_MIN(inode) ((unsigned long)PTLRPC_MAX_BRW_PAGES / 2) #define LL_RA_MAX(inode) ((ll_i2info(inode)->lli_smd->lsm_xfersize * 3) >> \ PAGE_CACHE_SHIFT) diff --git a/lustre/llite/super.c b/lustre/llite/super.c index 57ceb3f..e248be7 100644 --- a/lustre/llite/super.c +++ b/lustre/llite/super.c @@ -24,6 +24,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include +#include #include #include #include diff --git a/lustre/llite/super25.c b/lustre/llite/super25.c index ee340b9..526776b 100644 --- a/lustre/llite/super25.c +++ b/lustre/llite/super25.c @@ -24,6 +24,7 @@ #define DEBUG_SUBSYSTEM S_LLITE #include +#include #include #include #include diff --git a/lustre/lov/lov_internal.h b/lustre/lov/lov_internal.h index aa04e4e..cefe534 100644 --- a/lustre/lov/lov_internal.h +++ b/lustre/lov/lov_internal.h @@ -10,7 +10,7 @@ #ifndef LOV_INTERNAL_H #define LOV_INTERNAL_H -#include +#include #define LAP_MAGIC 8200 diff --git a/lustre/lov/lov_obd.c b/lustre/lov/lov_obd.c index 6adf567..41c0207 100644 --- a/lustre/lov/lov_obd.c +++ b/lustre/lov/lov_obd.c @@ -832,7 +832,7 @@ static int lov_create(struct obd_export *exp, struct obdo *src_oa, if (lsm_new != NULL) { memcpy(lsm_new, lsm, newsize); lsm_new->lsm_stripe_count = obj_alloc; - OBD_FREE(lsm, newsize); + OBD_FREE(lsm, oldsize); lsm = lsm_new; } else { CWARN("'leaking' %d bytes\n", oldsize - newsize); @@ -924,6 +924,8 @@ static int lov_destroy(struct obd_export *exp, struct obdo *oa, if (lov->tgts[loi->loi_ost_idx].active == 0) { CDEBUG(D_HA, "lov idx %d inactive\n", loi->loi_ost_idx); /* Orphan clean up will (someday) fix this up. */ + if (oti != NULL && oa->o_valid & OBD_MD_FLCOOKIE) + oti->oti_logcookies++; continue; } diff --git a/lustre/lov/lov_pack.c b/lustre/lov/lov_pack.c index 1b40327..91692ca 100644 --- a/lustre/lov/lov_pack.c +++ b/lustre/lov/lov_pack.c @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "lov_internal.h" @@ -295,7 +295,7 @@ int lov_alloc_memmd(struct lov_stripe_md **lsmp, int stripe_count, int pattern) (*lsmp)->lsm_magic = LOV_MAGIC; (*lsmp)->lsm_stripe_count = stripe_count; (*lsmp)->lsm_maxbytes = LUSTRE_STRIPE_MAXBYTES * stripe_count; - (*lsmp)->lsm_xfersize = PTL_MTU * stripe_count; + (*lsmp)->lsm_xfersize = PTLRPC_MTU * stripe_count; (*lsmp)->lsm_pattern = pattern; (*lsmp)->lsm_oinfo[0].loi_ost_idx = ~0; diff --git a/lustre/mds/handler.c b/lustre/mds/handler.c index 52c8997..3f2aff3 100644 --- a/lustre/mds/handler.c +++ b/lustre/mds/handler.c @@ -461,6 +461,37 @@ int mds_blocking_ast(struct ldlm_lock *lock, struct ldlm_lock_desc *desc, RETURN(0); } +int mds_get_md(struct obd_device *obd, struct inode *inode, void *md, + int *size, int lock) +{ + int rc = 0; + int lmm_size; + + if (lock) + down(&inode->i_sem); + rc = fsfilt_get_md(obd, inode, md, *size); + if (lock) + up(&inode->i_sem); + + if (rc < 0) { + CERROR("Error %d reading eadata for ino %lu\n", + rc, inode->i_ino); + } else if (rc > 0) { + lmm_size = rc; + rc = mds_convert_lov_ea(obd, inode, md, lmm_size); + + if (rc == 0) { + *size = lmm_size; + rc = lmm_size; + } else if (rc > 0) { + *size = rc; + } + } + + RETURN (rc); +} + + /* Call with lock=1 if you want mds_pack_md to take the i_sem. * Call with lock=0 if the caller has already taken the i_sem. */ int mds_pack_md(struct obd_device *obd, struct lustre_msg *msg, int offset, @@ -491,22 +522,13 @@ int mds_pack_md(struct obd_device *obd, struct lustre_msg *msg, int offset, inode->i_ino, lmm_size, mds->mds_max_mdsize); // RETURN(-EINVAL); } - - if (lock) - down(&inode->i_sem); - rc = fsfilt_get_md(obd, inode, lmm, lmm_size); - if (lock) - up(&inode->i_sem); - if (rc < 0) { - CERROR("Error %d reading eadata for ino %lu\n", - rc, inode->i_ino); - } else if (rc > 0) { - lmm_size = rc; - rc = mds_convert_lov_ea(obd, inode, lmm, lmm_size); - - if (rc > 0) - lmm_size = rc; - body->valid |= OBD_MD_FLEASIZE; + + rc = mds_get_md(obd, inode, lmm, &lmm_size, lock); + if (rc > 0) { + if (S_ISDIR(inode->i_mode)) + body->valid |= OBD_MD_FLDIREA; + else + body->valid |= OBD_MD_FLEASIZE; body->eadatasize = lmm_size; rc = 0; } @@ -532,12 +554,14 @@ static int mds_getattr_internal(struct obd_device *obd, struct dentry *dentry, mds_pack_inode2fid(&body->fid1, inode); mds_pack_inode2body(body, inode); - if (S_ISREG(inode->i_mode) && (reqbody->valid & OBD_MD_FLEASIZE) != 0) { + if ((S_ISREG(inode->i_mode) && (reqbody->valid & OBD_MD_FLEASIZE)) || + (S_ISDIR(inode->i_mode) && (reqbody->valid & OBD_MD_FLDIREA))) { rc = mds_pack_md(obd, req->rq_repmsg, reply_off + 1, body, inode, 1); /* If we have LOV EA data, the OST holds size, atime, mtime */ - if (!(body->valid & OBD_MD_FLEASIZE)) + if (!(body->valid & OBD_MD_FLEASIZE) && + !(body->valid & OBD_MD_FLDIREA)) body->valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | OBD_MD_FLATIME | OBD_MD_FLMTIME); } else if (S_ISLNK(inode->i_mode) && @@ -579,7 +603,8 @@ static int mds_getattr_pack_msg(struct ptlrpc_request *req, struct inode *inode, LASSERT(body != NULL); /* checked by caller */ LASSERT_REQSWABBED(req, offset); /* swabbed by caller */ - if (S_ISREG(inode->i_mode) && (body->valid & OBD_MD_FLEASIZE)) { + if ((S_ISREG(inode->i_mode) && (body->valid & OBD_MD_FLEASIZE)) || + (S_ISDIR(inode->i_mode) && (body->valid & OBD_MD_FLDIREA))) { int rc; down(&inode->i_sem); rc = fsfilt_get_md(req->rq_export->exp_obd, inode, NULL, 0); diff --git a/lustre/mds/mds_internal.h b/lustre/mds/mds_internal.h index d8eb150..ec3f063 100644 --- a/lustre/mds/mds_internal.h +++ b/lustre/mds/mds_internal.h @@ -97,6 +97,8 @@ int mds_lov_clean(struct obd_device *obd); extern int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len, void *karg, void *uarg); #ifdef __KERNEL__ +int mds_get_md(struct obd_device *, struct inode *, void *md, int *size, + int lock); int mds_pack_md(struct obd_device *, struct lustre_msg *, int offset, struct mds_body *, struct inode *, int lock); void mds_pack_inode2fid(struct ll_fid *fid, struct inode *inode); diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c index c16b374..63d26b0 100644 --- a/lustre/mds/mds_open.c +++ b/lustre/mds/mds_open.c @@ -304,13 +304,15 @@ static void mds_objids_from_lmm(obd_id *ids, struct lov_mds_md *lmm, static int mds_create_objects(struct ptlrpc_request *req, int offset, struct mds_update_record *rec, struct mds_obd *mds, struct obd_device *obd, - struct inode *inode, void **handle, obd_id **ids) + struct dentry *dchild, void **handle, + obd_id **ids) { struct obdo *oa; struct obd_trans_info oti = { 0 }; struct mds_body *body; struct lov_stripe_md *lsm = NULL; struct lov_mds_md *lmm = NULL; + struct inode *inode = dchild->d_inode; void *lmm_buf; int rc, lmm_bufsize, lmm_size; ENTRY; @@ -386,6 +388,21 @@ static int mds_create_objects(struct ptlrpc_request *req, int offset, 0, &lsm, rec->ur_eadata); if (rc) GOTO(out_oa, rc); + } else { + OBD_ALLOC(lmm, mds->mds_max_mdsize); + if (lmm == NULL) + GOTO(out_oa, rc = -ENOMEM); + + lmm_size = mds->mds_max_mdsize; + rc = mds_get_md(obd, dchild->d_parent->d_inode, + lmm, &lmm_size, 1); + if (rc > 0) + rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, + mds->mds_osc_exp, + 0, &lsm, lmm); + OBD_FREE(lmm, mds->mds_max_mdsize); + if (rc) + GOTO(out_oa, rc); } rc = obd_create(mds->mds_osc_exp, oa, &lsm, &oti); if (rc) { @@ -557,7 +574,7 @@ static void reconstruct_open(struct mds_update_record *rec, int offset, mfd = NULL; } -#warning "XXX fixme" + /* #warning "XXX fixme" bug 2991 */ /* Here it used to LASSERT(mfd) if exp_outstanding_reply != NULL. * Now that exp_outstanding_reply is a list, it's just using mfd != NULL * to detect a re-open */ @@ -620,7 +637,7 @@ static int mds_finish_open(struct ptlrpc_request *req, struct dentry *dchild, if (rec != NULL) { /* no EA: create objects */ rc = mds_create_objects(req, 2, rec, mds, obd, - dchild->d_inode, handle, &ids); + dchild, handle, &ids); if (rc) { CERROR("mds_create_objects: rc = %d\n", rc); up(&dchild->d_inode->i_sem); @@ -1044,6 +1061,7 @@ int mds_mfd_close(struct ptlrpc_request *req, struct obd_device *obd, } if (last_orphan && unlink_orphan) { + struct lov_mds_md *lmm = NULL; int stripe_count = 0; LASSERT(rc == 0); /* mds_put_write_access must have succeeded */ @@ -1063,7 +1081,7 @@ int mds_mfd_close(struct ptlrpc_request *req, struct obd_device *obd, cleanup_phase = 2; /* dput(pending_child) when finished */ if (req != NULL) { - struct lov_mds_md *lmm = lustre_msg_buf(req->rq_repmsg, + lmm = lustre_msg_buf(req->rq_repmsg, 1, 0); stripe_count = le32_to_cpu(lmm->lmm_stripe_count); } @@ -1077,8 +1095,7 @@ int mds_mfd_close(struct ptlrpc_request *req, struct obd_device *obd, } if (req != NULL && (reply_body->valid & OBD_MD_FLEASIZE) && - mds_log_op_unlink(obd, pending_child->d_inode, - lustre_msg_buf(req->rq_repmsg, 1, 0), + mds_log_op_unlink(obd, pending_child->d_inode, lmm, req->rq_repmsg->buflens[1], lustre_msg_buf(req->rq_repmsg, 2, 0), req->rq_repmsg->buflens[2]) > 0) { diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c index 96ea3a7..889d2cd 100644 --- a/lustre/mds/mds_reint.c +++ b/lustre/mds/mds_reint.c @@ -404,7 +404,8 @@ static int mds_reint_setattr(struct mds_update_record *rec, int offset, cleanup_phase = 1; inode = de->d_inode; LASSERT(inode); - if (S_ISREG(inode->i_mode) && rec->ur_eadata != NULL) + if ((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) && + rec->ur_eadata != NULL) down(&inode->i_sem); OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_SETATTR_WRITE, inode->i_sb); @@ -427,9 +428,21 @@ static int mds_reint_setattr(struct mds_update_record *rec, int offset, else /* setattr */ rc = fsfilt_setattr(obd, de, handle, &rec->ur_iattr, 0); - if (rc == 0 && S_ISREG(inode->i_mode) && rec->ur_eadata != NULL) { - rc = fsfilt_set_md(obd, inode, handle, - rec->ur_eadata, rec->ur_eadatalen); + if (rc == 0 && (S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) && + rec->ur_eadata != NULL) { + struct lov_stripe_md *lsm = NULL; + + rc = obd_iocontrol(OBD_IOC_LOV_SETSTRIPE, + mds->mds_osc_exp, 0, &lsm, rec->ur_eadata); + if (rc) + GOTO(cleanup, rc); + + obd_free_memmd(mds->mds_osc_exp, &lsm); + + rc = fsfilt_set_md(obd, inode, handle, rec->ur_eadata, + rec->ur_eadatalen); + if (rc) + GOTO(cleanup, rc); } body = lustre_msg_buf(req->rq_repmsg, 0, sizeof (*body)); @@ -470,7 +483,8 @@ static int mds_reint_setattr(struct mds_update_record *rec, int offset, err = mds_finish_transno(mds, inode, handle, req, rc, 0); switch (cleanup_phase) { case 1: - if (S_ISREG(inode->i_mode) && rec->ur_eadata != NULL) + if ((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) && + rec->ur_eadata != NULL) up(&inode->i_sem); l_dput(de); if (locked) { diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index 1d10fa5..0d901fd 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -1110,8 +1110,7 @@ static int filter_intent_policy(struct ldlm_namespace *ns, if (tmplock->l_granted_mode == LCK_PR) continue; - if (tmplock->l_policy_data.l_extent.end <= - reply_lvb->lvb_size) + if (tmplock->l_policy_data.l_extent.end <= reply_lvb->lvb_size) continue; if (l == NULL) { diff --git a/lustre/obdfilter/filter_lvb.c b/lustre/obdfilter/filter_lvb.c index 1bc9311..7d9d1c4 100644 --- a/lustre/obdfilter/filter_lvb.c +++ b/lustre/obdfilter/filter_lvb.c @@ -41,7 +41,6 @@ static int filter_lvbo_init(struct ldlm_resource *res) int rc = 0; struct ost_lvb *lvb = NULL; struct obd_device *obd; - struct obdo *oa = NULL; struct dentry *dentry; ENTRY; @@ -66,37 +65,23 @@ static int filter_lvbo_init(struct ldlm_resource *res) obd = res->lr_namespace->ns_lvbp; LASSERT(obd != NULL); - oa = obdo_alloc(); - if (oa == NULL) - GOTO(out, rc = -ENOMEM); - - oa->o_id = res->lr_name.name[0]; - oa->o_gr = 0; - dentry = filter_oa2dentry(obd, oa); + dentry = filter_fid2dentry(obd, NULL, 0, res->lr_name.name[0]); if (IS_ERR(dentry)) GOTO(out, rc = PTR_ERR(dentry)); - /* Limit the valid bits in the return data to what we actually use */ - oa->o_valid = OBD_MD_FLID; - obdo_from_inode(oa, dentry->d_inode, FILTER_VALID_FLAGS); - f_dput(dentry); lvb->lvb_size = dentry->d_inode->i_size; lvb->lvb_mtime = LTIME_S(dentry->d_inode->i_mtime); lvb->lvb_blocks = dentry->d_inode->i_blocks; + f_dput(dentry); + CDEBUG(D_DLMTRACE, "res: "LPU64" initial lvb size: "LPU64", " "mtime: "LPU64", blocks: "LPU64"\n", res->lr_name.name[0], lvb->lvb_size, lvb->lvb_mtime, lvb->lvb_blocks); out: - if (oa) - obdo_free(oa); - if (rc && lvb != NULL) { - OBD_FREE(lvb, sizeof(*lvb)); - res->lr_lvb_data = NULL; - res->lr_lvb_len = 0; - } + /* Don't free lvb data on lookup error */ up(&res->lr_lvb_sem); return rc; } @@ -114,7 +99,6 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m, int rc = 0; struct ost_lvb *lvb = res->lr_lvb_data; struct obd_device *obd; - struct obdo *oa = NULL; struct dentry *dentry; ENTRY; @@ -167,27 +151,18 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m, obd = res->lr_namespace->ns_lvbp; LASSERT(obd); - oa = obdo_alloc(); - if (oa == NULL) - GOTO(out, rc = -ENOMEM); - - oa->o_id = res->lr_name.name[0]; - oa->o_gr = 0; - dentry = filter_oa2dentry(obd, oa); + dentry = filter_fid2dentry(obd, NULL, 0, res->lr_name.name[0]); if (IS_ERR(dentry)) GOTO(out, rc = PTR_ERR(dentry)); - /* Limit the valid bits in the return data to what we actually use */ - oa->o_valid = OBD_MD_FLID; - obdo_from_inode(oa, dentry->d_inode, FILTER_VALID_FLAGS); - if (dentry->d_inode->i_size > lvb->lvb_size || !increase) { CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb size from disk: " LPU64" -> %llu\n", res->lr_name.name[0], lvb->lvb_size, dentry->d_inode->i_size); lvb->lvb_size = dentry->d_inode->i_size; } - if (dentry->d_inode->i_mtime > lvb->lvb_mtime || !increase) { + + if (LTIME_S(dentry->d_inode->i_mtime) > lvb->lvb_mtime || !increase) { CDEBUG(D_DLMTRACE, "res: "LPU64" updating lvb mtime from disk: " LPU64" -> %lu\n", res->lr_name.name[0], lvb->lvb_mtime, LTIME_S(dentry->d_inode->i_mtime)); @@ -201,8 +176,6 @@ static int filter_lvbo_update(struct ldlm_resource *res, struct lustre_msg *m, f_dput(dentry); out: - if (oa != NULL) - obdo_free(oa); up(&res->lr_lvb_sem); return rc; } diff --git a/lustre/osc/lproc_osc.c b/lustre/osc/lproc_osc.c index 0492fc6..93b4276 100644 --- a/lustre/osc/lproc_osc.c +++ b/lustre/osc/lproc_osc.c @@ -59,7 +59,7 @@ int osc_wr_max_pages_per_rpc(struct file *file, const char *buffer, if (rc) return rc; - if (val < 1 || val > PTL_MD_MAX_PAGES) + if (val < 1 || val > PTLRPC_MAX_BRW_PAGES) return -ERANGE; spin_lock(&cli->cl_loi_list_lock); diff --git a/lustre/osc/osc_create.c b/lustre/osc/osc_create.c index 6d3b80f..d4db2c7 100644 --- a/lustre/osc/osc_create.c +++ b/lustre/osc/osc_create.c @@ -36,7 +36,8 @@ # include # include # include -# include +# include +# include # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) # include # include @@ -47,13 +48,11 @@ # include #endif -#ifndef __CYGWIN__ -# include -# include -#else +#ifdef __CYGWIN__ # include #endif +# include #include #include "osc_internal.h" diff --git a/lustre/osc/osc_internal.h b/lustre/osc/osc_internal.h index f011d0e..b14d013 100644 --- a/lustre/osc/osc_internal.h +++ b/lustre/osc/osc_internal.h @@ -10,13 +10,6 @@ #ifndef OSC_INTERNAL_H #define OSC_INTERNAL_H -#include /* for PTL_MTU and PTL_MD_MAX_PAGES */ - - -/* bug 1578: negotiate BRW_MAX_SIZE with the OST, instead of hard-coding it */ -#define OSC_BRW_MAX_SIZE PTL_MTU -#define OSC_BRW_MAX_IOV PTL_MD_MAX_PAGES - #define OAP_MAGIC 8675309 struct osc_async_page { diff --git a/lustre/osc/osc_request.c b/lustre/osc/osc_request.c index bd0cb68..8312434 100644 --- a/lustre/osc/osc_request.c +++ b/lustre/osc/osc_request.c @@ -36,7 +36,8 @@ # include # include # include -# include +# include +# include # if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) # include # include @@ -47,16 +48,14 @@ # include #endif +# include #include #include -#include +#include #include #include -#ifndef __CYGWIN__ -# include -# include -#else +#ifdef __CYGWIN__ # include #endif @@ -189,7 +188,7 @@ static int osc_getattr_interpret(struct ptlrpc_request *req, memcpy(aa->aa_oa, &body->oa, sizeof(*aa->aa_oa)); /* This should really be sent by the OST */ - aa->aa_oa->o_blksize = OSC_BRW_MAX_SIZE; + aa->aa_oa->o_blksize = PTLRPC_MAX_BRW_SIZE; aa->aa_oa->o_valid |= OBD_MD_FLBLKSZ; } else { CERROR("can't unpack ost_body\n"); @@ -264,7 +263,7 @@ static int osc_getattr(struct obd_export *exp, struct obdo *oa, memcpy(oa, &body->oa, sizeof(*oa)); /* This should really be sent by the OST */ - oa->o_blksize = OSC_BRW_MAX_SIZE; + oa->o_blksize = PTLRPC_MAX_BRW_SIZE; oa->o_valid |= OBD_MD_FLBLKSZ; EXIT; @@ -357,7 +356,7 @@ int osc_real_create(struct obd_export *exp, struct obdo *oa, memcpy(oa, &body->oa, sizeof(*oa)); /* This should really be sent by the OST */ - oa->o_blksize = OSC_BRW_MAX_SIZE; + oa->o_blksize = PTLRPC_MAX_BRW_SIZE; oa->o_valid |= OBD_MD_FLBLKSZ; /* XXX LOV STACKING: the lsm that is passed to us from LOV does not @@ -1081,8 +1080,8 @@ static int osc_brw(int cmd, struct obd_export *exp, struct obdo *oa, obd_count pages_per_brw; int rc; - if (page_count > OSC_BRW_MAX_IOV) - pages_per_brw = OSC_BRW_MAX_IOV; + if (page_count > PTLRPC_MAX_BRW_PAGES) + pages_per_brw = PTLRPC_MAX_BRW_PAGES; else pages_per_brw = page_count; @@ -1121,8 +1120,8 @@ static int osc_brw_async(int cmd, struct obd_export *exp, struct obdo *oa, obd_count pages_per_brw; int rc; - if (page_count > OSC_BRW_MAX_IOV) - pages_per_brw = OSC_BRW_MAX_IOV; + if (page_count > PTLRPC_MAX_BRW_PAGES) + pages_per_brw = PTLRPC_MAX_BRW_PAGES; else pages_per_brw = page_count; @@ -2316,8 +2315,8 @@ static int sanosc_brw(int cmd, struct obd_export *exp, struct obdo *oa, obd_count pages_per_brw; int rc; - if (page_count > OSC_BRW_MAX_IOV) - pages_per_brw = OSC_BRW_MAX_IOV; + if (page_count > PTLRPC_MAX_BRW_PAGES) + pages_per_brw = PTLRPC_MAX_BRW_PAGES; else pages_per_brw = page_count; diff --git a/lustre/portals/archdep.m4 b/lustre/portals/archdep.m4 index 65cfaff..e9eef5e 100644 --- a/lustre/portals/archdep.m4 +++ b/lustre/portals/archdep.m4 @@ -331,6 +331,9 @@ AC_SUBST(SCIMACNAL) CFLAGS="$KCFLAGS" CPPFLAGS="$KINCFLAGS $KCPPFLAGS $MFLAGS $enable_zerocopy $enable_affinity $with_quadrics $with_gm $with_scamac $with_ib" +if test $host_cpu == "lib" ; then +CPPFLAGS="$CPPFLAGS -fPIC -D_LARGEFILE64_SOURCE=1 -g" +fi AM_CONDITIONAL(LIBLUSTRE, test x$host_cpu = xlib) AC_SUBST(MOD_LINK) @@ -386,3 +389,38 @@ if test "$HAVE_DIO_FILE" != 0 ; then else AC_MSG_RESULT(no) fi + +# --- Check that ext3 and ext3 xattr are enabled in the kernel +if test "$host_cpu" != "lib" ; then + AC_MSG_CHECKING([that ext3 is enabled in the kernel]) + AC_TRY_COMPILE([ +#define __KERNEL__ +#include + ], + [ +#ifdef CONFIG_EXT3_FS + return 0; +#else +#error CONFIG_EXT3_FS not #defined +#endif + ],[AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Lustre requires that ext3 is enabled in the kernel (CONFIG_EXT3_FS)]) + ]) +# disable this check until our xattr patches define it! +# AC_MSG_CHECKING([that extended attributes for ext3 are enabled in the kernel]) +# AC_TRY_COMPILE([ +##define __KERNEL__ +##include +# ], +# [ +##ifdef CONFIG_EXT3_FS_XATTR +# return 0; +##else +##error CONFIG_EXT3_FS_XATTR not #defined +##endif +# ],[AC_MSG_RESULT([yes])], +# [AC_MSG_RESULT([no]) +# AC_MSG_ERROR([Lustre requires that extended attributes for ext3 are enabled in the kernel (CONFIG_EXT3_FS_XATTR)]) +# ]) +fi diff --git a/lustre/portals/include/portals/lib-types.h b/lustre/portals/include/portals/lib-types.h index 904204b..d05d3fa 100644 --- a/lustre/portals/include/portals/lib-types.h +++ b/lustre/portals/include/portals/lib-types.h @@ -133,9 +133,8 @@ typedef struct { } lib_counters_t; /* temporary expedient: limit number of entries in discontiguous MDs */ -# define PTL_MTU (512<<10) -# define PTL_MD_MAX_IOV 128 -# define PTL_MD_MAX_PAGES min_t(int, PTL_MD_MAX_IOV, PTL_MTU / PAGE_SIZE) +#define PTL_MTU (512<<10) +#define PTL_MD_MAX_IOV 128 struct lib_msg_t { struct list_head msg_list; diff --git a/lustre/portals/include/portals/list.h b/lustre/portals/include/portals/list.h index 9cab047..37d9952 100644 --- a/lustre/portals/include/portals/list.h +++ b/lustre/portals/include/portals/list.h @@ -9,8 +9,6 @@ * using the generic single-entry routines. */ -#define prefetch(a) ((void)a) - struct list_head { struct list_head *next, *prev; }; @@ -194,8 +192,7 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each(pos, head) \ - for (pos = (head)->next, prefetch(pos->next); pos != (head); \ - pos = pos->next, prefetch(pos->next)) + for (pos = (head)->next ; pos != (head); pos = pos->next ) /** * list_for_each_prev - iterate over a list in reverse order @@ -203,8 +200,7 @@ static inline void list_splice_init(struct list_head *list, * @head: the head for your list. */ #define list_for_each_prev(pos, head) \ - for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ - pos = pos->prev, prefetch(pos->prev)) + for (pos = (head)->prev ; pos != (head); pos = pos->prev) /** * list_for_each_safe - iterate over a list safe against removal of list entry @@ -226,11 +222,9 @@ static inline void list_splice_init(struct list_head *list, * @member: the name of the list_struct within the struct. */ #define list_for_each_entry(pos, head, member) \ - for (pos = list_entry((head)->next, typeof(*pos), member), \ - prefetch(pos->member.next); \ + for (pos = list_entry((head)->next, typeof(*pos), member); \ &pos->member != (head); \ - pos = list_entry(pos->member.next, typeof(*pos), member), \ - prefetch(pos->member.next)) + pos = list_entry(pos->member.next, typeof(*pos), member)) #endif #ifndef list_for_each_entry_safe diff --git a/lustre/ptlbd/blk.c b/lustre/ptlbd/blk.c index d8b7f02..ccef070 100644 --- a/lustre/ptlbd/blk.c +++ b/lustre/ptlbd/blk.c @@ -284,7 +284,7 @@ int ptlbd_blk_init(void) /* avoid integer overflow */ ptlbd_size[i] = (16*1024*((1024*1024) >> BLOCK_SIZE_BITS)); ptlbd_hardsect_size[i] = 4096; - ptlbd_max_sectors[i] = PTL_MD_MAX_IOV * (4096/512); + ptlbd_max_sectors[i] = PTLRPC_MAX_BRW_PAGES * (4096/512); } return 0; diff --git a/lustre/ptlrpc/import.c b/lustre/ptlrpc/import.c index dece441..f46aa03 100644 --- a/lustre/ptlrpc/import.c +++ b/lustre/ptlrpc/import.c @@ -79,7 +79,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp); int ptlrpc_init_import(struct obd_import *imp) { unsigned long flags; - + spin_lock_irqsave(&imp->imp_lock, flags); imp->imp_generation++; @@ -97,18 +97,18 @@ int ptlrpc_set_import_discon(struct obd_import *imp) { unsigned long flags; int rc = 0; - + spin_lock_irqsave(&imp->imp_lock, flags); if (imp->imp_state == LUSTRE_IMP_FULL) { IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_DISCON); - spin_unlock_irqrestore(&imp->imp_lock, flags); + spin_unlock_irqrestore(&imp->imp_lock, flags); obd_import_event(imp->imp_obd, imp, IMP_EVENT_DISCON); rc = 1; } else { spin_unlock_irqrestore(&imp->imp_lock, flags); CDEBUG(D_HA, "%p %s: import already not connected: %s\n", - imp,imp->imp_client->cli_name, + imp,imp->imp_client->cli_name, ptlrpc_import_state_name(imp->imp_state)); } @@ -166,16 +166,15 @@ void ptlrpc_fail_import(struct obd_import *imp, int generation) imp->imp_obd->obd_name); ptlrpc_invalidate_import(imp); } - - CDEBUG(D_HA, "%s: waking up pinger\n", + + CDEBUG(D_HA, "%s: waking up pinger\n", imp->imp_target_uuid.uuid); - + spin_lock_irqsave(&imp->imp_lock, flags); imp->imp_force_verify = 1; spin_unlock_irqrestore(&imp->imp_lock, flags); - + ptlrpc_pinger_wake_up(); - } EXIT; } @@ -214,7 +213,7 @@ int ptlrpc_connect_import(struct obd_import *imp, char * new_uuid) IMPORT_SET_STATE_NOLOCK(imp, LUSTRE_IMP_CONNECTING); - imp->imp_conn_cnt++; + imp->imp_conn_cnt++; imp->imp_last_replay_transno = 0; if (imp->imp_remote_handle.cookie == 0) { @@ -256,7 +255,7 @@ int ptlrpc_connect_import(struct obd_import *imp, char * new_uuid) imp->imp_connection = conn; dlmexp = class_conn2export(&imp->imp_dlm_handle); - + LASSERT(dlmexp != NULL); if (dlmexp->exp_connection) @@ -308,7 +307,7 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request, unsigned long flags; int msg_flags; ENTRY; - + spin_lock_irqsave(&imp->imp_lock, flags); if (imp->imp_state == LUSTRE_IMP_CLOSED) { spin_unlock_irqrestore(&imp->imp_lock, flags); @@ -357,7 +356,7 @@ static int ptlrpc_connect_interpret(struct ptlrpc_request *request, imp->imp_remote_handle = request->rq_repmsg->handle; } else { CERROR("reconnected to %s@%s after partition\n", - imp->imp_target_uuid.uuid, + imp->imp_target_uuid.uuid, imp->imp_connection->c_remote_uuid.uuid); } IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER); @@ -402,7 +401,7 @@ finish: imp->imp_connection->c_remote_uuid.uuid); ptlrpc_connect_import(imp, NULL); RETURN(0); - } + } } out: if (rc != 0) { @@ -442,7 +441,7 @@ static int signal_completed_replay(struct obd_import *imp) req->rq_replen = lustre_msg_size(0, NULL); req->rq_send_state = LUSTRE_IMP_REPLAY_WAIT; req->rq_reqmsg->flags |= MSG_LAST_REPLAY; - req->rq_timeout *= 3; + req->rq_timeout *= 3; req->rq_interpret_reply = completed_replay_interpret; ptlrpcd_add_req(req); @@ -461,13 +460,13 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp) imp->imp_connection->c_remote_uuid.uuid); ptlrpc_invalidate_import(imp); IMPORT_SET_STATE(imp, LUSTRE_IMP_RECOVER); - } - + } + if (imp->imp_state == LUSTRE_IMP_REPLAY) { CDEBUG(D_HA, "replay requested by %s\n", imp->imp_target_uuid.uuid); rc = ptlrpc_replay_next(imp, &inflight); - if (inflight == 0 && + if (inflight == 0 && atomic_read(&imp->imp_replay_inflight) == 0) { IMPORT_SET_STATE(imp, LUSTRE_IMP_REPLAY_LOCKS); rc = ldlm_replay_locks(imp); @@ -514,7 +513,7 @@ int ptlrpc_import_recovery_state_machine(struct obd_import *imp) RETURN(rc); } -static int back_to_sleep(void *unused) +static int back_to_sleep(void *unused) { return 0; } @@ -540,9 +539,9 @@ int ptlrpc_disconnect_import(struct obd_import *imp) if (ptlrpc_import_in_recovery(imp)) { struct l_wait_info lwi; - lwi = LWI_TIMEOUT_INTR(MAX(obd_timeout * HZ, 1), back_to_sleep, + lwi = LWI_TIMEOUT_INTR(MAX(obd_timeout * HZ, 1), back_to_sleep, NULL, NULL); - rc = l_wait_event(imp->imp_recovery_waitq, + rc = l_wait_event(imp->imp_recovery_waitq, !ptlrpc_import_in_recovery(imp), &lwi); } diff --git a/lustre/ptlrpc/llog_net.c b/lustre/ptlrpc/llog_net.c index 17be7dd..0eb8d41 100644 --- a/lustre/ptlrpc/llog_net.c +++ b/lustre/ptlrpc/llog_net.c @@ -138,7 +138,8 @@ EXPORT_SYMBOL(llog_initiator_connect); #else /* !__KERNEL__ */ int llog_origin_connect(struct llog_ctxt *ctxt, int count, - struct llog_logid *logid, struct llog_gen *gen) + struct llog_logid *logid, struct llog_gen *gen, + struct obd_uuid *uuid) { return 0; } diff --git a/lustre/ptlrpc/niobuf.c b/lustre/ptlrpc/niobuf.c index 29b4e36..bb23f3f 100644 --- a/lustre/ptlrpc/niobuf.c +++ b/lustre/ptlrpc/niobuf.c @@ -218,7 +218,7 @@ int ptlrpc_register_bulk (struct ptlrpc_request *req) /* NB no locking required until desc is on the network */ LASSERT (desc->bd_nob > 0); LASSERT (!desc->bd_network_rw); - LASSERT (desc->bd_page_count <= PTL_MD_MAX_PAGES); + LASSERT (desc->bd_page_count <= PTLRPC_MAX_BRW_PAGES); LASSERT (desc->bd_req != NULL); LASSERT (desc->bd_type == BULK_PUT_SINK || desc->bd_type == BULK_GET_SOURCE); diff --git a/lustre/tests/.RC_CURRENT.tag b/lustre/tests/.RC_CURRENT.tag index 25cb73f..3b1a02e 100644 --- a/lustre/tests/.RC_CURRENT.tag +++ b/lustre/tests/.RC_CURRENT.tag @@ -1 +1 @@ -RC_1_3_0_6 +RC_1_3_0_14 diff --git a/lustre/tests/.cvsignore b/lustre/tests/.cvsignore index 932a2a0..275e52f 100644 --- a/lustre/tests/.cvsignore +++ b/lustre/tests/.cvsignore @@ -60,3 +60,5 @@ iopentest2 XMLCONFIG *.log logs +ostactive +ll_dirstripe_verify diff --git a/lustre/tests/Makefile.am b/lustre/tests/Makefile.am index 34adfb9..d37259c 100644 --- a/lustre/tests/Makefile.am +++ b/lustre/tests/Makefile.am @@ -19,7 +19,7 @@ noinst_PROGRAMS += stat createmany statmany multifstat createtest mlink utime cm noinst_PROGRAMS += opendirunlink opendevunlink unlinkmany fchdir_test checkstat noinst_PROGRAMS += wantedi statone runas openfile getdents mkdirdeep o_directory noinst_PROGRAMS += small_write multiop sleeptest ll_sparseness_verify -noinst_PROGRAMS += ll_sparseness_write mrename +noinst_PROGRAMS += ll_sparseness_write mrename ll_dirstripe_verify # noinst_PROGRAMS += ldaptest bin_PROGRAMS = mcreate munlink mkdirmany iopentest1 iopentest2 @@ -74,5 +74,6 @@ sleeptest_SOURCES = sleeptest.c #sanity test ll_sparseness_verify_SOURCES = ll_sparseness_verify.c ll_sparseness_write_SOURCES = ll_sparseness_write.c +ll_dirstripe_verify_SOURCE = ll_dirstripe_verify.c include $(top_srcdir)/Rules diff --git a/lustre/tests/conf-sanity.sh b/lustre/tests/conf-sanity.sh index f2483c3..4212cab 100644 --- a/lustre/tests/conf-sanity.sh +++ b/lustre/tests/conf-sanity.sh @@ -670,5 +670,34 @@ test_17() { } run_test 17 "Verify failed mds_postsetup won't fail assertion (2936)" +test_18() { + [ -f $MDSDEV ] && echo "remove $MDSDEV" && rm -f $MDSDEV + echo "mount mds with large journal..." + OLDMDSSIZE=$MDSSIZE + MDSSIZE=2000000 + gen_config + + echo "mount lustre system..." + start_ost + start_mds + mount_client $MOUNT + check_mount || return 41 + + echo "check journal size..." + FOUNDJOURNALSIZE=`debugfs -R "stat <8>" $MDSDEV | awk '/Size: / { print $6; exit;}'` + if [ $FOUNDJOURNALSIZE = "79691776" ]; then + echo "Success:lconf creates large journals" + else + echo "Error:lconf not create large journals correctly" + echo "expected journal size: 79691776(76M), found journal size: $FOUNDJOURNALSIZE" + return 1 + fi + + cleanup || return $? + + MDSSIZE=$OLDMDSSIZE + gen_config +} +run_test 18 "check lconf creates large journals" equals_msg "Done" diff --git a/lustre/tests/ll_dirstripe_verify.c b/lustre/tests/ll_dirstripe_verify.c new file mode 100644 index 0000000..a4ce6d1 --- /dev/null +++ b/lustre/tests/ll_dirstripe_verify.c @@ -0,0 +1,201 @@ +/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- + * vim:expandtab:shiftwidth=8:tabstop=8: + * + * ll_dirstripe_verify : + * - to verify if the file has the same lov_user_md setting as the parent dir. + * - if dir's offset is set -1, ll_dirstripe_verify + * is used to further verify if file1 and file2's obdidx is continuous. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +#include + + +#define MAX_LOV_UUID_COUNT 1000 + +int compare(struct lov_user_md *lum_dir, struct lov_user_md *lum_file1, + struct lov_user_md *lum_file2) +{ + int stripe_count; + int stripe_size; + int stripe_offset; + int ost_count; + int fd; + char buf[32]; + int i; + + stripe_count = (int)lum_dir->lmm_stripe_count; + if (stripe_count == 0) { + fd = open("/proc/fs/lustre/lov/lov1/stripecount", O_RDONLY); + if (fd == -1) { + fprintf(stderr, "open proc file error: %s\n", + strerror(errno)); + return -1; + } + if (read(fd, buf, sizeof(buf)) == -1) { + fprintf(stderr, "read proc file error: %s\n", + strerror(errno)); + close(fd); + return -1; + } + + stripe_count = atoi(buf); + stripe_count = stripe_count ? stripe_count : 1; + close(fd); + } + + stripe_size = (int)lum_dir->lmm_stripe_size; + if (stripe_size == 0) { + fd = open("/proc/fs/lustre/lov/lov1/stripesize", O_RDONLY); + if (fd == -1) { + fprintf(stderr, "open proc file error: %s\n", + strerror(errno)); + return -1; + } + if (read(fd, buf, sizeof(buf)) == -1) { + fprintf(stderr, "read proc file error: %s\n", + strerror(errno)); + close(fd); + return -1; + } + + stripe_size = atoi(buf); + close(fd); + } + + fd = open("/proc/fs/lustre/lov/lov1/numobd", O_RDONLY); + if(fd == -1) { + fprintf(stderr, "open proc file error: %s\n", + strerror(errno)); + return -1; + } + if (read(fd, buf, sizeof(buf)) == -1) { + fprintf(stderr, "read proc file error: %s\n", + strerror(errno)); + close(fd); + return -1; + } + + ost_count = atoi(buf); + close(fd); + + if ((lum_file1->lmm_stripe_count != stripe_count) || + (lum_file1->lmm_stripe_size != stripe_size)) + return -1; + + stripe_offset = (short int)lum_dir->lmm_stripe_offset; + if (stripe_offset != -1) { + for (i = 0; i < stripe_count; i++) + if (lum_file1->lmm_objects[i].l_ost_idx != + (stripe_offset + i) % ost_count) + return -1; + } else if (lum_file2 != NULL) { + int next, idx; + next = (lum_file1->lmm_objects[stripe_count-1].l_ost_idx + 1) + % ost_count; + idx = lum_file2->lmm_objects[0].l_ost_idx; + if (idx != next) + return -1; + } + + return 0; +} + +int main(int argc, char **argv) +{ + DIR * dir; + struct lov_user_md *lum_dir, *lum_file1, *lum_file2=NULL; + int rc; + int lum_size; + char *fname; + + if (argc < 3) { + fprintf(stderr, "Usage: %s [filename2]\n", + argv[0]); + exit(1); + } + + dir = opendir(argv[1]); + if (dir == NULL) { + fprintf(stderr, "%s opendir failed\n", argv[1]); + return errno; + } + + lum_size = lov_mds_md_size(MAX_LOV_UUID_COUNT); + if ((lum_dir = (struct lov_user_md *)malloc(lum_size)) == NULL) { + fprintf(stderr, "unable to allocate memory for ioctl's"); + return errno; + } + + rc = ioctl(dirfd(dir), LL_IOC_LOV_GETSTRIPE, lum_dir); + if (rc) { + if (errno == ENODATA) { + lum_dir->lmm_stripe_size = 0; + lum_dir->lmm_stripe_count = 0; + lum_dir->lmm_stripe_offset = -1; + } else { + rc = errno; + goto cleanup; + } + } + + if ((lum_file1 = (struct lov_user_md *)malloc(lum_size)) == NULL) { + fprintf(stderr, "unable to allocate memory for ioctl's"); + rc = errno; + goto cleanup; + } + + fname = strrchr(argv[2], '/'); + fname++; + strncpy((char *)lum_file1, fname, lum_size); + rc = ioctl(dirfd(dir), IOC_MDC_GETSTRIPE, lum_file1); + if (rc) { + rc = errno; + goto cleanup; + } + + if (argc == 4) { + if ((lum_file2 = (struct lov_user_md *)malloc(lum_size)) + == NULL) { + fprintf(stderr, + "unable to allocate memory for ioctl's"); + rc = errno; + goto cleanup; + } + + fname = strrchr(argv[3], '/'); + fname++; + strncpy((char *)lum_file2, fname, lum_size); + rc = ioctl(dirfd(dir), IOC_MDC_GETSTRIPE, lum_file2); + if (rc) { + rc = errno; + goto cleanup; + } + } + + rc = compare(lum_dir, lum_file1, lum_file2); + +cleanup: + if (lum_dir != NULL) + free(lum_dir); + if (lum_file1 != NULL) + free(lum_file1); + if (lum_file2 != NULL) + free(lum_file2); + + return rc; +} diff --git a/lustre/tests/open_delay.c b/lustre/tests/open_delay.c index 7200c3f..e4f46dc 100644 --- a/lustre/tests/open_delay.c +++ b/lustre/tests/open_delay.c @@ -2,7 +2,7 @@ #include #include #include -#include +#include int main(int argc, char **argv) { diff --git a/lustre/tests/openclose.c b/lustre/tests/openclose.c index ca10134..0def4b2 100644 --- a/lustre/tests/openclose.c +++ b/lustre/tests/openclose.c @@ -16,7 +16,7 @@ #include #include -#include +#include int main(int argc, char *argv[]) { diff --git a/lustre/tests/openfile.c b/lustre/tests/openfile.c index d494b4a4..0c5081d 100644 --- a/lustre/tests/openfile.c +++ b/lustre/tests/openfile.c @@ -17,6 +17,7 @@ #include #include #include +#include typedef struct flag_mapping { const char *string; @@ -39,6 +40,7 @@ FLAG_MAPPING flag_table[] = { {"O_LARGEFILE", O_LARGEFILE}, {"O_DIRECTORY", O_DIRECTORY}, {"O_NOFOLLOW", O_NOFOLLOW}, + {"O_LOV_DELAY_CREATE", O_LOV_DELAY_CREATE}, {"", -1} }; diff --git a/lustre/tests/recovery-small.sh b/lustre/tests/recovery-small.sh index 63e6ad1..6117da4 100755 --- a/lustre/tests/recovery-small.sh +++ b/lustre/tests/recovery-small.sh @@ -3,7 +3,7 @@ set -e # 17 = bug 2732 2986 -ALWAYS_EXCEPT="17 19b" +ALWAYS_EXCEPT="17 20b" LUSTRE=${LUSTRE:-`dirname $0`/..} UPCALL=${UPCALL:-$PWD/recovery-small-upcall.sh} @@ -117,7 +117,6 @@ test_8() { } run_test 8 "touch: drop rep (bug 1423)" - #bug 1420 test_9() { pause_bulk "cp /etc/profile $MOUNT" || return 1 @@ -202,6 +201,81 @@ test_15() { } run_test 15 "failed open (-ENOMEM)" +test_16() { + do_facet client cp /etc/termcap $MOUNT + sync + +#define OBD_FAIL_PTLRPC_BULK_PUT_NET 0x504 | OBD_FAIL_ONCE + sysctl -w lustre.fail_loc=0x80000504 + cancel_lru_locks OSC + # will get evicted here + do_facet client "diff /etc/termcap $MOUNT/termcap" && return 1 + sysctl -w lustre.fail_loc=0 + do_facet client "diff /etc/termcap $MOUNT/termcap" || return 2 +} +run_test 16 "timeout bulk put, evict client (2732)" + +test_17() { +#define OBD_FAIL_PTLRPC_BULK_GET_NET 0x504 | OBD_FAIL_ONCE + # will get evicted here + sysctl -w lustre.fail_loc=0x80000503 + do_facet client cp /etc/termcap $MOUNT && return 1 + + do_facet client "diff /etc/termcap $MOUNT/termcap" && return 2 + sysctl -w lustre.fail_loc=0 + do_facet client "diff /etc/termcap $MOUNT/termcap" || return 3 +} +run_test 17 "timeout bulk get, evict client (2732)" + +test_18a() { + do_facet client mkdir -p $MOUNT/$tdir + f=$MOUNT/$tdir/$tfile + + cancel_lru_locks OSC + pgcache_empty || return 1 + + # 1 stripe on ost2 + lfs setstripe $f $((128 * 1024)) 1 1 + + do_facet client cp /etc/termcap $f + sync + local osc2_dev=`$LCTL device_list | \ + awk '(/ost2.*client_facet/){print $4}' ` + $LCTL --device %$osc2_dev deactivate + # my understanding is that there should be nothing in the page + # cache after the client reconnects? + rc=0 + pgcache_empty || rc=2 + $LCTL --device %$osc2_dev activate + rm -f $f + return $rc +} +run_test 18a "manual ost invalidate clears page cache immediately" + +test_18b() { +# OBD_FAIL_PTLRPC_BULK_PUT_NET|OBD_FAIL_ONCE + do_facet client mkdir -p $MOUNT/$tdir + f=$MOUNT/$tdir/$tfile + f2=$MOUNT/$tdir/${tfile}-2 + + cancel_lru_locks OSC + pgcache_empty || return 1 + + # shouldn't have to set stripe size of count==1 + lfs setstripe $f $((128 * 1024)) 0 1 + sync + sysctl -w lustre.fail_loc=0 + # allow recovery to complete + sleep $((TIMEOUT + 2)) + # my understanding is that there should be nothing in the page + # cache after the client reconnects? + rc=0 + pgcache_empty || rc=2 + rm -f $f $f2 + return $rc +} +run_test 18b "eviction and reconnect clears page cache (2766)" + test_19a() { f=$MOUNT/$tfile do_facet client mcreate $f || return 1 diff --git a/lustre/tests/replay-single.sh b/lustre/tests/replay-single.sh index 13a3465..3ab2ad8 100755 --- a/lustre/tests/replay-single.sh +++ b/lustre/tests/replay-single.sh @@ -836,7 +836,7 @@ test_42() { unlinkmany $DIR/$tfile-%d 400 400 $CHECKSTAT -t file $DIR/$tfile-* && return 1 || true } -run_test 42 "recoery after ost failure" +run_test 42 "recovery after ost failure" # b=2530 # directory orphans can't be unlinked from PENDING directory diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 7719771..2cffeee 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -1482,7 +1482,7 @@ test_47() { } run_test 47 "Device nodes check ================================" -test_48a() { +test_48a() { # bug 2399 mkdir $DIR/d48a cd $DIR/d48a mv $DIR/d48a $DIR/d48.new || error "move directory failed" @@ -1498,7 +1498,7 @@ test_48a() { } run_test 48a "Access renamed working dir (should return errors)=" -test_48b() { +test_48b() { # bug 2399 mkdir $DIR/d48b cd $DIR/d48b rmdir $DIR/d48b || error "remove cwd $DIR/d48b failed" @@ -1830,6 +1830,53 @@ test_64b () { } run_test 64b "check out-of-space detection on client ============" +# bug 1414 - set/get directories' stripe info +test_65() { + LFS=${LFS:-lfs} + LVERIFY=${LVERIFY:-ll_dirstripe_verify} + + echo "dir has no stripe info" + mkdir $DIR/d65 + touch $DIR/d65/f1 + $LVERIFY $DIR/d65 $DIR/d65/f1 || error + + echo "setstripe $(($STRIPESIZE * 2)) 0 1" + $LFS setstripe $DIR/d65 $(($STRIPESIZE * 2)) 0 1 || error + touch $DIR/d65/f2 + $LVERIFY $DIR/d65 $DIR/d65/f2 || error + + if [ $ostcount -gt 1 ]; then + echo "setstripe $(($STRIPESIZE * 4)) 1 $(($OSTCOUNT - 1))" + $LFS setstripe $DIR/d65 $(($STRIPESIZE * 4)) 1 \ + $(($OSTCOUNT - 1)) || error + touch $DIR/d65/f3 + $LVERIFY $DIR/d65 $DIR/d65/f3 || error + fi + + [ $STRIPECOUNT -eq 0 ] && sc=1 || sc=$(($STRIPECOUNT - 1)) + + echo "setstripe $STRIPESIZE -1 $sc" + $LFS setstripe $DIR/d65 $STRIPESIZE -1 $sc || error + touch $DIR/d65/f4 $DIR/d65/f5 + $LVERIFY $DIR/d65 $DIR/d65/f4 $DIR/d65/f5 || error + + echo "setstripe 0 -1 0 (default)" + $LFS setstripe $DIR/d65 0 -1 0 || error + touch $DIR/d65/f6 + $LVERIFY $DIR/d65 $DIR/d65/f6 || error +} +run_test 65 "Verify that the files are created using parent dir's stripe info" + +# bug 2543 - update blocks count on client +test_66() { + COUNT=${COUNT:-8} + dd if=/dev/zero of=$DIR/f66 bs=1k count=$COUNT + sync + BLOCKS=`ls -s $DIR/f66 | awk '{ print $1 }'` + [ $BLOCKS -ge $COUNT ] || error "$DIR/f66 blocks $BLOCKS < $COUNT" +} +run_test 66 "update inode blocks count on client ===============" + # on the LLNL clusters, runas will still pick up root's $TMP settings, # which will not be writable for the runas user, and then you get a CVS # error message with a corrupt path string (CVS bug) and panic. @@ -1851,7 +1898,12 @@ run_test 99a "cvs init =========================================" test_99b() { [ ! -d $DIR/d99cvsroot ] && test_99a cd /etc/init.d - $RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" d99reposname vtag rtag + # some versions of cvs import exit(1) when asked to import links or + # files they can't read. ignore those files. + TOIGNORE=$(find . -type l -printf '-I %f\n' -o \ + ! -perm +4 -printf '-I %f\n') + $RUNAS cvs -d $DIR/d99cvsroot import -m "nomesg" $TOIGNORE \ + d99reposname vtag rtag } run_test 99b "cvs import =======================================" diff --git a/lustre/tests/test-framework.sh b/lustre/tests/test-framework.sh index 0247f31..2181547 100644 --- a/lustre/tests/test-framework.sh +++ b/lustre/tests/test-framework.sh @@ -451,6 +451,18 @@ cancel_lru_locks() { done } + +pgcache_empty() { + for a in /proc/fs/lustre/llite/*/dump_page_cache; do + if [ `wc -l $a | awk '{print $1}'` -gt 1 ]; then + echo there is still data in page cache $a ? + cat $a; + return 1; + fi + done + return 0 +} + ################################## # Test interface error() { diff --git a/lustre/tests/write_append_truncate.c b/lustre/tests/write_append_truncate.c index 30a95e5..7bfb121 100644 --- a/lustre/tests/write_append_truncate.c +++ b/lustre/tests/write_append_truncate.c @@ -49,7 +49,7 @@ void usage(char *prog) } /* Print process rank, loop count, message, and exit (i.e. a fatal error) */ -int rprintf(int rank, int loop, const char *fmt, ...) +void rprintf(int rank, int loop, const char *fmt, ...) { va_list ap; @@ -59,8 +59,7 @@ int rprintf(int rank, int loop, const char *fmt, ...) vprintf(fmt, ap); - MPI_Finalize(); - exit(1); + MPI_Abort(MPI_COMM_WORLD, 1); } int main(int argc, char *argv[]) diff --git a/lustre/tests/write_disjoint.c b/lustre/tests/write_disjoint.c index 16774c8..c9ffae6 100644 --- a/lustre/tests/write_disjoint.c +++ b/lustre/tests/write_disjoint.c @@ -24,11 +24,9 @@ #include #include "mpi.h" - -#define FILENAME "/mnt/lustre/write_disjoint" #define CHUNK_MAX_SIZE 123456 -int rprintf(int rank, int loop, const char *fmt, ...) +void rprintf(int rank, int loop, const char *fmt, ...) { va_list ap; @@ -38,8 +36,7 @@ int rprintf(int rank, int loop, const char *fmt, ...) vprintf(fmt, ap); - MPI_Finalize(); - exit(1); + MPI_Abort(MPI_COMM_WORLD, 1); } int main (int argc, char *argv[]) { @@ -47,9 +44,23 @@ int main (int argc, char *argv[]) { int rank, noProcessors, done; off_t offset; char **chunk_buf; - char *read_buf; + char *read_buf, c; struct stat stat_buf; ssize_t ret; + char *filename = "/mnt/lustre/write_disjoint"; + + /* Parse command line options */ + while (1) { + c = getopt(argc, argv, "f:"); + if (c == -1) + break; + + switch (c) { + case 'f': + filename = optarg; + break; + } + } MPI_Init(&argc, &argv); MPI_Comm_size(MPI_COMM_WORLD, &noProcessors); @@ -63,21 +74,21 @@ int main (int argc, char *argv[]) { read_buf = malloc(noProcessors * CHUNK_MAX_SIZE); if (rank == 0) { - fd = open(FILENAME, O_WRONLY|O_CREAT|O_TRUNC, 0666); + fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0666); if (fd < 0) rprintf(rank, -1, "open() returned %s\n", strerror(errno)); } MPI_Barrier(MPI_COMM_WORLD); - fd = open(FILENAME, O_RDWR); + fd = open(filename, O_RDWR); if (fd < 0) rprintf(rank, -1, "open() returned %s\n", strerror(errno)); for (n=0; n < 1000 ; n++) { /* reset the environment */ if (rank == 0) { - ret = truncate(FILENAME, 0); + ret = truncate(filename, 0); if (ret != 0) rprintf(rank, n, "truncate() returned %s\n", strerror(errno) ); @@ -109,7 +120,7 @@ int main (int argc, char *argv[]) { lseek(fd, 0, SEEK_SET); /* quick check */ - stat(FILENAME, &stat_buf); + stat(filename, &stat_buf); file_size = stat_buf.st_size; if (file_size != chunk_size * noProcessors) rprintf(rank, n, "invalid file size %d" @@ -147,7 +158,7 @@ int main (int argc, char *argv[]) { (b + 4096) & ~(4096-1)); } - sprintf(command, "od -Ad -a %s", FILENAME); + sprintf(command, "od -Ad -a %s", filename); system(command); MPI_Finalize(); exit(1); diff --git a/lustre/utils/lconf b/lustre/utils/lconf index 322e1f1..2b3f0e2 100755 --- a/lustre/utils/lconf +++ b/lustre/utils/lconf @@ -2608,11 +2608,24 @@ def main(): init_select(config.select) if len(args) > 0: - if not os.access(args[0], os.R_OK): + # allow config to be fetched via HTTP, but only with python2 + if sys.version[0] != '1' and args[0].startswith('http://'): + import urllib2 + try: + config_file = urllib2.urlopen(args[0]) + except (urllib2.URLError, socket.error), err: + if hasattr(err, 'args'): + err = err.args[1] + print "Could not access '%s': %s" %(args[0], err) + sys.exit(1) + elif not os.access(args[0], os.R_OK): print 'File not found or readable:', args[0] sys.exit(1) + else: + # regular file + config_file = open(args[0], 'r') try: - dom = xml.dom.minidom.parse(args[0]) + dom = xml.dom.minidom.parse(config_file) except Exception: panic("%s does not appear to be a config file." % (args[0])) sys.exit(1) # make sure to die here, even in debug mode. diff --git a/lustre/utils/lfs.c b/lustre/utils/lfs.c index 4685e46..ab354af 100644 --- a/lustre/utils/lfs.c +++ b/lustre/utils/lfs.c @@ -34,16 +34,12 @@ #include #include -#include +#include +#include #include "parser.h" #include "obdctl.h" -extern int op_find(char *path, struct obd_uuid *obduuid, int recursive, - int verbose, int quiet); -extern int op_check(int type_num, char **obd_type_p, char *dir); -extern int op_catinfo(char *dir, char *keyword, char *node_name); - /* all functions */ static int lfs_setstripe(int argc, char **argv); static int lfs_find(int argc, char **argv); @@ -55,8 +51,8 @@ static int lfs_catinfo(int argc, char **argv); /* all avaialable commands */ command_t cmdlist[] = { {"setstripe", lfs_setstripe, 0, - "To create a new file with a specific striping pattern.\n" - "usage: setstripe \n" + "To create a new file with a specific striping pattern, or to set default striping pattern on an existing directory\n" + "usage: setstripe \n" "\tstripe size: Number of bytes in each stripe (0 default)\n" "\tstripe start: OST index of first stripe (-1 default)\n" "\tstripe count: Number of OSTs to stripe over (0 default)"}, diff --git a/lustre/utils/liblustreapi.c b/lustre/utils/liblustreapi.c index bb5bbe1..987550c 100644 --- a/lustre/utils/liblustreapi.c +++ b/lustre/utils/liblustreapi.c @@ -45,7 +45,7 @@ #include #include #include -#include +#include #include #include @@ -74,11 +74,15 @@ int op_create_file(char *name, long stripe_size, int stripe_offset, lum.lmm_stripe_count = stripe_count; fd = open(name, O_CREAT | O_RDWR | O_LOV_DELAY_CREATE, 0644); + if (errno == EISDIR) + fd = open(name, O_DIRECTORY | O_RDONLY); + if (fd < 0) { err_msg("unable to open '%s'",name); rc = -errno; return rc; } + if (ioctl(fd, LL_IOC_LOV_SETSTRIPE, &lum)) { char *errmsg = "stripe already set"; if (errno != EEXIST && errno != EALREADY) @@ -96,7 +100,6 @@ int op_create_file(char *name, long stripe_size, int stripe_offset, return rc; } - struct find_param { int recursive; int verbose; @@ -250,6 +253,16 @@ void lov_dump_user_lmm_v1(struct lov_user_md_v1 *lum, char *dname, char *fname, obdstripe = 1; } + /* if it's a directory */ + if (*fname == '\0') { + if (header && (obdstripe == 1)) { + printf("count: %d, size: %d, offset: %d\n\n", + lum->lmm_stripe_count, lum->lmm_stripe_size, + (short int)lum->lmm_stripe_offset); + } + return; + } + if (header && (obdstripe == 1)) { printf("lmm_magic: 0x%08X\n", lum->lmm_magic); printf("lmm_object_gr: "LPX64"\n", lum->lmm_object_gr); @@ -367,6 +380,26 @@ static int process_file(DIR *dir, char *dname, char *fname, return 0; } +/* some 64bit libcs implement readdir64() by calling sys_getdents(). the + * kernel's sys_getdents() doesn't return d_type. */ +unsigned char handle_dt_unknown(char *parent, char *entry) +{ + char path[PATH_MAX + 1]; + int fd, ret; + + ret = snprintf(path, PATH_MAX, "%s/%s", parent, entry); + if (ret >= PATH_MAX) + return DT_UNKNOWN; + + fd = open(path, O_DIRECTORY|O_RDONLY); + if (fd < 0) { + if (errno == ENOTDIR) + return DT_REG; /* kind of a lie */ + return DT_UNKNOWN; + } + close(fd); + return DT_DIR; +} static int process_dir(DIR *dir, char *dname, struct find_param *param) { @@ -381,11 +414,31 @@ static int process_dir(DIR *dir, char *dname, struct find_param *param) return rc; } + /* retrieve dir's stripe info */ + strncpy((char *)param->lum, dname, param->buflen); + rc = ioctl(dirfd(dir), LL_IOC_LOV_GETSTRIPE, (void *)param->lum); + if (rc) { + if (errno == ENODATA) { + if (!param->obduuid && !param->quiet) + printf("%s/%s has no stripe info\n", + dname, ""); + rc = 0; + } else { + err_msg("IOC_MDC_GETSTRIPE ioctl failed"); + return errno; + } + } else { + lov_dump_user_lmm(param, dname, ""); + } + /* Handle the contents of the directory */ while ((dirp = readdir64(dir)) != NULL) { if (!strcmp(dirp->d_name, ".") || !strcmp(dirp->d_name, "..")) continue; + if (dirp->d_type == DT_UNKNOWN) + dirp->d_type = handle_dt_unknown(dname, dirp->d_name); + switch (dirp->d_type) { case DT_UNKNOWN: err_msg("\"%s\" is UNKNOWN type %d", dirp->d_name, -- 1.8.3.1