--- lustre-1.8.3.orig/lustre/kernel_patches/series/2.6.26-vanilla.series +++ lustre-1.8.3/lustre/kernel_patches/series/2.6.26-vanilla.series @@ -0,0 +1,2 @@ +lustre_version.patch +debian-2.6.26.diff --- lustre-1.8.3.orig/lustre/kernel_patches/series/2.6.27-vanilla.series +++ lustre-1.8.3/lustre/kernel_patches/series/2.6.27-vanilla.series @@ -0,0 +1,15 @@ +lustre_version.patch +vfs_races-2.6.22-vanilla.patch +iopen-misc-2.6.22-vanilla.patch +export-truncate-2.6.18-vanilla.patch +export_symbols-2.6.22-vanilla.patch +dev_read_only-2.6.27-vanilla.patch +export-2.6.27-vanilla.patch +export-show_task-2.6.27-vanilla.patch +sd_iostats-2.6.27-vanilla.patch +md-mmp-unplug-dev-2.6.27-vanilla.patch +quota-Split-off-quota-tree-handling-into-a-separate.patch +quota-Increase-size-of-variables-for-limits-and-ino.patch +quota-support-64-bit-quota-format-2.6.27-vanilla.patch +jbd2-jcberr-2.6-sles11.patch +jbd2-commit-timer-no-jiffies-rounding.diff --- lustre-1.8.3.orig/lustre/kernel_patches/patches/quota-Split-off-quota-tree-handling-into-a-separate.patch +++ lustre-1.8.3/lustre/kernel_patches/patches/quota-Split-off-quota-tree-handling-into-a-separate.patch @@ -0,0 +1,1593 @@ +From: Jan Kara +References: fate#302681 +Subject: [PATCH 12/28] quota: Split off quota tree handling into a separate file +Patch-mainline: 2.6.29? + +There is going to be a new version of quota format having 64-bit +quota limits and a new quota format for OCFS2. They are both +going to use the same tree structure as VFSv0 quota format. So +split out tree handling into a separate file and make size of +leaf blocks, amount of space usable in each block (needed for +checksumming) and structures contained in them configurable +so that the code can be shared. + +Signed-off-by: Jan Kara +--- + fs/Kconfig | 5 + fs/Makefile | 1 + fs/quota_tree.c | 645 ++++++++++++++++++++++++++++++++++++++++++++ + fs/quota_tree.h | 25 + + fs/quota_v2.c | 598 +++------------------------------------- + fs/quotaio_v2.h | 33 -- + include/linux/dqblk_qtree.h | 56 +++ + include/linux/dqblk_v2.h | 19 - + 8 files changed, 800 insertions(+), 582 deletions(-) + create mode 100644 fs/quota_tree.c + create mode 100644 fs/quota_tree.h + create mode 100644 include/linux/dqblk_qtree.h + +Index: linux-2.6.27.36/fs/Kconfig +=================================================================== +--- linux-2.6.27.36.orig/fs/Kconfig 2009-10-05 17:19:01.000000000 +0200 ++++ linux-2.6.27.36/fs/Kconfig 2009-10-08 16:32:48.000000000 +0200 +@@ -569,6 +569,10 @@ + Note that this behavior is currently deprecated and may go away in + future. Please use notification via netlink socket instead. + ++# Generic support for tree structured quota files. Seleted when needed. ++config QUOTA_TREE ++ tristate ++ + config QFMT_V1 + tristate "Old quota format support" + depends on QUOTA +@@ -580,6 +584,7 @@ + config QFMT_V2 + tristate "Quota format v2 support" + depends on QUOTA ++ select QUOTA_TREE + help + This quota format allows using quotas with 32-bit UIDs/GIDs. If you + need this functionality say Y here. +Index: linux-2.6.27.36/fs/Makefile +=================================================================== +--- linux-2.6.27.36.orig/fs/Makefile 2009-10-05 17:19:01.000000000 +0200 ++++ linux-2.6.27.36/fs/Makefile 2009-10-08 16:32:48.000000000 +0200 +@@ -53,6 +53,7 @@ + obj-$(CONFIG_QUOTA) += dquot.o + obj-$(CONFIG_QFMT_V1) += quota_v1.o + obj-$(CONFIG_QFMT_V2) += quota_v2.o ++obj-$(CONFIG_QUOTA_TREE) += quota_tree.o + obj-$(CONFIG_QUOTACTL) += quota.o + + obj-$(CONFIG_DNOTIFY) += dnotify.o +Index: linux-2.6.27.36/include/linux/quotaio_v2.h +=================================================================== +--- linux-2.6.27.36.orig/include/linux/quotaio_v2.h 2009-10-05 17:19:01.000000000 +0200 ++++ linux-2.6.27.36/include/linux/quotaio_v2.h 2009-10-08 16:32:48.000000000 +0200 +@@ -21,6 +21,12 @@ + 0 /* GRPQUOTA */\ + } + ++/* First generic header */ ++struct v2_disk_dqheader { ++ __le32 dqh_magic; /* Magic number identifying file */ ++ __le32 dqh_version; /* File version */ ++}; ++ + /* + * The following structure defines the format of the disk quota file + * (as it appears on disk) - the file is a radix tree whose leaves point +@@ -38,15 +44,6 @@ + __le64 dqb_itime; /* time limit for excessive inode use */ + }; + +-/* +- * Here are header structures as written on disk and their in-memory copies +- */ +-/* First generic header */ +-struct v2_disk_dqheader { +- __le32 dqh_magic; /* Magic number identifying file */ +- __le32 dqh_version; /* File version */ +-}; +- + /* Header with type and version specific information */ + struct v2_disk_dqinfo { + __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ +@@ -57,23 +54,7 @@ + __le32 dqi_free_entry; /* Number of block with at least one free entry */ + }; + +-/* +- * Structure of header of block with quota structures. It is padded to 16 bytes so +- * there will be space for exactly 21 quota-entries in a block +- */ +-struct v2_disk_dqdbheader { +- __le32 dqdh_next_free; /* Number of next block with free entry */ +- __le32 dqdh_prev_free; /* Number of previous block with free entry */ +- __le16 dqdh_entries; /* Number of valid entries in block */ +- __le16 dqdh_pad1; +- __le32 dqdh_pad2; +-}; +- + #define V2_DQINFOOFF sizeof(struct v2_disk_dqheader) /* Offset of info header in file */ +-#define V2_DQBLKSIZE_BITS 10 +-#define V2_DQBLKSIZE (1 << V2_DQBLKSIZE_BITS) /* Size of block with quota structures */ +-#define V2_DQTREEOFF 1 /* Offset of tree in file in blocks */ +-#define V2_DQTREEDEPTH 4 /* Depth of quota tree */ +-#define V2_DQSTRINBLK ((V2_DQBLKSIZE - sizeof(struct v2_disk_dqdbheader)) / sizeof(struct v2_disk_dqblk)) /* Number of entries in one blocks */ ++#define V2_DQBLKSIZE_BITS 10 /* Size of leaf block in tree */ + + #endif /* _LINUX_QUOTAIO_V2_H */ +Index: linux-2.6.27.36/fs/quota_tree.c +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.27.36/fs/quota_tree.c 2009-10-08 16:32:48.000000000 +0200 +@@ -0,0 +1,645 @@ ++/* ++ * vfsv0 quota IO operations on file ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++ ++#include "quota_tree.h" ++ ++MODULE_AUTHOR("Jan Kara"); ++MODULE_DESCRIPTION("Quota trie support"); ++MODULE_LICENSE("GPL"); ++ ++#define __QUOTA_QT_PARANOIA ++ ++typedef char *dqbuf_t; ++ ++static int get_index(struct qtree_mem_dqinfo *info, qid_t id, int depth) ++{ ++ unsigned int epb = info->dqi_usable_bs >> 2; ++ ++ depth = info->dqi_qtree_depth - depth - 1; ++ while (depth--) ++ id /= epb; ++ return id % epb; ++} ++ ++/* Number of entries in one blocks */ ++static inline int qtree_dqstr_in_blk(struct qtree_mem_dqinfo *info) ++{ ++ return (info->dqi_usable_bs - sizeof(struct qt_disk_dqdbheader)) ++ / info->dqi_entry_size; ++} ++ ++static dqbuf_t getdqbuf(size_t size) ++{ ++ dqbuf_t buf = kmalloc(size, GFP_NOFS); ++ if (!buf) ++ printk(KERN_WARNING "VFS: Not enough memory for quota buffers.\n"); ++ return buf; ++} ++ ++static inline void freedqbuf(dqbuf_t buf) ++{ ++ kfree(buf); ++} ++ ++static inline ssize_t read_blk(struct qtree_mem_dqinfo *info, uint blk, dqbuf_t buf) ++{ ++ struct super_block *sb = info->dqi_sb; ++ ++ memset(buf, 0, info->dqi_usable_bs); ++ return sb->s_op->quota_read(sb, info->dqi_type, (char *)buf, ++ info->dqi_usable_bs, blk << info->dqi_blocksize_bits); ++} ++ ++static inline ssize_t write_blk(struct qtree_mem_dqinfo *info, uint blk, dqbuf_t buf) ++{ ++ struct super_block *sb = info->dqi_sb; ++ ++ return sb->s_op->quota_write(sb, info->dqi_type, (char *)buf, ++ info->dqi_usable_bs, blk << info->dqi_blocksize_bits); ++} ++ ++/* Remove empty block from list and return it */ ++static int get_free_dqblk(struct qtree_mem_dqinfo *info) ++{ ++ dqbuf_t buf = getdqbuf(info->dqi_usable_bs); ++ struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; ++ int ret, blk; ++ ++ if (!buf) ++ return -ENOMEM; ++ if (info->dqi_free_blk) { ++ blk = info->dqi_free_blk; ++ ret = read_blk(info, blk, buf); ++ if (ret < 0) ++ goto out_buf; ++ info->dqi_free_blk = le32_to_cpu(dh->dqdh_next_free); ++ } ++ else { ++ memset(buf, 0, info->dqi_usable_bs); ++ /* Assure block allocation... */ ++ ret = write_blk(info, info->dqi_blocks, buf); ++ if (ret < 0) ++ goto out_buf; ++ blk = info->dqi_blocks++; ++ } ++ mark_info_dirty(info->dqi_sb, info->dqi_type); ++ ret = blk; ++out_buf: ++ freedqbuf(buf); ++ return ret; ++} ++ ++/* Insert empty block to the list */ ++static int put_free_dqblk(struct qtree_mem_dqinfo *info, dqbuf_t buf, uint blk) ++{ ++ struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; ++ int err; ++ ++ dh->dqdh_next_free = cpu_to_le32(info->dqi_free_blk); ++ dh->dqdh_prev_free = cpu_to_le32(0); ++ dh->dqdh_entries = cpu_to_le16(0); ++ err = write_blk(info, blk, buf); ++ if (err < 0) ++ return err; ++ info->dqi_free_blk = blk; ++ mark_info_dirty(info->dqi_sb, info->dqi_type); ++ return 0; ++} ++ ++/* Remove given block from the list of blocks with free entries */ ++static int remove_free_dqentry(struct qtree_mem_dqinfo *info, dqbuf_t buf, uint blk) ++{ ++ dqbuf_t tmpbuf = getdqbuf(info->dqi_usable_bs); ++ struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; ++ uint nextblk = le32_to_cpu(dh->dqdh_next_free); ++ uint prevblk = le32_to_cpu(dh->dqdh_prev_free); ++ int err; ++ ++ if (!tmpbuf) ++ return -ENOMEM; ++ if (nextblk) { ++ err = read_blk(info, nextblk, tmpbuf); ++ if (err < 0) ++ goto out_buf; ++ ((struct qt_disk_dqdbheader *)tmpbuf)->dqdh_prev_free = ++ dh->dqdh_prev_free; ++ err = write_blk(info, nextblk, tmpbuf); ++ if (err < 0) ++ goto out_buf; ++ } ++ if (prevblk) { ++ err = read_blk(info, prevblk, tmpbuf); ++ if (err < 0) ++ goto out_buf; ++ ((struct qt_disk_dqdbheader *)tmpbuf)->dqdh_next_free = ++ dh->dqdh_next_free; ++ err = write_blk(info, prevblk, tmpbuf); ++ if (err < 0) ++ goto out_buf; ++ } else { ++ info->dqi_free_entry = nextblk; ++ mark_info_dirty(info->dqi_sb, info->dqi_type); ++ } ++ freedqbuf(tmpbuf); ++ dh->dqdh_next_free = dh->dqdh_prev_free = cpu_to_le32(0); ++ /* No matter whether write succeeds block is out of list */ ++ if (write_blk(info, blk, buf) < 0) ++ printk(KERN_ERR "VFS: Can't write block (%u) with free entries.\n", blk); ++ return 0; ++out_buf: ++ freedqbuf(tmpbuf); ++ return err; ++} ++ ++/* Insert given block to the beginning of list with free entries */ ++static int insert_free_dqentry(struct qtree_mem_dqinfo *info, dqbuf_t buf, uint blk) ++{ ++ dqbuf_t tmpbuf = getdqbuf(info->dqi_usable_bs); ++ struct qt_disk_dqdbheader *dh = (struct qt_disk_dqdbheader *)buf; ++ int err; ++ ++ if (!tmpbuf) ++ return -ENOMEM; ++ dh->dqdh_next_free = cpu_to_le32(info->dqi_free_entry); ++ dh->dqdh_prev_free = cpu_to_le32(0); ++ err = write_blk(info, blk, buf); ++ if (err < 0) ++ goto out_buf; ++ if (info->dqi_free_entry) { ++ err = read_blk(info, info->dqi_free_entry, tmpbuf); ++ if (err < 0) ++ goto out_buf; ++ ((struct qt_disk_dqdbheader *)tmpbuf)->dqdh_prev_free = ++ cpu_to_le32(blk); ++ err = write_blk(info, info->dqi_free_entry, tmpbuf); ++ if (err < 0) ++ goto out_buf; ++ } ++ freedqbuf(tmpbuf); ++ info->dqi_free_entry = blk; ++ mark_info_dirty(info->dqi_sb, info->dqi_type); ++ return 0; ++out_buf: ++ freedqbuf(tmpbuf); ++ return err; ++} ++ ++/* Is the entry in the block free? */ ++int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk) ++{ ++ int i; ++ ++ for (i = 0; i < info->dqi_entry_size; i++) ++ if (disk[i]) ++ return 0; ++ return 1; ++} ++EXPORT_SYMBOL(qtree_entry_unused); ++ ++/* Find space for dquot */ ++static uint find_free_dqentry(struct qtree_mem_dqinfo *info, ++ struct dquot *dquot, int *err) ++{ ++ uint blk, i; ++ struct qt_disk_dqdbheader *dh; ++ dqbuf_t buf = getdqbuf(info->dqi_usable_bs); ++ char *ddquot; ++ ++ *err = 0; ++ if (!buf) { ++ *err = -ENOMEM; ++ return 0; ++ } ++ dh = (struct qt_disk_dqdbheader *)buf; ++ if (info->dqi_free_entry) { ++ blk = info->dqi_free_entry; ++ *err = read_blk(info, blk, buf); ++ if (*err < 0) ++ goto out_buf; ++ } else { ++ blk = get_free_dqblk(info); ++ if ((int)blk < 0) { ++ *err = blk; ++ freedqbuf(buf); ++ return 0; ++ } ++ memset(buf, 0, info->dqi_usable_bs); ++ /* This is enough as block is already zeroed and entry list is empty... */ ++ info->dqi_free_entry = blk; ++ mark_info_dirty(dquot->dq_sb, dquot->dq_type); ++ } ++ /* Block will be full? */ ++ if (le16_to_cpu(dh->dqdh_entries) + 1 >= qtree_dqstr_in_blk(info)) { ++ *err = remove_free_dqentry(info, buf, blk); ++ if (*err < 0) { ++ printk(KERN_ERR "VFS: find_free_dqentry(): Can't " ++ "remove block (%u) from entry free list.\n", ++ blk); ++ goto out_buf; ++ } ++ } ++ le16_add_cpu(&dh->dqdh_entries, 1); ++ /* Find free structure in block */ ++ for (i = 0, ddquot = ((char *)buf) + sizeof(struct qt_disk_dqdbheader); ++ i < qtree_dqstr_in_blk(info) && !qtree_entry_unused(info, ddquot); ++ i++, ddquot += info->dqi_entry_size); ++#ifdef __QUOTA_QT_PARANOIA ++ if (i == qtree_dqstr_in_blk(info)) { ++ printk(KERN_ERR "VFS: find_free_dqentry(): Data block full " ++ "but it shouldn't.\n"); ++ *err = -EIO; ++ goto out_buf; ++ } ++#endif ++ *err = write_blk(info, blk, buf); ++ if (*err < 0) { ++ printk(KERN_ERR "VFS: find_free_dqentry(): Can't write quota " ++ "data block %u.\n", blk); ++ goto out_buf; ++ } ++ dquot->dq_off = (blk << info->dqi_blocksize_bits) + ++ sizeof(struct qt_disk_dqdbheader) + ++ i * info->dqi_entry_size; ++ freedqbuf(buf); ++ return blk; ++out_buf: ++ freedqbuf(buf); ++ return 0; ++} ++ ++/* Insert reference to structure into the trie */ ++static int do_insert_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot, ++ uint *treeblk, int depth) ++{ ++ dqbuf_t buf = getdqbuf(info->dqi_usable_bs); ++ int ret = 0, newson = 0, newact = 0; ++ __le32 *ref; ++ uint newblk; ++ ++ if (!buf) ++ return -ENOMEM; ++ if (!*treeblk) { ++ ret = get_free_dqblk(info); ++ if (ret < 0) ++ goto out_buf; ++ *treeblk = ret; ++ memset(buf, 0, info->dqi_usable_bs); ++ newact = 1; ++ } else { ++ ret = read_blk(info, *treeblk, buf); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't read tree quota block " ++ "%u.\n", *treeblk); ++ goto out_buf; ++ } ++ } ++ ref = (__le32 *)buf; ++ newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); ++ if (!newblk) ++ newson = 1; ++ if (depth == info->dqi_qtree_depth - 1) { ++#ifdef __QUOTA_QT_PARANOIA ++ if (newblk) { ++ printk(KERN_ERR "VFS: Inserting already present quota " ++ "entry (block %u).\n", ++ le32_to_cpu(ref[get_index(info, ++ dquot->dq_id, depth)])); ++ ret = -EIO; ++ goto out_buf; ++ } ++#endif ++ newblk = find_free_dqentry(info, dquot, &ret); ++ } else { ++ ret = do_insert_tree(info, dquot, &newblk, depth+1); ++ } ++ if (newson && ret >= 0) { ++ ref[get_index(info, dquot->dq_id, depth)] = ++ cpu_to_le32(newblk); ++ ret = write_blk(info, *treeblk, buf); ++ } else if (newact && ret < 0) { ++ put_free_dqblk(info, buf, *treeblk); ++ } ++out_buf: ++ freedqbuf(buf); ++ return ret; ++} ++ ++/* Wrapper for inserting quota structure into tree */ ++static inline int dq_insert_tree(struct qtree_mem_dqinfo *info, ++ struct dquot *dquot) ++{ ++ int tmp = QT_TREEOFF; ++ return do_insert_tree(info, dquot, &tmp, 0); ++} ++ ++/* ++ * We don't have to be afraid of deadlocks as we never have quotas on quota files... ++ */ ++int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) ++{ ++ int type = dquot->dq_type; ++ struct super_block *sb = dquot->dq_sb; ++ ssize_t ret; ++ dqbuf_t ddquot = getdqbuf(info->dqi_entry_size); ++ ++ if (!ddquot) ++ return -ENOMEM; ++ ++ /* dq_off is guarded by dqio_mutex */ ++ if (!dquot->dq_off) { ++ ret = dq_insert_tree(info, dquot); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Error %zd occurred while " ++ "creating quota.\n", ret); ++ freedqbuf(ddquot); ++ return ret; ++ } ++ } ++ spin_lock(&dq_data_lock); ++ info->dqi_ops->mem2disk_dqblk(ddquot, dquot); ++ spin_unlock(&dq_data_lock); ++ ret = sb->s_op->quota_write(sb, type, (char *)ddquot, ++ info->dqi_entry_size, dquot->dq_off); ++ if (ret != info->dqi_entry_size) { ++ printk(KERN_WARNING "VFS: dquota write failed on dev %s\n", ++ sb->s_id); ++ if (ret >= 0) ++ ret = -ENOSPC; ++ } else { ++ ret = 0; ++ } ++ dqstats.writes++; ++ freedqbuf(ddquot); ++ ++ return ret; ++} ++EXPORT_SYMBOL(qtree_write_dquot); ++ ++/* Free dquot entry in data block */ ++static int free_dqentry(struct qtree_mem_dqinfo *info, struct dquot *dquot, ++ uint blk) ++{ ++ struct qt_disk_dqdbheader *dh; ++ dqbuf_t buf = getdqbuf(info->dqi_usable_bs); ++ int ret = 0; ++ ++ if (!buf) ++ return -ENOMEM; ++ if (dquot->dq_off >> info->dqi_blocksize_bits != blk) { ++ printk(KERN_ERR "VFS: Quota structure has offset to other " ++ "block (%u) than it should (%u).\n", blk, ++ (uint)(dquot->dq_off >> info->dqi_blocksize_bits)); ++ goto out_buf; ++ } ++ ret = read_blk(info, blk, buf); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't read quota data block %u\n", blk); ++ goto out_buf; ++ } ++ dh = (struct qt_disk_dqdbheader *)buf; ++ le16_add_cpu(&dh->dqdh_entries, -1); ++ if (!le16_to_cpu(dh->dqdh_entries)) { /* Block got free? */ ++ ret = remove_free_dqentry(info, buf, blk); ++ if (ret >= 0) ++ ret = put_free_dqblk(info, buf, blk); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't move quota data block (%u) " ++ "to free list.\n", blk); ++ goto out_buf; ++ } ++ } else { ++ memset(buf + ++ (dquot->dq_off & ((1 << info->dqi_blocksize_bits) - 1)), ++ 0, info->dqi_entry_size); ++ if (le16_to_cpu(dh->dqdh_entries) == ++ qtree_dqstr_in_blk(info) - 1) { ++ /* Insert will write block itself */ ++ ret = insert_free_dqentry(info, buf, blk); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't insert quota data " ++ "block (%u) to free entry list.\n", blk); ++ goto out_buf; ++ } ++ } else { ++ ret = write_blk(info, blk, buf); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't write quota data " ++ "block %u\n", blk); ++ goto out_buf; ++ } ++ } ++ } ++ dquot->dq_off = 0; /* Quota is now unattached */ ++out_buf: ++ freedqbuf(buf); ++ return ret; ++} ++ ++/* Remove reference to dquot from tree */ ++static int remove_tree(struct qtree_mem_dqinfo *info, struct dquot *dquot, ++ uint *blk, int depth) ++{ ++ dqbuf_t buf = getdqbuf(info->dqi_usable_bs); ++ int ret = 0; ++ uint newblk; ++ __le32 *ref = (__le32 *)buf; ++ ++ if (!buf) ++ return -ENOMEM; ++ ret = read_blk(info, *blk, buf); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't read quota data block %u\n", *blk); ++ goto out_buf; ++ } ++ newblk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); ++ if (depth == info->dqi_qtree_depth - 1) { ++ ret = free_dqentry(info, dquot, newblk); ++ newblk = 0; ++ } else { ++ ret = remove_tree(info, dquot, &newblk, depth+1); ++ } ++ if (ret >= 0 && !newblk) { ++ int i; ++ ref[get_index(info, dquot->dq_id, depth)] = cpu_to_le32(0); ++ /* Block got empty? */ ++ for (i = 0; ++ i < (info->dqi_usable_bs >> 2) && !ref[i]; ++ i++); ++ /* Don't put the root block into the free block list */ ++ if (i == (info->dqi_usable_bs >> 2) ++ && *blk != QT_TREEOFF) { ++ put_free_dqblk(info, buf, *blk); ++ *blk = 0; ++ } else { ++ ret = write_blk(info, *blk, buf); ++ if (ret < 0) ++ printk(KERN_ERR "VFS: Can't write quota tree " ++ "block %u.\n", *blk); ++ } ++ } ++out_buf: ++ freedqbuf(buf); ++ return ret; ++} ++ ++/* Delete dquot from tree */ ++int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) ++{ ++ uint tmp = QT_TREEOFF; ++ ++ if (!dquot->dq_off) /* Even not allocated? */ ++ return 0; ++ return remove_tree(info, dquot, &tmp, 0); ++} ++EXPORT_SYMBOL(qtree_delete_dquot); ++ ++/* Find entry in block */ ++static loff_t find_block_dqentry(struct qtree_mem_dqinfo *info, ++ struct dquot *dquot, uint blk) ++{ ++ dqbuf_t buf = getdqbuf(info->dqi_usable_bs); ++ loff_t ret = 0; ++ int i; ++ char *ddquot; ++ ++ if (!buf) ++ return -ENOMEM; ++ ret = read_blk(info, blk, buf); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk); ++ goto out_buf; ++ } ++ for (i = 0, ddquot = ((char *)buf) + sizeof(struct qt_disk_dqdbheader); ++ i < qtree_dqstr_in_blk(info) && !info->dqi_ops->is_id(ddquot, dquot); ++ i++, ddquot += info->dqi_entry_size); ++ if (i == qtree_dqstr_in_blk(info)) { ++ printk(KERN_ERR "VFS: Quota for id %u referenced " ++ "but not present.\n", dquot->dq_id); ++ ret = -EIO; ++ goto out_buf; ++ } else { ++ ret = (blk << info->dqi_blocksize_bits) + sizeof(struct ++ qt_disk_dqdbheader) + i * info->dqi_entry_size; ++ } ++out_buf: ++ freedqbuf(buf); ++ return ret; ++} ++ ++/* Find entry for given id in the tree */ ++static loff_t find_tree_dqentry(struct qtree_mem_dqinfo *info, ++ struct dquot *dquot, uint blk, int depth) ++{ ++ dqbuf_t buf = getdqbuf(info->dqi_usable_bs); ++ loff_t ret = 0; ++ __le32 *ref = (__le32 *)buf; ++ ++ if (!buf) ++ return -ENOMEM; ++ ret = read_blk(info, blk, buf); ++ if (ret < 0) { ++ printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk); ++ goto out_buf; ++ } ++ ret = 0; ++ blk = le32_to_cpu(ref[get_index(info, dquot->dq_id, depth)]); ++ if (!blk) /* No reference? */ ++ goto out_buf; ++ if (depth < info->dqi_qtree_depth - 1) ++ ret = find_tree_dqentry(info, dquot, blk, depth+1); ++ else ++ ret = find_block_dqentry(info, dquot, blk); ++out_buf: ++ freedqbuf(buf); ++ return ret; ++} ++ ++/* Find entry for given id in the tree - wrapper function */ ++static inline loff_t find_dqentry(struct qtree_mem_dqinfo *info, ++ struct dquot *dquot) ++{ ++ return find_tree_dqentry(info, dquot, QT_TREEOFF, 0); ++} ++ ++int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) ++{ ++ int type = dquot->dq_type; ++ struct super_block *sb = dquot->dq_sb; ++ loff_t offset; ++ dqbuf_t ddquot; ++ int ret = 0; ++ ++#ifdef __QUOTA_QT_PARANOIA ++ /* Invalidated quota? */ ++ if (!sb_dqopt(dquot->dq_sb)->files[type]) { ++ printk(KERN_ERR "VFS: Quota invalidated while reading!\n"); ++ return -EIO; ++ } ++#endif ++ /* Do we know offset of the dquot entry in the quota file? */ ++ if (!dquot->dq_off) { ++ offset = find_dqentry(info, dquot); ++ if (offset <= 0) { /* Entry not present? */ ++ if (offset < 0) ++ printk(KERN_ERR "VFS: Can't read quota " ++ "structure for id %u.\n", dquot->dq_id); ++ dquot->dq_off = 0; ++ set_bit(DQ_FAKE_B, &dquot->dq_flags); ++ memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); ++ ret = offset; ++ goto out; ++ } ++ dquot->dq_off = offset; ++ } ++ ddquot = getdqbuf(info->dqi_entry_size); ++ if (!ddquot) ++ return -ENOMEM; ++ ret = sb->s_op->quota_read(sb, type, (char *)ddquot, ++ info->dqi_entry_size, dquot->dq_off); ++ if (ret != info->dqi_entry_size) { ++ if (ret >= 0) ++ ret = -EIO; ++ printk(KERN_ERR "VFS: Error while reading quota " ++ "structure for id %u.\n", dquot->dq_id); ++ set_bit(DQ_FAKE_B, &dquot->dq_flags); ++ memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); ++ freedqbuf(ddquot); ++ goto out; ++ } ++ spin_lock(&dq_data_lock); ++ info->dqi_ops->disk2mem_dqblk(dquot, ddquot); ++ if (!dquot->dq_dqb.dqb_bhardlimit && ++ !dquot->dq_dqb.dqb_bsoftlimit && ++ !dquot->dq_dqb.dqb_ihardlimit && ++ !dquot->dq_dqb.dqb_isoftlimit) ++ set_bit(DQ_FAKE_B, &dquot->dq_flags); ++ spin_unlock(&dq_data_lock); ++ freedqbuf(ddquot); ++out: ++ dqstats.reads++; ++ return ret; ++} ++EXPORT_SYMBOL(qtree_read_dquot); ++ ++/* Check whether dquot should not be deleted. We know we are ++ * the only one operating on dquot (thanks to dq_lock) */ ++int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot) ++{ ++ if (test_bit(DQ_FAKE_B, &dquot->dq_flags) && !(dquot->dq_dqb.dqb_curinodes | dquot->dq_dqb.dqb_curspace)) ++ return qtree_delete_dquot(info, dquot); ++ return 0; ++} ++EXPORT_SYMBOL(qtree_release_dquot); +Index: linux-2.6.27.36/fs/quota_tree.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.27.36/fs/quota_tree.h 2009-10-08 16:32:48.000000000 +0200 +@@ -0,0 +1,25 @@ ++/* ++ * Definitions of structures for vfsv0 quota format ++ */ ++ ++#ifndef _LINUX_QUOTA_TREE_H ++#define _LINUX_QUOTA_TREE_H ++ ++#include ++#include ++ ++/* ++ * Structure of header of block with quota structures. It is padded to 16 bytes so ++ * there will be space for exactly 21 quota-entries in a block ++ */ ++struct qt_disk_dqdbheader { ++ __le32 dqdh_next_free; /* Number of next block with free entry */ ++ __le32 dqdh_prev_free; /* Number of previous block with free entry */ ++ __le16 dqdh_entries; /* Number of valid entries in block */ ++ __le16 dqdh_pad1; ++ __le32 dqdh_pad2; ++}; ++ ++#define QT_TREEOFF 1 /* Offset of tree in file in blocks */ ++ ++#endif /* _LINUX_QUOTAIO_TREE_H */ +Index: linux-2.6.27.36/fs/quota_v2.c +=================================================================== +--- linux-2.6.27.36.orig/fs/quota_v2.c 2009-10-05 17:19:01.000000000 +0200 ++++ linux-2.6.27.36/fs/quota_v2.c 2009-10-08 16:34:36.000000000 +0200 +@@ -6,6 +6,7 @@ + #include + #include + #include ++#include "quota_tree.h" + #include + #include + #include +@@ -15,16 +16,22 @@ + + #include + ++ + MODULE_AUTHOR("Jan Kara"); + MODULE_DESCRIPTION("Quota format v2 support"); + MODULE_LICENSE("GPL"); + + #define __QUOTA_V2_PARANOIA + +-typedef char *dqbuf_t; +- +-#define GETIDINDEX(id, depth) (((id) >> ((V2_DQTREEDEPTH-(depth)-1)*8)) & 0xff) +-#define GETENTRIES(buf) ((struct v2_disk_dqblk *)(((char *)buf)+sizeof(struct v2_disk_dqdbheader))) ++static void v2_mem2diskdqb(void *dp, struct dquot *dquot); ++static void v2_disk2memdqb(struct dquot *dquot, void *dp); ++static int v2_is_id(void *dp, struct dquot *dquot); ++ ++static struct qtree_fmt_operations v2_qtree_ops = { ++ .mem2disk_dqblk = v2_mem2diskdqb, ++ .disk2mem_dqblk = v2_disk2memdqb, ++ .is_id = v2_is_id, ++}; + + /* Check whether given file is really vfsv0 quotafile */ + static int v2_check_quota_file(struct super_block *sb, int type) +@@ -50,7 +57,7 @@ + static int v2_read_file_info(struct super_block *sb, int type) + { + struct v2_disk_dqinfo dinfo; +- struct mem_dqinfo *info = sb_dqopt(sb)->info+type; ++ struct mem_dqinfo *info = sb_dqinfo(sb, type); + ssize_t size; + + size = sb->s_op->quota_read(sb, type, (char *)&dinfo, +@@ -66,9 +73,16 @@ + info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace); + info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace); + info->dqi_flags = le32_to_cpu(dinfo.dqi_flags); +- info->u.v2_i.dqi_blocks = le32_to_cpu(dinfo.dqi_blocks); +- info->u.v2_i.dqi_free_blk = le32_to_cpu(dinfo.dqi_free_blk); +- info->u.v2_i.dqi_free_entry = le32_to_cpu(dinfo.dqi_free_entry); ++ info->u.v2_i.i.dqi_sb = sb; ++ info->u.v2_i.i.dqi_type = type; ++ info->u.v2_i.i.dqi_blocks = le32_to_cpu(dinfo.dqi_blocks); ++ info->u.v2_i.i.dqi_free_blk = le32_to_cpu(dinfo.dqi_free_blk); ++ info->u.v2_i.i.dqi_free_entry = le32_to_cpu(dinfo.dqi_free_entry); ++ info->u.v2_i.i.dqi_blocksize_bits = V2_DQBLKSIZE_BITS; ++ info->u.v2_i.i.dqi_usable_bs = 1 << V2_DQBLKSIZE_BITS; ++ info->u.v2_i.i.dqi_qtree_depth = qtree_depth(&info->u.v2_i.i); ++ info->u.v2_i.i.dqi_entry_size = sizeof(struct v2_disk_dqblk); ++ info->u.v2_i.i.dqi_ops = &v2_qtree_ops; + return 0; + } + +@@ -76,7 +90,7 @@ + static int v2_write_file_info(struct super_block *sb, int type) + { + struct v2_disk_dqinfo dinfo; +- struct mem_dqinfo *info = sb_dqopt(sb)->info+type; ++ struct mem_dqinfo *info = sb_dqinfo(sb, type); + ssize_t size; + + spin_lock(&dq_data_lock); +@@ -85,9 +99,9 @@ + dinfo.dqi_igrace = cpu_to_le32(info->dqi_igrace); + dinfo.dqi_flags = cpu_to_le32(info->dqi_flags & DQF_MASK); + spin_unlock(&dq_data_lock); +- dinfo.dqi_blocks = cpu_to_le32(info->u.v2_i.dqi_blocks); +- dinfo.dqi_free_blk = cpu_to_le32(info->u.v2_i.dqi_free_blk); +- dinfo.dqi_free_entry = cpu_to_le32(info->u.v2_i.dqi_free_entry); ++ dinfo.dqi_blocks = cpu_to_le32(info->u.v2_i.i.dqi_blocks); ++ dinfo.dqi_free_blk = cpu_to_le32(info->u.v2_i.i.dqi_free_blk); ++ dinfo.dqi_free_entry = cpu_to_le32(info->u.v2_i.i.dqi_free_entry); + size = sb->s_op->quota_write(sb, type, (char *)&dinfo, + sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); + if (size != sizeof(struct v2_disk_dqinfo)) { +@@ -98,8 +112,11 @@ + return 0; + } + +-static void disk2memdqb(struct mem_dqblk *m, struct v2_disk_dqblk *d) ++static void v2_disk2memdqb(struct dquot *dquot, void *dp) + { ++ struct v2_disk_dqblk *d = dp, empty; ++ struct mem_dqblk *m = &dquot->dq_dqb; ++ + m->dqb_ihardlimit = le32_to_cpu(d->dqb_ihardlimit); + m->dqb_isoftlimit = le32_to_cpu(d->dqb_isoftlimit); + m->dqb_curinodes = le32_to_cpu(d->dqb_curinodes); +@@ -108,10 +125,20 @@ + m->dqb_bsoftlimit = le32_to_cpu(d->dqb_bsoftlimit); + m->dqb_curspace = le64_to_cpu(d->dqb_curspace); + m->dqb_btime = le64_to_cpu(d->dqb_btime); ++ /* We need to escape back all-zero structure */ ++ memset(&empty, 0, sizeof(struct v2_disk_dqblk)); ++ empty.dqb_itime = cpu_to_le64(1); ++ if (!memcmp(&empty, dp, sizeof(struct v2_disk_dqblk))) ++ m->dqb_itime = 0; + } + +-static void mem2diskdqb(struct v2_disk_dqblk *d, struct mem_dqblk *m, qid_t id) ++static void v2_mem2diskdqb(void *dp, struct dquot *dquot) + { ++ struct v2_disk_dqblk *d = dp; ++ struct mem_dqblk *m = &dquot->dq_dqb; ++ struct qtree_mem_dqinfo *info = ++ &sb_dqinfo(dquot->dq_sb, dquot->dq_type)->u.v2_i.i; ++ + d->dqb_ihardlimit = cpu_to_le32(m->dqb_ihardlimit); + d->dqb_isoftlimit = cpu_to_le32(m->dqb_isoftlimit); + d->dqb_curinodes = cpu_to_le32(m->dqb_curinodes); +@@ -120,553 +147,35 @@ + d->dqb_bsoftlimit = cpu_to_le32(m->dqb_bsoftlimit); + d->dqb_curspace = cpu_to_le64(m->dqb_curspace); + d->dqb_btime = cpu_to_le64(m->dqb_btime); +- d->dqb_id = cpu_to_le32(id); +-} +- +-static dqbuf_t getdqbuf(void) +-{ +- dqbuf_t buf = kmalloc(V2_DQBLKSIZE, GFP_NOFS); +- if (!buf) +- printk(KERN_WARNING "VFS: Not enough memory for quota buffers.\n"); +- return buf; +-} +- +-static inline void freedqbuf(dqbuf_t buf) +-{ +- kfree(buf); +-} +- +-static inline ssize_t read_blk(struct super_block *sb, int type, uint blk, dqbuf_t buf) +-{ +- memset(buf, 0, V2_DQBLKSIZE); +- return sb->s_op->quota_read(sb, type, (char *)buf, +- V2_DQBLKSIZE, blk << V2_DQBLKSIZE_BITS); +-} +- +-static inline ssize_t write_blk(struct super_block *sb, int type, uint blk, dqbuf_t buf) +-{ +- return sb->s_op->quota_write(sb, type, (char *)buf, +- V2_DQBLKSIZE, blk << V2_DQBLKSIZE_BITS); ++ d->dqb_id = cpu_to_le32(dquot->dq_id); ++ if (qtree_entry_unused(info, dp)) ++ d->dqb_itime = cpu_to_le64(1); + } + +-/* Remove empty block from list and return it */ +-static int get_free_dqblk(struct super_block *sb, int type) ++static int v2_is_id(void *dp, struct dquot *dquot) + { +- dqbuf_t buf = getdqbuf(); +- struct mem_dqinfo *info = sb_dqinfo(sb, type); +- struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf; +- int ret, blk; ++ struct v2_disk_dqblk *d = dp; ++ struct qtree_mem_dqinfo *info = ++ &sb_dqinfo(dquot->dq_sb, dquot->dq_type)->u.v2_i.i; + +- if (!buf) +- return -ENOMEM; +- if (info->u.v2_i.dqi_free_blk) { +- blk = info->u.v2_i.dqi_free_blk; +- if ((ret = read_blk(sb, type, blk, buf)) < 0) +- goto out_buf; +- info->u.v2_i.dqi_free_blk = le32_to_cpu(dh->dqdh_next_free); +- } +- else { +- memset(buf, 0, V2_DQBLKSIZE); +- /* Assure block allocation... */ +- if ((ret = write_blk(sb, type, info->u.v2_i.dqi_blocks, buf)) < 0) +- goto out_buf; +- blk = info->u.v2_i.dqi_blocks++; +- } +- mark_info_dirty(sb, type); +- ret = blk; +-out_buf: +- freedqbuf(buf); +- return ret; +-} +- +-/* Insert empty block to the list */ +-static int put_free_dqblk(struct super_block *sb, int type, dqbuf_t buf, uint blk) +-{ +- struct mem_dqinfo *info = sb_dqinfo(sb, type); +- struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf; +- int err; +- +- dh->dqdh_next_free = cpu_to_le32(info->u.v2_i.dqi_free_blk); +- dh->dqdh_prev_free = cpu_to_le32(0); +- dh->dqdh_entries = cpu_to_le16(0); +- info->u.v2_i.dqi_free_blk = blk; +- mark_info_dirty(sb, type); +- /* Some strange block. We had better leave it... */ +- if ((err = write_blk(sb, type, blk, buf)) < 0) +- return err; +- return 0; +-} +- +-/* Remove given block from the list of blocks with free entries */ +-static int remove_free_dqentry(struct super_block *sb, int type, dqbuf_t buf, uint blk) +-{ +- dqbuf_t tmpbuf = getdqbuf(); +- struct mem_dqinfo *info = sb_dqinfo(sb, type); +- struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf; +- uint nextblk = le32_to_cpu(dh->dqdh_next_free), prevblk = le32_to_cpu(dh->dqdh_prev_free); +- int err; +- +- if (!tmpbuf) +- return -ENOMEM; +- if (nextblk) { +- if ((err = read_blk(sb, type, nextblk, tmpbuf)) < 0) +- goto out_buf; +- ((struct v2_disk_dqdbheader *)tmpbuf)->dqdh_prev_free = dh->dqdh_prev_free; +- if ((err = write_blk(sb, type, nextblk, tmpbuf)) < 0) +- goto out_buf; +- } +- if (prevblk) { +- if ((err = read_blk(sb, type, prevblk, tmpbuf)) < 0) +- goto out_buf; +- ((struct v2_disk_dqdbheader *)tmpbuf)->dqdh_next_free = dh->dqdh_next_free; +- if ((err = write_blk(sb, type, prevblk, tmpbuf)) < 0) +- goto out_buf; +- } +- else { +- info->u.v2_i.dqi_free_entry = nextblk; +- mark_info_dirty(sb, type); +- } +- freedqbuf(tmpbuf); +- dh->dqdh_next_free = dh->dqdh_prev_free = cpu_to_le32(0); +- /* No matter whether write succeeds block is out of list */ +- if (write_blk(sb, type, blk, buf) < 0) +- printk(KERN_ERR "VFS: Can't write block (%u) with free entries.\n", blk); +- return 0; +-out_buf: +- freedqbuf(tmpbuf); +- return err; +-} +- +-/* Insert given block to the beginning of list with free entries */ +-static int insert_free_dqentry(struct super_block *sb, int type, dqbuf_t buf, uint blk) +-{ +- dqbuf_t tmpbuf = getdqbuf(); +- struct mem_dqinfo *info = sb_dqinfo(sb, type); +- struct v2_disk_dqdbheader *dh = (struct v2_disk_dqdbheader *)buf; +- int err; +- +- if (!tmpbuf) +- return -ENOMEM; +- dh->dqdh_next_free = cpu_to_le32(info->u.v2_i.dqi_free_entry); +- dh->dqdh_prev_free = cpu_to_le32(0); +- if ((err = write_blk(sb, type, blk, buf)) < 0) +- goto out_buf; +- if (info->u.v2_i.dqi_free_entry) { +- if ((err = read_blk(sb, type, info->u.v2_i.dqi_free_entry, tmpbuf)) < 0) +- goto out_buf; +- ((struct v2_disk_dqdbheader *)tmpbuf)->dqdh_prev_free = cpu_to_le32(blk); +- if ((err = write_blk(sb, type, info->u.v2_i.dqi_free_entry, tmpbuf)) < 0) +- goto out_buf; +- } +- freedqbuf(tmpbuf); +- info->u.v2_i.dqi_free_entry = blk; +- mark_info_dirty(sb, type); +- return 0; +-out_buf: +- freedqbuf(tmpbuf); +- return err; +-} +- +-/* Find space for dquot */ +-static uint find_free_dqentry(struct dquot *dquot, int *err) +-{ +- struct super_block *sb = dquot->dq_sb; +- struct mem_dqinfo *info = sb_dqopt(sb)->info+dquot->dq_type; +- uint blk, i; +- struct v2_disk_dqdbheader *dh; +- struct v2_disk_dqblk *ddquot; +- struct v2_disk_dqblk fakedquot; +- dqbuf_t buf; +- +- *err = 0; +- if (!(buf = getdqbuf())) { +- *err = -ENOMEM; ++ if (qtree_entry_unused(info, dp)) + return 0; +- } +- dh = (struct v2_disk_dqdbheader *)buf; +- ddquot = GETENTRIES(buf); +- if (info->u.v2_i.dqi_free_entry) { +- blk = info->u.v2_i.dqi_free_entry; +- if ((*err = read_blk(sb, dquot->dq_type, blk, buf)) < 0) +- goto out_buf; +- } +- else { +- blk = get_free_dqblk(sb, dquot->dq_type); +- if ((int)blk < 0) { +- *err = blk; +- freedqbuf(buf); +- return 0; +- } +- memset(buf, 0, V2_DQBLKSIZE); +- /* This is enough as block is already zeroed and entry list is empty... */ +- info->u.v2_i.dqi_free_entry = blk; +- mark_info_dirty(sb, dquot->dq_type); +- } +- if (le16_to_cpu(dh->dqdh_entries)+1 >= V2_DQSTRINBLK) /* Block will be full? */ +- if ((*err = remove_free_dqentry(sb, dquot->dq_type, buf, blk)) < 0) { +- printk(KERN_ERR "VFS: find_free_dqentry(): Can't remove block (%u) from entry free list.\n", blk); +- goto out_buf; +- } +- le16_add_cpu(&dh->dqdh_entries, 1); +- memset(&fakedquot, 0, sizeof(struct v2_disk_dqblk)); +- /* Find free structure in block */ +- for (i = 0; i < V2_DQSTRINBLK && memcmp(&fakedquot, ddquot+i, sizeof(struct v2_disk_dqblk)); i++); +-#ifdef __QUOTA_V2_PARANOIA +- if (i == V2_DQSTRINBLK) { +- printk(KERN_ERR "VFS: find_free_dqentry(): Data block full but it shouldn't.\n"); +- *err = -EIO; +- goto out_buf; +- } +-#endif +- if ((*err = write_blk(sb, dquot->dq_type, blk, buf)) < 0) { +- printk(KERN_ERR "VFS: find_free_dqentry(): Can't write quota data block %u.\n", blk); +- goto out_buf; +- } +- dquot->dq_off = (blk<dq_sb; +- dqbuf_t buf; +- int ret = 0, newson = 0, newact = 0; +- __le32 *ref; +- uint newblk; +- +- if (!(buf = getdqbuf())) +- return -ENOMEM; +- if (!*treeblk) { +- ret = get_free_dqblk(sb, dquot->dq_type); +- if (ret < 0) +- goto out_buf; +- *treeblk = ret; +- memset(buf, 0, V2_DQBLKSIZE); +- newact = 1; +- } +- else { +- if ((ret = read_blk(sb, dquot->dq_type, *treeblk, buf)) < 0) { +- printk(KERN_ERR "VFS: Can't read tree quota block %u.\n", *treeblk); +- goto out_buf; +- } +- } +- ref = (__le32 *)buf; +- newblk = le32_to_cpu(ref[GETIDINDEX(dquot->dq_id, depth)]); +- if (!newblk) +- newson = 1; +- if (depth == V2_DQTREEDEPTH-1) { +-#ifdef __QUOTA_V2_PARANOIA +- if (newblk) { +- printk(KERN_ERR "VFS: Inserting already present quota entry (block %u).\n", le32_to_cpu(ref[GETIDINDEX(dquot->dq_id, depth)])); +- ret = -EIO; +- goto out_buf; +- } +-#endif +- newblk = find_free_dqentry(dquot, &ret); +- } +- else +- ret = do_insert_tree(dquot, &newblk, depth+1); +- if (newson && ret >= 0) { +- ref[GETIDINDEX(dquot->dq_id, depth)] = cpu_to_le32(newblk); +- ret = write_blk(sb, dquot->dq_type, *treeblk, buf); +- } +- else if (newact && ret < 0) +- put_free_dqblk(sb, dquot->dq_type, buf, *treeblk); +-out_buf: +- freedqbuf(buf); +- return ret; ++ return le32_to_cpu(d->dqb_id) == dquot->dq_id; + } + +-/* Wrapper for inserting quota structure into tree */ +-static inline int dq_insert_tree(struct dquot *dquot) ++static int v2_read_dquot(struct dquot *dquot) + { +- int tmp = V2_DQTREEOFF; +- return do_insert_tree(dquot, &tmp, 0); ++ return qtree_read_dquot(&sb_dqinfo(dquot->dq_sb, dquot->dq_type)->u.v2_i.i, dquot); + } + +-/* +- * We don't have to be afraid of deadlocks as we never have quotas on quota files... +- */ + static int v2_write_dquot(struct dquot *dquot) + { +- int type = dquot->dq_type; +- ssize_t ret; +- struct v2_disk_dqblk ddquot, empty; +- +- /* dq_off is guarded by dqio_mutex */ +- if (!dquot->dq_off) +- if ((ret = dq_insert_tree(dquot)) < 0) { +- printk(KERN_ERR "VFS: Error %zd occurred while creating quota.\n", ret); +- return ret; +- } +- spin_lock(&dq_data_lock); +- mem2diskdqb(&ddquot, &dquot->dq_dqb, dquot->dq_id); +- /* Argh... We may need to write structure full of zeroes but that would be +- * treated as an empty place by the rest of the code. Format change would +- * be definitely cleaner but the problems probably are not worth it */ +- memset(&empty, 0, sizeof(struct v2_disk_dqblk)); +- if (!memcmp(&empty, &ddquot, sizeof(struct v2_disk_dqblk))) +- ddquot.dqb_itime = cpu_to_le64(1); +- spin_unlock(&dq_data_lock); +- ret = dquot->dq_sb->s_op->quota_write(dquot->dq_sb, type, +- (char *)&ddquot, sizeof(struct v2_disk_dqblk), dquot->dq_off); +- if (ret != sizeof(struct v2_disk_dqblk)) { +- printk(KERN_WARNING "VFS: dquota write failed on dev %s\n", dquot->dq_sb->s_id); +- if (ret >= 0) +- ret = -ENOSPC; +- } +- else +- ret = 0; +- dqstats.writes++; +- +- return ret; +-} +- +-/* Free dquot entry in data block */ +-static int free_dqentry(struct dquot *dquot, uint blk) +-{ +- struct super_block *sb = dquot->dq_sb; +- int type = dquot->dq_type; +- struct v2_disk_dqdbheader *dh; +- dqbuf_t buf = getdqbuf(); +- int ret = 0; +- +- if (!buf) +- return -ENOMEM; +- if (dquot->dq_off >> V2_DQBLKSIZE_BITS != blk) { +- printk(KERN_ERR "VFS: Quota structure has offset to other " +- "block (%u) than it should (%u).\n", blk, +- (uint)(dquot->dq_off >> V2_DQBLKSIZE_BITS)); +- goto out_buf; +- } +- if ((ret = read_blk(sb, type, blk, buf)) < 0) { +- printk(KERN_ERR "VFS: Can't read quota data block %u\n", blk); +- goto out_buf; +- } +- dh = (struct v2_disk_dqdbheader *)buf; +- le16_add_cpu(&dh->dqdh_entries, -1); +- if (!le16_to_cpu(dh->dqdh_entries)) { /* Block got free? */ +- if ((ret = remove_free_dqentry(sb, type, buf, blk)) < 0 || +- (ret = put_free_dqblk(sb, type, buf, blk)) < 0) { +- printk(KERN_ERR "VFS: Can't move quota data block (%u) " +- "to free list.\n", blk); +- goto out_buf; +- } +- } +- else { +- memset(buf+(dquot->dq_off & ((1 << V2_DQBLKSIZE_BITS)-1)), 0, +- sizeof(struct v2_disk_dqblk)); +- if (le16_to_cpu(dh->dqdh_entries) == V2_DQSTRINBLK-1) { +- /* Insert will write block itself */ +- if ((ret = insert_free_dqentry(sb, type, buf, blk)) < 0) { +- printk(KERN_ERR "VFS: Can't insert quota data block (%u) to free entry list.\n", blk); +- goto out_buf; +- } +- } +- else +- if ((ret = write_blk(sb, type, blk, buf)) < 0) { +- printk(KERN_ERR "VFS: Can't write quota data " +- "block %u\n", blk); +- goto out_buf; +- } +- } +- dquot->dq_off = 0; /* Quota is now unattached */ +-out_buf: +- freedqbuf(buf); +- return ret; +-} +- +-/* Remove reference to dquot from tree */ +-static int remove_tree(struct dquot *dquot, uint *blk, int depth) +-{ +- struct super_block *sb = dquot->dq_sb; +- int type = dquot->dq_type; +- dqbuf_t buf = getdqbuf(); +- int ret = 0; +- uint newblk; +- __le32 *ref = (__le32 *)buf; +- +- if (!buf) +- return -ENOMEM; +- if ((ret = read_blk(sb, type, *blk, buf)) < 0) { +- printk(KERN_ERR "VFS: Can't read quota data block %u\n", *blk); +- goto out_buf; +- } +- newblk = le32_to_cpu(ref[GETIDINDEX(dquot->dq_id, depth)]); +- if (depth == V2_DQTREEDEPTH-1) { +- ret = free_dqentry(dquot, newblk); +- newblk = 0; +- } +- else +- ret = remove_tree(dquot, &newblk, depth+1); +- if (ret >= 0 && !newblk) { +- int i; +- ref[GETIDINDEX(dquot->dq_id, depth)] = cpu_to_le32(0); +- for (i = 0; i < V2_DQBLKSIZE && !buf[i]; i++); /* Block got empty? */ +- /* Don't put the root block into the free block list */ +- if (i == V2_DQBLKSIZE && *blk != V2_DQTREEOFF) { +- put_free_dqblk(sb, type, buf, *blk); +- *blk = 0; +- } +- else +- if ((ret = write_blk(sb, type, *blk, buf)) < 0) +- printk(KERN_ERR "VFS: Can't write quota tree " +- "block %u.\n", *blk); +- } +-out_buf: +- freedqbuf(buf); +- return ret; +-} +- +-/* Delete dquot from tree */ +-static int v2_delete_dquot(struct dquot *dquot) +-{ +- uint tmp = V2_DQTREEOFF; +- +- if (!dquot->dq_off) /* Even not allocated? */ +- return 0; +- return remove_tree(dquot, &tmp, 0); +-} +- +-/* Find entry in block */ +-static loff_t find_block_dqentry(struct dquot *dquot, uint blk) +-{ +- dqbuf_t buf = getdqbuf(); +- loff_t ret = 0; +- int i; +- struct v2_disk_dqblk *ddquot = GETENTRIES(buf); +- +- if (!buf) +- return -ENOMEM; +- if ((ret = read_blk(dquot->dq_sb, dquot->dq_type, blk, buf)) < 0) { +- printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk); +- goto out_buf; +- } +- if (dquot->dq_id) +- for (i = 0; i < V2_DQSTRINBLK && +- le32_to_cpu(ddquot[i].dqb_id) != dquot->dq_id; i++); +- else { /* ID 0 as a bit more complicated searching... */ +- struct v2_disk_dqblk fakedquot; +- +- memset(&fakedquot, 0, sizeof(struct v2_disk_dqblk)); +- for (i = 0; i < V2_DQSTRINBLK; i++) +- if (!le32_to_cpu(ddquot[i].dqb_id) && +- memcmp(&fakedquot, ddquot+i, sizeof(struct v2_disk_dqblk))) +- break; +- } +- if (i == V2_DQSTRINBLK) { +- printk(KERN_ERR "VFS: Quota for id %u referenced " +- "but not present.\n", dquot->dq_id); +- ret = -EIO; +- goto out_buf; +- } +- else +- ret = (blk << V2_DQBLKSIZE_BITS) + sizeof(struct +- v2_disk_dqdbheader) + i * sizeof(struct v2_disk_dqblk); +-out_buf: +- freedqbuf(buf); +- return ret; +-} +- +-/* Find entry for given id in the tree */ +-static loff_t find_tree_dqentry(struct dquot *dquot, uint blk, int depth) +-{ +- dqbuf_t buf = getdqbuf(); +- loff_t ret = 0; +- __le32 *ref = (__le32 *)buf; +- +- if (!buf) +- return -ENOMEM; +- if ((ret = read_blk(dquot->dq_sb, dquot->dq_type, blk, buf)) < 0) { +- printk(KERN_ERR "VFS: Can't read quota tree block %u.\n", blk); +- goto out_buf; +- } +- ret = 0; +- blk = le32_to_cpu(ref[GETIDINDEX(dquot->dq_id, depth)]); +- if (!blk) /* No reference? */ +- goto out_buf; +- if (depth < V2_DQTREEDEPTH-1) +- ret = find_tree_dqentry(dquot, blk, depth+1); +- else +- ret = find_block_dqentry(dquot, blk); +-out_buf: +- freedqbuf(buf); +- return ret; ++ return qtree_write_dquot(&sb_dqinfo(dquot->dq_sb, dquot->dq_type)->u.v2_i.i, dquot); + } + +-/* Find entry for given id in the tree - wrapper function */ +-static inline loff_t find_dqentry(struct dquot *dquot) +-{ +- return find_tree_dqentry(dquot, V2_DQTREEOFF, 0); +-} +- +-static int v2_read_dquot(struct dquot *dquot) +-{ +- int type = dquot->dq_type; +- loff_t offset; +- struct v2_disk_dqblk ddquot, empty; +- int ret = 0; +- +-#ifdef __QUOTA_V2_PARANOIA +- /* Invalidated quota? */ +- if (!dquot->dq_sb || !sb_dqopt(dquot->dq_sb)->files[type]) { +- printk(KERN_ERR "VFS: Quota invalidated while reading!\n"); +- return -EIO; +- } +-#endif +- offset = find_dqentry(dquot); +- if (offset <= 0) { /* Entry not present? */ +- if (offset < 0) +- printk(KERN_ERR "VFS: Can't read quota " +- "structure for id %u.\n", dquot->dq_id); +- dquot->dq_off = 0; +- set_bit(DQ_FAKE_B, &dquot->dq_flags); +- memset(&dquot->dq_dqb, 0, sizeof(struct mem_dqblk)); +- ret = offset; +- } +- else { +- dquot->dq_off = offset; +- if ((ret = dquot->dq_sb->s_op->quota_read(dquot->dq_sb, type, +- (char *)&ddquot, sizeof(struct v2_disk_dqblk), offset)) +- != sizeof(struct v2_disk_dqblk)) { +- if (ret >= 0) +- ret = -EIO; +- printk(KERN_ERR "VFS: Error while reading quota " +- "structure for id %u.\n", dquot->dq_id); +- memset(&ddquot, 0, sizeof(struct v2_disk_dqblk)); +- } +- else { +- ret = 0; +- /* We need to escape back all-zero structure */ +- memset(&empty, 0, sizeof(struct v2_disk_dqblk)); +- empty.dqb_itime = cpu_to_le64(1); +- if (!memcmp(&empty, &ddquot, sizeof(struct v2_disk_dqblk))) +- ddquot.dqb_itime = 0; +- } +- disk2memdqb(&dquot->dq_dqb, &ddquot); +- if (!dquot->dq_dqb.dqb_bhardlimit && +- !dquot->dq_dqb.dqb_bsoftlimit && +- !dquot->dq_dqb.dqb_ihardlimit && +- !dquot->dq_dqb.dqb_isoftlimit) +- set_bit(DQ_FAKE_B, &dquot->dq_flags); +- } +- dqstats.reads++; +- +- return ret; +-} +- +-/* Check whether dquot should not be deleted. We know we are +- * the only one operating on dquot (thanks to dq_lock) */ + static int v2_release_dquot(struct dquot *dquot) + { +- if (test_bit(DQ_FAKE_B, &dquot->dq_flags) && !(dquot->dq_dqb.dqb_curinodes | dquot->dq_dqb.dqb_curspace)) +- return v2_delete_dquot(dquot); +- return 0; ++ return qtree_release_dquot(&sb_dqinfo(dquot->dq_sb, dquot->dq_type)->u.v2_i.i, dquot); + } + + static struct quota_format_ops v2_format_ops = { +Index: linux-2.6.27.36/include/linux/dqblk_qtree.h +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ linux-2.6.27.36/include/linux/dqblk_qtree.h 2009-10-08 16:32:48.000000000 +0200 +@@ -0,0 +1,56 @@ ++/* ++ * Definitions of structures and functions for quota formats using trie ++ */ ++ ++#ifndef _LINUX_DQBLK_QTREE_H ++#define _LINUX_DQBLK_QTREE_H ++ ++#include ++ ++/* Numbers of blocks needed for updates - we count with the smallest ++ * possible block size (1024) */ ++#define QTREE_INIT_ALLOC 4 ++#define QTREE_INIT_REWRITE 2 ++#define QTREE_DEL_ALLOC 0 ++#define QTREE_DEL_REWRITE 6 ++ ++struct dquot; ++ ++/* Operations */ ++struct qtree_fmt_operations { ++ void (*mem2disk_dqblk)(void *disk, struct dquot *dquot); /* Convert given entry from in memory format to disk one */ ++ void (*disk2mem_dqblk)(struct dquot *dquot, void *disk); /* Convert given entry from disk format to in memory one */ ++ int (*is_id)(void *disk, struct dquot *dquot); /* Is this structure for given id? */ ++}; ++ ++/* Inmemory copy of version specific information */ ++struct qtree_mem_dqinfo { ++ struct super_block *dqi_sb; /* Sb quota is on */ ++ int dqi_type; /* Quota type */ ++ unsigned int dqi_blocks; /* # of blocks in quota file */ ++ unsigned int dqi_free_blk; /* First block in list of free blocks */ ++ unsigned int dqi_free_entry; /* First block with free entry */ ++ unsigned int dqi_blocksize_bits; /* Block size of quota file */ ++ unsigned int dqi_entry_size; /* Size of quota entry in quota file */ ++ unsigned int dqi_usable_bs; /* Space usable in block for quota data */ ++ unsigned int dqi_qtree_depth; /* Precomputed depth of quota tree */ ++ struct qtree_fmt_operations *dqi_ops; /* Operations for entry manipulation */ ++}; ++ ++int qtree_write_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); ++int qtree_read_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); ++int qtree_delete_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); ++int qtree_release_dquot(struct qtree_mem_dqinfo *info, struct dquot *dquot); ++int qtree_entry_unused(struct qtree_mem_dqinfo *info, char *disk); ++static inline int qtree_depth(struct qtree_mem_dqinfo *info) ++{ ++ unsigned int epb = info->dqi_usable_bs >> 2; ++ unsigned long long entries = epb; ++ int i; ++ ++ for (i = 1; entries < (1ULL << 32); i++) ++ entries *= epb; ++ return i; ++} ++ ++#endif /* _LINUX_DQBLK_QTREE_H */ +Index: linux-2.6.27.36/include/linux/dqblk_v2.h +=================================================================== +--- linux-2.6.27.36.orig/include/linux/dqblk_v2.h 2009-10-05 17:19:01.000000000 +0200 ++++ linux-2.6.27.36/include/linux/dqblk_v2.h 2009-10-08 16:32:48.000000000 +0200 +@@ -1,26 +1,23 @@ + /* +- * Definitions of structures for vfsv0 quota format ++ * Definitions for vfsv0 quota format + */ + + #ifndef _LINUX_DQBLK_V2_H + #define _LINUX_DQBLK_V2_H + +-#include ++#include + +-/* id numbers of quota format */ ++/* Id number of quota format */ + #define QFMT_VFS_V0 2 + + /* Numbers of blocks needed for updates */ +-#define V2_INIT_ALLOC 4 +-#define V2_INIT_REWRITE 2 +-#define V2_DEL_ALLOC 0 +-#define V2_DEL_REWRITE 6 ++#define V2_INIT_ALLOC QTREE_INIT_ALLOC ++#define V2_INIT_REWRITE QTREE_INIT_REWRITE ++#define V2_DEL_ALLOC QTREE_DEL_ALLOC ++#define V2_DEL_REWRITE QTREE_DEL_REWRITE + +-/* Inmemory copy of version specific information */ + struct v2_mem_dqinfo { +- unsigned int dqi_blocks; +- unsigned int dqi_free_blk; +- unsigned int dqi_free_entry; ++ struct qtree_mem_dqinfo i; + }; + + #endif /* _LINUX_DQBLK_V2_H */ --- lustre-1.8.3.orig/lustre/kernel_patches/patches/sd_iostats-2.6.26-vanilla.patch +++ lustre-1.8.3/lustre/kernel_patches/patches/sd_iostats-2.6.26-vanilla.patch @@ -0,0 +1,579 @@ +Index: linux-source-2.6.26/drivers/scsi/Kconfig +=================================================================== +--- linux-source-2.6.26.orig/drivers/scsi/Kconfig 2009-10-09 13:33:25.000000000 +0200 ++++ linux-source-2.6.26/drivers/scsi/Kconfig 2009-10-09 13:39:06.000000000 +0200 +@@ -81,6 +81,14 @@ + In this case, do not compile the driver for your SCSI host adapter + (below) as a module either. + ++config SD_IOSTATS ++ bool "Enable SCSI disk I/O stats" ++ depends on BLK_DEV_SD ++ default y ++ ---help--- ++ This enables SCSI disk I/O stats collection. You must also enable ++ /proc file system support if you want this feature. ++ + config CHR_DEV_ST + tristate "SCSI tape support" + depends on SCSI +Index: linux-source-2.6.26/drivers/scsi/scsi_proc.c +=================================================================== +--- linux-source-2.6.26.orig/drivers/scsi/scsi_proc.c 2009-10-09 13:33:25.000000000 +0200 ++++ linux-source-2.6.26/drivers/scsi/scsi_proc.c 2009-10-09 13:39:06.000000000 +0200 +@@ -40,7 +40,8 @@ + /* 4K page size, but our output routines, use some slack for overruns */ + #define PROC_BLOCK_SIZE (3*1024) + +-static struct proc_dir_entry *proc_scsi; ++struct proc_dir_entry *proc_scsi; ++EXPORT_SYMBOL(proc_scsi); + + /* Protect sht->present and sht->proc_dir */ + static DEFINE_MUTEX(global_host_template_mutex); +Index: linux-source-2.6.26/drivers/scsi/sd.c +=================================================================== +--- linux-source-2.6.26.orig/drivers/scsi/sd.c 2009-10-09 13:33:25.000000000 +0200 ++++ linux-source-2.6.26/drivers/scsi/sd.c 2009-10-09 13:39:50.000000000 +0200 +@@ -107,6 +107,24 @@ + * object after last put) */ + static DEFINE_MUTEX(sd_ref_mutex); + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++# include ++# include ++struct proc_dir_entry *sd_iostats_procdir = NULL; ++char sd_iostats_procdir_name[] = "sd_iostats"; ++static struct file_operations sd_iostats_proc_fops; ++ ++extern void sd_iostats_init(void); ++extern void sd_iostats_fini(void); ++void sd_iostats_start_req(struct scsi_cmnd *SCpnt); ++void sd_iostats_finish_req(struct scsi_cmnd *SCpnt); ++#else ++static inline void sd_iostats_init(void) {} ++static inline void sd_iostats_fini(void) {} ++static inline void sd_iostats_start_req(struct scsi_cmnd *SCpnt) {} ++static inline void sd_iostats_finish_req(struct scsi_cmnd *SCpnt) {} ++#endif ++ + static const char *sd_cache_types[] = { + "write through", "none", "write back", + "write back, no read (daft)" +@@ -578,6 +596,8 @@ + + sdev = sdkp->device; + ++ sd_iostats_start_req(SCpnt); ++ + /* + * If the device is in error recovery, wait until it is done. + * If the device is offline, then disallow any access to it. +@@ -1023,6 +1043,7 @@ + break; + } + out: ++ sd_iostats_finish_req(SCpnt); + return good_bytes; + } + +@@ -1712,6 +1733,36 @@ + if (sdp->removable) + gd->flags |= GENHD_FL_REMOVABLE; + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++ sdkp->stats = kzalloc(sizeof(iostat_stats_t), GFP_KERNEL); ++ if (!sdkp->stats) { ++ printk(KERN_WARNING "cannot allocate iostat structure for" ++ "%s\n", gd->disk_name); ++ } else { ++ do_gettimeofday(&sdkp->stats->iostat_timeval); ++ sdkp->stats->iostat_queue_stamp = jiffies; ++ spin_lock_init(&sdkp->stats->iostat_lock); ++ if (sd_iostats_procdir) { ++ struct proc_dir_entry *pde; ++ pde = create_proc_entry(gd->disk_name, S_IRUGO | S_IWUSR, ++ sd_iostats_procdir); ++ if (!pde) { ++ printk(KERN_WARNING "Can't create /proc/scsi/" ++ "%s/%s\n", ++ sd_iostats_procdir_name, ++ gd->disk_name); ++ kfree(sdkp->stats); ++ sdkp->stats = NULL; ++ } else { ++ pde->proc_fops = &sd_iostats_proc_fops; ++ pde->data = gd; ++ } ++ } else { ++ kfree(sdkp->stats); ++ sdkp->stats = NULL; ++ } ++ } ++#endif + dev_set_drvdata(dev, sdkp); + add_disk(gd); + +@@ -1755,6 +1806,366 @@ + return 0; + } + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++static int ++sd_iostats_seq_show(struct seq_file *seq, void *v) ++{ ++ struct timeval now; ++ struct gendisk *disk = seq->private; ++ iostat_stats_t *stats; ++ unsigned long long read_len; ++ unsigned long long read_len_tot; ++ unsigned long read_num; ++ unsigned long read_num_tot; ++ unsigned long long write_len; ++ unsigned long long write_len_tot; ++ unsigned long write_num; ++ unsigned long write_num_tot; ++ int i; ++ int maxi; ++ ++ stats = scsi_disk(disk)->stats; ++ if (stats == NULL) { ++ printk(KERN_ERR "sd_iostats_seq_show: NULL stats entry\n"); ++ BUG(); ++ } ++ ++ do_gettimeofday(&now); ++ now.tv_sec -= stats->iostat_timeval.tv_sec; ++ now.tv_usec -= stats->iostat_timeval.tv_usec; ++ if (now.tv_usec < 0) { ++ now.tv_usec += 1000000; ++ now.tv_sec--; ++ } ++ ++ /* this sampling races with updates */ ++ seq_printf(seq, "index: %lu snapshot_time: %lu.%06lu\n", ++ (unsigned long) scsi_disk(disk)->index, ++ now.tv_sec, now.tv_usec); ++ ++ for (i = IOSTAT_NCOUNTERS - 1; i > 0; i--) ++ if (stats->iostat_read_histogram[i].iostat_count != 0 || ++ stats->iostat_write_histogram[i].iostat_count != 0) ++ break; ++ maxi = i; ++ ++ seq_printf(seq, "%8s %8s %12s %8s %12s\n", "size", ++ "reads", "total", "writes", "total"); ++ ++ read_len_tot = write_len_tot = 0; ++ read_num_tot = write_num_tot = 0; ++ for (i = 0; i <= maxi; i++) { ++ read_len = stats->iostat_read_histogram[i].iostat_size; ++ read_len_tot += read_len; ++ read_num = stats->iostat_read_histogram[i].iostat_count; ++ read_num_tot += read_num; ++ ++ write_len = stats->iostat_write_histogram[i].iostat_size; ++ write_len_tot += write_len; ++ write_num = stats->iostat_write_histogram[i].iostat_count; ++ write_num_tot += write_num; ++ ++ seq_printf (seq, "%8d %8lu %12llu %8lu %12llu\n", ++ 512<iostat_queue_ticks[i]; ++ if (ticks == 0) ++ continue; ++ percent = stats->iostat_queue_ticks[i] * 100; ++ do_div(percent, stats->iostat_queue_ticks_sum); ++ seq_printf(seq, "%8d %8llu %8llu\n", i, ticks, percent); ++ } ++ ++ if (stats->iostat_reqs != 0) { ++ unsigned long long aveseek = 0, percent = 0; ++ ++ if (stats->iostat_seeks) { ++ aveseek = stats->iostat_seek_sectors; ++ do_div(aveseek, stats->iostat_seeks); ++ percent = stats->iostat_seeks * 100; ++ do_div(percent, stats->iostat_reqs); ++ } ++ ++ seq_printf(seq, "\n%llu sectors in %llu reqs: %llu seek(s) over " ++ "%llu sectors in ave, %llu%% of all reqs\n", ++ stats->iostat_sectors, stats->iostat_reqs, ++ stats->iostat_seeks, aveseek, percent); ++ } ++ ++ seq_printf(seq, "\n%16s %8s %8s %8s %8s\n", "process time", "reads", ++ "%%", "writes", "%%"); ++ for (i = 0; i < IOSTAT_NCOUNTERS; i++) { ++ unsigned long read_percent = 0, write_percent = 0; ++ if (stats->iostat_wtime[i] == 0 && ++ stats->iostat_rtime[i] == 0) ++ continue; ++ if (stats->iostat_read_reqs) ++ read_percent = stats->iostat_rtime[i] * 100 / ++ stats->iostat_read_reqs; ++ if (stats->iostat_write_reqs) ++ write_percent = stats->iostat_wtime[i] * 100 / ++ stats->iostat_write_reqs; ++ seq_printf(seq, "%16u %8lu %8lu %8lu %8lu\n", ++ jiffies_to_msecs(((1UL << i) >> 1) << 1), ++ stats->iostat_rtime[i], read_percent, ++ stats->iostat_wtime[i], write_percent); ++ } ++ ++ seq_printf(seq, "\n%16s %8s %8s %8s %8s\n", "time in queue", "reads", ++ "%%", "writes", "%%"); ++ for (i = 0; i < IOSTAT_NCOUNTERS; i++) { ++ unsigned long read_percent = 0, write_percent = 0; ++ if (stats->iostat_wtime_in_queue[i] == 0 && ++ stats->iostat_rtime_in_queue[i] == 0) ++ continue; ++ if (stats->iostat_read_reqs) ++ read_percent = stats->iostat_rtime_in_queue[i] * 100 / ++ stats->iostat_read_reqs; ++ if (stats->iostat_write_reqs) ++ write_percent = stats->iostat_wtime_in_queue[i] * 100 / ++ stats->iostat_write_reqs; ++ seq_printf(seq, "%16u %8lu %8lu %8lu %8lu\n", ++ jiffies_to_msecs(((1UL << i) >> 1) << 1), ++ stats->iostat_rtime_in_queue[i], ++ read_percent, ++ stats->iostat_wtime_in_queue[i], ++ write_percent); ++ } ++ ++ return 0; ++} ++ ++static void * ++sd_iostats_seq_start(struct seq_file *p, loff_t *pos) ++{ ++ return (*pos == 0) ? (void *)1 : NULL; ++} ++ ++static void * ++sd_iostats_seq_next(struct seq_file *p, void *v, loff_t *pos) ++{ ++ ++*pos; ++ return NULL; ++} ++ ++static void ++sd_iostats_seq_stop(struct seq_file *p, void *v) ++{ ++} ++ ++static struct seq_operations sd_iostats_seqops = { ++ .start = sd_iostats_seq_start, ++ .stop = sd_iostats_seq_stop, ++ .next = sd_iostats_seq_next, ++ .show = sd_iostats_seq_show, ++}; ++ ++static int ++sd_iostats_seq_open (struct inode *inode, struct file *file) ++{ ++ int rc; ++ ++ rc = seq_open(file, &sd_iostats_seqops); ++ if (rc != 0) ++ return rc; ++ ++ ((struct seq_file *)file->private_data)->private = PDE(inode)->data; ++ return 0; ++} ++ ++static ssize_t ++sd_iostats_seq_write(struct file *file, const char *buffer, ++ size_t len, loff_t *off) ++{ ++ struct seq_file *seq = file->private_data; ++ struct gendisk *disk = seq->private; ++ iostat_stats_t *stats = scsi_disk(disk)->stats; ++ unsigned long flags; ++ unsigned long qdepth; ++ ++ ++ spin_lock_irqsave (&stats->iostat_lock, flags); ++ qdepth = stats->iostat_queue_depth; ++ memset (stats, 0, offsetof(iostat_stats_t, iostat_lock)); ++ do_gettimeofday(&stats->iostat_timeval); ++ stats->iostat_queue_stamp = jiffies; ++ stats->iostat_queue_depth = qdepth; ++ spin_unlock_irqrestore (&stats->iostat_lock, flags); ++ ++ return len; ++} ++ ++static struct file_operations sd_iostats_proc_fops = { ++ .owner = THIS_MODULE, ++ .open = sd_iostats_seq_open, ++ .read = seq_read, ++ .write = sd_iostats_seq_write, ++ .llseek = seq_lseek, ++ .release = seq_release, ++}; ++ ++extern struct proc_dir_entry *proc_scsi; ++ ++void ++sd_iostats_init(void) ++{ ++ if (proc_scsi == NULL) { ++ printk(KERN_WARNING "No access to sd iostats: " ++ "proc_scsi is NULL\n"); ++ return; ++ } ++ ++ sd_iostats_procdir = create_proc_entry(sd_iostats_procdir_name, ++ S_IFDIR | S_IRUGO | S_IXUGO, ++ proc_scsi); ++ if (sd_iostats_procdir == NULL) { ++ printk(KERN_WARNING "No access to sd iostats: " ++ "can't create /proc/scsi/%s\n", sd_iostats_procdir_name); ++ return; ++ } ++} ++ ++void sd_iostats_fini(void) ++{ ++ if (proc_scsi != NULL && sd_iostats_procdir != NULL) ++ remove_proc_entry(sd_iostats_procdir_name, proc_scsi); ++ ++ sd_iostats_procdir = NULL; ++} ++ ++void sd_iostats_finish_req(struct scsi_cmnd *SCpnt) ++{ ++ struct request *rq = SCpnt->request; ++ iostat_stats_t *stats; ++ unsigned long *tcounter; ++ int tbucket; ++ int tmp; ++ unsigned long irqflags; ++ unsigned long i; ++ ++ stats = scsi_disk(rq->rq_disk)->stats; ++ if (stats == NULL) ++ return; ++ ++ tmp = jiffies - rq->start_time; ++ for (tbucket = 0; tmp > 1; tbucket++) ++ tmp >>= 1; ++ if (tbucket >= IOSTAT_NCOUNTERS) ++ tbucket = IOSTAT_NCOUNTERS - 1; ++ //printk("%u ticks in D to %u\n", jiffies - rq->start_time, tbucket); ++ ++ tcounter = rq_data_dir(rq) == WRITE ? ++ &stats->iostat_wtime[tbucket] : &stats->iostat_rtime[tbucket]; ++ ++ spin_lock_irqsave(&stats->iostat_lock, irqflags); ++ ++ /* update delay stats */ ++ (*tcounter)++; ++ ++ /* update queue depth stats */ ++ i = stats->iostat_queue_depth; ++ if (i >= IOSTAT_NCOUNTERS) ++ i = IOSTAT_NCOUNTERS - 1; ++ stats->iostat_queue_ticks[i] += jiffies - stats->iostat_queue_stamp; ++ stats->iostat_queue_ticks_sum += jiffies - stats->iostat_queue_stamp; ++ BUG_ON(stats->iostat_queue_depth == 0); ++ stats->iostat_queue_depth--; ++ ++ /* update seek stats. XXX: not sure about nr_sectors */ ++ stats->iostat_sectors += rq->nr_sectors; ++ stats->iostat_reqs++; ++ if (rq->sector != stats->iostat_next_sector) { ++ stats->iostat_seek_sectors += ++ rq->sector > stats->iostat_next_sector ? ++ rq->sector - stats->iostat_next_sector : ++ stats->iostat_next_sector - rq->sector; ++ stats->iostat_seeks++; ++ } ++ stats->iostat_next_sector = rq->sector + rq->nr_sectors; ++ ++ stats->iostat_queue_stamp = jiffies; ++ ++ spin_unlock_irqrestore(&stats->iostat_lock, irqflags); ++} ++ ++void sd_iostats_start_req(struct scsi_cmnd *SCpnt) ++{ ++ struct request *rq = SCpnt->request; ++ iostat_stats_t *stats; ++ iostat_counter_t *counter; ++ int bucket; ++ int tbucket; ++ int tmp; ++ unsigned long irqflags; ++ unsigned long i; ++ int nsect; ++ ++ stats = scsi_disk(rq->rq_disk)->stats; ++ if (stats == NULL) ++ return; ++ ++ nsect = scsi_bufflen(SCpnt) >> 9; ++ for (bucket = 0, tmp = nsect; tmp > 1; bucket++) ++ tmp >>= 1; ++ ++ if (bucket >= IOSTAT_NCOUNTERS) { ++ printk (KERN_ERR "sd_iostats_bump: nsect %d too big\n", nsect); ++ BUG(); ++ } ++ ++ counter = rq_data_dir(rq) == WRITE ? ++ &stats->iostat_write_histogram[bucket] : ++ &stats->iostat_read_histogram[bucket]; ++ ++ tmp = jiffies - rq->start_time; ++ for (tbucket = 0; tmp > 1; tbucket++) ++ tmp >>= 1; ++ if (tbucket >= IOSTAT_NCOUNTERS) ++ tbucket = IOSTAT_NCOUNTERS - 1; ++ //printk("%u ticks in Q to %u\n", jiffies - rq->start_time, tbucket); ++ ++ /* an ugly hack to know exact processing time. the right ++ * solution is to add one more field to struct request ++ * hopefully it will break nothing ... */ ++ rq->start_time = jiffies; ++ ++ spin_lock_irqsave(&stats->iostat_lock, irqflags); ++ ++ /* update queue depth stats */ ++ i = stats->iostat_queue_depth; ++ if (i >= IOSTAT_NCOUNTERS) ++ i = IOSTAT_NCOUNTERS - 1; ++ stats->iostat_queue_ticks[i] += jiffies - stats->iostat_queue_stamp; ++ stats->iostat_queue_ticks_sum += jiffies - stats->iostat_queue_stamp; ++ stats->iostat_queue_depth++; ++ ++ /* update delay stats */ ++ if (rq_data_dir(rq) == WRITE) { ++ stats->iostat_wtime_in_queue[tbucket]++; ++ stats->iostat_write_reqs++; ++ } else { ++ stats->iostat_rtime_in_queue[tbucket]++; ++ stats->iostat_read_reqs++; ++ } ++ ++ /* update size stats */ ++ counter->iostat_size += nsect; ++ counter->iostat_count++; ++ ++ stats->iostat_queue_stamp = jiffies; ++ ++ spin_unlock_irqrestore(&stats->iostat_lock, irqflags); ++} ++#endif ++ + /** + * scsi_disk_release - Called to free the scsi_disk structure + * @dev: pointer to embedded class device +@@ -1773,10 +2184,16 @@ + idr_remove(&sd_index_idr, sdkp->index); + spin_unlock(&sd_index_lock); + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++ if (sdkp->stats) { ++ remove_proc_entry(disk->disk_name, sd_iostats_procdir); ++ kfree(sdkp->stats); ++ sdkp->stats = NULL; ++ } ++#endif + disk->private_data = NULL; + put_disk(disk); + put_device(&sdkp->device->sdev_gendev); +- + kfree(sdkp); + } + +@@ -1890,6 +2307,8 @@ + if (!majors) + return -ENODEV; + ++ sd_iostats_init(); ++ + err = class_register(&sd_disk_class); + if (err) + goto err_out; +@@ -1905,6 +2324,7 @@ + err_out: + for (i = 0; i < SD_MAJORS; i++) + unregister_blkdev(sd_major(i), "sd"); ++ sd_iostats_fini(); + return err; + } + +Index: linux-source-2.6.26/include/scsi/sd.h +=================================================================== +--- linux-source-2.6.26.orig/include/scsi/sd.h 2009-10-09 13:33:25.000000000 +0200 ++++ linux-source-2.6.26/include/scsi/sd.h 2009-10-09 13:39:06.000000000 +0200 +@@ -31,6 +31,46 @@ + */ + #define SD_BUF_SIZE 512 + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++typedef struct { ++ unsigned long long iostat_size; ++ unsigned long long iostat_count; ++} iostat_counter_t; ++ ++#define IOSTAT_NCOUNTERS 16 ++typedef struct { ++ iostat_counter_t iostat_read_histogram[IOSTAT_NCOUNTERS]; ++ iostat_counter_t iostat_write_histogram[IOSTAT_NCOUNTERS]; ++ struct timeval iostat_timeval; ++ ++ /* queue depth: how well the pipe is filled up */ ++ unsigned long long iostat_queue_ticks[IOSTAT_NCOUNTERS]; ++ unsigned long long iostat_queue_ticks_sum; ++ unsigned long iostat_queue_depth; ++ unsigned long iostat_queue_stamp; ++ ++ /* seeks: how linear the traffic is */ ++ unsigned long long iostat_next_sector; ++ unsigned long long iostat_seek_sectors; ++ unsigned long long iostat_seeks; ++ unsigned long long iostat_sectors; ++ unsigned long long iostat_reqs; ++ unsigned long iostat_read_reqs; ++ unsigned long iostat_write_reqs; ++ ++ /* process time: how long it takes to process requests */ ++ unsigned long iostat_rtime[IOSTAT_NCOUNTERS]; ++ unsigned long iostat_wtime[IOSTAT_NCOUNTERS]; ++ ++ /* queue time: how long process spent in elevator's queue */ ++ unsigned long iostat_rtime_in_queue[IOSTAT_NCOUNTERS]; ++ unsigned long iostat_wtime_in_queue[IOSTAT_NCOUNTERS]; ++ ++ /* must be the last field, as it's used to know size to be memset'ed */ ++ spinlock_t iostat_lock; ++} ____cacheline_aligned_in_smp iostat_stats_t; ++#endif ++ + struct scsi_disk { + struct scsi_driver *driver; /* always &sd_template */ + struct scsi_device *device; +@@ -45,6 +85,9 @@ + unsigned WCE : 1; /* state of disk WCE bit */ + unsigned RCD : 1; /* state of disk RCD bit, unused */ + unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++ iostat_stats_t *stats; /* scsi disk statistics */ ++#endif + }; + #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) + --- lustre-1.8.3.orig/lustre/kernel_patches/patches/export-2.6.26-vanilla.patch +++ lustre-1.8.3/lustre/kernel_patches/patches/export-2.6.26-vanilla.patch @@ -0,0 +1,24 @@ +Index: linux-source-2.6.26/fs/jbd2/journal.c +=================================================================== +--- linux-source-2.6.26.orig/fs/jbd2/journal.c 2009-10-09 13:49:43.000000000 +0200 ++++ linux-source-2.6.26/fs/jbd2/journal.c 2009-10-09 13:49:50.000000000 +0200 +@@ -460,6 +460,7 @@ + spin_unlock(&journal->j_state_lock); + return ret; + } ++EXPORT_SYMBOL(jbd2_log_start_commit); + + /* + * Force and wait upon a commit if the calling process is not within +Index: linux-source-2.6.26/security/security.c +=================================================================== +--- linux-source-2.6.26.orig/security/security.c 2009-10-09 13:49:43.000000000 +0200 ++++ linux-source-2.6.26/security/security.c 2009-10-09 13:49:50.000000000 +0200 +@@ -68,6 +68,7 @@ + + return 0; + } ++EXPORT_SYMBOL(security_inode_unlink); + + /* Save user chosen LSM */ + static int __init choose_lsm(char *str) --- lustre-1.8.3.orig/lustre/kernel_patches/patches/md-mmp-unplug-dev-2.6.27-vanilla.patch +++ lustre-1.8.3/lustre/kernel_patches/patches/md-mmp-unplug-dev-2.6.27-vanilla.patch @@ -0,0 +1,22 @@ +Index: linux-2.6.27.36/drivers/md/raid5.c +=================================================================== +--- linux-2.6.27.36.orig/drivers/md/raid5.c 2009-10-05 17:19:01.000000000 +0200 ++++ linux-2.6.27.36/drivers/md/raid5.c 2009-10-08 15:06:10.000000000 +0200 +@@ -1726,6 +1726,8 @@ + bi->bi_next = *bip; + *bip = bi; + bi->bi_phys_segments ++; ++ if (bio_sync(bi) && !forwrite) ++ clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); /* force to read from disk. */ + spin_unlock_irq(&conf->device_lock); + spin_unlock(&sh->lock); + +@@ -3478,6 +3480,8 @@ + + bio_endio(bi, 0); + } ++ if (bio_sync(bi)) ++ raid5_unplug_device(q); + return 0; + } + --- lustre-1.8.3.orig/lustre/kernel_patches/patches/debian-2.6.26.diff +++ lustre-1.8.3/lustre/kernel_patches/patches/debian-2.6.26.diff @@ -0,0 +1,1210 @@ +diff -u -r debian-2.6.26/Documentation/filesystems/ext2.txt debian-2.6.26_lustre.1.8.2/Documentation/filesystems/ext2.txt +--- debian-2.6.26/Documentation/filesystems/ext2.txt 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/Documentation/filesystems/ext2.txt 2010-02-12 15:11:19.000000000 +0100 +@@ -58,6 +58,22 @@ + + xip Use execute in place (no caching) if possible + ++iopen Makes an invisible pseudo-directory called ++ __iopen__ available in the root directory ++ of the filesystem. Allows open-by-inode- ++ number. i.e., inode 3145 can be accessed ++ via /mntpt/__iopen__/3145 ++ ++iopen_nopriv This option makes the iopen directory be ++ world-readable. This may be safer since it ++ allows daemons to run as an unprivileged user, ++ however it significantly changes the security ++ model of a Unix filesystem, since previously ++ all files under a mode 700 directory were not ++ generally avilable even if the ++ permissions on the file itself is ++ world-readable. ++ + grpquota,noquota,quota,usrquota Quota options are silently ignored by ext2. + + +diff -u -r debian-2.6.26/block/blk-core.c debian-2.6.26_lustre.1.8.2/block/blk-core.c +--- debian-2.6.26/block/blk-core.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/block/blk-core.c 2010-02-12 15:14:32.000000000 +0100 +@@ -1270,6 +1270,8 @@ + + #endif /* CONFIG_FAIL_MAKE_REQUEST */ + ++int dev_check_rdonly(struct block_device *bdev); ++ + /* + * Check whether this bio extends beyond the end of the device. + */ +@@ -1371,6 +1373,12 @@ + + if (unlikely(test_bit(QUEUE_FLAG_DEAD, &q->queue_flags))) + goto end_io; ++ /* this is cfs's dev_rdonly check */ ++ if (bio->bi_rw == WRITE && ++ dev_check_rdonly(bio->bi_bdev)) { ++ bio_endio(bio, 0); ++ break; ++ } + + if (should_fail_request(bio)) + goto end_io; +@@ -2028,6 +2036,91 @@ + } + EXPORT_SYMBOL(kblockd_flush_work); + ++ /* ++ * Debug code for turning block devices "read-only" (will discard writes ++ * silently). This is for filesystem crash/recovery testing. ++ */ ++struct deventry { ++ dev_t dev; ++ struct deventry *next; ++}; ++ ++static struct deventry *devlist = NULL; ++static spinlock_t devlock = SPIN_LOCK_UNLOCKED; ++ ++int dev_check_rdonly(struct block_device *bdev) ++{ ++ struct deventry *cur; ++ if (!bdev) return 0; ++ spin_lock(&devlock); ++ cur = devlist; ++ while(cur) { ++ if (bdev->bd_dev == cur->dev) { ++ spin_unlock(&devlock); ++ return 1; ++ } ++ cur = cur->next; ++ } ++ spin_unlock(&devlock); ++ return 0; ++} ++ ++void dev_set_rdonly(struct block_device *bdev) ++{ ++ struct deventry *newdev, *cur; ++ ++ if (!bdev) ++ return; ++ newdev = kmalloc(sizeof(struct deventry), GFP_KERNEL); ++ if (!newdev) ++ return; ++ ++ spin_lock(&devlock); ++ cur = devlist; ++ while(cur) { ++ if (bdev->bd_dev == cur->dev) { ++ spin_unlock(&devlock); ++ kfree(newdev); ++ return; ++ } ++ cur = cur->next; ++ } ++ newdev->dev = bdev->bd_dev; ++ newdev->next = devlist; ++ devlist = newdev; ++ spin_unlock(&devlock); ++ printk(KERN_WARNING "Turning device %s (%#x) read-only\n", ++ bdev->bd_disk ? bdev->bd_disk->disk_name : "", bdev->bd_dev); ++} ++ ++void dev_clear_rdonly(struct block_device *bdev) ++{ ++ struct deventry *cur, *last = NULL; ++ if (!bdev) return; ++ spin_lock(&devlock); ++ cur = devlist; ++ while(cur) { ++ if (bdev->bd_dev == cur->dev) { ++ if (last) ++ last->next = cur->next; ++ else ++ devlist = cur->next; ++ spin_unlock(&devlock); ++ kfree(cur); ++ printk(KERN_WARNING "Removing read-only on %s (%#x)\n", ++ bdev->bd_disk ? bdev->bd_disk->disk_name : ++ "unknown block", bdev->bd_dev); ++ return; ++ } ++ last = cur; ++ cur = cur->next; ++ } ++ spin_unlock(&devlock); ++} ++ ++EXPORT_SYMBOL(dev_set_rdonly); ++EXPORT_SYMBOL(dev_clear_rdonly); ++ + int __init blk_dev_init(void) + { + int i; +diff -u -r debian-2.6.26/drivers/md/raid5.c debian-2.6.26_lustre.1.8.2/drivers/md/raid5.c +--- debian-2.6.26/drivers/md/raid5.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/drivers/md/raid5.c 2010-02-12 15:19:25.000000000 +0100 +@@ -1817,6 +1817,8 @@ + bi->bi_next = *bip; + *bip = bi; + bi->bi_phys_segments ++; ++ if (bio_sync(bi) && !forwrite) ++ clear_bit(R5_UPTODATE, &sh->dev[dd_idx].flags); /* force to read from disk. */ + spin_unlock_irq(&conf->device_lock); + spin_unlock(&sh->lock); + +@@ -3699,6 +3701,8 @@ + test_bit(BIO_UPTODATE, &bi->bi_flags) + ? 0 : -EIO); + } ++ if (bio_sync(bi)) ++ raid5_unplug_device(q); + return 0; + } + +diff -u -r debian-2.6.26/drivers/scsi/Kconfig debian-2.6.26_lustre.1.8.2/drivers/scsi/Kconfig +--- debian-2.6.26/drivers/scsi/Kconfig 2009-12-26 09:14:53.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/drivers/scsi/Kconfig 2010-02-12 15:20:02.000000000 +0100 +@@ -81,6 +81,14 @@ + In this case, do not compile the driver for your SCSI host adapter + (below) as a module either. + ++config SD_IOSTATS ++ bool "Enable SCSI disk I/O stats" ++ depends on BLK_DEV_SD ++ default y ++ ---help--- ++ This enables SCSI disk I/O stats collection. You must also enable ++ /proc file system support if you want this feature. ++ + config CHR_DEV_ST + tristate "SCSI tape support" + depends on SCSI +diff -u -r debian-2.6.26/drivers/scsi/scsi_proc.c debian-2.6.26_lustre.1.8.2/drivers/scsi/scsi_proc.c +--- debian-2.6.26/drivers/scsi/scsi_proc.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/drivers/scsi/scsi_proc.c 2010-02-12 15:22:05.000000000 +0100 +@@ -40,7 +40,8 @@ + /* 4K page size, but our output routines, use some slack for overruns */ + #define PROC_BLOCK_SIZE (3*1024) + +-static struct proc_dir_entry *proc_scsi; ++struct proc_dir_entry *proc_scsi; ++EXPORT_SYMBOL(proc_scsi); + + /* Protect sht->present and sht->proc_dir */ + static DEFINE_MUTEX(global_host_template_mutex); +diff -u -r debian-2.6.26/drivers/scsi/sd.c debian-2.6.26_lustre.1.8.2/drivers/scsi/sd.c +--- debian-2.6.26/drivers/scsi/sd.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/drivers/scsi/sd.c 2010-02-17 14:13:32.000000000 +0100 +@@ -107,6 +107,24 @@ + * object after last put) */ + static DEFINE_MUTEX(sd_ref_mutex); + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++# include ++# include ++struct proc_dir_entry *sd_iostats_procdir = NULL; ++char sd_iostats_procdir_name[] = "sd_iostats"; ++static struct file_operations sd_iostats_proc_fops; ++ ++extern void sd_iostats_init(void); ++extern void sd_iostats_fini(void); ++void sd_iostats_start_req(struct scsi_cmnd *SCpnt); ++void sd_iostats_finish_req(struct scsi_cmnd *SCpnt); ++#else ++static inline void sd_iostats_init(void) {} ++static inline void sd_iostats_fini(void) {} ++static inline void sd_iostats_start_req(struct scsi_cmnd *SCpnt) {} ++static inline void sd_iostats_finish_req(struct scsi_cmnd *SCpnt) {} ++#endif ++ + static const char *sd_cache_types[] = { + "write through", "none", "write back", + "write back, no read (daft)" +@@ -531,6 +549,8 @@ + } + SCpnt->sdb.length = this_count * sdp->sector_size; + ++ sd_iostats_start_req(SCpnt); ++ + /* + * We shouldn't disconnect in the middle of a sector, so with a dumb + * host adapter, it's safe to assume that we can at least transfer +@@ -667,7 +687,7 @@ + int diskinfo[4]; + + /* default to most commonly used values */ +- diskinfo[0] = 0x40; /* 1 << 6 */ ++ diskinfo[0] = 0x40; /* 1 << 6 */ + diskinfo[1] = 0x20; /* 1 << 5 */ + diskinfo[2] = sdkp->capacity >> 11; + +@@ -1023,6 +1043,7 @@ + break; + } + out: ++ sd_iostats_finish_req(SCpnt); + return good_bytes; + } + +@@ -1711,6 +1732,36 @@ + gd->flags = GENHD_FL_DRIVERFS; + if (sdp->removable) + gd->flags |= GENHD_FL_REMOVABLE; ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++ sdkp->stats = kzalloc(sizeof(iostat_stats_t), GFP_KERNEL); ++ if (!sdkp->stats) { ++ printk(KERN_WARNING "cannot allocate iostat structure for" ++ "%s\n", gd->disk_name); ++ } else { ++ do_gettimeofday(&sdkp->stats->iostat_timeval); ++ sdkp->stats->iostat_queue_stamp = jiffies; ++ spin_lock_init(&sdkp->stats->iostat_lock); ++ if (sd_iostats_procdir) { ++ struct proc_dir_entry *pde; ++ pde = create_proc_entry(gd->disk_name, S_IRUGO | S_IWUSR, ++ sd_iostats_procdir); ++ if (!pde) { ++ printk(KERN_WARNING "Can't create /proc/scsi/" ++ "%s/%s\n", ++ sd_iostats_procdir_name, ++ gd->disk_name); ++ kfree(sdkp->stats); ++ sdkp->stats = NULL; ++ } else { ++ pde->proc_fops = &sd_iostats_proc_fops; ++ pde->data = gd; ++ } ++ } else { ++ kfree(sdkp->stats); ++ sdkp->stats = NULL; ++ } ++ } ++#endif + + dev_set_drvdata(dev, sdkp); + add_disk(gd); +@@ -1755,6 +1806,366 @@ + return 0; + } + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++static int ++ sd_iostats_seq_show(struct seq_file *seq, void *v) ++ { ++ struct timeval now; ++ struct gendisk *disk = seq->private; ++ iostat_stats_t *stats; ++ unsigned long long read_len; ++ unsigned long long read_len_tot; ++ unsigned long read_num; ++ unsigned long read_num_tot; ++ unsigned long long write_len; ++ unsigned long long write_len_tot; ++ unsigned long write_num; ++ unsigned long write_num_tot; ++ int i; ++ int maxi; ++ ++ stats = scsi_disk(disk)->stats; ++ if (stats == NULL) { ++ printk(KERN_ERR "sd_iostats_seq_show: NULL stats entry\n"); ++ BUG(); ++ } ++ ++ do_gettimeofday(&now); ++ now.tv_sec -= stats->iostat_timeval.tv_sec; ++ now.tv_usec -= stats->iostat_timeval.tv_usec; ++ if (now.tv_usec < 0) { ++ now.tv_usec += 1000000; ++ now.tv_sec--; ++ } ++ ++ /* this sampling races with updates */ ++ seq_printf(seq, "index: %lu snapshot_time: %lu.%06lu\n", ++ (unsigned long) scsi_disk(disk)->index, ++ now.tv_sec, now.tv_usec); ++ ++ for (i = IOSTAT_NCOUNTERS - 1; i > 0; i--) ++ if (stats->iostat_read_histogram[i].iostat_count != 0 || ++ stats->iostat_write_histogram[i].iostat_count != 0) ++ break; ++ maxi = i; ++ ++ seq_printf(seq, "%8s %8s %12s %8s %12s\n", "size", ++ "reads", "total", "writes", "total"); ++ ++ read_len_tot = write_len_tot = 0; ++ read_num_tot = write_num_tot = 0; ++ for (i = 0; i <= maxi; i++) { ++ read_len = stats->iostat_read_histogram[i].iostat_size; ++ read_len_tot += read_len; ++ read_num = stats->iostat_read_histogram[i].iostat_count; ++ read_num_tot += read_num; ++ ++ write_len = stats->iostat_write_histogram[i].iostat_size; ++ write_len_tot += write_len; ++ write_num = stats->iostat_write_histogram[i].iostat_count; ++ write_num_tot += write_num; ++ ++ seq_printf (seq, "%8d %8lu %12llu %8lu %12llu\n", ++ 512<iostat_queue_ticks[i]; ++ if (ticks == 0) ++ continue; ++ percent = stats->iostat_queue_ticks[i] * 100; ++ do_div(percent, stats->iostat_queue_ticks_sum); ++ seq_printf(seq, "%8d %8llu %8llu\n", i, ticks, percent); ++ } ++ ++ if (stats->iostat_reqs != 0) { ++ unsigned long long aveseek = 0, percent = 0; ++ ++ if (stats->iostat_seeks) { ++ aveseek = stats->iostat_seek_sectors; ++ do_div(aveseek, stats->iostat_seeks); ++ percent = stats->iostat_seeks * 100; ++ do_div(percent, stats->iostat_reqs); ++ } ++ ++ seq_printf(seq, "\n%llu sectors in %llu reqs: %llu seek(s) over " ++ "%llu sectors in ave, %llu%% of all reqs\n", ++ stats->iostat_sectors, stats->iostat_reqs, ++ stats->iostat_seeks, aveseek, percent); ++ } ++ ++ seq_printf(seq, "\n%16s %8s %8s %8s %8s\n", "process time", "reads", ++ "%%", "writes", "%%"); ++ for (i = 0; i < IOSTAT_NCOUNTERS; i++) { ++ unsigned long read_percent = 0, write_percent = 0; ++ if (stats->iostat_wtime[i] == 0 && ++ stats->iostat_rtime[i] == 0) ++ continue; ++ if (stats->iostat_read_reqs) ++ read_percent = stats->iostat_rtime[i] * 100 / ++ stats->iostat_read_reqs; ++ if (stats->iostat_write_reqs) ++ write_percent = stats->iostat_wtime[i] * 100 / ++ stats->iostat_write_reqs; ++ seq_printf(seq, "%16u %8lu %8lu %8lu %8lu\n", ++ jiffies_to_msecs(((1UL << i) >> 1) << 1), ++ stats->iostat_rtime[i], read_percent, ++ stats->iostat_wtime[i], write_percent); ++ } ++ ++ seq_printf(seq, "\n%16s %8s %8s %8s %8s\n", "time in queue", "reads", ++ "%%", "writes", "%%"); ++ for (i = 0; i < IOSTAT_NCOUNTERS; i++) { ++ unsigned long read_percent = 0, write_percent = 0; ++ if (stats->iostat_wtime_in_queue[i] == 0 && ++ stats->iostat_rtime_in_queue[i] == 0) ++ continue; ++ if (stats->iostat_read_reqs) ++ read_percent = stats->iostat_rtime_in_queue[i] * 100 / ++ stats->iostat_read_reqs; ++ if (stats->iostat_write_reqs) ++ write_percent = stats->iostat_wtime_in_queue[i] * 100 / ++ stats->iostat_write_reqs; ++ seq_printf(seq, "%16u %8lu %8lu %8lu %8lu\n", ++ jiffies_to_msecs(((1UL << i) >> 1) << 1), ++ stats->iostat_rtime_in_queue[i], ++ read_percent, ++ stats->iostat_wtime_in_queue[i], ++ write_percent); ++ } ++ ++ return 0; ++ } ++ ++ static void * ++ sd_iostats_seq_start(struct seq_file *p, loff_t *pos) ++ { ++ return (*pos == 0) ? (void *)1 : NULL; ++ } ++ ++ static void * ++ sd_iostats_seq_next(struct seq_file *p, void *v, loff_t *pos) ++ { ++ ++*pos; ++ return NULL; ++ } ++ ++ static void ++ sd_iostats_seq_stop(struct seq_file *p, void *v) ++ { ++ } ++ ++ static struct seq_operations sd_iostats_seqops = { ++ .start = sd_iostats_seq_start, ++ .stop = sd_iostats_seq_stop, ++ .next = sd_iostats_seq_next, ++ .show = sd_iostats_seq_show, ++ }; ++ ++ static int ++ sd_iostats_seq_open (struct inode *inode, struct file *file) ++ { ++ int rc; ++ ++ rc = seq_open(file, &sd_iostats_seqops); ++ if (rc != 0) ++ return rc; ++ ++ ((struct seq_file *)file->private_data)->private = PDE(inode)->data; ++ return 0; ++ } ++ ++ static ssize_t ++ sd_iostats_seq_write(struct file *file, const char *buffer, ++ size_t len, loff_t *off) ++ { ++ struct seq_file *seq = file->private_data; ++ struct gendisk *disk = seq->private; ++ iostat_stats_t *stats = scsi_disk(disk)->stats; ++ unsigned long flags; ++ unsigned long qdepth; ++ ++ ++ spin_lock_irqsave (&stats->iostat_lock, flags); ++ qdepth = stats->iostat_queue_depth; ++ memset (stats, 0, offsetof(iostat_stats_t, iostat_lock)); ++ do_gettimeofday(&stats->iostat_timeval); ++ stats->iostat_queue_stamp = jiffies; ++ stats->iostat_queue_depth = qdepth; ++ spin_unlock_irqrestore (&stats->iostat_lock, flags); ++ ++ return len; ++ } ++ ++ static struct file_operations sd_iostats_proc_fops = { ++ .owner = THIS_MODULE, ++ .open = sd_iostats_seq_open, ++ .read = seq_read, ++ .write = sd_iostats_seq_write, ++ .llseek = seq_lseek, ++ .release = seq_release, ++ }; ++ ++ extern struct proc_dir_entry *proc_scsi; ++ ++ void ++ sd_iostats_init(void) ++ { ++ if (proc_scsi == NULL) { ++ printk(KERN_WARNING "No access to sd iostats: " ++ "proc_scsi is NULL\n"); ++ return; ++ } ++ ++ sd_iostats_procdir = create_proc_entry(sd_iostats_procdir_name, ++ S_IFDIR | S_IRUGO | S_IXUGO, ++ proc_scsi); ++ if (sd_iostats_procdir == NULL) { ++ printk(KERN_WARNING "No access to sd iostats: " ++ "can't create /proc/scsi/%s\n", sd_iostats_procdir_name); ++ return; ++ } ++ } ++ ++ void sd_iostats_fini(void) ++ { ++ if (proc_scsi != NULL && sd_iostats_procdir != NULL) ++ remove_proc_entry(sd_iostats_procdir_name, proc_scsi); ++ ++ sd_iostats_procdir = NULL; ++ } ++ ++ void sd_iostats_finish_req(struct scsi_cmnd *SCpnt) ++ { ++ struct request *rq = SCpnt->request; ++ iostat_stats_t *stats; ++ unsigned long *tcounter; ++ int tbucket; ++ int tmp; ++ unsigned long irqflags; ++ unsigned long i; ++ ++ stats = scsi_disk(rq->rq_disk)->stats; ++ if (stats == NULL) ++ return; ++ ++ tmp = jiffies - rq->start_time; ++ for (tbucket = 0; tmp > 1; tbucket++) ++ tmp >>= 1; ++ if (tbucket >= IOSTAT_NCOUNTERS) ++ tbucket = IOSTAT_NCOUNTERS - 1; ++ //printk("%u ticks in D to %u\n", jiffies - rq->start_time, tbucket); ++ ++ tcounter = rq_data_dir(rq) == WRITE ? ++ &stats->iostat_wtime[tbucket] : &stats->iostat_rtime[tbucket]; ++ ++ spin_lock_irqsave(&stats->iostat_lock, irqflags); ++ ++ /* update delay stats */ ++ (*tcounter)++; ++ ++ /* update queue depth stats */ ++ i = stats->iostat_queue_depth; ++ if (i >= IOSTAT_NCOUNTERS) ++ i = IOSTAT_NCOUNTERS - 1; ++ stats->iostat_queue_ticks[i] += jiffies - stats->iostat_queue_stamp; ++ stats->iostat_queue_ticks_sum += jiffies - stats->iostat_queue_stamp; ++ BUG_ON(stats->iostat_queue_depth == 0); ++ stats->iostat_queue_depth--; ++ ++ /* update seek stats. XXX: not sure about nr_sectors */ ++ stats->iostat_sectors += rq->nr_sectors; ++ stats->iostat_reqs++; ++ if (rq->sector != stats->iostat_next_sector) { ++ stats->iostat_seek_sectors += ++ rq->sector > stats->iostat_next_sector ? ++ rq->sector - stats->iostat_next_sector : ++ stats->iostat_next_sector - rq->sector; ++ stats->iostat_seeks++; ++ } ++ stats->iostat_next_sector = rq->sector + rq->nr_sectors; ++ ++ stats->iostat_queue_stamp = jiffies; ++ ++ spin_unlock_irqrestore(&stats->iostat_lock, irqflags); ++ } ++ ++ void sd_iostats_start_req(struct scsi_cmnd *SCpnt) ++ { ++ struct request *rq = SCpnt->request; ++ iostat_stats_t *stats; ++ iostat_counter_t *counter; ++ int bucket; ++ int tbucket; ++ int tmp; ++ unsigned long irqflags; ++ unsigned long i; ++ int nsect; ++ ++ stats = scsi_disk(rq->rq_disk)->stats; ++ if (stats == NULL) ++ return; ++ ++ nsect = scsi_bufflen(SCpnt) >> 9; ++ for (bucket = 0, tmp = nsect; tmp > 1; bucket++) ++ tmp >>= 1; ++ ++ if (bucket >= IOSTAT_NCOUNTERS) { ++ printk (KERN_ERR "sd_iostats_bump: nsect %d too big\n", nsect); ++ BUG(); ++ } ++ ++ counter = rq_data_dir(rq) == WRITE ? ++ &stats->iostat_write_histogram[bucket] : ++ &stats->iostat_read_histogram[bucket]; ++ ++ tmp = jiffies - rq->start_time; ++ for (tbucket = 0; tmp > 1; tbucket++) ++ tmp >>= 1; ++ if (tbucket >= IOSTAT_NCOUNTERS) ++ tbucket = IOSTAT_NCOUNTERS - 1; ++ //printk("%u ticks in Q to %u\n", jiffies - rq->start_time, tbucket); ++ ++ /* an ugly hack to know exact processing time. the right ++ * solution is to add one more field to struct request ++ * hopefully it will break nothing ... */ ++ rq->start_time = jiffies; ++ ++ spin_lock_irqsave(&stats->iostat_lock, irqflags); ++ ++ /* update queue depth stats */ ++ i = stats->iostat_queue_depth; ++ if (i >= IOSTAT_NCOUNTERS) ++ i = IOSTAT_NCOUNTERS - 1; ++ stats->iostat_queue_ticks[i] += jiffies - stats->iostat_queue_stamp; ++ stats->iostat_queue_ticks_sum += jiffies - stats->iostat_queue_stamp; ++ stats->iostat_queue_depth++; ++ ++ /* update delay stats */ ++ if (rq_data_dir(rq) == WRITE) { ++ stats->iostat_wtime_in_queue[tbucket]++; ++ stats->iostat_write_reqs++; ++ } else { ++ stats->iostat_rtime_in_queue[tbucket]++; ++ stats->iostat_read_reqs++; ++ } ++ ++ /* update size stats */ ++ counter->iostat_size += nsect; ++ counter->iostat_count++; ++ ++ stats->iostat_queue_stamp = jiffies; ++ ++ spin_unlock_irqrestore(&stats->iostat_lock, irqflags); ++} ++#endif ++ + /** + * scsi_disk_release - Called to free the scsi_disk structure + * @dev: pointer to embedded class device +@@ -1773,6 +2184,13 @@ + idr_remove(&sd_index_idr, sdkp->index); + spin_unlock(&sd_index_lock); + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++ if (sdkp->stats) { ++ remove_proc_entry(disk->disk_name, sd_iostats_procdir); ++ kfree(sdkp->stats); ++ sdkp->stats = NULL; ++ } ++#endif + disk->private_data = NULL; + put_disk(disk); + put_device(&sdkp->device->sdev_gendev); +@@ -1890,6 +2308,8 @@ + if (!majors) + return -ENODEV; + ++ sd_iostats_init(); ++ + err = class_register(&sd_disk_class); + if (err) + goto err_out; +@@ -1905,6 +2325,7 @@ + err_out: + for (i = 0; i < SD_MAJORS; i++) + unregister_blkdev(sd_major(i), "sd"); ++ sd_iostats_fini(); + return err; + } + +diff -u -r debian-2.6.26/fs/block_dev.c debian-2.6.26_lustre.1.8.2/fs/block_dev.c +--- debian-2.6.26/fs/block_dev.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/fs/block_dev.c 2010-02-17 14:19:50.000000000 +0100 +@@ -1125,6 +1125,7 @@ + if (bdev != bdev->bd_contains) + victim = bdev->bd_contains; + bdev->bd_contains = NULL; ++ dev_clear_rdonly(bdev); + } + unlock_kernel(); + mutex_unlock(&bdev->bd_mutex); +diff -u -r debian-2.6.26/fs/dcache.c debian-2.6.26_lustre.1.8.2/fs/dcache.c +--- debian-2.6.26/fs/dcache.c 2009-12-26 09:14:56.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/fs/dcache.c 2010-02-17 14:24:24.000000000 +0100 +@@ -250,6 +250,13 @@ + spin_unlock(&dcache_lock); + return 0; + } ++ ++ /* network invalidation by Lustre */ ++ if (dentry->d_flags & DCACHE_LUSTRE_INVALID) { ++ spin_unlock(&dcache_lock); ++ return 0; ++ } ++ + /* + * Check whether to do a partial shrink_dcache + * to get rid of unused child entries. +@@ -1427,14 +1434,23 @@ + * + * Adds a dentry to the hash according to its name. + */ +- ++ ++void d_rehash_cond(struct dentry * entry, int lock) ++{ ++ if (lock) ++ spin_lock(&dcache_lock); ++ spin_lock(&entry->d_lock); ++ _d_rehash(entry); ++ spin_unlock(&entry->d_lock); ++ if (lock) ++ spin_unlock(&dcache_lock); ++} ++ ++EXPORT_SYMBOL(d_rehash_cond); ++ + void d_rehash(struct dentry * entry) + { +- spin_lock(&dcache_lock); +- spin_lock(&entry->d_lock); +- _d_rehash(entry); +- spin_unlock(&entry->d_lock); +- spin_unlock(&dcache_lock); ++ d_rehash_cond(entry, 1); + } + + #define do_switch(x,y) do { \ +@@ -1510,7 +1526,7 @@ + * Update the dcache to reflect the move of a file name. Negative + * dcache entries should not be moved in this way. + */ +-static void d_move_locked(struct dentry * dentry, struct dentry * target) ++void d_move_locked(struct dentry * dentry, struct dentry * target) + { + struct hlist_head *list; + +@@ -1568,6 +1584,7 @@ + spin_unlock(&dentry->d_lock); + write_sequnlock(&rename_lock); + } ++EXPORT_SYMBOL(d_move_locked); + + /** + * d_move - move a dentry +@@ -2051,6 +2068,7 @@ + + return result; + } ++EXPORT_SYMBOL(is_subdir); + + void d_genocide(struct dentry *root) + { +diff -u -r debian-2.6.26/fs/filesystems.c debian-2.6.26_lustre.1.8.2/fs/filesystems.c +--- debian-2.6.26/fs/filesystems.c 2009-12-26 09:14:56.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/fs/filesystems.c 2010-02-17 14:26:59.000000000 +0100 +@@ -28,7 +28,9 @@ + */ + + static struct file_system_type *file_systems; +-static DEFINE_RWLOCK(file_systems_lock); ++DEFINE_RWLOCK(file_systems_lock); ++ ++EXPORT_SYMBOL(file_systems_lock); + + /* WARNING: This can be used only if we _already_ own a reference */ + void get_filesystem(struct file_system_type *fs) +diff -u -r debian-2.6.26/fs/inode.c debian-2.6.26_lustre.1.8.2/fs/inode.c +--- debian-2.6.26/fs/inode.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/fs/inode.c 2010-02-17 14:27:51.000000000 +0100 +@@ -409,7 +409,9 @@ + int nr_scanned; + unsigned long reap = 0; + +- mutex_lock(&iprune_mutex); ++ if (!mutex_trylock(&iprune_mutex)) ++ return; ++ + spin_lock(&inode_lock); + for (nr_scanned = 0; nr_scanned < nr_to_scan; nr_scanned++) { + struct inode *inode; +diff -u -r debian-2.6.26/fs/jbd2/checkpoint.c debian-2.6.26_lustre.1.8.2/fs/jbd2/checkpoint.c +--- debian-2.6.26/fs/jbd2/checkpoint.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/fs/jbd2/checkpoint.c 2010-02-17 14:28:49.000000000 +0100 +@@ -696,6 +696,7 @@ + J_ASSERT(transaction->t_checkpoint_list == NULL); + J_ASSERT(transaction->t_checkpoint_io_list == NULL); + J_ASSERT(transaction->t_updates == 0); ++ J_ASSERT(list_empty(&transaction->t_jcb)); + J_ASSERT(journal->j_committing_transaction != transaction); + J_ASSERT(journal->j_running_transaction != transaction); + +diff -u -r debian-2.6.26/fs/jbd2/commit.c debian-2.6.26_lustre.1.8.2/fs/jbd2/commit.c +--- debian-2.6.26/fs/jbd2/commit.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/fs/jbd2/commit.c 2010-02-17 14:29:44.000000000 +0100 +@@ -874,6 +874,30 @@ + transaction can be removed from any checkpoint list it was on + before. */ + ++ /* ++ * Call any callbacks that had been registered for handles in this ++ * transaction. It is up to the callback to free any allocated ++ * memory. ++ * ++ * The spinlocking (t_jcb_lock) here is surely unnecessary... ++ */ ++ spin_lock(&commit_transaction->t_jcb_lock); ++ if (!list_empty(&commit_transaction->t_jcb)) { ++ struct list_head *p, *n; ++ int error = is_journal_aborted(journal); ++ ++ list_for_each_safe(p, n, &commit_transaction->t_jcb) { ++ struct journal_callback *jcb; ++ ++ jcb = list_entry(p, struct journal_callback, jcb_list); ++ list_del(p); ++ spin_unlock(&commit_transaction->t_jcb_lock); ++ jcb->jcb_func(jcb, error); ++ spin_lock(&commit_transaction->t_jcb_lock); ++ } ++ } ++ spin_unlock(&commit_transaction->t_jcb_lock); ++ + jbd_debug(3, "JBD: commit phase 7\n"); + + J_ASSERT(commit_transaction->t_sync_datalist == NULL); +diff -u -r debian-2.6.26/fs/jbd2/journal.c debian-2.6.26_lustre.1.8.2/fs/jbd2/journal.c +--- debian-2.6.26/fs/jbd2/journal.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/fs/jbd2/journal.c 2010-02-17 14:38:15.000000000 +0100 +@@ -82,6 +82,8 @@ + EXPORT_SYMBOL(jbd2_journal_invalidatepage); + EXPORT_SYMBOL(jbd2_journal_try_to_free_buffers); + EXPORT_SYMBOL(jbd2_journal_force_commit); ++EXPORT_SYMBOL(jbd2_journal_callback_set); ++EXPORT_SYMBOL(jbd2_journal_bmap); + + static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *); + static void __journal_abort_soft (journal_t *journal, int errno); +@@ -460,6 +462,7 @@ + spin_unlock(&journal->j_state_lock); + return ret; + } ++EXPORT_SYMBOL(jbd2_log_start_commit); + + /* + * Force and wait upon a commit if the calling process is not within +diff -u -r debian-2.6.26/fs/jbd2/transaction.c debian-2.6.26_lustre.1.8.2/fs/jbd2/transaction.c +--- debian-2.6.26/fs/jbd2/transaction.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/fs/jbd2/transaction.c 2010-02-17 14:42:20.000000000 +0100 +@@ -51,10 +51,12 @@ + transaction->t_state = T_RUNNING; + transaction->t_tid = journal->j_transaction_sequence++; + transaction->t_expires = jiffies + journal->j_commit_interval; ++ INIT_LIST_HEAD(&transaction->t_jcb); + spin_lock_init(&transaction->t_handle_lock); ++ spin_lock_init(&transaction->t_jcb_lock); + + /* Set up the commit timer for the new transaction. */ +- journal->j_commit_timer.expires = round_jiffies(transaction->t_expires); ++ journal->j_commit_timer.expires = transaction->t_expires; + add_timer(&journal->j_commit_timer); + + J_ASSERT(journal->j_running_transaction == NULL); +@@ -252,6 +254,7 @@ + memset(handle, 0, sizeof(*handle)); + handle->h_buffer_credits = nblocks; + handle->h_ref = 1; ++ INIT_LIST_HEAD(&handle->h_jcb); + + lockdep_init_map(&handle->h_lockdep_map, "jbd2_handle", + &jbd2_handle_key, 0); +@@ -1350,6 +1353,36 @@ + } + + /** ++ * void jbd2_journal_callback_set() - Register a callback function for this handle. ++ * @handle: handle to attach the callback to. ++ * @func: function to callback. ++ * @jcb: structure with additional information required by func() , and ++ * some space for jbd2 internal information. ++ * ++ * The function will be ++ * called when the transaction that this handle is part of has been ++ * committed to disk with the original callback data struct and the ++ * error status of the journal as parameters. There is no guarantee of ++ * ordering between handles within a single transaction, nor between ++ * callbacks registered on the same handle. ++ * ++ * The caller is responsible for allocating the journal_callback struct. ++ * This is to allow the caller to add as much extra data to the callback ++ * as needed, but reduce the overhead of multiple allocations. The caller ++ * allocated struct must start with a struct journal_callback at offset 0, ++ * and has the caller-specific data afterwards. ++ */ ++void jbd2_journal_callback_set(handle_t *handle, ++ void (*func)(struct journal_callback *jcb, int error), ++ struct journal_callback *jcb) ++{ ++ spin_lock(&handle->h_transaction->t_jcb_lock); ++ list_add_tail(&jcb->jcb_list, &handle->h_jcb); ++ spin_unlock(&handle->h_transaction->t_jcb_lock); ++ jcb->jcb_func = func; ++} ++ ++/** + * int jbd2_journal_stop() - complete a transaction + * @handle: tranaction to complete. + * +@@ -1423,6 +1456,11 @@ + wake_up(&journal->j_wait_transaction_locked); + } + ++ /* Move callbacks from the handle to the transaction. */ ++ spin_lock(&transaction->t_jcb_lock); ++ list_splice(&handle->h_jcb, &transaction->t_jcb); ++ spin_unlock(&transaction->t_jcb_lock); ++ + /* + * If the handle is marked SYNC, we need to set another commit + * going! We also want to force a commit if the current +diff -u -r debian-2.6.26/fs/namespace.c debian-2.6.26_lustre.1.8.2/fs/namespace.c +--- debian-2.6.26/fs/namespace.c 2009-12-26 09:14:56.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/fs/namespace.c 2010-02-17 14:43:07.000000000 +0100 +@@ -1660,6 +1660,7 @@ + + return do_add_mount(mnt, nd, mnt_flags, NULL); + } ++EXPORT_SYMBOL(set_fs_pwd); + + /* + * add a mount into a namespace's mount tree +diff -u -r debian-2.6.26/include/linux/blkdev.h debian-2.6.26_lustre.1.8.2/include/linux/blkdev.h +--- debian-2.6.26/include/linux/blkdev.h 2009-12-26 09:14:55.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/include/linux/blkdev.h 2010-02-18 07:44:31.000000000 +0100 +@@ -806,7 +806,7 @@ + #define MAX_PHYS_SEGMENTS 128 + #define MAX_HW_SEGMENTS 128 + #define SAFE_MAX_SECTORS 255 +-#define BLK_DEF_MAX_SECTORS 1024 ++#define BLK_DEF_MAX_SECTORS 2048 + + #define MAX_SEGMENT_SIZE 65536 + +diff -u -r debian-2.6.26/include/linux/dcache.h debian-2.6.26_lustre.1.8.2/include/linux/dcache.h +--- debian-2.6.26/include/linux/dcache.h 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/include/linux/dcache.h 2010-02-18 07:46:08.000000000 +0100 +@@ -173,6 +173,7 @@ + + #define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ + #define DCACHE_UNHASHED 0x0010 ++#define DCACHE_LUSTRE_INVALID 0x0040 /* Lustre invalidated */ + + #define DCACHE_INOTIFY_PARENT_WATCHED 0x0020 /* Parent inode is watched */ + +@@ -250,6 +251,7 @@ + * This adds the entry to the hash queues. + */ + extern void d_rehash(struct dentry *); ++extern void d_rehash_cond(struct dentry *, int lock); + + /** + * d_add - add dentry to hash queues +@@ -285,6 +287,7 @@ + + /* used for rename() and baskets */ + extern void d_move(struct dentry *, struct dentry *); ++extern void d_move_locked(struct dentry *, struct dentry *); + + /* appendix may either be NULL or be used for transname suffixes */ + extern struct dentry * d_lookup(struct dentry *, struct qstr *); +diff -u -r debian-2.6.26/include/linux/fs.h debian-2.6.26_lustre.1.8.2/include/linux/fs.h +--- debian-2.6.26/include/linux/fs.h 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/include/linux/fs.h 2010-02-18 07:57:56.000000000 +0100 +@@ -1832,6 +1832,10 @@ + extern void submit_bio(int, struct bio *); + extern int bdev_read_only(struct block_device *); + #endif ++#define HAVE_CLEAR_RDONLY_ON_PUT ++extern void dev_set_rdonly(struct block_device *bdev); ++extern int dev_check_rdonly(struct block_device *bdev); ++extern void dev_clear_rdonly(struct block_device *bdev); + extern int set_blocksize(struct block_device *, int); + extern int sb_set_blocksize(struct super_block *, int); + extern int sb_min_blocksize(struct super_block *, int); +@@ -1930,6 +1934,7 @@ + + extern const struct file_operations generic_ro_fops; + ++extern rwlock_t file_systems_lock; + #define special_file(m) (S_ISCHR(m)||S_ISBLK(m)||S_ISFIFO(m)||S_ISSOCK(m)) + + extern int vfs_readlink(struct dentry *, char __user *, int, const char *); +diff -u -r debian-2.6.26/include/linux/jbd2.h debian-2.6.26_lustre.1.8.2/include/linux/jbd2.h +--- debian-2.6.26/include/linux/jbd2.h 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/include/linux/jbd2.h 2010-02-18 08:08:30.000000000 +0100 +@@ -379,6 +379,27 @@ + bit_spin_unlock(BH_JournalHead, &bh->b_state); + } + ++#define HAVE_JOURNAL_CALLBACK_STATUS ++/** ++ * struct journal_callback - Base structure for callback information. ++ * @jcb_list: list information for other callbacks attached to the same handle. ++ * @jcb_func: Function to call with this callback structure. ++ * ++ * This struct is a 'seed' structure for a using with your own callback ++ * structs. If you are using callbacks you must allocate one of these ++ * or another struct of your own definition which has this struct ++ * as it's first element and pass it to journal_callback_set(). ++ * ++ * This is used internally by jbd2 to maintain callback information. ++ * ++ * See journal_callback_set for more information. ++ **/ ++struct journal_callback { ++ struct list_head jcb_list; /* t_jcb_lock */ ++ void (*jcb_func)(struct journal_callback *jcb, int error); ++ /* user data goes here */ ++}; ++ + struct jbd2_revoke_table_s; + + /** +@@ -387,6 +408,7 @@ + * @h_transaction: Which compound transaction is this update a part of? + * @h_buffer_credits: Number of remaining buffers we are allowed to dirty. + * @h_ref: Reference count on this handle ++ * @h_jcb: List of application registered callbacks for this handle. + * @h_err: Field for caller's use to track errors through large fs operations + * @h_sync: flag for sync-on-close + * @h_jdata: flag to force data journaling +@@ -412,6 +434,13 @@ + /* operations */ + int h_err; + ++ /* ++ * List of application registered callbacks for this handle. The ++ * function(s) will be called after the transaction that this handle is ++ * part of has been committed to disk. [t_jcb_lock] ++ */ ++ struct list_head h_jcb; ++ + /* Flags [no locking] */ + unsigned int h_sync: 1; /* sync-on-close */ + unsigned int h_jdata: 1; /* force data journaling */ +@@ -467,6 +496,9 @@ + * j_state_lock + * ->j_list_lock (journal_unmap_buffer) + * ++ * t_handle_lock ++ * ->t_jcb_lock ++ * + */ + + struct transaction_s +@@ -613,6 +645,15 @@ + */ + int t_handle_count; + ++ /* ++ * Protects the callback list ++ */ ++ spinlock_t t_jcb_lock; ++ /* ++ * List of registered callback functions for this transaction. ++ * Called when the transaction is committed. [t_jcb_lock] ++ */ ++ struct list_head t_jcb; + }; + + struct transaction_run_stats_s { +@@ -1016,6 +1057,9 @@ + extern int jbd2_journal_flush (journal_t *); + extern void jbd2_journal_lock_updates (journal_t *); + extern void jbd2_journal_unlock_updates (journal_t *); ++extern void jbd2_journal_callback_set(handle_t *handle, ++ void (*fn)(struct journal_callback *,int), ++ struct journal_callback *jcb); + + extern journal_t * jbd2_journal_init_dev(struct block_device *bdev, + struct block_device *fs_dev, +diff -u -r debian-2.6.26/include/linux/mm.h debian-2.6.26_lustre.1.8.2/include/linux/mm.h +--- debian-2.6.26/include/linux/mm.h 2009-12-26 09:14:57.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/include/linux/mm.h 2010-02-18 08:10:11.000000000 +0100 +@@ -564,6 +564,8 @@ + { + return __va(page_to_pfn(page) << PAGE_SHIFT); + } ++/* truncate.c */ ++extern void truncate_complete_page(struct address_space *mapping,struct page *); + + #if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) + #define HASHED_PAGE_VIRTUAL +diff -u -r debian-2.6.26/include/scsi/sd.h debian-2.6.26_lustre.1.8.2/include/scsi/sd.h +--- debian-2.6.26/include/scsi/sd.h 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/include/scsi/sd.h 2010-02-17 14:18:52.000000000 +0100 +@@ -31,6 +31,47 @@ + */ + #define SD_BUF_SIZE 512 + ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++typedef struct { ++ unsigned long long iostat_size; ++ unsigned long long iostat_count; ++} iostat_counter_t; ++ ++#define IOSTAT_NCOUNTERS 16 ++typedef struct { ++ iostat_counter_t iostat_read_histogram[IOSTAT_NCOUNTERS]; ++ iostat_counter_t iostat_write_histogram[IOSTAT_NCOUNTERS]; ++ struct timeval iostat_timeval; ++ ++ /* queue depth: how well the pipe is filled up */ ++ unsigned long long iostat_queue_ticks[IOSTAT_NCOUNTERS]; ++ unsigned long long iostat_queue_ticks_sum; ++ unsigned long iostat_queue_depth; ++ unsigned long iostat_queue_stamp; ++ ++ /* seeks: how linear the traffic is */ ++ unsigned long long iostat_next_sector; ++ unsigned long long iostat_seek_sectors; ++ unsigned long long iostat_seeks; ++ unsigned long long iostat_sectors; ++ unsigned long long iostat_reqs; ++ unsigned long iostat_read_reqs; ++ unsigned long iostat_write_reqs; ++ ++ /* process time: how long it takes to process requests */ ++ unsigned long iostat_rtime[IOSTAT_NCOUNTERS]; ++ unsigned long iostat_wtime[IOSTAT_NCOUNTERS]; ++ ++ /* queue time: how long process spent in elevator's queue */ ++ unsigned long iostat_rtime_in_queue[IOSTAT_NCOUNTERS]; ++ unsigned long iostat_wtime_in_queue[IOSTAT_NCOUNTERS]; ++ ++ /* must be the last field, as it's used to know size to be memset'ed */ ++ spinlock_t iostat_lock; ++} ____cacheline_aligned_in_smp iostat_stats_t; ++#endif ++ ++ + struct scsi_disk { + struct scsi_driver *driver; /* always &sd_template */ + struct scsi_device *device; +@@ -45,6 +86,9 @@ + unsigned WCE : 1; /* state of disk WCE bit */ + unsigned RCD : 1; /* state of disk RCD bit, unused */ + unsigned DPOFUA : 1; /* state of disk DPOFUA bit */ ++#if (defined(CONFIG_SD_IOSTATS) && defined(CONFIG_PROC_FS)) ++ iostat_stats_t *stats; /* scsi disk statistics */ ++#endif + }; + #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev) + +diff -u -r debian-2.6.26/kernel/sched.c debian-2.6.26_lustre.1.8.2/kernel/sched.c +--- debian-2.6.26/kernel/sched.c 2009-12-26 09:14:56.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/kernel/sched.c 2010-02-18 08:11:02.000000000 +0100 +@@ -5477,6 +5477,7 @@ + + show_stack(p, NULL); + } ++EXPORT_SYMBOL(sched_show_task); + + void show_state_filter(unsigned long state_filter) + { +diff -u -r debian-2.6.26/mm/truncate.c debian-2.6.26_lustre.1.8.2/mm/truncate.c +--- debian-2.6.26/mm/truncate.c 2008-07-13 23:51:29.000000000 +0200 ++++ debian-2.6.26_lustre.1.8.2/mm/truncate.c 2010-02-18 08:12:58.000000000 +0100 +@@ -92,7 +92,7 @@ + * its lock, b) when a concurrent invalidate_mapping_pages got there first and + * c) when tmpfs swizzles a page between a tmpfs inode and swapper_space. + */ +-static void ++void + truncate_complete_page(struct address_space *mapping, struct page *page) + { + if (page->mapping != mapping) +@@ -108,6 +108,7 @@ + ClearPageMappedToDisk(page); + page_cache_release(page); /* pagecache ref */ + } ++EXPORT_SYMBOL_GPL(truncate_complete_page); + + /* + * This is for invalidate_mapping_pages(). That function can be called at +diff -u -r debian-2.6.26/security/security.c debian-2.6.26_lustre.1.8.2/security/security.c +--- debian-2.6.26/security/security.c 2009-12-26 09:14:57.000000000 +0100 ++++ debian-2.6.26_lustre.1.8.2/security/security.c 2010-02-18 08:13:38.000000000 +0100 +@@ -406,6 +406,7 @@ + return 0; + return security_ops->inode_unlink(dir, dentry); + } ++EXPORT_SYMBOL(security_inode_unlink); + + int security_inode_symlink(struct inode *dir, struct dentry *dentry, + const char *old_name) --- lustre-1.8.3.orig/lustre/kernel_patches/patches/quota-Increase-size-of-variables-for-limits-and-ino.patch +++ lustre-1.8.3/lustre/kernel_patches/patches/quota-Increase-size-of-variables-for-limits-and-ino.patch @@ -0,0 +1,359 @@ +From: Jan Kara +References: fate#302681 +Subject: [PATCH 02/28] quota: Increase size of variables for limits and inode usage +Patch-mainline: 2.6.29? + +So far quota was fine with quota block limits and inode limits/numbers in +a 32-bit type. Now with rapid increase in storage sizes there are coming +requests to be able to handle quota limits above 4TB / more that 2^32 inodes. +So bump up sizes of types in mem_dqblk structure to 64-bits to be able to +handle this. Also update inode allocation / checking functions to use qsize_t +and make global structure keep quota limits in bytes so that things are +consistent. + +Signed-off-by: Jan Kara +--- + fs/dquot.c | 50 ++++++++++++++++++++++++++------------------- + fs/quota_v1.c | 25 +++++++++++++++++----- + fs/quota_v2.c | 21 +++++++++++++++--- + include/linux/quota.h | 28 +++++++++++-------------- + include/linux/quotaops.h | 4 +- + 5 files changed, 79 insertions(+), 49 deletions(-) + +diff --git a/fs/dquot.c b/fs/dquot.c +index e1dac3e..758bf4a 100644 +--- a/fs/dquot.c ++++ b/fs/dquot.c +@@ -833,7 +833,7 @@ static void drop_dquot_ref(struct super_block *sb, int type) + } + } + +-static inline void dquot_incr_inodes(struct dquot *dquot, unsigned long number) ++static inline void dquot_incr_inodes(struct dquot *dquot, qsize_t number) + { + dquot->dq_dqb.dqb_curinodes += number; + } +@@ -843,7 +843,7 @@ static inline void dquot_incr_space(struct dquot *dquot, qsize_t number) + dquot->dq_dqb.dqb_curspace += number; + } + +-static inline void dquot_decr_inodes(struct dquot *dquot, unsigned long number) ++static inline void dquot_decr_inodes(struct dquot *dquot, qsize_t number) + { + if (dquot->dq_dqb.dqb_curinodes > number) + dquot->dq_dqb.dqb_curinodes -= number; +@@ -860,7 +860,7 @@ static inline void dquot_decr_space(struct dquot *dquot, qsize_t number) + dquot->dq_dqb.dqb_curspace -= number; + else + dquot->dq_dqb.dqb_curspace = 0; +- if (toqb(dquot->dq_dqb.dqb_curspace) <= dquot->dq_dqb.dqb_bsoftlimit) ++ if (dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) + dquot->dq_dqb.dqb_btime = (time_t) 0; + clear_bit(DQ_BLKS_B, &dquot->dq_flags); + } +@@ -1038,7 +1038,7 @@ static inline char ignore_hardlimit(struct dquot *dquot) + } + + /* needs dq_data_lock */ +-static int check_idq(struct dquot *dquot, ulong inodes, char *warntype) ++static int check_idq(struct dquot *dquot, qsize_t inodes, char *warntype) + { + *warntype = QUOTA_NL_NOWARN; + if (inodes <= 0 || test_bit(DQ_FAKE_B, &dquot->dq_flags)) +@@ -1077,7 +1077,7 @@ static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, char *war + return QUOTA_OK; + + if (dquot->dq_dqb.dqb_bhardlimit && +- toqb(dquot->dq_dqb.dqb_curspace + space) > dquot->dq_dqb.dqb_bhardlimit && ++ dquot->dq_dqb.dqb_curspace + space > dquot->dq_dqb.dqb_bhardlimit && + !ignore_hardlimit(dquot)) { + if (!prealloc) + *warntype = QUOTA_NL_BHARDWARN; +@@ -1085,7 +1085,7 @@ static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, char *war + } + + if (dquot->dq_dqb.dqb_bsoftlimit && +- toqb(dquot->dq_dqb.dqb_curspace + space) > dquot->dq_dqb.dqb_bsoftlimit && ++ dquot->dq_dqb.dqb_curspace + space > dquot->dq_dqb.dqb_bsoftlimit && + dquot->dq_dqb.dqb_btime && get_seconds() >= dquot->dq_dqb.dqb_btime && + !ignore_hardlimit(dquot)) { + if (!prealloc) +@@ -1094,7 +1094,7 @@ static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, char *war + } + + if (dquot->dq_dqb.dqb_bsoftlimit && +- toqb(dquot->dq_dqb.dqb_curspace + space) > dquot->dq_dqb.dqb_bsoftlimit && ++ dquot->dq_dqb.dqb_curspace + space > dquot->dq_dqb.dqb_bsoftlimit && + dquot->dq_dqb.dqb_btime == 0) { + if (!prealloc) { + *warntype = QUOTA_NL_BSOFTWARN; +@@ -1111,7 +1111,7 @@ static int check_bdq(struct dquot *dquot, qsize_t space, int prealloc, char *war + return QUOTA_OK; + } + +-static int info_idq_free(struct dquot *dquot, ulong inodes) ++static int info_idq_free(struct dquot *dquot, qsize_t inodes) + { + if (test_bit(DQ_FAKE_B, &dquot->dq_flags) || + dquot->dq_dqb.dqb_curinodes <= dquot->dq_dqb.dqb_isoftlimit) +@@ -1128,15 +1128,13 @@ static int info_idq_free(struct dquot *dquot, ulong inodes) + static int info_bdq_free(struct dquot *dquot, qsize_t space) + { + if (test_bit(DQ_FAKE_B, &dquot->dq_flags) || +- toqb(dquot->dq_dqb.dqb_curspace) <= dquot->dq_dqb.dqb_bsoftlimit) ++ dquot->dq_dqb.dqb_curspace <= dquot->dq_dqb.dqb_bsoftlimit) + return QUOTA_NL_NOWARN; + +- if (toqb(dquot->dq_dqb.dqb_curspace - space) <= +- dquot->dq_dqb.dqb_bsoftlimit) ++ if (dquot->dq_dqb.dqb_curspace - space <= dquot->dq_dqb.dqb_bsoftlimit) + return QUOTA_NL_BSOFTBELOW; +- if (toqb(dquot->dq_dqb.dqb_curspace) >= dquot->dq_dqb.dqb_bhardlimit && +- toqb(dquot->dq_dqb.dqb_curspace - space) < +- dquot->dq_dqb.dqb_bhardlimit) ++ if (dquot->dq_dqb.dqb_curspace >= dquot->dq_dqb.dqb_bhardlimit && ++ dquot->dq_dqb.dqb_curspace - space < dquot->dq_dqb.dqb_bhardlimit) + return QUOTA_NL_BHARDBELOW; + return QUOTA_NL_NOWARN; + } +@@ -1279,7 +1277,7 @@ warn_put_all: + /* + * This operation can block, but only after everything is updated + */ +-int dquot_alloc_inode(const struct inode *inode, unsigned long number) ++int dquot_alloc_inode(const struct inode *inode, qsize_t number) + { + int cnt, ret = NO_QUOTA; + char warntype[MAXQUOTAS]; +@@ -1364,7 +1362,7 @@ out_sub: + /* + * This operation can block, but only after everything is updated + */ +-int dquot_free_inode(const struct inode *inode, unsigned long number) ++int dquot_free_inode(const struct inode *inode, qsize_t number) + { + unsigned int cnt; + char warntype[MAXQUOTAS]; +@@ -1881,14 +1879,24 @@ int vfs_dq_quota_on_remount(struct super_block *sb) + return ret; + } + ++static inline qsize_t qbtos(qsize_t blocks) ++{ ++ return blocks << QIF_DQBLKSIZE_BITS; ++} ++ ++static inline qsize_t stoqb(qsize_t space) ++{ ++ return (space + QIF_DQBLKSIZE - 1) >> QIF_DQBLKSIZE_BITS; ++} ++ + /* Generic routine for getting common part of quota structure */ + static void do_get_dqblk(struct dquot *dquot, struct if_dqblk *di) + { + struct mem_dqblk *dm = &dquot->dq_dqb; + + spin_lock(&dq_data_lock); +- di->dqb_bhardlimit = dm->dqb_bhardlimit; +- di->dqb_bsoftlimit = dm->dqb_bsoftlimit; ++ di->dqb_bhardlimit = stoqb(dm->dqb_bhardlimit); ++ di->dqb_bsoftlimit = stoqb(dm->dqb_bsoftlimit); + di->dqb_curspace = dm->dqb_curspace; + di->dqb_ihardlimit = dm->dqb_ihardlimit; + di->dqb_isoftlimit = dm->dqb_isoftlimit; +@@ -1935,8 +1943,8 @@ static int do_set_dqblk(struct dquot *dquot, struct if_dqblk *di) + check_blim = 1; + } + if (di->dqb_valid & QIF_BLIMITS) { +- dm->dqb_bsoftlimit = di->dqb_bsoftlimit; +- dm->dqb_bhardlimit = di->dqb_bhardlimit; ++ dm->dqb_bsoftlimit = qbtos(di->dqb_bsoftlimit); ++ dm->dqb_bhardlimit = qbtos(di->dqb_bhardlimit); + check_blim = 1; + } + if (di->dqb_valid & QIF_INODES) { +@@ -1954,7 +1962,7 @@ static int do_set_dqblk(struct dquot *dquot, struct if_dqblk *di) + dm->dqb_itime = di->dqb_itime; + + if (check_blim) { +- if (!dm->dqb_bsoftlimit || toqb(dm->dqb_curspace) < dm->dqb_bsoftlimit) { ++ if (!dm->dqb_bsoftlimit || dm->dqb_curspace < dm->dqb_bsoftlimit) { + dm->dqb_btime = 0; + clear_bit(DQ_BLKS_B, &dquot->dq_flags); + } +diff --git a/fs/quota_v1.c b/fs/quota_v1.c +index 5ae15b1..3e078ee 100644 +--- a/fs/quota_v1.c ++++ b/fs/quota_v1.c +@@ -14,14 +14,27 @@ MODULE_AUTHOR("Jan Kara"); + MODULE_DESCRIPTION("Old quota format support"); + MODULE_LICENSE("GPL"); + ++#define QUOTABLOCK_BITS 10 ++#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) ++ ++static inline qsize_t v1_stoqb(qsize_t space) ++{ ++ return (space + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS; ++} ++ ++static inline qsize_t v1_qbtos(qsize_t blocks) ++{ ++ return blocks << QUOTABLOCK_BITS; ++} ++ + static void v1_disk2mem_dqblk(struct mem_dqblk *m, struct v1_disk_dqblk *d) + { + m->dqb_ihardlimit = d->dqb_ihardlimit; + m->dqb_isoftlimit = d->dqb_isoftlimit; + m->dqb_curinodes = d->dqb_curinodes; +- m->dqb_bhardlimit = d->dqb_bhardlimit; +- m->dqb_bsoftlimit = d->dqb_bsoftlimit; +- m->dqb_curspace = ((qsize_t)d->dqb_curblocks) << QUOTABLOCK_BITS; ++ m->dqb_bhardlimit = v1_qbtos(d->dqb_bhardlimit); ++ m->dqb_bsoftlimit = v1_qbtos(d->dqb_bsoftlimit); ++ m->dqb_curspace = v1_qbtos(d->dqb_curblocks); + m->dqb_itime = d->dqb_itime; + m->dqb_btime = d->dqb_btime; + } +@@ -31,9 +44,9 @@ static void v1_mem2disk_dqblk(struct v1_disk_dqblk *d, struct mem_dqblk *m) + d->dqb_ihardlimit = m->dqb_ihardlimit; + d->dqb_isoftlimit = m->dqb_isoftlimit; + d->dqb_curinodes = m->dqb_curinodes; +- d->dqb_bhardlimit = m->dqb_bhardlimit; +- d->dqb_bsoftlimit = m->dqb_bsoftlimit; +- d->dqb_curblocks = toqb(m->dqb_curspace); ++ d->dqb_bhardlimit = v1_stoqb(m->dqb_bhardlimit); ++ d->dqb_bsoftlimit = v1_stoqb(m->dqb_bsoftlimit); ++ d->dqb_curblocks = v1_stoqb(m->dqb_curspace); + d->dqb_itime = m->dqb_itime; + d->dqb_btime = m->dqb_btime; + } +diff --git a/fs/quota_v2.c b/fs/quota_v2.c +index b53827d..51c4717 100644 +--- a/fs/quota_v2.c ++++ b/fs/quota_v2.c +@@ -26,6 +26,19 @@ typedef char *dqbuf_t; + #define GETIDINDEX(id, depth) (((id) >> ((V2_DQTREEDEPTH-(depth)-1)*8)) & 0xff) + #define GETENTRIES(buf) ((struct v2_disk_dqblk *)(((char *)buf)+sizeof(struct v2_disk_dqdbheader))) + ++#define QUOTABLOCK_BITS 10 ++#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) ++ ++static inline qsize_t v2_stoqb(qsize_t space) ++{ ++ return (space + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS; ++} ++ ++static inline qsize_t v2_qbtos(qsize_t blocks) ++{ ++ return blocks << QUOTABLOCK_BITS; ++} ++ + /* Check whether given file is really vfsv0 quotafile */ + static int v2_check_quota_file(struct super_block *sb, int type) + { +@@ -104,8 +117,8 @@ static void disk2memdqb(struct mem_dqblk *m, struct v2_disk_dqblk *d) + m->dqb_isoftlimit = le32_to_cpu(d->dqb_isoftlimit); + m->dqb_curinodes = le32_to_cpu(d->dqb_curinodes); + m->dqb_itime = le64_to_cpu(d->dqb_itime); +- m->dqb_bhardlimit = le32_to_cpu(d->dqb_bhardlimit); +- m->dqb_bsoftlimit = le32_to_cpu(d->dqb_bsoftlimit); ++ m->dqb_bhardlimit = v2_qbtos(le32_to_cpu(d->dqb_bhardlimit)); ++ m->dqb_bsoftlimit = v2_qbtos(le32_to_cpu(d->dqb_bsoftlimit)); + m->dqb_curspace = le64_to_cpu(d->dqb_curspace); + m->dqb_btime = le64_to_cpu(d->dqb_btime); + } +@@ -116,8 +129,8 @@ static void mem2diskdqb(struct v2_disk_dqblk *d, struct mem_dqblk *m, qid_t id) + d->dqb_isoftlimit = cpu_to_le32(m->dqb_isoftlimit); + d->dqb_curinodes = cpu_to_le32(m->dqb_curinodes); + d->dqb_itime = cpu_to_le64(m->dqb_itime); +- d->dqb_bhardlimit = cpu_to_le32(m->dqb_bhardlimit); +- d->dqb_bsoftlimit = cpu_to_le32(m->dqb_bsoftlimit); ++ d->dqb_bhardlimit = cpu_to_le32(v2_qbtos(m->dqb_bhardlimit)); ++ d->dqb_bsoftlimit = cpu_to_le32(v2_qbtos(m->dqb_bsoftlimit)); + d->dqb_curspace = cpu_to_le64(m->dqb_curspace); + d->dqb_btime = cpu_to_le64(m->dqb_btime); + d->dqb_id = cpu_to_le32(id); +diff --git a/include/linux/quota.h b/include/linux/quota.h +index eeae7a9..5167786 100644 +--- a/include/linux/quota.h ++++ b/include/linux/quota.h +@@ -41,15 +41,6 @@ + #define __DQUOT_VERSION__ "dquot_6.5.1" + #define __DQUOT_NUM_VERSION__ 6*10000+5*100+1 + +-/* Size of blocks in which are counted size limits */ +-#define QUOTABLOCK_BITS 10 +-#define QUOTABLOCK_SIZE (1 << QUOTABLOCK_BITS) +- +-/* Conversion routines from and to quota blocks */ +-#define qb2kb(x) ((x) << (QUOTABLOCK_BITS-10)) +-#define kb2qb(x) ((x) >> (QUOTABLOCK_BITS-10)) +-#define toqb(x) (((x) + QUOTABLOCK_SIZE - 1) >> QUOTABLOCK_BITS) +- + #define MAXQUOTAS 2 + #define USRQUOTA 0 /* element used for user quotas */ + #define GRPQUOTA 1 /* element used for group quotas */ +@@ -82,6 +73,11 @@ + #define Q_GETQUOTA 0x800007 /* get user quota structure */ + #define Q_SETQUOTA 0x800008 /* set user quota structure */ + ++/* Size of block in which space limits are passed through the quota ++ * interface */ ++#define QIF_DQBLKSIZE_BITS 10 ++#define QIF_DQBLKSIZE (1 << QIF_DQBLKSIZE_BITS) ++ + /* + * Quota structure used for communication with userspace via quotactl + * Following flags are used to specify which fields are valid +@@ -189,12 +185,12 @@ extern spinlock_t dq_data_lock; + * Data for one user/group kept in memory + */ + struct mem_dqblk { +- __u32 dqb_bhardlimit; /* absolute limit on disk blks alloc */ +- __u32 dqb_bsoftlimit; /* preferred limit on disk blks */ ++ qsize_t dqb_bhardlimit; /* absolute limit on disk blks alloc */ ++ qsize_t dqb_bsoftlimit; /* preferred limit on disk blks */ + qsize_t dqb_curspace; /* current used space */ +- __u32 dqb_ihardlimit; /* absolute limit on allocated inodes */ +- __u32 dqb_isoftlimit; /* preferred inode limit */ +- __u32 dqb_curinodes; /* current # allocated inodes */ ++ qsize_t dqb_ihardlimit; /* absolute limit on allocated inodes */ ++ qsize_t dqb_isoftlimit; /* preferred inode limit */ ++ qsize_t dqb_curinodes; /* current # allocated inodes */ + time_t dqb_btime; /* time limit for excessive disk use */ + time_t dqb_itime; /* time limit for excessive inode use */ + }; +@@ -289,9 +285,9 @@ struct dquot_operations { + int (*initialize) (struct inode *, int); + int (*drop) (struct inode *); + int (*alloc_space) (struct inode *, qsize_t, int); +- int (*alloc_inode) (const struct inode *, unsigned long); ++ int (*alloc_inode) (const struct inode *, qsize_t); + int (*free_space) (struct inode *, qsize_t); +- int (*free_inode) (const struct inode *, unsigned long); ++ int (*free_inode) (const struct inode *, qsize_t); + int (*transfer) (struct inode *, struct iattr *); + int (*write_dquot) (struct dquot *); /* Ordinary dquot write */ + struct dquot *(*alloc_dquot)(struct super_block *, int); /* Allocate memory for new dquot (can be NULL if no special entries dquot are needed) */ +diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h +index ca6b9b5..9e7bc4b 100644 +--- a/include/linux/quotaops.h ++++ b/include/linux/quotaops.h +@@ -29,10 +29,10 @@ int dquot_initialize(struct inode *inode, int type); + int dquot_drop(struct inode *inode); + + int dquot_alloc_space(struct inode *inode, qsize_t number, int prealloc); +-int dquot_alloc_inode(const struct inode *inode, unsigned long number); ++int dquot_alloc_inode(const struct inode *inode, qsize_t number); + + int dquot_free_space(struct inode *inode, qsize_t number); +-int dquot_free_inode(const struct inode *inode, unsigned long number); ++int dquot_free_inode(const struct inode *inode, qsize_t number); + + int dquot_transfer(struct inode *inode, struct iattr *iattr); + int dquot_commit(struct dquot *dquot); +-- +1.5.2.4 + --- lustre-1.8.3.orig/lustre/kernel_patches/patches/jbd2-jcberr-2.6.26-vanilla.patch +++ lustre-1.8.3/lustre/kernel_patches/patches/jbd2-jcberr-2.6.26-vanilla.patch @@ -0,0 +1,211 @@ +Index: linux-source-2.6.26/include/linux/jbd2.h +=================================================================== +--- linux-source-2.6.26.orig/include/linux/jbd2.h 2008-07-13 23:51:29.000000000 +0200 ++++ linux-source-2.6.26/include/linux/jbd2.h 2009-10-09 13:42:21.000000000 +0200 +@@ -379,6 +379,27 @@ + bit_spin_unlock(BH_JournalHead, &bh->b_state); + } + ++#define HAVE_JOURNAL_CALLBACK_STATUS ++/** ++ * struct journal_callback - Base structure for callback information. ++ * @jcb_list: list information for other callbacks attached to the same handle. ++ * @jcb_func: Function to call with this callback structure. ++ * ++ * This struct is a 'seed' structure for a using with your own callback ++ * structs. If you are using callbacks you must allocate one of these ++ * or another struct of your own definition which has this struct ++ * as it's first element and pass it to journal_callback_set(). ++ * ++ * This is used internally by jbd2 to maintain callback information. ++ * ++ * See journal_callback_set for more information. ++ **/ ++struct journal_callback { ++ struct list_head jcb_list; /* t_jcb_lock */ ++ void (*jcb_func)(struct journal_callback *jcb, int error); ++ /* user data goes here */ ++}; ++ + struct jbd2_revoke_table_s; + + /** +@@ -387,6 +408,7 @@ + * @h_transaction: Which compound transaction is this update a part of? + * @h_buffer_credits: Number of remaining buffers we are allowed to dirty. + * @h_ref: Reference count on this handle ++ * @h_jcb: List of application registered callbacks for this handle. + * @h_err: Field for caller's use to track errors through large fs operations + * @h_sync: flag for sync-on-close + * @h_jdata: flag to force data journaling +@@ -412,6 +434,13 @@ + /* operations */ + int h_err; + ++ /* ++ * List of application registered callbacks for this handle. The ++ * function(s) will be called after the transaction that this handle is ++ * part of has been committed to disk. [t_jcb_lock] ++ */ ++ struct list_head h_jcb; ++ + /* Flags [no locking] */ + unsigned int h_sync: 1; /* sync-on-close */ + unsigned int h_jdata: 1; /* force data journaling */ +@@ -467,6 +496,8 @@ + * j_state_lock + * ->j_list_lock (journal_unmap_buffer) + * ++ * t_handle_lock ++ * ->t_jcb_lock + */ + + struct transaction_s +@@ -613,6 +644,15 @@ + */ + int t_handle_count; + ++ /* ++ * Protects the callback list ++ */ ++ spinlock_t t_jcb_lock; ++ /* ++ * List of registered callback functions for this transaction. ++ * Called when the transaction is committed. [t_jcb_lock] ++ */ ++ struct list_head t_jcb; + }; + + struct transaction_run_stats_s { +@@ -1016,6 +1056,9 @@ + extern int jbd2_journal_flush (journal_t *); + extern void jbd2_journal_lock_updates (journal_t *); + extern void jbd2_journal_unlock_updates (journal_t *); ++extern void jbd2_journal_callback_set(handle_t *handle, ++ void (*fn)(struct journal_callback *,int), ++ struct journal_callback *jcb); + + extern journal_t * jbd2_journal_init_dev(struct block_device *bdev, + struct block_device *fs_dev, +Index: linux-source-2.6.26/fs/jbd2/checkpoint.c +=================================================================== +--- linux-source-2.6.26.orig/fs/jbd2/checkpoint.c 2008-07-13 23:51:29.000000000 +0200 ++++ linux-source-2.6.26/fs/jbd2/checkpoint.c 2009-10-09 13:42:21.000000000 +0200 +@@ -696,6 +696,7 @@ + J_ASSERT(transaction->t_checkpoint_list == NULL); + J_ASSERT(transaction->t_checkpoint_io_list == NULL); + J_ASSERT(transaction->t_updates == 0); ++ J_ASSERT(list_empty(&transaction->t_jcb)); + J_ASSERT(journal->j_committing_transaction != transaction); + J_ASSERT(journal->j_running_transaction != transaction); + +Index: linux-source-2.6.26/fs/jbd2/commit.c +=================================================================== +--- linux-source-2.6.26.orig/fs/jbd2/commit.c 2008-07-13 23:51:29.000000000 +0200 ++++ linux-source-2.6.26/fs/jbd2/commit.c 2009-10-09 13:42:21.000000000 +0200 +@@ -854,6 +854,30 @@ + /* AKPM: bforget here */ + } + ++ /* ++ * Call any callbacks that had been registered for handles in this ++ * transaction. It is up to the callback to free any allocated ++ * memory. ++ * ++ * The spinlocking (t_jcb_lock) here is surely unnecessary... ++ */ ++ spin_lock(&commit_transaction->t_jcb_lock); ++ if (!list_empty(&commit_transaction->t_jcb)) { ++ struct list_head *p, *n; ++ int error = is_journal_aborted(journal); ++ ++ list_for_each_safe(p, n, &commit_transaction->t_jcb) { ++ struct journal_callback *jcb; ++ ++ jcb = list_entry(p, struct journal_callback, jcb_list); ++ list_del(p); ++ spin_unlock(&commit_transaction->t_jcb_lock); ++ jcb->jcb_func(jcb, error); ++ spin_lock(&commit_transaction->t_jcb_lock); ++ } ++ } ++ spin_unlock(&commit_transaction->t_jcb_lock); ++ + jbd_debug(3, "JBD: commit phase 6\n"); + + if (!JBD2_HAS_INCOMPAT_FEATURE(journal, +Index: linux-source-2.6.26/fs/jbd2/journal.c +=================================================================== +--- linux-source-2.6.26.orig/fs/jbd2/journal.c 2009-10-09 13:39:04.000000000 +0200 ++++ linux-source-2.6.26/fs/jbd2/journal.c 2009-10-09 13:43:03.000000000 +0200 +@@ -82,6 +82,9 @@ + EXPORT_SYMBOL(jbd2_journal_invalidatepage); + EXPORT_SYMBOL(jbd2_journal_try_to_free_buffers); + EXPORT_SYMBOL(jbd2_journal_force_commit); ++EXPORT_SYMBOL(jbd2_journal_callback_set); ++EXPORT_SYMBOL(jbd2_journal_bmap); ++ + + static int journal_convert_superblock_v1(journal_t *, journal_superblock_t *); + static void __journal_abort_soft (journal_t *journal, int errno); +Index: linux-source-2.6.26/fs/jbd2/transaction.c +=================================================================== +--- linux-source-2.6.26.orig/fs/jbd2/transaction.c 2008-07-13 23:51:29.000000000 +0200 ++++ linux-source-2.6.26/fs/jbd2/transaction.c 2009-10-09 13:42:21.000000000 +0200 +@@ -252,6 +252,7 @@ + memset(handle, 0, sizeof(*handle)); + handle->h_buffer_credits = nblocks; + handle->h_ref = 1; ++ INIT_LIST_HEAD(&handle->h_jcb); + + lockdep_init_map(&handle->h_lockdep_map, "jbd2_handle", + &jbd2_handle_key, 0); +@@ -1350,6 +1351,36 @@ + } + + /** ++ * void jbd2_journal_callback_set() - Register a callback function for this handle. ++ * @handle: handle to attach the callback to. ++ * @func: function to callback. ++ * @jcb: structure with additional information required by func() , and ++ * some space for jbd2 internal information. ++ * ++ * The function will be ++ * called when the transaction that this handle is part of has been ++ * committed to disk with the original callback data struct and the ++ * error status of the journal as parameters. There is no guarantee of ++ * ordering between handles within a single transaction, nor between ++ * callbacks registered on the same handle. ++ * ++ * The caller is responsible for allocating the journal_callback struct. ++ * This is to allow the caller to add as much extra data to the callback ++ * as needed, but reduce the overhead of multiple allocations. The caller ++ * allocated struct must start with a struct journal_callback at offset 0, ++ * and has the caller-specific data afterwards. ++ */ ++void jbd2_journal_callback_set(handle_t *handle, ++ void (*func)(struct journal_callback *jcb, int error), ++ struct journal_callback *jcb) ++{ ++ spin_lock(&handle->h_transaction->t_jcb_lock); ++ list_add_tail(&jcb->jcb_list, &handle->h_jcb); ++ spin_unlock(&handle->h_transaction->t_jcb_lock); ++ jcb->jcb_func = func; ++} ++ ++/** + * int jbd2_journal_stop() - complete a transaction + * @handle: tranaction to complete. + * +@@ -1423,6 +1454,11 @@ + wake_up(&journal->j_wait_transaction_locked); + } + ++ /* Move callbacks from the handle to the transaction. */ ++ spin_lock(&transaction->t_jcb_lock); ++ list_splice(&handle->h_jcb, &transaction->t_jcb); ++ spin_unlock(&transaction->t_jcb_lock); ++ + /* + * If the handle is marked SYNC, we need to set another commit + * going! We also want to force a commit if the current --- lustre-1.8.3.orig/lustre/kernel_patches/patches/quota-support-64-bit-quota-format-2.6.27-vanilla.patch +++ lustre-1.8.3/lustre/kernel_patches/patches/quota-support-64-bit-quota-format-2.6.27-vanilla.patch @@ -0,0 +1,282 @@ +From: Jan Kara + +Implement conversion functions for new version (version 1) of quota format +which supports 64-bit block and inode limits and 64-bit inode usage. The +original implementation has been written by Andrew Perepechko. + +Signed-off-by: Andrew Perepechko +Signed-off-by: Jan Kara +Signed-off-by: Andrew Morton +--- + + fs/quota_v2.c | 140 ++++++++++++++++++++++++++++++++++++---------- + fs/quotaio_v2.h | 26 ++++++-- + 2 files changed, 132 insertions(+), 34 deletions(-) + +Index: linux-2.6.27.36/fs/quota_v2.c +=================================================================== +--- linux-2.6.27.36.orig/fs/quota_v2.c 2009-10-09 17:00:48.000000000 +0200 ++++ linux-2.6.27.36/fs/quota_v2.c 2009-10-09 17:03:35.000000000 +0200 +@@ -23,14 +23,24 @@ + + #define __QUOTA_V2_PARANOIA + +-static void v2_mem2diskdqb(void *dp, struct dquot *dquot); +-static void v2_disk2memdqb(struct dquot *dquot, void *dp); +-static int v2_is_id(void *dp, struct dquot *dquot); +- +-static struct qtree_fmt_operations v2_qtree_ops = { +- .mem2disk_dqblk = v2_mem2diskdqb, +- .disk2mem_dqblk = v2_disk2memdqb, +- .is_id = v2_is_id, ++static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot); ++static void v2r0_disk2memdqb(struct dquot *dquot, void *dp); ++static int v2r0_is_id(void *dp, struct dquot *dquot); ++ ++static struct qtree_fmt_operations v2r0_qtree_ops = { ++ .mem2disk_dqblk = v2r0_mem2diskdqb, ++ .disk2mem_dqblk = v2r0_disk2memdqb, ++ .is_id = v2r0_is_id, ++}; ++ ++static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot); ++static void v2r1_disk2memdqb(struct dquot *dquot, void *dp); ++static int v2r1_is_id(void *dp, struct dquot *dquot); ++ ++static struct qtree_fmt_operations v2r1_qtree_ops = { ++ .mem2disk_dqblk = v2r1_mem2diskdqb, ++ .disk2mem_dqblk = v2r1_disk2memdqb, ++ .is_id = v2r1_is_id, + }; + + #define QUOTABLOCK_BITS 10 +@@ -46,8 +56,7 @@ + return blocks << QUOTABLOCK_BITS; + } + +-/* Check whether given file is really vfsv0 quotafile */ +-static int v2_check_quota_file(struct super_block *sb, int type) ++static int v2_check_quota_file_header(struct super_block *sb, int type) + { + struct v2_disk_dqheader dqhead; + ssize_t size; +@@ -58,12 +67,20 @@ + if (size != sizeof(struct v2_disk_dqheader)) { + printk("quota_v2: failed read expected=%zd got=%zd\n", + sizeof(struct v2_disk_dqheader), size); +- return 0; ++ return -EIO; + } +- if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type] || +- le32_to_cpu(dqhead.dqh_version) != quota_versions[type]) +- return 0; +- return 1; ++ if (le32_to_cpu(dqhead.dqh_magic) != quota_magics[type]) ++ return -ENOENT; ++ if (le32_to_cpu(dqhead.dqh_version) > quota_versions[type]) ++ return -EOPNOTSUPP; ++ return le32_to_cpu(dqhead.dqh_version); ++} ++ ++ ++/* Check whether given file is really vfsv0 quotafile */ ++static int v2_check_quota_file(struct super_block *sb, int type) ++{ ++ return v2_check_quota_file_header(sb, type) >= 0; + } + + /* Read information header from quota file */ +@@ -72,7 +89,13 @@ + struct v2_disk_dqinfo dinfo; + struct mem_dqinfo *info = sb_dqinfo(sb, type); + ssize_t size; ++ int version = v2_check_quota_file_header(sb, type); + ++ if (version < 0) { ++ printk(KERN_WARNING "Cannot identify quota file version on " ++ "device %s: %d\n", sb->s_id, version); ++ return -1; ++ } + size = sb->s_op->quota_read(sb, type, (char *)&dinfo, + sizeof(struct v2_disk_dqinfo), V2_DQINFOOFF); + if (size != sizeof(struct v2_disk_dqinfo)) { +@@ -81,8 +104,14 @@ + return -1; + } + /* limits are stored as unsigned 32-bit data */ +- info->dqi_maxblimit = 0xffffffff; +- info->dqi_maxilimit = 0xffffffff; ++ if (version == 0) { ++ /* limits are stored as unsigned 32-bit data */ ++ info->dqi_maxblimit = 0xffffffff; ++ info->dqi_maxilimit = 0xffffffff; ++ } else { ++ info->dqi_maxblimit = 0x7fffffffffffffffULL; ++ info->dqi_maxilimit = 0x7fffffffffffffffULL; ++ } + info->dqi_bgrace = le32_to_cpu(dinfo.dqi_bgrace); + info->dqi_igrace = le32_to_cpu(dinfo.dqi_igrace); + info->dqi_flags = le32_to_cpu(dinfo.dqi_flags); +@@ -94,8 +123,13 @@ + info->u.v2_i.i.dqi_blocksize_bits = V2_DQBLKSIZE_BITS; + info->u.v2_i.i.dqi_usable_bs = 1 << V2_DQBLKSIZE_BITS; + info->u.v2_i.i.dqi_qtree_depth = qtree_depth(&info->u.v2_i.i); +- info->u.v2_i.i.dqi_entry_size = sizeof(struct v2_disk_dqblk); +- info->u.v2_i.i.dqi_ops = &v2_qtree_ops; ++ if (version == 0) { ++ qinfo->dqi_entry_size = sizeof(struct v2r0_disk_dqblk); ++ qinfo->dqi_ops = &v2r0_qtree_ops; ++ } else { ++ qinfo->dqi_entry_size = sizeof(struct v2r1_disk_dqblk); ++ qinfo->dqi_ops = &v2r1_qtree_ops; ++ } + return 0; + } + +@@ -125,9 +159,9 @@ + return 0; + } + +-static void v2_disk2memdqb(struct dquot *dquot, void *dp) ++static void v2r0_disk2memdqb(struct dquot *dquot, void *dp) + { +- struct v2_disk_dqblk *d = dp, empty; ++ struct v2r0_disk_dqblk *d = dp, empty; + struct mem_dqblk *m = &dquot->dq_dqb; + + m->dqb_ihardlimit = le32_to_cpu(d->dqb_ihardlimit); +@@ -139,15 +173,15 @@ + m->dqb_curspace = le64_to_cpu(d->dqb_curspace); + m->dqb_btime = le64_to_cpu(d->dqb_btime); + /* We need to escape back all-zero structure */ +- memset(&empty, 0, sizeof(struct v2_disk_dqblk)); ++ memset(&empty, 0, sizeof(struct v2r0_disk_dqblk)); + empty.dqb_itime = cpu_to_le64(1); +- if (!memcmp(&empty, dp, sizeof(struct v2_disk_dqblk))) ++ if (!memcmp(&empty, dp, sizeof(struct v2r0_disk_dqblk))) + m->dqb_itime = 0; + } + +-static void v2_mem2diskdqb(void *dp, struct dquot *dquot) ++static void v2r0_mem2diskdqb(void *dp, struct dquot *dquot) + { +- struct v2_disk_dqblk *d = dp; ++ struct v2r0_disk_dqblk *d = dp; + struct mem_dqblk *m = &dquot->dq_dqb; + struct qtree_mem_dqinfo *info = + &sb_dqinfo(dquot->dq_sb, dquot->dq_type)->u.v2_i.i; +@@ -165,9 +199,60 @@ + d->dqb_itime = cpu_to_le64(1); + } + +-static int v2_is_id(void *dp, struct dquot *dquot) ++static int v2r0_is_id(void *dp, struct dquot *dquot) ++{ ++ struct v2r0_disk_dqblk *d = dp; ++ struct qtree_mem_dqinfo *info = ++ sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv; ++ ++ if (qtree_entry_unused(info, dp)) ++ return 0; ++ return le32_to_cpu(d->dqb_id) == dquot->dq_id; ++} ++ ++static void v2r1_disk2memdqb(struct dquot *dquot, void *dp) ++{ ++ struct v2r1_disk_dqblk *d = dp, empty; ++ struct mem_dqblk *m = &dquot->dq_dqb; ++ ++ m->dqb_ihardlimit = le64_to_cpu(d->dqb_ihardlimit); ++ m->dqb_isoftlimit = le64_to_cpu(d->dqb_isoftlimit); ++ m->dqb_curinodes = le64_to_cpu(d->dqb_curinodes); ++ m->dqb_itime = le64_to_cpu(d->dqb_itime); ++ m->dqb_bhardlimit = v2_qbtos(le64_to_cpu(d->dqb_bhardlimit)); ++ m->dqb_bsoftlimit = v2_qbtos(le64_to_cpu(d->dqb_bsoftlimit)); ++ m->dqb_curspace = le64_to_cpu(d->dqb_curspace); ++ m->dqb_btime = le64_to_cpu(d->dqb_btime); ++ /* We need to escape back all-zero structure */ ++ memset(&empty, 0, sizeof(struct v2r1_disk_dqblk)); ++ empty.dqb_itime = cpu_to_le64(1); ++ if (!memcmp(&empty, dp, sizeof(struct v2r1_disk_dqblk))) ++ m->dqb_itime = 0; ++} ++ ++static void v2r1_mem2diskdqb(void *dp, struct dquot *dquot) ++{ ++ struct v2r1_disk_dqblk *d = dp; ++ struct mem_dqblk *m = &dquot->dq_dqb; ++ struct qtree_mem_dqinfo *info = ++ sb_dqinfo(dquot->dq_sb, dquot->dq_type)->dqi_priv; ++ ++ d->dqb_ihardlimit = cpu_to_le64(m->dqb_ihardlimit); ++ d->dqb_isoftlimit = cpu_to_le64(m->dqb_isoftlimit); ++ d->dqb_curinodes = cpu_to_le64(m->dqb_curinodes); ++ d->dqb_itime = cpu_to_le64(m->dqb_itime); ++ d->dqb_bhardlimit = cpu_to_le64(v2_stoqb(m->dqb_bhardlimit)); ++ d->dqb_bsoftlimit = cpu_to_le64(v2_stoqb(m->dqb_bsoftlimit)); ++ d->dqb_curspace = cpu_to_le64(m->dqb_curspace); ++ d->dqb_btime = cpu_to_le64(m->dqb_btime); ++ d->dqb_id = cpu_to_le32(dquot->dq_id); ++ if (qtree_entry_unused(info, dp)) ++ d->dqb_itime = cpu_to_le64(1); ++} ++ ++static int v2r1_is_id(void *dp, struct dquot *dquot) + { +- struct v2_disk_dqblk *d = dp; ++ struct v2r1_disk_dqblk *d = dp; + struct qtree_mem_dqinfo *info = + &sb_dqinfo(dquot->dq_sb, dquot->dq_type)->u.v2_i.i; + +Index: linux-2.6.27.36/include/linux/quotaio_v2.h +=================================================================== +--- linux-2.6.27.36.orig/include/linux/quotaio_v2.h 2009-10-09 17:00:48.000000000 +0200 ++++ linux-2.6.27.36/include/linux/quotaio_v2.h 2009-10-09 17:00:56.000000000 +0200 +@@ -17,8 +17,8 @@ + } + + #define V2_INITQVERSIONS {\ +- 0, /* USRQUOTA */\ +- 0 /* GRPQUOTA */\ ++ 1, /* USRQUOTA */\ ++ 1 /* GRPQUOTA */\ + } + + /* First generic header */ +@@ -28,11 +28,11 @@ + }; + + /* +- * The following structure defines the format of the disk quota file +- * (as it appears on disk) - the file is a radix tree whose leaves point +- * to blocks of these structures. ++ * The following structure defines the format of the disk quota file in version ++ * 0 - the file is a radix tree whose leaves point to blocks of these ++ * structures. + */ +-struct v2_disk_dqblk { ++struct v2r0_disk_dqblk { + __le32 dqb_id; /* id this quota applies to */ + __le32 dqb_ihardlimit; /* absolute limit on allocated inodes */ + __le32 dqb_isoftlimit; /* preferred inode limit */ +@@ -44,6 +44,20 @@ + __le64 dqb_itime; /* time limit for excessive inode use */ + }; + ++/* The same structure in quota file version 1 */ ++struct v2r1_disk_dqblk { ++ __le32 dqb_id; /* id this quota applies to */ ++ __le32 dqb_padding; /* padding field */ ++ __le64 dqb_ihardlimit; /* absolute limit on allocated inodes */ ++ __le64 dqb_isoftlimit; /* preferred inode limit */ ++ __le64 dqb_curinodes; /* current # allocated inodes */ ++ __le64 dqb_bhardlimit; /* absolute limit on disk space */ ++ __le64 dqb_bsoftlimit; /* preferred limit on disk space */ ++ __le64 dqb_curspace; /* current space occupied (in bytes) */ ++ __le64 dqb_btime; /* time limit for excessive disk use */ ++ __le64 dqb_itime; /* time limit for excessive inode use */ ++}; ++ + /* Header with type and version specific information */ + struct v2_disk_dqinfo { + __le32 dqi_bgrace; /* Time before block soft limit becomes hard limit */ --- lustre-1.8.3.orig/debian/linux-patch-lustre.apply +++ lustre-1.8.3/debian/linux-patch-lustre.apply @@ -0,0 +1,118 @@ +#! /bin/bash +set -x + +if ! [ -d kernel -a -d Documentation ] +then + echo >&2 "Not in kernel top level directory. Exiting" + exit 1 +fi +TOPPATCHDIR=/usr/src/kernel-patches/lustre +ARCHITECTURE=`dpkg --print-installation-architecture` + +QUILT="quilt --quiltrc /dev/null" +export QUILT_PATCHES="$TOPPATCHDIR/patches" + +[ -f debian/APPLIED_all_lustre ] && exit 0 +VERSION=$(grep ^VERSION Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +PATCHLEVEL=$( grep ^PATCHLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +#EXTRAVERSION=$(grep ^EXTRAVERSION Makefile | head -1 2>/dev/null | \ +# sed -e 's/EXTRAVERSION =[ ]*\([^ ]*\)$/\1/') +#KERNELBRANCHLET=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} +#KERNELRELEASE=${KERNELBRANCHLET}${EXTRAVERSION} +KERNELRELEASE=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} + +cleanup() { + echo >&2 Cleaning up + if [ -e series ]; then + echo >&2 Removing series file + rm series + fi + if [ -e debian/APLLIED_all_lustre_tmp/series.orig ]; then + echo >&1 Restoring orig series file + mv debian/APLLIED_all_lustre_tmp/series.orig series + fi + if [ -e .pc ]; then + echo >&2 Removing .pc dir + rm -r .pc + fi + if [ -e debian/APPLIED_all_lustre_tmp/.pc.orig ]; then + echo >&2 Restoring orig .pc dir + mv debian/APPLIED_all_lustre_tmp/.pc.orig .pc + fi +} + +mkdir -p debian/APPLIED_all_lustre_tmp +if [ -e series ]; then + echo >&2 Preserving existing series file + mv series debian/APPLIED_all_lustre_tmp/series.orig +fi +if [ -e .pc ]; then + echo >&2 Preserving existing .pc dir + mv .pc debian/APPLIED_all_lustre_tmp/.pc.orig +fi + +trap cleanup EXIT + +echo >&2 Setting up quilt +$QUILT setup $TOPPATCHDIR/series/$KERNELRELEASE-vanilla.series 2>/dev/null +ERR=$? +if ! [ $ERR = 0 ]; then + echo >&2 Quilt failed to initialize + cleanup + exit $ERR +fi + +echo >&2 Applying lustre patches +$QUILT push -a +ERR=$? +if ! [ $ERR = 0 ]; then + echo >&2 Lustre patched failed to apply + echo >&2 Reverting partialy applied patch + $QUILT pop -a + cleanup + exit $ERR +fi + +echo >&2 Finalizing lustre patch +mv series debian/APPLIED_all_lustre_tmp/series.lustre +mv .pc debian/APPLIED_all_lustre_tmp/.pc.lustre +cleanup + + +echo >&2 "\"Lustre Filesystem patch for the Linux kernel\" patch for $KVERSION succeeded" + +echo >&2 "Removing empty files:" +# make an exception for ./debian, or else the stamp files will go too. +find . -path ./debian -prune -o \ + -type f -size 0 ! -name 'APPLIED*' -exec rm {} \; -print +echo >&2 "Done." + +mkdir -p debian +cat > 'debian/APPLIED_all_lustre' < 'debian/image.d/register-lustre' <> \${docdir}/applied-patches +EOF +chmod +x 'debian/image.d/register-lustre' + +echo >&2 "END applying lustre patch" --- lustre-1.8.3.orig/debian/control +++ lustre-1.8.3/debian/control @@ -0,0 +1,97 @@ +Source: lustre +Section: admin +Priority: optional +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Debian Lustre Packaging team +Uploaders: Patrick Winnertz , NoĆØl Kƶthe +Standards-Version: 3.8.4 +Build-Depends: libreadline-dev, debhelper (>=6.0.7), dpatch, dh-kpatches (>= 0.99.3), lyx, automake1.7, libsnmp-dev, bzip2, texlive-extra-utils | tetex-extra, quilt, texlive-latex-recommended +Homepage: http://www.lustre.org/ +Vcs-Cvs: -d :pserver:anonymous@cvs.lustre.org:/lustre + +Package: linux-patch-lustre +Section: kernel +Architecture: all +Depends: ${kpatch:Depends}, ${misc:Depends} +Recommends: kernel-package, quilt +Description: Linux kernel patch for the Lustre Filesystem + Lustre is a scalable, secure, robust, highly-available + cluster file system. It is maintained by Cluster Filesystems, Inc. + and available from http://www.lustre.org + . + Lustre servers require a number of patches to the core Linux kernel, + mostly to export new functions, add features to ext3, and add + a new locking path to the VFS. This package provides these patches + for kernel versions 2.6.18, 2.6.21 and 2.6.22 on i386, amd64, powerpc + and ia64 architectures. + . + For Lustre clients, you will also need to build a lustre-modules + package, using the lustre-source package and module-assistant. + +Package: lustre-source +Section: kernel +Architecture: all +Depends: module-assistant, bzip2, debhelper (>= 5.0.0), libsnmp-dev, dpatch, ${misc:Depends} +Suggests: ofa-kernel-source +Description: source for Lustre filesystem client kernel modules + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Cluster Filesystems, Inc. and available from + http://www.lustre.org + . + This package contains the module source. The client kernel modules + can be built from it using module-assistant or make-kpkg. + +Package: lustre-utils +Section: utils +Architecture: i386 powerpc amd64 ia64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Userspace utilities for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Cluster Filesystems, Inc. and available from + http://www.lustre.org + . + This package provides a number of userspace utilities for + maintaining Lustre filesystems. + +Package: lustre-tests +Architecture: i386 powerpc amd64 ia64 +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Test suite for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Cluster Filesystems, Inc. and available from + http://www.lustre.org + . + This package provides a number of test utilities for the Lustre filesystem. + +Package: liblustre +Architecture: i386 powerpc amd64 ia64 +Section: otherosfs +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: Runtime library for Lustre filesystem utilities + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Cluster Filesystems, Inc. and available + from http://www.lustre.org + . + This package provides a shared library that is used by userspace + applications to work with Lustre filesystems. It gives a user application + linked with the library access to Lustre + file systems without the need to mount Lustre (VFS) on the client. + The key goals for the library are to provide a portable mechanism to + access Lustre from different POSIX compliant operating systems, to provide + access from microkernel based systems and from the Windows operating system. + . + Currently, liblustre is still under development and only works on Linux + (i386 & amd64, not tested on ia64). + . + Please see http://wiki.lustre.org/index.php/LibLustre_How-To_Guide for details. + +Package: lustre-dev +Section: libdevel +Architecture: i386 powerpc amd64 ia64 +Depends: lustre-utils (= ${binary:Version}), ${misc:Depends} +Description: Development files for the Lustre filesystem + Lustre is a scalable, secure, robust, highly-available cluster file system. + It is maintained by Cluster Filesystems, Inc. and available from + http://www.lustre.org + . + This package provides development libraries for the Lustre filesystem. --- lustre-1.8.3.orig/debian/README.build +++ lustre-1.8.3/debian/README.build @@ -0,0 +1,40 @@ +What to do in order to build lustre for a new kernel: + +1.) Create a new lustre patch series for the new kernel (e.g. 2.6.23-vanilla.series ). + This file have to be in ./lustre/kernel_patches/series/ + + To ease this, use the previous series (means copy 2.6.22-vanilla.series to 2.6.23-vanilla.series) + +2.) Get the vanilla source for this kernel and try to apply the patches in this series. this could + easily be done by using quilt. (Or you include them into linux-patch-lustre and call make-kpkg with + the --added-patches=lustre option. + +3.) If patches doesn't apply: Check why and port them. Check also for every patch if this patch is still + needed on the new kernel. + +4.) If all patches apply: Try to build the kernel. If this fails you've to sort out this issues ;-) Have fun :) + +5.) When the kernel is build successfully: Now try to build the ldiskfs kernel module for this kernel. (See + next section.) + + +What to do in order to build ldiskfs for a new kernel: + +1.) Create a new ldiskfs patch series for the new kernel (e.g ldiskfs-2.6.23-vanilla.series). + This file have to be in ./ldiskfs/kernel_patches/series/ + + To ease this, use the previous series (copy 2.6.22 to 2.6.23) + +2.) Now try to build the kernel modules. + +3.) If the patch doesn't apply correctly (this is normal ;-)), start to have a look where are the difficulties + and try to sort them out. After all patches apply cleanly try to build the modules. If this fails you'll + have to look into the specific files, what is wrong there. + +4.) After the modules build fine install them and reboot into the new kernel. After the system is up again try + to load the modules. If this doesn't work you'll have to have a look on the error msg (see dmesg) and fix this + either in the kernel module or in the kernel itself. + +5.) The last step: Do _many_ testing if the kernel module and the kernel really works... Please note that you shouldn't + touch anything if you don't know what you are doing there. And of course: No warranty at all! + --- lustre-1.8.3.orig/debian/lustre-tests.lintian-overrides +++ lustre-1.8.3/debian/lustre-tests.lintian-overrides @@ -0,0 +1,2 @@ +#This are only config files, not executables +lustre-tests: executable-not-elf-or-script ./usr/lib/lustre/tests/cfg/local.sh --- lustre-1.8.3.orig/debian/linux-patch-lustre.kpatches +++ lustre-1.8.3/debian/linux-patch-lustre.kpatches @@ -0,0 +1,13 @@ +Patch-name: Lustre Filesystem patch for the Linux kernel +Patch-id: lustre +Architecture: amd64, ia64, i386, powerpc +Path-strip-level: 1 + +Patch-file: debian/kpatches/patch-vanilla-2.6.18 +Kernel-version: 2.6.18 + +Patch-file: debian/kpatches/patch-vanilla-2.6.20 +Kernel-version: 2.6.20 + +Patch-file: debian/kpatches/patch-vanilla-2.6.21 +Kernel-version: 2.6.21 --- lustre-1.8.3.orig/debian/TODO +++ lustre-1.8.3/debian/TODO @@ -0,0 +1,9 @@ +- this programms should get a manpage: + - lst + - lstclient + - routerstat + - llobdstat + - all lc_* programms at once (maybe one and link al other to this one) + + + -- Patrick Winnertz Thu, 17 Jan 2008 13:09:05 +0200 --- lustre-1.8.3.orig/debian/linux-patch-lustre.dirs +++ lustre-1.8.3/debian/linux-patch-lustre.dirs @@ -0,0 +1,3 @@ +usr/src/kernel-patches/lustre/scripts +usr/src/kernel-patches/lustre/series +usr/src/kernel-patches/lustre/patches --- lustre-1.8.3.orig/debian/lustre-utils.docs +++ lustre-1.8.3/debian/lustre-utils.docs @@ -0,0 +1 @@ +README --- lustre-1.8.3.orig/debian/lustre-utils.lintian-overrides +++ lustre-1.8.3/debian/lustre-utils.lintian-overrides @@ -0,0 +1,47 @@ +#Overrides warnings about manpages, you've to read nevertheless the docu +lustre-utils: binary-without-manpage usr/sbin/debugctl +lustre-utils: binary-without-manpage usr/bin/ior-survey +lustre-utils: binary-without-manpage usr/sbin/l_getgroups +lustre-utils: binary-without-manpage usr/sbin/lc_cluman +lustre-utils: binary-without-manpage usr/sbin/lc_hb +lustre-utils: binary-without-manpage usr/sbin/lc_lvm +lustre-utils: binary-without-manpage usr/sbin/lc_md +lustre-utils: binary-without-manpage usr/sbin/lc_modprobe +lustre-utils: binary-without-manpage usr/sbin/lc_net +lustre-utils: binary-without-manpage usr/sbin/lc_servip +lustre-utils: binary-without-manpage usr/bin/libecho +lustre-utils: binary-without-manpage usr/sbin/ll_decode_filter_fid +lustre-utils: binary-without-manpage usr/sbin/ll_recover_lost_found_objs +lustre-utils: binary-without-manpage usr/bin/llobdstat +lustre-utils: binary-without-manpage usr/sbin/llog_reader +lustre-utils: binary-without-manpage usr/bin/llstat +lustre-utils: binary-without-manpage usr/sbin/llverdev +lustre-utils: binary-without-manpage usr/sbin/llverfs +lustre-utils: binary-without-manpage usr/sbin/loadgen +lustre-utils: binary-without-manpage usr/sbin/lr_reader +lustre-utils: binary-without-manpage usr/sbin/lrun +lustre-utils: binary-without-manpage usr/sbin/lshowmount +lustre-utils: binary-without-manpage usr/sbin/lst +lustre-utils: binary-without-manpage usr/sbin/lstclient +lustre-utils: binary-without-manpage usr/sbin/ltrack_stats +lustre-utils: binary-without-manpage usr/sbin/lustre_config +lustre-utils: binary-without-manpage usr/sbin/lustre_createcsv +lustre-utils: binary-without-manpage usr/bin/lustre_req_history +lustre-utils: binary-without-manpage usr/sbin/lustre_rmmod +lustre-utils: binary-without-manpage usr/sbin/lustre_start +lustre-utils: binary-without-manpage usr/sbin/lustre_up14 +lustre-utils: binary-without-manpage usr/bin/mcreate +lustre-utils: binary-without-manpage usr/bin/munlink +lustre-utils: binary-without-manpage usr/bin/obdfilter-survey +lustre-utils: binary-without-manpage usr/bin/ost-survey +lustre-utils: binary-without-manpage usr/bin/parse-ior +lustre-utils: binary-without-manpage usr/bin/plot-llstat +lustre-utils: binary-without-manpage usr/bin/plot-obdfilter +lustre-utils: binary-without-manpage usr/bin/plot-ost +lustre-utils: binary-without-manpage usr/bin/plot-sgpdd +lustre-utils: binary-without-manpage usr/sbin/ptlctl +lustre-utils: binary-without-manpage usr/sbin/routerstat +lustre-utils: binary-without-manpage usr/bin/sgpdd-survey +lustre-utils: binary-without-manpage usr/sbin/wirecheck +lustre-utils: binary-without-manpage usr/sbin/wiretest + --- lustre-1.8.3.orig/debian/liblustre.install +++ lustre-1.8.3/debian/liblustre.install @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/liblustre.so usr/lib/lustre-1.6 +debian/tmp/usr/lib/lustre/snmp/lustresnmp.so usr/lib/lustre-1.6 --- lustre-1.8.3.orig/debian/README.Debian +++ lustre-1.8.3/debian/README.Debian @@ -0,0 +1,77 @@ +Here is an short explanation what to install on your Servers to set up lustre quickly. +Be aware that this don't replace the Documentation and Installation Howtos from Lustre. + + +#1. Building the kernel and the modules + You've to download the linux-source-2.6.18|21|22 package and the linux-patch-lustre package. + + Then patch your kernel with the correct patch file. Build and install it. (Use make-kpkg) + To patch the kernel automatically use --added-patches=lustre as build option. + + Here is the full line how I build my kernel (for those who are not familiar with make-kpkg) + make-kpkg --added-patches=lustre --initrd --append-to-version "-quota-enabled-lustre-1.6.4.1" --revision credativ.1 kernel_image + + Now reboot into this new kernel and install the lustre modules with: + - m-a auto-install lustre + + Then the kernel and the modules should be there. + +#2. Preparing the system + In the next stepp install: + - lustre-utils + + Then load the kernel modules with: + - modprobe lnet + - modprobe lustre + - modprobe ldiskfs + + This have to be done on every server system. + +#3. Creating partitions on the OST/MDT/MGS Servers + Now you'll have to differentiate between the OST and MDT and MGS Systems + We'll assume here that MDT and MGS are on the same system: + + - Create partitions: + - MGS/MDT: mkfs.lustre --fsname spfs --mdt --mgs $device + - OST: mkfs.lustre --fsname spfs --ost --mgsnode=$mgsnode@tcp0 $device + + Additional options are: + --reformat - this partition was previously formated with lustre, reformat it + --param="failover.mode=failout" - don't hang the complete fs if a ost isn't available. + + - Now mount the partitons on the servers: + - first the MDT/MGS Server: + - mount -t lustre /dev/sda /srv/mdt + - now the OST's + - mount -t lustre /dev/sda /srv/ost + + +#4. Using the filesystem + In order to use the FS, you'll have to mount it on a client. Please note that this client also + needs the lustre-modules to be installed. (You can install lustre-source and build the module + as described in 1.) + - mount -t lustre mgsnode@tcp0:/spfs /mnt + +#4.1 Using Quota: + + The binaries and drivers for lustre in debian are compiled with enabled-quota. + So if you like to use quota this is quite simple: + - lfs quotacheck -ug $path/to/mounted/lustre/fs + - lfs setquota -u $user 1000 2000 10000 20000 $path/to/mounted/lustre/fs + - lfs quota -u $user $path/to/mounted/lustre/fs + + If you want to reset this quota information for a given user, you'll have first to + set every value to zero, and then give the new information: + - lfs setquota -u $user 0 0 0 0 $path/to/mounted/lustre/fs + - lfs setquota -u $user 2000 3000 3000 4000 $path/to/mounted/lustre/fs + + This behaviour is reported as lustre bug: https://bugzilla.lustre.org/show_bug.cgi?id=14513 + + + +########### +Please have also a look into the official documentation for lustre available at: + +http://manual.lustre.org/index.php?title=Main_Page + + -- Patrick Winnertz Thu, 28 Dec 2007 14:53:25 +0200 --- lustre-1.8.3.orig/debian/control.modules.in +++ lustre-1.8.3/debian/control.modules.in @@ -0,0 +1,20 @@ +Source: lustre +Section: admin +Priority: optional +Maintainer: Lustre Packaging team +Uploaders: Patrick Winnertz +Standards-Version: 3.8.0 +Build-Depends: debhelper (>= 5.0.0), libsnmp-dev, bzip2, dpatch + +Package: lustre-modules-_KVERS_ +Architecture: i386 powerpc amd64 ia64 +Recommends: linux-image, lustre-utils +Provides: lustre-modules +Description: Lustre Linux kernel module (kernel _KVERS_) + This package contains the lustre loadable kernel modules for the + Lustre cluster filesystem. + . + These modules are compiled for the _KVERS_ linux kernel. + + + --- lustre-1.8.3.orig/debian/changelog +++ lustre-1.8.3/debian/changelog @@ -0,0 +1,515 @@ +lustre (1.8.3-4ubuntu1) natty; urgency=low + + * Merge from debian unstable. Remaining changes: + - Fix a bashism in lustre/liblustre/genlib.sh + - Build lustre without stack protector as the linker is called with + -nostdlib. + * link against -lpthread to fix FTBFS + + -- Bhavani Shankar Fri, 12 Nov 2010 11:25:22 +0530 + +lustre (1.8.3-4) unstable; urgency=low + + * [98ac0eb] Fix a small typo in the control file (Closes: #587201) + * [5dad88e] Using /bin/bash as interpreter for lnet-selftest + (Closes: #581121) + + -- Patrick Winnertz Thu, 29 Jul 2010 11:27:56 +0200 + +lustre (1.8.3-3) unstable; urgency=low + + * [015b186] Fixed typo in bug15587 patch: SECURUTY --> SECURITY + * [3f28bcb] Add a suggest to ofa-kernel-source and link against a ofa- + kernel-headers dir if available + * [912f1ee] Add a ugly hack to recommend ofa-kernel-modules if they + should exist (if lustre is linked against it) + * [5d01075] Install mkfs.lustre into /sbin instead of /usr/sbin + (Closes: #589230) + + -- Patrick Winnertz Wed, 28 Jul 2010 12:24:21 +0200 + +lustre (1.8.3-2ubuntu1) maverick; urgency=low + + * Fix a bashism in lustre/liblustre/genlib.sh + * Build lustre without stack protector as the linker is called with + -nostdlib. + + -- Michael Bienia Sat, 26 Jun 2010 00:02:43 +0200 + +lustre (1.8.3-2) unstable; urgency=low + + * [df329e4] Add bug15587_security.capability_xattr.dpatch + * [f274fcb] Fix some lintian warnings/issues + + -- Patrick Winnertz Wed, 02 Jun 2010 12:24:23 +0200 + +lustre (1.8.3-1) unstable; urgency=low + + * [93cd284] Imported Upstream version 1.8.3 + * [e89f2a4] Remove LBUG patches as they are part of 1.8.3 + * [9f19dda] Updated no-darwin patch for 1.8.3 + * [4b619b5] Remove configure_error_on_unstable.dpatch as it seems to + be unnecessary with 1.8.3 + * [0033ec8] New changelog for 1.8.3 + * [29825e3] Fix bashism in configure script, which fails on unstable + + -- Patrick Winnertz Wed, 12 May 2010 14:54:51 +0200 + +lustre (1.8.2-1) unstable; urgency=low + + * [3c3977b] Imported Upstream version 1.8.2 + - fixes FTBFS with conflicting types of preadv (Closes: #552824) + * [08d8154] Removed upstreams debian dir, we use our own one + * [5a23ceb] Updated debian/changelog for 1.8.2 + * [6dcac55] Remove some patches as they aren't needed with 1.8.2 + * [944119c] The place of lc_common has changed, updated lustre- + utils.install + * [c7eaef8] add -fno-strict-aliases to fix build warnings + * [6d1ed66] various -Werror fixes for gcc-4.4 + * [e816b24] Fix some bashisms by switching the interpreter from sh to + bash (Closes: #530134) + * [f9cb5a5] Fix some lintian warnings + * [ad70829] Fix configure on debian unstable, which is broken since a + autofoo update + * [1048e3c] Updated no-strict-aliasing patch & removed autogen-run + patch from 00list + * [d4fca9f] Fix two build failures of the kernel module on 2.6.26 + * [3474fbb] Fix several more typecasts while building 2.6.26 + * [ccab816] Fix one configure target, which uses undefined + HAVE_EXPORTFS_H variable + * [682f0da] fix typecast: long unsigned int is needed here, not + unsigned int + * [094dc16] Moved debian patch into the right direction for kernel + build + * [7fee658] Removed old patches from debian/patches + * [7c9f508] Updated no-strict-aliasing patch and removed non-needed + stuff + * [e8b335c] Updated darwin patch, as we need it to build correctly on + linux + * [29e8c86] Fix an LBUG concerning open-unlinked directories + + -- Patrick Winnertz Wed, 28 Apr 2010 14:20:36 +0200 + +lustre (1.8.1.1-1) unstable; urgency=low + + * Build 1.8.1 for unstable, as it is stable enough. + * [3c387b9] Build lustre 1.8.1 also for unstable as it is stable + enough to be included into unstable + * [c4ed83a] lustre 1.8.1 has support for 2.6.27 sles11 kernels .. + backported some patches to 2.6.27 vanilla kernel + * [1e60fc0] Backporting some patches to 2.6.26-vanilla kernel + * [c4252b8] Add changelog entry + * [a0ec60e] Fixed some compiling issues on 2.6.26 about double symbols + * [d21413b] function v2_qbtos is missing, get it out of the sles11 + stuff + * [ea79bf9] Needed to rediff one patch due to the sles11 quota patch + * [09275dc] Imported Upstream version 1.8.1.1 + + -- Patrick Winnertz Wed, 28 Oct 2009 12:21:23 +0100 + +lustre (1.8.1-1) experimental; urgency=low + + * [a1cc29f] New upstream version merged into git + * [dad5827] Rediffed no-darwin patch against 1.8.1 + * [1123fa1] Don't use bio_errors patch anymore, it should be fixed in + 1.8.1 + * [68d73d7] Fix one missing include in lustre-snmp.c + * [9e78739] Fix wrong includepath in libcfs (lnet/include was + forgotten) + * [f66d304] Add missing prototypes of functions defined in + lnet/framework.c + * [df28a24] Fix version_tag.pl + * [cca7a2c] Rediffed remove-set_tunables patch to fix a compilation + problem. + * [c85867b] Fix typecasts in lustre/liblustre/tests/sanity.c + * [6f9c04d] Redone the verson_tag.pl patch. + * [632c4f6] Fix location of .pl script + * [4754943] Fixed applying problem on 2.6.18er kernel series, rediffed + two + * [d75312a] Rediffed two ldiskfs patches for kernel 2.6.18 as they + fail to apply + * [c18e468] Rediffed ldiskfs-detect patch as we need it to build + debian kernels + * [fb2b913] Add typecasts in lustre/mds/handler.c as also the kernel + module is + * [74c8a2f] Restructured the patches for 1.8.1 + * [13486cb] Disabled autogen.sh on build time as the result will be + broken on unstable atm + * [b950455] Including one line fix for data corruption issue on OST + + -- Patrick Winnertz Thu, 10 Sep 2009 13:35:24 +0200 + +lustre (1.8.0-0) unstable; urgency=low + + * [aa7b4a7] Add minor-version number to lustre-module package + * [117f60a] Change UPVERSION to contain a proper minor version + * [cc071eb] Updated 00list and no-darwin.dpatch to work with 1.8.0 + * [7573f35] Updating changelog to for 1.8.0 + * [6e6371f] Remove llecho.sh from lustre-utils package as this file is + not longer provided by upstream in 1.8.0 + * [28f0e23] Add small patch to build modules on > 2.6.24er kernel this + is adopted from b_release_1.8.1 branch + + -- Patrick Winnertz Thu, 04 Jun 2009 15:22:49 +0200 + +lustre (1.6.7-2) unstable; urgency=high + + * [07652fb] Moved linux-patch-lustre & lustre-source to new section: + kernel + * [5fbb424] Add patch which fixes directory corruption in 1.6.7. + + -- Patrick Winnertz Mon, 06 Apr 2009 11:27:38 +0200 + +lustre (1.6.7-1) unstable; urgency=low + + * [60d3712] Imported Upstream version 1.6.7 + * [9047010] Rediffing patches to make them work on 1.6.7: + - posix_acl.dpatch + - remove-set_tunables.dpatch + - enable-quota.dpatch + - removed never used patches for patchless_support in subdir + - used new patchless support patch from bugzilla + * [3f69310] Fixed two compilation issues with patchless support for + kernel >= 2.6.24 + * [2db4f47] Added .gitignore file in order to ignore cscope.out and + tags created by cscope/ctags + * [922bd75] Removed not longer used patches from debian/patches + + -- Patrick Winnertz Tue, 17 Mar 2009 12:03:38 +0100 + +lustre (1.6.6-2) unstable; urgency=low + + * [7e86dbb] Add fiemap 2.6.18 patch from 1.6.5.1 + * [07ca9b0] Moved .populate = ll_populate (vm_operations_struct) into + !HAVE_VM_OP_FAULT + * [129dd3d] Move LPROCFS_ENTRY_WRITE and LPROCFS_ENTRY_EXIT out of + #ifdef in lprocfs_status.h (Closes: #514351) + * [5182d5a] Added configure check for blk_cleanup_queue which replaced + blk_put_queue in 2.6.25-rc4 (Closes: 508078) + * [82b2128] Bumped build-dep on debhelper to 6.0.7 as we're using + dh_lintian which is available in the toolchain since 6.07. + + -- Patrick Winnertz Thu, 12 Mar 2009 08:36:44 +0100 + +lustre (1.6.6-1) experimental; urgency=low + + * [f449338] New upstream version 1.6.6 + * [1f3badd] fix quota for 1.6.6 + * [451621f] Updated patches to apply on 1.6.6 + - [7e42d21] Add missing #endif in patchless support patch + - [6149694] Add missing #define OBD_MAX_DIRTY_PAGES + + -- Patrick Winnertz Mon, 29 Dec 2008 14:11:58 +0100 + +lustre (1.6.5.1-4) unstable; urgency=low + + * [673c9e4] Removed obsolete svn-deblayout, since we now use git + * [1923e32] Bump standards version - no other changes needed. + * [089f772] Clean up TODO list + * [57f3006] Fix insanity.sh script which uses functions not available + in sh + * [92e65fa] Fix two lintian msg about missing magic sh header + * [5214788] Removed unused patch from debian/patches/ + * [cd08297] Add override for liblustre not linked against libc + * [e0ab205] Install lintian overrides into the corresponding packages + * [e76c899] Remove make -C $(KSRC) prepare call. (Closes: #501427) + + -- Patrick Winnertz Mon, 20 Oct 2008 18:16:18 +0200 + +lustre (1.6.5.1-3) unstable; urgency=low + + * [dc55182] Updated patchless support patch to do not disable + server support. (Closes: #501613) + * [444a141] Removed full-clean target, it seems to be unnecessary + nowadays + + -- Patrick Winnertz Thu, 09 Oct 2008 12:00:42 +0200 + +lustre (1.6.5.1-2) unstable; urgency=high + + * Add patch from bugzilla to fix 101 Error msg. This issue + is only around if using 1.6.4.x servers and 1.6.5.x clients + (bug_15949_mds.body_capacity.dpatch) + * Added patch from bugzilla to prevent kernel oops when + ost disk is ~70% full. - (prevent oops, but FS will hang) + * Add patch to support patchless clients with 2.6.24-2.6.26 kernels. + * Added several patches from upstream bugzilla which fixes some errors. + This are backports from patches applied to 1.6.6 or 1.6.7 + * Fix lintian warning about missing patch description in + fix-symlink-attack.dpatch + * Add lintian override for lustre, which overrides this messages: + - build-depends-on-obsolete-package build-depends: tetex-extra + => we want to build lustre also on etch, therefore need tetex-extra + - more-than-one-patch-system + - patch-system-but-direct-changes-in-diff + ldiskfs/kernel_patches/series/ldiskfs-2.6.18-debian.series + - lustre source: quilt-build-dep-but-no-series-file lustre + => lustre itself uses quilt and we use dpatch for patching + * Fixes some more lintian warnings: + - changed section of lustre-source from base to admin + - added use_bash_instead_of_sh.dpatch to use bash instead of sh + in make-tree + - modified fix-lustre-manpage.dpatch to fix typo in lctl.8 + * Added libsnmp-dev as dependency to control.modules.in as the build fails + without it. + + -- Patrick Winnertz Tue, 16 Sep 2008 19:20:35 +0200 + +lustre (1.6.5.1-1) unstable; urgency=low + + * New upstream version + * Add README.Debian also to lustre-source + * Fix possible symlink attack in lustre-tests. (Closes: #496371) + + -- Patrick Winnertz Wed, 27 Aug 2008 16:59:29 +0200 + +lustre (1.6.5-1) unstable; urgency=low + + * New upstream Version + * Rediffed ldiskfs-2.6.18-debian.series + * Quotas > 4TB works now (fixed by upstream) + * Changed lustre version in rules.. forgot that in last upload + - replaced static string with some basename/awk magic + + -- Patrick Winnertz Tue, 17 Jun 2008 17:28:05 +0200 + +lustre (1.6.4.3-1) unstable; urgency=low + + [ Patrick Winnertz ] + * Package new upstream version. (Closes: #471407) + * Add patch from David Brown in order to enable o2ib + * Use $QUILT in apply/unpatch script in linux-patch-lustre (Closes: #466479) + * Remove build-dependency libxml-dev, it's going to be removed from the + archive. (Closes: #470004) + + [ Goswin von Brederlow ] + * Replace autogen.sh patch with scripts from upstream cvs + * Fix automake error and run autogen.sh at build time + + [ NoĆØl Kƶthe ] + * added lustre-source dependency: dpatch (Closes: #466658) + * added linux-patch-lustre recommends quilt (Closes: #466660) + + -- Patrick Winnertz Thu, 20 Mar 2008 09:26:38 +0100 + +lustre (1.6.4.2-1) unstable; urgency=low + + * spell linux correctly: Linux (description of liblustre) + * install own lfs.1 manpage which has more informations + * Removed some old and obsolete programms + * Rediff autogen-run dpatch + * Added two quota related patches from the upstream bts + + -- Patrick Winnertz Wed, 02 Jan 2008 14:50:43 +0100 + +lustre (1.6.4.1-1) unstable; urgency=low + + [ Patrick Winnertz ] + * Changed my maintainer address + * Packaging new upstream version 1.6.4.1 + * Bump of Standards-Version to 3.7.3 + * Removed some patches in debian/patches since they are now adapted + by upstream: + - 2.6.22_signal.dpatch + - 2.6.22_scheduler.dpatch + - 2.6.21-sysctl.dpatch + - bug13438-fix-mballoc-bogus-BUGON.dpatch + - bug12411-build_patchless-client-packages.dpatch + - bug12609-make_group_upcall_default.dpatch + - bug13632-no_namespace_lock.dpatch + - bug13696-lru_resize_mount_opts+perf_test.dpatch + - fix-mballoc3corepatch.dpatch + * Modified some patches, since they doesn't apply cleanly: + - autgen-run.dpatch + * Give a description to the following patches under debian/patchs (in order + to fix lintian warnings): + - page-size-undef-fixes.dpatch + - remove-set_tunables.dpatch + - tex2pdf.dpatch + * Add new patch in order to fix the lustre manpage provided by upstream + (fix-lustre-manpage.dpatch) + * Removed obsolete target from debian/rules + * Fixed path issue of lc_common (lc_common in wrong path) Closes: #457287) + * Improved README.Debian a bit + * Include fiemap.h on 2.6.18er kernels (remove-fiemaph.dpatch). + * Changed the klugde to get the modules into the right dir a bit, since .?? + doesn't fit to kernels as 2.6.22.15 ... (replaced .?? with .*) + * Switched in rules to 1.6.4.1 + * Fixed ftbfs of lustre-modules with debian 2.6.18er kernel + + -- Patrick Winnertz Wed, 02 Jan 2008 10:33:13 +0100 + +lustre (1.6.3-2) unstable; urgency=low + + [ Patrick Winnertz ] + * Add patch to remove fiemap.h from new_sources list + * Add some patches to make it work with etch again + * enable quota in binarys with a hack + + [ NoĆØl Kƶthe ] + * updated kernel info in README.Debian + * debian/control adding Homepage: and Xs-Vcs-Cvs: fields + + -- NoĆØl Kƶthe Thu, 29 Nov 2007 13:45:21 +0100 + +lustre (1.6.3-1) unstable; urgency=low + + [ Patrick Winnertz ] + * New upstream version + * Added klugde from Niklas again, in order to install the modules into + the right directory. + * Added patches for bug 13438 & 13614 (from upstream bugzilla) to + debian/patches. + * Added patch from Niklas to fix ubuntu specific thing + * Added patches to compile with --enable-quota + + FIXME: configure patch is a _very_ ugly hack + * Fix ftbfs due to a missing include (liblustre-makefile.dpatch) + * Removed unneeded patches (this patches are included in the new release) + * Include several patches from upstream bugzilla with some important fixes, + which aren't addressed by the 1.6.3 release. + + [ NoĆØl Kƶthe ] + * adding author and date of debian/TODO + * correcting supported kernels + + -- NoĆØl Kƶthe Fri, 26 Oct 2007 17:47:00 +0200 + +lustre (1.6.2-3) unstable; urgency=low + + [ Patrick Winnertz ] + * Added several patches from upstream bugzilla to fix some + smaller bugs. + * Added patch to fix file system corruption on large 32bit + OST nodes. (large = bigger than 2TB) + * Fix Problem concerning lc_common in the wrong path. + + -- NoĆØl Kƶthe Tue, 18 Sep 2007 15:01:16 +0200 + +lustre (1.6.2-2) unstable; urgency=low + + [ Patrick Winnertz ] + + * Fix error in ldiskfs patchset for 2.6.22. + * FTBFS caused by wrong HOME is fixed now. (Closes: #442978) + + -- NoĆØl Kƶthe Tue, 18 Sep 2007 13:22:24 +0200 + +lustre (1.6.2-1) unstable; urgency=low + + [ Upstream ] + * New upstream version 1.6.2 + + [ Patrick Winnertz ] + * Starting to modify patchset for kernel 2.6.21 for debian + * Modified patchset for lustre and ldiskfs for kernel 2.6.22 + * Started work on 2.6.23-pre6 + + FIXME: fix ldiskfs patch series for 2.6.23 + ( these patches are not yet active in this release. ) If you + would like to help us, you can of course apply them manually. + + [ Goswin von Brederlow ] + * Fix -m64 problem causing FTBFS + * Move kernel patches out of debian/patches and ships them verbatim + * Custom patch/unpatch script using quilt, no more prebuild kpatches + + FIXME: Only put needed series and patches into linux-patch-lustre + * FIXME: update 2.6.21 and 2.6.22 patches, disabled for now + * Update autogen.sh and autogen-run patches + * Re-add liblustre.so and lustresnmp.so under /usr/lib/lustre-1.6 + * Set liblustre.deb section to otherosfs + + [ NoĆØl Kƶthe ] + * debian/TODO: remove bull.patch + * debian/README.build: added information about building + + -- NoĆØl Kƶthe Mon, 17 Sep 2007 13:31:15 +0200 + +lustre (1.6.0.1-2) unstable; urgency=low + + [ Patrick Winnertz ] + * Build the patch files for the supported kernels (2.6.18 - 2.6.21) + * Fix some typos in rules file + * Fix FTBFS if builded twice in a row. + * Deleted old and not used config files for kernel 2.6.18 + * Deleted build-patch.sh since it wasn't any longer up to date + and we have now an other approach to generate the patch files + * Added patch for tex2pdf to prevend it to ftbfs on buildds + + [ Goswin von Brederlow ] + * Fixed kernel patchsets (2.6.18- 2.6.21) + * Fixed patch gerneration in debian/rules + + [ NoĆØl Kƶthe ] + * fixed liblustre_1.6.0.1-1_amd64.deb: package says section is otherosfs, + override says libs. + + -- NoĆØl Kƶthe Wed, 25 Jul 2007 15:37:32 +0200 + +lustre (1.6.0.1-1) unstable; urgency=low + + [ Patrick Winnertz ] + * New upstream version 1.6.0.1 + - Doesn't use 1.5.97 anymore (Closes: #432328) + - Doesn't build depend on linux-source-2.6.18 anymore. + (Closes: #432345) + * Added(Modified) several patches from upstream bts to + fix several errors (listed below): + -utsrelease.dpatch + -al_header.dpatch + -bash_completion.dpatch + -disable_pf_synowrite.dpatch + -page-size-undef-fixes.dpatch + -ubuntu-fixes.dpatch + -updated-2.6.18.dpatch + -vfs_intent_fix-2.6.18.dpatch + * Drop Build-Depend on gcc-3.4 and use gcc-4.1 instead + (gcc-3.4 is going to be removed from unstable) + * Removed the complete 1.5.97 stuff since this is not longer needed. + * Removed all kernel patches exept patches for 2.6.18 and 2.6.20 since all + others are not longer in debian + * Use a non-native package format + + [ Goswin von Brederlow ] + * Adjust debhelper files to new archive layout + * Add svn-deblayout file + + -- NoĆØl Kƶthe Mon, 23 Jul 2007 20:00:49 +0200 + +lustre (1.5.97-1) unstable; urgency=low + + [ Alastair McKinstry ] + * New upstream release. + * lustre-source requires SNMP support, so depend on libsnmp-dev. + * Removed patches no longer needed as we build 2.6.18 kernels only (and onwards) + vfs_intent fix needed for building on Debian 2.6.18 server + * Added --disable-zerocopy to temporarily enable build of server + * Fix from Niklas Edmundsson to make pkg work on Ubuntu (kernel 2.6.15) + * ext3_mballoc and extents fixes from Lustre.org Bugzilla: + - see https://bugzilla.lustre.org/show_bug.cgi?id=1167 + * Build on i386,powerpc,amd64,ia64 olny. Closes: #411553. + * Remove old pre-2.6.18 patches from debian/patches. This code should now be + rolled into the 1.5.97 release. + * Build on latest 2.6.18 kernel (2.6.18.dfsg.1). + + -- Alastair McKinstry Tue, 27 Feb 2007 17:00:43 +0000 + +lustre (1.5.95-1) unstable; urgency=low + + * New upstream release. Closes: #237713. + * 2.6.18_kern_mount.dpatch: Move from do_kern_mount() to vfs_kern_mount() to a + allow modules to load on unpatched Debian kernels. + * umount_begin.dpatch: Fixes oops on umount on client. + * Point out in the copyright file that the documents listed in lustre-utils + are covered by the GNU FDL (included in lustre-utils). No documents + include invariant sections. + * Add changes to kernel-config files for current 2.6.18-3 kernel sources. + + -- Alastair McKinstry Wed, 17 Jan 2007 15:27:19 +0000 + +lustre (1.5.91-1) experimental; urgency=low + + [ Alastair McKinstry ] + * Initial release of 1.5.91 (1.6beta4). Includes patches to build on + Debian 2.6.17, 2.6.18-rc[67] kernels. + + -- Alastair McKinstry Wed, 6 Sep 2006 16:08:00 +0100 + --- lustre-1.8.3.orig/debian/lustre-utils.examples +++ lustre-1.8.3/debian/lustre-utils.examples @@ -0,0 +1,2 @@ +lustre/tests/llmountcleanup.sh +lustre/tests/llmount.sh --- lustre-1.8.3.orig/debian/lustre-source.docs +++ lustre-1.8.3/debian/lustre-source.docs @@ -0,0 +1 @@ +debian/README.Debian --- lustre-1.8.3.orig/debian/source.lintian-overrides +++ lustre-1.8.3/debian/source.lintian-overrides @@ -0,0 +1,3 @@ +lustre source: ored-build-depends-on-obsolete-package build-depends: tetex-extra +lustre source: more-than-one-patch-system +lustre source: quilt-build-dep-but-no-series-file --- lustre-1.8.3.orig/debian/compat +++ lustre-1.8.3/debian/compat @@ -0,0 +1 @@ +5 --- lustre-1.8.3.orig/debian/lustre-tests.install +++ lustre-1.8.3/debian/lustre-tests.install @@ -0,0 +1,2 @@ +debian/tmp/usr/lib/lustre/tests/* usr/lib/lustre/tests/ + --- lustre-1.8.3.orig/debian/copyright +++ lustre-1.8.3/debian/copyright @@ -0,0 +1,17 @@ +This package was debianized by Alastair McKinstry , October 2006. + +It is currently maintained by the Debian Lustre Packaging team, + + +Lustre is Copyright (C) 2002-2007 Cluster Filesystems Inc. and is licensed +under the GNU Public License Version 2; +it was downloaded from http://www.clusterfs.com/download.html . + +The documentation (included in lustre-utils) is covered by +the GNU Free Documentation License; there are no invariant-clauses included +in this documentation, and hence it is considered to be free under +the Debian Free Software Guidelines (DFSG). + +A copy of the GPL may be found at /usr/share/common-licenses/GPL-2. + +A copy of the FDL may be found at /usr/share/common-licenses/ . --- lustre-1.8.3.orig/debian/liblustre.lintian-overrides +++ lustre-1.8.3/debian/liblustre.lintian-overrides @@ -0,0 +1 @@ +liblustre: library-not-linked-against-libc ./usr/lib/lustre-1.6/liblustre.so --- lustre-1.8.3.orig/debian/lustre-utils.install +++ lustre-1.8.3/debian/lustre-utils.install @@ -0,0 +1,6 @@ +debian/build/lnet/utils/routerstat usr/sbin +debian/tmp/sbin/* sbin +debian/tmp/usr/sbin/mkfs.lustre sbin +debian/tmp/usr/sbin/* usr/sbin +debian/tmp/usr/bin/* usr/bin +debian/tmp/usr/libexec/lustre/lc_common usr/share/lustre --- lustre-1.8.3.orig/debian/lfs.1 +++ lustre-1.8.3/debian/lfs.1 @@ -0,0 +1,258 @@ +.\" -*- nroff -*- +.\" Copyright 2007 by Patrick Winnertz . +.\" This file may be copied under the terms of the GNU Public License v2 or later. +.\" +.TH lfs 8 "2008 Jan 09" Lustre "configuration utilities" +.SH NAME +lfs \- helper utility to administrate lustre clusters +.SH SYNOPSIS +.br +.B lfs + [values] +.br +.SH DESCRIPTION +.B lfs +lfs is used to administrate a lustre filesystem, you'll need it to get or set +various informations concerning the filesystem usage (e.g. striping, quota, osts, ..) + +.B lfs +can be invoked in interactive and non-interative mode. In order to use it interactive call lfs without arguments. +The available commands in lfs are: +.B setstripe +, +.B getstripe +, +.B find +, +.B check +, +.B catinfo +, +.B join +, +.B osts +, +.B df +, +.B quotachown +, +.B quotacheck +, +.B quotaon +, +.B quotaoff +, +.B setquota +, +.B quota +, +.B help +, +.B exit +, +.B quit +. + +In order to get help type +.I lfs help +.br +If you want more specific help on a command type +.I lfs help $command +.br +where $command is one of the ones in the list above. + +.SH OPTIONS +.TP +.B setstripe: +Create a new file with a specific striping pattern or +set the default striping pattern on an existing directory or +delete the default striping pattern from an existing directory +.br +usage: setstripe + or + setstripe [--size|-s stripe_size] + [--index|-i stripe_index] + [--count|-c stripe_count] + or +.br + setstripe -d (to delete default striping) + + stripe_size: Number of bytes on each OST (0 filesystem default) + Can be specified with k, m or g (in KB, MB and GB respectively) + stripe_index: OST index of first stripe (-1 filesystem default) + stripe_count: Number of OSTs to stripe over (0 default, -1 all) + +.TP +.B getstripe: +To list the striping info for a given filename or files in a +directory or recursively for all files in a directory tree. + +usage: getstripe [--obd|-O ] [--quiet | -q] [--verbose | -v] + [--recursive | -r] ... + +.TP +.B find: +.br +To find files that match given parameters recursively in a directory tree. + +usage: find ... + [[!] --atime|-A [+-]N] [[!] --mtime|-M [+-]N] [[!] --ctime|-C [+-]N] + [--maxdepth|-D N] [[!] --name|-n ] [--print0|-P] + [--print|-p] [--obd|-O ] [[!] --type|-t ] + !: used before an option indicates 'NOT' the requested attribute + -: used before an value indicates 'AT MOST' the requested value + +: used before an option indicates 'AT LEAST' the requested value + +.TP +.B check: +.br +Display the status of MDS or OSTs (as specified in the command) +or all the servers (MDS and OSTs). + +usage: check + +.TP +.B catinfo: +Show information of specified type logs. + +usage: catinfo {keyword} [node name] + keywords are one of followings: config, deletions. + node name must be provided when use keyword config. + +.TP +.B join: +.br +join two lustre files into one - join A, B, will be like cat B >> A & del B + +usage: join + +.TP +.B osts: +.br +osts +FIXME + + +.TP +.B df: +.br +report filesystem disk space usage or inodes usageof each MDS/OSD. + +usage: df [-i] [-h] [path] + +.TP +.B quotachown: +Change files' owner or group on the specified filesystem. + +usage: quotachown [-i] + -i: ignore error if file is not exist + +.TP +.B quotacheck: +Scan the specified filesystem for disk usage, and create, +or update quota files. + +usage: quotacheck [ -ug ] + +.TP +.B quotaon: +Turn filesystem quotas on. + +usage: quotaon [ -ugf ] + +.TP +.B quotaoff: +Turn filesystem quotas off. + +usage: quotaoff [ -ug ] + +.TP +.B setquota: +Set filesystem quotas. + +usage: setquota [ -u | -g ] + setquota -t [ -u | -g ] + +.TP +.B quota: +.br +Display disk usage and limits. + +usage: quota [ -o obd_uuid ] [{-u|-g }|-t] + +.TP +.B help: +.br +help + +.TP +.B exit: +.br +quit + +.TP +.B quit: +.br +quit + +.SH EXAMPLES +.TP +.B $ lfs setstripe /mnt/lustre/file1 131072 -1 2 +This creats a file striped on two OSTs with 128kB on each stripe. +.TP +.B $ lfs setstripe -d /mnt/lustre/dir +This deletes a default stripe pattern on dir. New files will use the default striping pattern created therein. +.TP +.B $ lfs find /mnt/lustre/file1 +Lists the object allocation of a given file +.TP +.B $ lfs find /mnt/lustre/ +Lists the object allocationss of all files in a given directory +.TP +.B $ lfs find -r /mnt/lustre/ +Recursively list the objects of all files in a given directory tree +.TP +.B $ lfs find -r --obd OST2-UUID /mnt/lustre/ +Recursively list all files in a given directory that have objects on OST2-UUID. +.TP +.B $ lfs quotachown -i /mnt/lustre +Change file owner and group +.TP +.B $ lfs quotacheck -ug /mnt/lustre +Quotacheck for user and group - will turn on quotas after making the check. +.TP +.B $ lfs quotaon -ug /mnt/lustre +Turn quotas of user and group on +.TP +.B $ lfs quotaoff -ug /mnt/lustre +Turn quotas of user and group off +.TP +.B $ lfs setquota -u bob 0 1000000 0 10000 /mnt/lustre +Set quotas of user `bob': 1GB block quota and 10,000 file quota +.TP +.B $ lfs quota -u bob /mnt/lustre +List quotas of user `bob' +.TP +.B $ lfs check servers +Check the status of all servers (MDT, OST) +.TP +.B $ lfs osts +List all the OSTs +.B $ lfs df -i +Lists inode consumpton per OST and MDT + +.SH SEE ALSO +.BR lustre(7) +.BR Lustre (7), +.BR mount (8), +.BR mkfs.lustre (8), +.BR tunefs.lustre (8), +.BR lctl (8), + +.SH AUTHOR +lustre was written by ClusterFileSystems + +This manpage was written by Patrick Winnertz for the Debian GNU/Linux system (but may be used by others). + +Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License version 2 or any later version published by the Free Software Foundation. + --- lustre-1.8.3.orig/debian/lustre-utils.manpages +++ lustre-1.8.3/debian/lustre-utils.manpages @@ -0,0 +1,6 @@ +lustre/doc/lustre.7 +lustre/doc/mkfs.lustre.8 +lustre/doc/lctl.8 +debian/lfs.1 +lustre/doc/mount.lustre.8 +lustre/doc/tunefs.lustre.8 --- lustre-1.8.3.orig/debian/rules +++ lustre-1.8.3/debian/rules @@ -0,0 +1,340 @@ +#!/usr/bin/make -f +# +# Created 2006 by Alastair McKinstry, , +# Modified 2007 by Patrick Winnertz +# +# Copying and modification is unlimited, provided that the modified +# version is marked as being modified. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) +DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) + +CFLAGS = -Wall -g -fno-stack-protector +LDFLAGS = -lpthread +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) + CFLAGS += -O0 +else + CFLAGS += -O2 +endif + +# Module-assistant stuff +PACKAGE=lustre-modules +MA_DIR ?= /usr/share/modass +-include $(MA_DIR)/include/generic.make +-include $(MA_DIR)/include/common-rules.make + +ARCH=$(shell dpkg --print-architecture) +TOP_DIR:=$(shell pwd) + +# Lustre version to use +VERSION=`cat $(TOP_DIR)/debian/lustre-version` +SUPPORTED_KERNELS=2.6.18 2.6.22 2.6.24 2.6.26 2.6.27 +UPVERSION=`head -n1 $(TOP_DIR)/debian/changelog | awk '{print $$2}' | sed -e 's%[()]%%g'` +OFA_KERNEL=`if [ -d /usr/src/ofa-kernel-headers-$(KVERS) ]; then \ + echo "--with-o2ib=/usr/src/ofa-kernel-headers-$(KVERS)"; \ +else \ + echo ""; \ +fi` + + +# Packages +PATCH_PKG=linux-patch-lustre +UTILS_PKG=lustre-utils +TESTS_PKG=lustre-tests +DEV_PKG=lustre-dev +LIB_PKG=liblustre +SOURCE_PKG=lustre-source + +#Build dir +BUILDDIR=debian/build + +autogen: autogen-stamp +autogen-stamp: patch-stamp + cp /usr/share/misc/config.sub config.sub + cp /usr/share/misc/config.sub libsysio/config.sub + cp /usr/share/misc/config.sub ldiskfs/config.sub + cp /usr/share/misc/config.guess config.guess + cp /usr/share/misc/config.guess libsysio/config.guess + cp /usr/share/misc/config.guess ldiskfs/config.guess + sh ./autogen.sh + touch $@ + +configure: configure-stamp +configure-stamp: autogen-stamp debian/control + dh_testdir + # touch files to same date, to avoid auto* + find . -type f -exec touch -r COPYING {} \; + mkdir -p $(BUILDDIR)/build $(BUILDDIR)/lustre/contrib $(BUILDDIR)/libsysio + cp build/Makefile $(BUILDDIR)/build/ + cp lustre/contrib/mpich-*.patch $(BUILDDIR)/lustre/contrib/ + ln -s ../../../libsysio/include $(BUILDDIR)/libsysio/ + ( cd $(BUILDDIR) && \ + export TOP_DIR=$(TOP_DIR); ../../configure --disable-dependency-tracking \ + --disable-modules \ + --enable-snmp \ + --disable-client \ + --enable-quota \ + --disable-server ) + # Correct tex2pdf mode. + chmod 744 lustre/doc/tex2pdf + touch $@ + +build-arch build-indep: build + +build: build-stamp +build-stamp: patch-stamp configure-stamp + dh_testdir + $(MAKE) -C $(BUILDDIR) + # The .pdf's don't get automatically built, so + #HOME=$(TOP_DIR)/debian/build/lustre/doc $(MAKE) -C $(BUILDDIR)/lustre/doc lconf.pdf lctl.pdf lfs.pdf lmc.pdf + ## FIXME: $(BUILDDIR) isn't used + # mv lustre/doc/lconf.pdf lustre/doc/lctl.pdf lustre/doc/lfs.pdf lustre/doc/lmc.pdf $(BUILDDIR)/lustre/doc + $(MAKE) -C $(BUILDDIR) DESTDIR=$(TOP_DIR)/debian/tmp install + touch $@ + +binary-arch: binary-$(UTILS_PKG) binary-$(TESTS_PKG) binary-$(DEV_PKG) binary-$(LIB_PKG) + +binary-indep: binary-$(PATCH_PKG) binary-$(SOURCE_PKG) + +binary: binary-indep binary-arch + +binary-$(PATCH_PKG): patch-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(PATCH_PKG) + dh_installdocs -p $(PATCH_PKG) +# dh_installkpatches -p $(PATCH_PKG) + dh_install -p $(PATCH_PKG) + + # Install apply script + cp $(TOP_DIR)/debian/linux-patch-lustre.apply $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/apply + chmod a+x $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/apply + set -e; for KERNEL in $(SUPPORTED_KERNELS); do \ + mkdir -p $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/apply/; \ + ln -s ../../../lustre/scripts/apply $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/apply/lustre; \ + done + + # Install unpatch script + cp $(TOP_DIR)/debian/linux-patch-lustre.unpatch $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/unpatch + chmod a+x $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/scripts/unpatch + set -e; for KERNEL in $(SUPPORTED_KERNELS); do \ + mkdir -p $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/unpatch/; \ + ln -s ../../../lustre/scripts/unpatch $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/all/$$KERNEL/unpatch/lustre; \ + done + + # Install series + cp lustre/kernel_patches/series/* $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/series/ + + # Install patches + cp lustre/kernel_patches/patches/* $(TOP_DIR)/debian/$(PATCH_PKG)/usr/src/kernel-patches/lustre/patches/ + + dh_installchangelogs -p $(PATCH_PKG) lustre/ChangeLog + dh_compress -p $(PATCH_PKG) + dh_installdeb -p $(PATCH_PKG) + dh_fixperms -p $(PATCH_PKG) + dh_gencontrol -p $(PATCH_PKG) + dh_md5sums -p $(PATCH_PKG) + dh_builddeb -p $(PATCH_PKG) + +binary-$(UTILS_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(UTILS_PKG) + dh_installdocs -p $(UTILS_PKG) + dh_installman -p $(UTILS_PKG) + dh_install -p $(UTILS_PKG) + #Removing not needed shell scripts from utils pkg. + rm -f debian/$(UTILS_PKG)/usr/bin/config.sh debian/$(UTILS_PKG)/usr/bin/gather_stats_everywhere.sh debian/$(UTILS_PKG)/usr/bin/lstats.sh + dh_makeshlibs -p $(UTILS_PKG) + dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib + dh_installexamples -p $(UTILS_PKG) + dh_installchangelogs -p $(UTILS_PKG) lustre/ChangeLog + dh_compress -p $(UTILS_PKG) + dh_lintian -p $(UTILS_PKG) + dh_strip -p $(UTILS_PKG) + dh_installdeb -p $(UTILS_PKG) + dh_fixperms -p $(UTILS_PKG) + dh_gencontrol -p $(UTILS_PKG) + dh_md5sums -p $(UTILS_PKG) + dh_builddeb -p $(UTILS_PKG) + +binary-$(TESTS_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(TESTS_PKG) + dh_installdocs -p $(TESTS_PKG) + dh_installman -p $(TESTS_PKG) + dh_install -p $(TESTS_PKG) + #removing ncli.sh as it is not needed + rm -f debian/$(TESTS_PKG)/usr/lib/lustre/tests/cfg/ncli.sh + dh_makeshlibs -p $(TESTS_PKG) + dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib + dh_installexamples -p $(TESTS_PKG) + dh_installchangelogs -p $(TESTS_PKG) lustre/ChangeLog + dh_compress -p $(TESTS_PKG) + dh_lintian -p $(TESTS_PKG) + dh_strip -p $(TESTS_PKG) + dh_installdeb -p $(TESTS_PKG) + dh_fixperms -p $(TESTS_PKG) + dh_gencontrol -p $(TESTS_PKG) + dh_md5sums -p $(TESTS_PKG) + dh_builddeb -p $(TESTS_PKG) + +binary-$(DEV_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(DEV_PKG) + dh_install -p $(DEV_PKG) + dh_installdocs -p $(DEV_PKG) + dh_installchangelogs -p $(DEV_PKG) lustre/ChangeLog + dh_compress -p $(DEV_PKG) + dh_installdeb -p $(DEV_PKG) + dh_fixperms -p $(DEV_PKG) + dh_gencontrol -p $(DEV_PKG) + dh_md5sums -p $(DEV_PKG) + dh_builddeb -p $(DEV_PKG) + +binary-$(LIB_PKG): build-stamp + dh_testdir + dh_testroot + dh_installdirs -p $(LIB_PKG) + dh_installdocs -p $(LIB_PKG) + dh_install -p $(LIB_PKG) + dh_makeshlibs -p $(LIB_PKG) + dh_shlibdeps -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib + dh_installchangelogs -p $(LIB_PKG) lustre/ChangeLog + dh_compress -p $(LIB_PKG) + dh_installdeb -p $(LIB_PKG) + dh_lintian -p $(LIB_PKG) + dh_strip -p $(LIB_PKG) + dh_fixperms -p $(LIB_PKG) + dh_gencontrol -p $(LIB_PKG) + dh_md5sums -p $(LIB_PKG) + dh_builddeb -p $(LIB_PKG) + +binary-$(SOURCE_PKG): build-stamp + dh_testdir + dh_testroot + # Copy everything + dh_installdirs -p $(SOURCE_PKG) usr/src/modules/lustre/debian + tar -chf - . --exclude='debian/$(SOURCE_PKG)/*' | \ + ( cd debian/$(SOURCE_PKG)/usr/src/modules/lustre && \ + tar xf - ) + # clean up dest + rm -rf debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/patched \ + debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/patches/* + $(MAKE) -C debian/$(SOURCE_PKG)/usr/src/modules/lustre -f debian/rules clean + # Create the module-source tarball. + echo $(UPVERSION) > debian/$(SOURCE_PKG)/usr/src/modules/lustre/debian/lustre-version + cd debian/$(SOURCE_PKG)/usr/src && tar jcf lustre.tar.bz2 modules + rm -rf debian/$(SOURCE_PKG)/usr/src/modules + dh_install -p$(SOURCE_PKG) + dh_installchangelogs -p $(SOURCE_PKG) lustre/ChangeLog + dh_installdocs -p $(SOURCE_PKG) + dh_link -p $(SOURCE_PKG) /usr/share/modass/packages/default.sh /usr/share/modass/overrides/lustre-source + dh_compress -p $(SOURCE_PKG) + dh_installdeb -p $(SOURCE_PKG) + dh_fixperms -p $(SOURCE_PKG) + dh_gencontrol -p $(SOURCE_PKG) + dh_md5sums -p $(SOURCE_PKG) + dh_builddeb -p $(SOURCE_PKG) + +### +### For module-assistant +### + +# the kdist_clean target is called by make-kpkg modules_clean and from +# kdist* rules. It is responsible for cleaning up any changes that have +# been made by the other kdist_commands (except for the .deb files created) + +kdist_clean: + dh_clean + $(MAKE) $(MFLAGS) -f debian/rules clean + + +# module assistant calculates all needed things for us and sets +# # following variables: +# # KSRC (kernel source directory), KVERS (kernel version string), KDREV +# # (revision of the Debian kernel-image package), CC (the correct +# # compiler), VERSION (the final package version string), PKGNAME (full +# # package name with KVERS included), DEB_DESTDIR (path to store DEBs) +# +# # The kdist_configure target is called by make-kpkg modules_config and +# # by kdist* rules by dependency. It should configure the module so it is +# # ready for compilation (mostly useful for calling configure). +# # prep-deb-files from module-assistant creates the neccessary debian/ +kdist_config: prep-deb-files + # Check build dependencies again, needs to be done since we just + # replaced the control file. + dpkg-checkbuilddeps + # ugly hack to recommend ofa-kernel-modules if they should exist + if [ ! -z $(OFA_KERNEL) ]; then \ + sed -e 's#^Recommends:\(.*\)#Recommends:\1, ofa-kernel-modules-$(KVERS)#g' -i debian/control; \ + fi + # touch files to same date, to avoid auto* + find . -type f -exec touch -r COPYING {} \; + # Doesn't seem possible to only build modules... + ./configure --with-linux=$(KSRC) $(OFA_KERNEL) \ + --disable-quilt \ + --disable-dependency-tracking \ + --disable-doc \ + --disable-utils \ + --disable-liblustre \ + --enable-snmp \ + --enable-ldiskfs \ + --disable-zerocopy \ + --disable-tests \ + --enable-quota + +kdist_configure: kdist_config + +# the binary-modules rule is invoked by module-assistant while processing the +# kdist* targets. It is called by module-assistant or make-kpkg and *not* +# during a normal build +binary-modules: prep-deb-files + dh_testroot + dh_clean -k + $(MAKE) + $(MAKE) install DESTDIR=$(CURDIR)/debian/$(PKGNAME) + + # Kludge to make modules end up in the right place, UTSNAME only + # contains kernel version in 2.6.18 so lustre module install puts them + # in the wrong place currently. + -mv -f $(CURDIR)/debian/$(PKGNAME)/lib/modules/2.6.* $(CURDIR)/debian/$(PKGNAME)/lib/modules/$(KVERS) + # Remove stuff that doesn't belong (no module-only target) + # FIXME: check if this is needed + cd $(CURDIR)/debian/$(PKGNAME) && rm -rf usr sbin etc + dh_installdocs -p$(PKGNAME) + dh_installchangelogs -p$(PKGNAME) + dh_installmodules -p $(PKGNAME) + dh_compress -p $(PKGNAME) + dh_fixperms -p $(PKGNAME) + dh_installdeb -p $(PKGNAME) + dh_gencontrol -- -v$(VERSION) + dh_md5sums -p $(PKGNAME) + dh_builddeb --destdir=$(DEB_DESTDIR) -p $(PKGNAME) + dh_clean -k -p $(PKGNAME) + + +clean: + dh_testdir + dh_testroot + dpatch deapply-all + rm -rf debian/substvars debian/*.bak debian/*~ *~ *-stamp + rm -rf $(BUILDDIR) + rm -rf debian/patched + dh_clean + +patch: patch-stamp +patch-stamp: + dpatch apply-all + touch $@ + +unpatch: + dpatch deapply-all + rm -rf debian/patched patch-stamp + +.PHONY: binary-arch clean source diff binary binary-indep binary-arch install configure --- lustre-1.8.3.orig/debian/lustre-dev.install +++ lustre-1.8.3/debian/lustre-dev.install @@ -0,0 +1,6 @@ +debian/build/lnet/utils/libptlctl.a usr/lib +lustre/contrib/README usr/share/doc/lustre-dev/contrib +lustre/contrib/mpich-1.2.6-lustre.patch usr/share/doc/lustre-dev/contrib +debian/tmp/usr/include/linux/* usr/include/linux +debian/tmp/usr/include/lustre/* usr/include/lustre +debian/tmp/usr/lib/*.a usr/lib --- lustre-1.8.3.orig/debian/linux-patch-lustre.unpatch +++ lustre-1.8.3/debian/linux-patch-lustre.unpatch @@ -0,0 +1,117 @@ +#! /bin/bash +set -x + +if ! [ -d kernel -a -d Documentation ] +then + echo >&2 "Not in kernel top level directory. Exiting" + exit 1 +fi +TOPPATCHDIR=/usr/src/kernel-patches/lustre +ARCHITECTURE=`dpkg --print-installation-architecture` + +QUILT="quilt --quiltrc /dev/null" +export QUILT_PATCHES="$TOPPATCHDIR/patches" + +if ! [ -f debian/APPLIED_all_lustre ]; then + echo >&2 "Lustre patch not applied." + exit 0 +fi +VERSION=$(grep ^VERSION Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +PATCHLEVEL=$( grep ^PATCHLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +SUBLEVEL=$(grep ^SUBLEVEL Makefile 2>/dev/null | \ + sed -e 's/[^0-9]*\([0-9]*\)/\1/') +#EXTRAVERSION=$(grep ^EXTRAVERSION Makefile | head -1 2>/dev/null | \ +# sed -e 's/EXTRAVERSION =[ ]*\([^ ]*\)$/\1/') +#KERNELBRANCHLET=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} +#KERNELRELEASE=${KERNELBRANCHLET}${EXTRAVERSION} +KERNELRELEASE=${VERSION}.${PATCHLEVEL}.${SUBLEVEL} + +# Check for depends on lustre +if grep -l "^DEPENDS=.*[' ]all/unpatch/lustre[' ]" debian/APPLIED_* >/dev/null 2>/dev/null; then + # There are patches depending on this one, to be removed before. + # the dep will be removed by the last of those other patches. + echo >&2 "NOT unpatching \"Lustre Filesystem patch for the Linux kernel\" since other patches still rely on it" + exit 0 +fi + +if ! [ -d debian/APPLIED_all_lustre_tmp/.pc.lustre ]; then + cat >&2 <&2 <&2 Cleaning up + if [ -e series ]; then + echo >&2 Removing series file + rm series + fi + if [ -e debian/APPLIED_all_lustre_tmp/series.orig ]; then + echo >&1 Restoring orig series file + mv debian/APPLIED_all_lustre_tmp/series.orig series + fi + if [ -e .pc ]; then + echo >&2 Removing .pc dir + rm -r .pc + fi + if [ -e debian/APPLIED_all_lustre_tmp/.pc.orig ]; then + echo >&2 Restoring orig .pc dir + mv debian/APPLIED_all_lustre_tmp/.pc.orig .pc + fi +} + +if [ -e series ]; then + echo >&2 Preserving existing series file + mv series debian/APPLIED_all_lustre_tmp/series.orig +fi +if [ -e .pc ]; then + echo >&2 Preserving existing .pc dir + mv .pc debian/APPLIED_all_lustre_tmp/.pc.orig +fi + +trap cleanup EXIT + +echo >&2 Restoring lustre quilt +mv debian/APPLIED_all_lustre_tmp/series.lustre series +mv debian/APPLIED_all_lustre_tmp/.pc.lustre .pc + +echo >&2 Unpatching lustre patches +$QUILT pop -a +ERR=$? +if ! [ $ERR = 0 ]; then + cat >&2 <&2 Removing lustre quilt +rm -rf .pc series +cleanup +rm debian/APPLIED_all_lustre debian/image.d/register-lustre + +echo >&2 "\"Lustre Filesystem patch for the Linux kernel\" patch for $KVERSION removed successfully" + +echo >&2 "Removing empty files:" +# make an exception for ./debian, or else the stamp files will go too. +find . -path ./debian -prune -o \ + -type f -size 0 ! -name 'APPLIED*' -exec rm {} \; -print +echo >&2 "Done." + +rmdir debian/image.d debian/APPLIED_all_lustre_tmp || true + +echo >&2 "END unpatching lustre patch" --- lustre-1.8.3.orig/debian/patches/fix-oot-builds.dpatch +++ lustre-1.8.3/debian/patches/fix-oot-builds.dpatch @@ -0,0 +1,74 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## autogen.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: forgot include dir in gcc flags and fix version_tag.pl to handle +## DP: out of tree builds. + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/build/autoconf/lustre-build.m4 lustre/build/autoconf/lustre-build.m4 +--- lustre~/build/autoconf/lustre-build.m4 2010-03-03 14:44:38.000000000 +0100 ++++ lustre/build/autoconf/lustre-build.m4 2010-03-03 16:30:38.704635051 +0100 +@@ -816,7 +816,7 @@ + CC="$CC -m64" + fi + +-CPPFLAGS="-I$PWD/$LIBCFS_INCLUDE_DIR -I$PWD/lnet/include -I$PWD/lustre/include $CPPFLAGS" ++CPPFLAGS="-I$PWD/$LIBCFS_INCLUDE_DIR -I$TOP_DIR/lnet/include -I$TOP_DIR/lustre/include -I$PWD/lnet/include -I$PWD/lustre/include $CPPFLAGS" + + LLCPPFLAGS="-D__arch_lib__ -D_LARGEFILE64_SOURCE=1" + AC_SUBST(LLCPPFLAGS) +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/autoMakefile.am lustre/lustre/autoMakefile.am +--- lustre~/lustre/autoMakefile.am 2010-01-23 03:07:58.000000000 +0100 ++++ lustre/lustre/autoMakefile.am 2010-03-03 16:30:38.704635051 +0100 +@@ -85,7 +85,7 @@ + BUILD_VER_H=$(top_builddir)/lustre/include/lustre/lustre_build_version.h + + lustre_build_version: +- perl $(top_builddir)/lustre/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver ++ perl $(top_srcdir)/lustre/scripts/version_tag.pl $(top_srcdir) $(top_builddir) > tmpver + echo "#define LUSTRE_RELEASE @RELEASE@" >> tmpver + cmp -s $(BUILD_VER_H) tmpver > tmpdiff 2> /dev/null && \ + $(RM) tmpver tmpdiff || \ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/scripts/version_tag.pl lustre/lustre/scripts/version_tag.pl +--- lustre~/lustre/scripts/version_tag.pl 2010-03-03 14:44:38.000000000 +0100 ++++ lustre/lustre/scripts/version_tag.pl 2010-03-03 16:33:54.136665590 +0100 +@@ -166,17 +166,19 @@ + !$ver->open("$objdir/include/linux/version.h") && + !$ver->open("$dir/include/linux/utsrelease.h") && + !$ver->open("$dir/include/linux/version.h")) { +- die "Run make dep on '$dir'\n"; +- } ++ #die "Run make dep on '$dir'\n"; ++ $kernver = "UNKOWN-KERNEL"; ++ } else { + +- while(defined($line = <$ver>)) { +- $line =~ /\#define UTS_RELEASE "(.*)"/; +- if ($1) { +- $kernver = $1; +- last; +- } +- } +- $ver->close(); ++ while(defined($line = <$ver>)) { ++ $line =~ /\#define UTS_RELEASE "(.*)"/; ++ if ($1) { ++ $kernver = $1; ++ last; ++ } ++ } ++ $ver->close(); ++ } + chomp($kernver); + $dir =~ s/\//\./g; + return $dir; +@@ -254,6 +256,8 @@ + if (!defined($ENV{LUSTRE_VERS})); + + if ($progname eq "version_tag.pl") { ++ chdir($cwd); ++ chdir($ARGV[1]); + my $linuxdir = get_linuxdir(); + $linuxdir =~ s/\//\./g; + generate_ver($tag, $mtime, $linuxdir); --- lustre-1.8.3.orig/debian/patches/LBUG_open-unlinked_bug_22177-1.dpatch +++ lustre-1.8.3/debian/patches/LBUG_open-unlinked_bug_22177-1.dpatch @@ -0,0 +1,132 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## LBUG_open-unlinked_bug_22177-1.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch from bugzilla #22177 + +@DPATCH@ +diff --git a/lustre/mds/mds_reint.c b/lustre/mds/mds_reint.c +index 97dc613..3c53148 100644 +--- a/lustre/mds/mds_reint.c ++++ b/lustre/mds/mds_reint.c +@@ -1755,31 +1755,37 @@ static int mds_orphan_add_link(struct mds_update_record *rec, + * for linking and return real mode back then -bzzz */ + mode = inode->i_mode; + inode->i_mode = S_IFREG; +- /* avoid vfs_link upon 0 nlink inode */ +- ++inode->i_nlink; ++ /* avoid vfs_link upon 0 nlink inode, inc by 2 instead of 1 because ++ * ext3_inc_count() can reset i_nlink for indexed directory */ ++ inode->i_nlink += 2; + rc = ll_vfs_link(dentry, mds->mds_vfsmnt, pending_dir, pending_child, + mds->mds_vfsmnt); + if (rc) +- CERROR("error linking orphan %s to PENDING: rc = %d\n", ++ CERROR("error linking orphan %s %s to PENDING: rc = %d\n", ++ S_ISDIR(mode) ? "dir" : S_ISREG(mode) ? "file" : "other", + rec->ur_name, rc); + else + mds_inode_set_orphan(inode); + + /* return mode and correct i_nlink if inode is directory */ + inode->i_mode = mode; +- LASSERTF(inode->i_nlink == 2, "%s nlink == %d\n", ++ LASSERTF(rc || inode->i_nlink == 3, "%s nlink == %d\n", + S_ISDIR(mode) ? "dir" : S_ISREG(mode) ? "file" : "other", + inode->i_nlink); ++ + if (S_ISDIR(mode)) { + pending_dir->i_nlink++; + if (pending_dir->i_sb->s_op->dirty_inode) + pending_dir->i_sb->s_op->dirty_inode(pending_dir); +- } else { +- --inode->i_nlink; +- if (inode->i_sb->s_op->dirty_inode) +- inode->i_sb->s_op->dirty_inode(inode); + } + ++ inode->i_nlink -= 2; ++ if (inode->i_sb->s_op->dirty_inode) ++ inode->i_sb->s_op->dirty_inode(inode); ++ ++ if (rc) ++ GOTO(out_dput, rc); ++ + GOTO(out_dput, rc = 1); + out_dput: + l_dput(pending_child); +@@ -2048,11 +2054,18 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset, + } + + if (rc == 0 && child_inode->i_nlink == 0) { +- if (mds_orphan_needed(obd, child_inode)) ++ if (mds_orphan_needed(obd, child_inode)) { + rc = mds_orphan_add_link(rec, obd, dchild); +- +- if (rc == 1) +- GOTO(cleanup, rc = 0); ++ if (rc == 1) ++ /* child inode was successfully linked ++ * to PENDING */ ++ GOTO(cleanup, rc = 0); ++ else ++ /* we failed to move the file to PENDING, ++ * really unlink the file as if there were ++ * no more openers */ ++ rc = 0; ++ } + + if (!S_ISREG(child_inode->i_mode)) + GOTO(cleanup, rc); +@@ -2738,11 +2751,18 @@ no_unlink: + } + + if (rc == 0 && new_inode != NULL && new_inode->i_nlink == 0) { +- if (mds_orphan_needed(obd, new_inode)) ++ if (mds_orphan_needed(obd, new_inode)) { + rc = mds_orphan_add_link(rec, obd, de_new); + +- if (rc == 1) +- GOTO(cleanup, rc = 0); ++ if (rc == 1) ++ /* inode successfully linked to PENDING */ ++ GOTO(cleanup, rc = 0); ++ else ++ /* we failed to move the file to PENDING, ++ * really unlink the file as if there were ++ * no more openers */ ++ rc = 0; ++ } + + if (!S_ISREG(new_inode->i_mode)) + GOTO(cleanup, rc); +diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh +index 4241a6b..7cefe84 100644 +--- a/lustre/tests/sanity.sh ++++ b/lustre/tests/sanity.sh +@@ -6458,6 +6458,25 @@ test_202() { + } + run_test 202 "O_APPEND+O_DIRECT multistripe write ========================" + ++test_203() { # bug 22177 ++ mkdir -p $DIR/$tdir || error "creating dir $DIR/$tdir" ++ # create enough files to index the directory ++ createmany -o $DIR/$tdir/foobar 4000 ++ # print attributes for debug purpose ++ lsattr -d . ++ # open dir ++ multiop_bg_pause $DIR/$tdir D_Sc || return 1 ++ MULTIPID=$! ++ # remove the files & current working dir ++ unlinkmany $DIR/$tdir/foobar 4000 ++ rmdir $DIR/$tdir ++ kill -USR1 $MULTIPID ++ wait $MULTIPID ++ stat $DIR/$tdir && error "open-unlinked dir was not removed!" ++ return 0 ++} ++run_test 203 "Test open-unlinked dir ========================" ++ + # + # tests that do cleanup/setup should be run at the end + # --- lustre-1.8.3.orig/debian/patches/tex2pdf.dpatch +++ lustre-1.8.3/debian/patches/tex2pdf.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: prevend tex2pdf from writing to a location outside the build dir + +@DPATCH@ +diff -urNad lustre-1.6.2.obsolete.0.125913187702285~/lustre/doc/tex2pdf lustre-1.6.2.obsolete.0.125913187702285/lustre/doc/tex2pdf +--- lustre-1.6.2~/lustre/doc/tex2pdf 2002-09-17 22:11:35.000000000 +0200 ++++ lustre-1.6.2/lustre/doc/tex2pdf 2007-09-18 11:30:03.000000000 +0200 +@@ -61,9 +61,8 @@ + my $MYHOSTNAME=hostname; + my $MYNAME=basename $0; + my $MYUSER=$ENV{'USER'}; +-my $USER_HOME=$ENV{'HOME'}; + if (not $MYUSER) { $MYUSER = 'nobody'; } +-if (not $USER_HOME) { $USER_HOME = '/tmp'; } ++my $USER_HOME = $ENV{'PWD'}; + + my @TMPFILES=(); + my @TMP_TEX_FILES=(); +@@ -1128,8 +1127,8 @@ + &abort("Illegal value: $value"); + } + &set_param_value($key, $value); +- } elsif (defined(&type_enum_array($type))){ +- &set_enum_param($key, $value); ++# } elsif (defined(&type_enum_array($type))){ ++# &set_enum_param($key, $value); + } else { + &set_param_value($key, $value); + } --- lustre-1.8.3.orig/debian/patches/bug13852-quota_includes.dpatch +++ lustre-1.8.3/debian/patches/bug13852-quota_includes.dpatch @@ -0,0 +1,16 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Missing include of sys/quota.h + +@DPATCH@ +--- ./lustre/include/liblustre.h 2007-08-13 19:31:56.000000000 +0200 ++++ ./lustre/include/liblustre.h 2007-10-10 11:38:20.071254030 +0200 +@@ -50,6 +50,7 @@ + #ifndef _IOWR + # include "ioctl.h" + #endif ++#include + + #include + #include --- lustre-1.8.3.orig/debian/patches/use_bash_instead_of_sh.dpatch +++ lustre-1.8.3/debian/patches/use_bash_instead_of_sh.dpatch @@ -0,0 +1,26 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## use_bash_instead_of_sh.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: This script uses functions not available on plain sh shell, therefore +## DP: using /bin/bash instead + +@DPATCH@ +diff -urNad lustre~/lustre/tests/acl/make-tree lustre/lustre/tests/acl/make-tree +--- lustre~/lustre/tests/acl/make-tree 2005-06-21 00:18:48.000000000 +0200 ++++ lustre/lustre/tests/acl/make-tree 2008-10-10 09:32:09.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + # reduce LEVELS from 3 => 2 by CFS + LEVELS=2 ; [ -z "$1" ] || LEVELS=$1 +diff -urNad lustre~/lustre/tests/insanity.sh lustre/lustre/tests/insanity.sh +--- lustre~/lustre/tests/insanity.sh 2008-01-11 13:30:26.000000000 +0100 ++++ lustre/lustre/tests/insanity.sh 2008-10-10 09:32:19.000000000 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + # Test multiple failures, AKA Test 17 + + set -e --- lustre-1.8.3.orig/debian/patches/fix_dentry_conf_test.dpatch +++ lustre-1.8.3/debian/patches/fix_dentry_conf_test.dpatch @@ -0,0 +1,25 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## no_default_debugging.patch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: HAVE_LINUX_EXPORTFS_H not defined in configure target :S + +@DPATCH@ +diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 +index d01d8e0..ac8eb0e 100644 +--- a/lustre/autoconf/lustre-core.m4 ++++ b/lustre/autoconf/lustre-core.m4 +@@ -1243,11 +1243,8 @@ LB_LINUX_TRY_COMPILE([ + AC_DEFUN([LC_FH_TO_DENTRY], + [AC_MSG_CHECKING([if kernel has .fh_to_dentry member in export_operations struct]) + LB_LINUX_TRY_COMPILE([ +-#ifdef HAVE_LINUX_EXPORTFS_H +- #include +-#else +- #include +-#endif ++#include ++#include + ],[ + struct export_operations exp; + --- lustre-1.8.3.orig/debian/patches/bug12769-ql-fix.dpatch +++ lustre-1.8.3/debian/patches/bug12769-ql-fix.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bug12769-ql-fix.dpatch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Ensure that dirty pages are flushed out with the right creds + +@DPATCH@ +diff --git a/lustre/llite/file.c b/lustre/llite/file.c +--- a/lustre/llite/file.c ++++ b/lustre/llite/file.c +@@ -281,6 +281,10 @@ int ll_file_release(struct inode *inode, + if (lsm) + lov_test_and_clear_async_rc(lsm); + lli->lli_async_rc = 0; ++ ++ /* Ensure that dirty pages are flushed out with the right creds */ ++ if (file->f_mode & FMODE_WRITE) ++ filemap_fdatawrite(file->f_mapping); + + rc = ll_mdc_close(sbi->ll_mdc_exp, inode, file); + RETURN(rc); --- lustre-1.8.3.orig/debian/patches/fix-lustre-manpage.dpatch +++ lustre-1.8.3/debian/patches/fix-lustre-manpage.dpatch @@ -0,0 +1,34 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix-lustre-manpage.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fix some errors in the lustre manpage + +@DPATCH@ +diff -urNad lustre-1.6.5.1~/lustre/doc/lctl.8 lustre-1.6.5.1/lustre/doc/lctl.8 +--- lustre-1.6.5.1~/lustre/doc/lctl.8 2007-09-27 07:09:22.000000000 +0200 ++++ lustre-1.6.5.1/lustre/doc/lctl.8 2008-09-12 16:09:43.000000000 +0200 +@@ -36,7 +36,7 @@ + command, type + .B help + .I command +-. Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys. ++Command completion is activated with the TAB key, and command history is available via the up- and down-arrow keys. + + For non-interactive use, one uses the second invocation, which runs command after connecting to the device. + +diff -urNad lustre-1.6.5.1~/lustre/doc/lustre.7 lustre-1.6.5.1/lustre/doc/lustre.7 +--- lustre-1.6.5.1~/lustre/doc/lustre.7 2008-09-12 16:09:32.000000000 +0200 ++++ lustre-1.6.5.1/lustre/doc/lustre.7 2008-09-12 16:09:33.000000000 +0200 +@@ -2,9 +2,9 @@ + .\" Copyright 2006 by Cluster FileSystems. All Rights Reserved. + .\" This file may be copied under the terms of the GNU Public License. + .\" +-.TH Lustre 7 "2006 Jun 15" Lustre "A high-performance cluster file system" ++.TH Lustre 7 + .SH NAME +-Lustre ++Lustre - a high-performance cluster file system + .SH SYNOPSIS + A high-performance file system designed for clusters. + .SH DESCRIPTION --- lustre-1.8.3.orig/debian/patches/fix-symlink-attack.dpatch +++ lustre-1.8.3/debian/patches/fix-symlink-attack.dpatch @@ -0,0 +1,23 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix-symlink-attack.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix symlink attack on runiozone + +@DPATCH@ +diff -urNad lustre-1.6.5.1~/lustre/tests/runiozone lustre-1.6.5.1/lustre/tests/runiozone +--- lustre-1.6.5.1~/lustre/tests/runiozone 2007-02-10 07:33:10.000000000 +0100 ++++ lustre-1.6.5.1/lustre/tests/runiozone 2008-08-27 16:58:36.000000000 +0200 +@@ -9,9 +9,11 @@ + LOOP=0 + rm -f endiozone + echo 0 > /proc/sys/lnet/debug ++tmpfile=$(mktemp -t iozone.XXXXXXXXXXXX) + while date; do + LOOP=`expr $LOOP + 1` + echo "Test #$LOOP" + iozone $VERIFY $ODIR -r $REC -i 0 -i 1 -f $FILE -s $SIZE 2>&1 || exit $? + [ -f endiozone -o $LOOP -ge $COUNT ] && rm -f endiozone && exit 0 +-done | tee /tmp/iozone.log ++done | tee $tmpfile ++echo "You'll find the log of this iozone run at: $tmpfile" --- lustre-1.8.3.orig/debian/patches/libsysio.dpatch +++ lustre-1.8.3/debian/patches/libsysio.dpatch @@ -0,0 +1,18 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## libsysio.dpatch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Use path relative to $srcdir instead of PWD to allow using a builddir + +@DPATCH@ +--- lustre-1.6.0.1/lustre/liblustre/Makefile.am~ 2004-12-20 00:06:24.000000000 +0100 ++++ lustre-1.6.0.1/lustre/liblustre/Makefile.am 2007-07-20 12:33:52.000000000 +0200 +@@ -1,7 +1,7 @@ + ## Liblustre excecutables & libraries Makefile + SUBDIRS = . tests + +-AM_CPPFLAGS = $(HAVE_EFENCE) -I$(SYSIO)/include -D_LARGEFILE64_SOURCE=1 \ ++AM_CPPFLAGS = $(HAVE_EFENCE) -I$(top_srcdir)/libsysio/include -D_LARGEFILE64_SOURCE=1 \ + $(LLCPPFLAGS) -I$(top_srcdir)/lnet/ulnds + AM_CFLAGS = $(LLCFLAGS) + --- lustre-1.8.3.orig/debian/patches/posix_acl.dpatch +++ lustre-1.8.3/debian/patches/posix_acl.dpatch @@ -0,0 +1,62 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## posix_acl.patch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch from Q-Leap Networks + +@DPATCH@ +diff -urNad lustre~/lustre/llite/file.c lustre/lustre/llite/file.c +--- lustre~/lustre/llite/file.c 2009-03-12 10:33:45.000000000 +0100 ++++ lustre/lustre/llite/file.c 2009-03-12 10:41:51.000000000 +0100 +@@ -45,6 +45,7 @@ + #include + #include + #include ++#include + #include "llite_internal.h" + #include + +diff -urNad lustre~/lustre/llite/xattr.c lustre/lustre/llite/xattr.c +--- lustre~/lustre/llite/xattr.c 2009-03-12 10:27:57.000000000 +0100 ++++ lustre/lustre/llite/xattr.c 2009-03-12 10:40:31.000000000 +0100 +@@ -38,6 +38,7 @@ + #include + #include + #include ++#include + + #define DEBUG_SUBSYSTEM S_LLITE + +diff -urNad lustre~/lustre/mdc/mdc_locks.c lustre/lustre/mdc/mdc_locks.c +--- lustre~/lustre/mdc/mdc_locks.c 2009-03-12 10:27:57.000000000 +0100 ++++ lustre/lustre/mdc/mdc_locks.c 2009-03-12 10:40:31.000000000 +0100 +@@ -44,6 +44,7 @@ + # include + # include + # include ++# include + #else + # include + #endif +diff -urNad lustre~/lustre/mdc/mdc_request.c lustre/lustre/mdc/mdc_request.c +--- lustre~/lustre/mdc/mdc_request.c 2009-03-12 10:27:57.000000000 +0100 ++++ lustre/lustre/mdc/mdc_request.c 2009-03-12 10:40:31.000000000 +0100 +@@ -44,6 +44,7 @@ + # include + # include + # include ++# include + #else + # include + #endif +diff -urNad lustre~/lustre/mds/handler.c lustre/lustre/mds/handler.c +--- lustre~/lustre/mds/handler.c 2009-03-12 10:40:31.000000000 +0100 ++++ lustre/lustre/mds/handler.c 2009-03-12 10:42:18.000000000 +0100 +@@ -52,6 +52,7 @@ + #include + #include + #include ++#include + # include + # include + # include --- lustre-1.8.3.orig/debian/patches/fix_various_typecasts.dpatch +++ lustre-1.8.3/debian/patches/fix_various_typecasts.dpatch @@ -0,0 +1,19 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## autogen.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: as we compile now with -Werror add typecasts for the printf stuff in sanity.c + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/liblustre/tests/sanity.c lustre/lustre/liblustre/tests/sanity.c +--- lustre~/lustre/liblustre/tests/sanity.c 2010-03-03 14:44:38.000000000 +0100 ++++ lustre/lustre/liblustre/tests/sanity.c 2010-03-03 18:18:43.028668969 +0100 +@@ -705,7 +705,7 @@ + } + + t_fcntl(fd, F_SETFL, O_APPEND); +- if (!(ret = t_fcntl(fd, F_GETFL)) & O_APPEND) { ++ if ((!(ret = t_fcntl(fd, F_GETFL))) & O_APPEND) { + printf("error get flag: ret %x\n", ret); + return(-1); + } --- lustre-1.8.3.orig/debian/patches/page-size-undef-fixes.dpatch +++ lustre-1.8.3/debian/patches/page-size-undef-fixes.dpatch @@ -0,0 +1,22 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## page-size-undef-fixes.dpatch by +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: set PAGE_SHIFT if this macro is undefined + +@DPATCH@ +--- lustre-1.6.0.1/lnet/include/libcfs/user-prim.h 2007-05-24 07:23:17.000000000 -0700 ++++ lustre-1.6.0.1/lnet/include/libcfs/user-prim.h 2007-05-24 07:24:04.000000000 -0700 +@@ -105,6 +105,12 @@ + + typedef struct page cfs_page_t; + ++#ifndef PAGE_SHIFT ++#define PAGE_SHIFT 12 /* 4KB page size if not defined */ ++#endif ++#ifndef PAGE_SIZE ++#define PAGE_SIZE ((__u64)1 << PAGE_SHIFT) ++#endif + #define CFS_PAGE_SIZE PAGE_SIZE + #define CFS_PAGE_SHIFT PAGE_SHIFT + #define CFS_PAGE_MASK (~((__u64)CFS_PAGE_SIZE-1)) --- lustre-1.8.3.orig/debian/patches/ldiskfs-detect-2.6.20-2.6.22.dpatch +++ lustre-1.8.3/debian/patches/ldiskfs-detect-2.6.20-2.6.22.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## ldiskfs-detect-2.6.20-2.6.22.dpatch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch from Q-Leap Networks modified by Patrick winnertz + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/ldiskfs/configure.ac lustre/ldiskfs/configure.ac +--- lustre~/ldiskfs/configure.ac 2010-03-03 17:25:38.000000000 +0100 ++++ lustre/ldiskfs/configure.ac 2010-03-04 14:53:13.608332585 +0100 +@@ -112,11 +112,16 @@ + else + LDISKFS_SERIES="2.6-rhel5.series" + fi +- else ++ else ++ if test -e $LINUX_OBJ/version.Debian; then ++ LDISKFS_SERIES="2.6.18-debian.series" ++ else + LDISKFS_SERIES="2.6.18-vanilla.series" ++ fi + fi + ;; + 2.6.22*) LDISKFS_SERIES="2.6.22-vanilla.series";; ++2.6.26*) LDISKFS_SERIES="2.6.26-vanilla.series";; + 2.6.27*) LDISKFS_SERIES="2.6-sles11.series";; + *) AC_MSG_WARN([Unknown kernel version $LINUXRELEASE, fix ldiskfs/configure.ac]) + esac --- lustre-1.8.3.orig/debian/patches/no_default_debugging.dpatch +++ lustre-1.8.3/debian/patches/no_default_debugging.dpatch @@ -0,0 +1,27 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## no_default_debugging.patch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch from Q-Leap Networks + +@DPATCH@ +diff -urNad lustre-1.6.5-rc2~/lnet/libcfs/debug.c lustre-1.6.5-rc2/lnet/libcfs/debug.c +--- lustre-1.6.5-rc2~/lnet/libcfs/debug.c 2008-05-09 13:44:34.000000000 +0200 ++++ lustre-1.6.5-rc2/lnet/libcfs/debug.c 2008-05-09 13:46:09.000000000 +0200 +@@ -34,13 +34,13 @@ + static char debug_file_name[1024]; + + #ifdef __KERNEL__ +-unsigned int libcfs_subsystem_debug = ~0; ++unsigned int libcfs_subsystem_debug = 0; + CFS_MODULE_PARM(libcfs_subsystem_debug, "i", int, 0644, + "Lustre kernel debug subsystem mask"); + EXPORT_SYMBOL(libcfs_subsystem_debug); + +-unsigned int libcfs_debug = (D_EMERG | D_ERROR | D_WARNING | D_CONSOLE | +- D_NETERROR | D_HA | D_CONFIG | D_IOCTL); ++unsigned int libcfs_debug = 0; ++ + CFS_MODULE_PARM(libcfs_debug, "i", int, 0644, + "Lustre kernel debug mask"); + EXPORT_SYMBOL(libcfs_debug); --- lustre-1.8.3.orig/debian/patches/configure_error_on_unstable.dpatch +++ lustre-1.8.3/debian/patches/configure_error_on_unstable.dpatch @@ -0,0 +1,31 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## autogen.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fix configure on debian unstable + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/build/autoconf/lustre-build-linux.m4 lustre/build/autoconf/lustre-build-linux.m4 +--- lustre~/build/autoconf/lustre-build-linux.m4 2010-03-08 10:25:09.000000000 +0100 ++++ lustre/build/autoconf/lustre-build-linux.m4 2010-03-08 11:00:46.106781669 +0100 +@@ -343,7 +343,7 @@ + AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], + [$4], + [_AC_MSG_LOG_CONFTEST +-m4_ifvaln([$5],[$5])dnl])dnl ++m4_ifvaln([$5],[$5])dnl]) + rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl + ]) + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/ldiskfs/build/autoconf/lustre-build-linux.m4 lustre/ldiskfs/build/autoconf/lustre-build-linux.m4 +--- lustre~/ldiskfs/build/autoconf/lustre-build-linux.m4 2010-03-08 10:25:09.000000000 +0100 ++++ lustre/ldiskfs/build/autoconf/lustre-build-linux.m4 2010-03-08 11:01:09.629794696 +0100 +@@ -343,7 +343,7 @@ + AS_IF([AC_TRY_COMMAND(cp conftest.c build && make -d [$2] ${LD:+"LD=$LD"} CC="$CC" -f $PWD/build/Makefile LUSTRE_LINUX_CONFIG=$LINUX_CONFIG LINUXINCLUDE="$EXTRA_LNET_INCLUDE -I$LINUX/arch/`uname -m|sed -e 's/ppc.*/powerpc/' -e 's/x86_64/x86/' -e 's/i.86/x86/'`/include -I$LINUX/include -I$LINUX_OBJ/include -I$LINUX_OBJ/include2 -include include/linux/autoconf.h" -o tmp_include_depends -o scripts -o include/config/MARKER -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM $MODULE_TARGET=$PWD/build) >/dev/null && AC_TRY_COMMAND([$3])], + [$4], + [_AC_MSG_LOG_CONFTEST +-m4_ifvaln([$5],[$5])dnl])dnl ++m4_ifvaln([$5],[$5])dnl]) + rm -f build/conftest.o build/conftest.mod.c build/conftest.mod.o build/conftest.ko m4_ifval([$1], [build/conftest.c conftest.c])[]dnl + ]) + --- lustre-1.8.3.orig/debian/patches/fix-2.6.15-versioncheck.dpatch +++ lustre-1.8.3/debian/patches/fix-2.6.15-versioncheck.dpatch @@ -0,0 +1,21 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## fix-2.6.15-versioncheck.dpatch by Niklas Edmundsson +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Fix version-check for 2.6.15 ubuntu/vanilla kernel. +## DP: Upstream check assumes RedHat patched kernel. + +@DPATCH@ + +diff lustre-1.6.2/lustre/include/linux/lustre_compat25.h lustre-1.6.2/lustre/include/linux/lustre_compat25.h +--- lustre-1.6.2/lustre/include/linux/lustre_compat25.h (revision 135) ++++ lustre-1.6.2/lustre/include/linux/lustre_compat25.h (working copy) +@@ -75,7 +75,7 @@ + #define TRYLOCK_INODE_MUTEX(inode) (!down_trylock(&(inode)->i_sem)) + #endif /* HAVE_INODE_I_MUTEX */ + +-#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,15) ++#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,15) + #define d_child d_u.d_child + #define d_rcu d_u.d_rcu + #endif --- lustre-1.8.3.orig/debian/patches/no-strict-aliasing.dpatch +++ lustre-1.8.3/debian/patches/no-strict-aliasing.dpatch @@ -0,0 +1,308 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## no_default_debugging.patch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Build lustre wit -fno-strict-aliasing as it otherwise fails to compile with gcc-4.4 + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/aclocal.m4 lustre/aclocal.m4 +--- lustre~/aclocal.m4 2010-03-11 13:05:55.000000000 +0100 ++++ lustre/aclocal.m4 2010-04-21 11:07:29.552195225 +0200 +@@ -1681,7 +1681,7 @@ + AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT], + [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + +@@ -1746,7 +1746,7 @@ + AC_DEFUN([LC_VFS_READDIR_U64_INO], + [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + int fillonedir(void * __buf, const char * name, int namlen, loff_t offset, +@@ -2086,7 +2086,7 @@ + AC_DEFUN([LC_RW_TREE_LOCK], + [AC_MSG_CHECKING([if kernel has tree_lock as rwlock]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + ],[ +@@ -2214,7 +2214,7 @@ + ],[ + AC_MSG_CHECKING([if kernel using gfp_t for shrinker second paramter]) + tmp_flags="$EXTRA_KCFLAGS" +- EXTRA_KCFLAGS="-Werror" ++ EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + ],[ +@@ -2454,7 +2454,7 @@ + AC_DEFUN([LC_RW_TREE_LOCK], + [AC_MSG_CHECKING([mapping->tree_lock is rw_lock]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + ],[ +@@ -3245,9 +3245,9 @@ + AC_DEFUN([LC_CONFIGURE], + [LC_CONFIG_OBD_BUFFER_SIZE + +-if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then +- CFLAGS="$CFLAGS -Werror" +-fi ++#if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then ++# CFLAGS="$CFLAGS -Werror -fno-strict-aliasing" ++#fi + + # include/liblustre.h + AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h]) +@@ -5093,7 +5093,7 @@ + AC_DEFUN([LN_KERN__U64_LONG_LONG], + [AC_MSG_CHECKING([kernel __u64 is long long type]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror" ++EXTRA_KCFLAGS="$EXTRA_KCFLAGS -Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + #include +@@ -5116,7 +5116,7 @@ + AC_DEFUN([LN_USER__U64_LONG_LONG], + [AC_MSG_CHECKING([userspace __u64 is long long type]) + tmp_flags="$CFLAGS" +-CFLAGS="$CFLAGS -Werror" ++CFLAGS="$CFLAGS -Werror -fno-strict-aliasing" + AC_COMPILE_IFELSE([ + #include + #include +@@ -5141,7 +5141,7 @@ + AC_DEFUN([LN_SIZE_T_LONG], + [AC_MSG_CHECKING([size_t is unsigned long type]) + tmp_flags="$CFLAGS" +-CFLAGS="$CFLAGS -Werror" ++CFLAGS="$CFLAGS -Werror -fno-strict-aliasing" + AC_COMPILE_IFELSE([ + #include + #include +@@ -5165,7 +5165,7 @@ + AC_DEFUN([LN_SSIZE_T_LONG], + [AC_MSG_CHECKING([ssize_t is signed long type]) + tmp_flags="$CFLAGS" +-CFLAGS="$CFLAGS -Werror" ++CFLAGS="$CFLAGS -Werror -fno-strict-aliasing" + AC_COMPILE_IFELSE([ + #include + #include +@@ -5312,7 +5312,7 @@ + AC_DEFUN([LN_KMEM_CACHE], + [AC_MSG_CHECKING([check kernel has struct kmem_cache]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + typedef struct kmem_cache cache_t; +@@ -5356,7 +5356,7 @@ + [LB_CHECK_SYMBOL_EXPORT([dump_trace], + [kernel/ksyms.c arch/${LINUX_ARCH%_64}/kernel/traps_64.c],[ + tmp_flags="$EXTRA_KCFLAGS" +- EXTRA_KCFLAGS="-Werror" ++ EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + AC_MSG_CHECKING([whether we can really use dump_trace]) + LB_LINUX_TRY_COMPILE([ + struct task_struct; +@@ -5510,7 +5510,7 @@ + AC_DEFUN([LN_FUNC_UNSHARE_FS_STRUCT], + [AC_MSG_CHECKING([if kernel defines unshare_fs_struct()]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + #include +@@ -6705,7 +6705,7 @@ + grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && + ${MAKE-make} -s -f confmf > /dev/null 2>&1; then + # icc doesn't choke on unknown options, it will just issue warnings +- # (even with -Werror). So we grep stderr for any message ++ # (even with -Werror -fno-strict-aliasing). So we grep stderr for any message + # that says an option was ignored. + if grep 'ignoring option' conftest.err >/dev/null 2>&1; then :; else + am_cv_$1_dependencies_compiler_type=$depmode +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/autoconf/lustre-core.m4 lustre/lustre/autoconf/lustre-core.m4 +--- lustre~/lustre/autoconf/lustre-core.m4 2010-04-21 11:03:04.964193828 +0200 ++++ lustre/lustre/autoconf/lustre-core.m4 2010-04-21 11:03:05.153194299 +0200 +@@ -651,7 +651,7 @@ + AC_DEFUN([LC_UMOUNTBEGIN_HAS_VFSMOUNT], + [AC_MSG_CHECKING([if umount_begin needs vfsmount parameter instead of super_block]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + +@@ -716,7 +716,7 @@ + AC_DEFUN([LC_VFS_READDIR_U64_INO], + [AC_MSG_CHECKING([check vfs_readdir need 64bit inode number]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + int fillonedir(void * __buf, const char * name, int namlen, loff_t offset, +@@ -1056,7 +1056,7 @@ + AC_DEFUN([LC_RW_TREE_LOCK], + [AC_MSG_CHECKING([if kernel has tree_lock as rwlock]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + ],[ +@@ -1184,7 +1184,7 @@ + ],[ + AC_MSG_CHECKING([if kernel using gfp_t for shrinker second paramter]) + tmp_flags="$EXTRA_KCFLAGS" +- EXTRA_KCFLAGS="-Werror" ++ EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + ],[ +@@ -1424,7 +1424,7 @@ + AC_DEFUN([LC_RW_TREE_LOCK], + [AC_MSG_CHECKING([mapping->tree_lock is rw_lock]) + tmp_flags="$EXTRA_KCFLAGS" +-EXTRA_KCFLAGS="-Werror" ++EXTRA_KCFLAGS="-Werror -fno-strict-aliasing" + LB_LINUX_TRY_COMPILE([ + #include + ],[ +@@ -2216,9 +2216,9 @@ + AC_DEFUN([LC_CONFIGURE], + [LC_CONFIG_OBD_BUFFER_SIZE + +-if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then +- CFLAGS="$CFLAGS -Werror" +-fi ++#if test $target_cpu == "i686" -o $target_cpu == "x86_64"; then ++# CFLAGS="$CFLAGS -Werror -fno-strict-aliasing" ++#fi + + # include/liblustre.h + AC_CHECK_HEADERS([asm/page.h sys/user.h sys/vfs.h stdint.h blkid/blkid.h]) +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/llite/file.c lustre/lustre/llite/file.c +--- lustre~/lustre/llite/file.c 2010-04-21 11:03:04.916194526 +0200 ++++ lustre/lustre/llite/file.c 2010-04-21 11:03:05.157194090 +0200 +@@ -1428,7 +1428,7 @@ + + count = ll_file_get_iov_count(iov, &nr_segs); + CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),size="LPSZ",offset=%Ld\n", +- inode->i_ino, inode->i_generation, inode, count, *ppos); ++ inode->i_ino, inode->i_generation, inode, (unsigned int)count, *ppos); + /* "If nbyte is 0, read() will return 0 and have no other results." + * -- Single Unix Spec */ + if (count == 0) +@@ -1598,7 +1598,7 @@ + + chunk = end - *ppos + 1; + CDEBUG(D_INODE,"Read ino %lu, "LPSZ" bytes, offset %lld, i_size %llu\n", +- inode->i_ino, chunk, *ppos, i_size_read(inode)); ++ inode->i_ino, (unsigned int)chunk, *ppos, i_size_read(inode)); + + /* turn off the kernel's read-ahead */ + if (ltd.lock_style != LL_LOCK_STYLE_NOLOCK) { +@@ -1778,7 +1778,7 @@ + count = ll_file_get_iov_count(iov, &nr_segs); + + CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),size="LPSZ",offset=%Ld\n", +- inode->i_ino, inode->i_generation, inode, count, *ppos); ++ inode->i_ino, inode->i_generation, inode, (unsigned int)count, *ppos); + + SIGNAL_MASK_ASSERT(); /* XXX BUG 1511 */ + +@@ -1881,7 +1881,7 @@ + /* generic_file_write handles O_APPEND after getting i_mutex */ + chunk = end - *ppos + 1; + CDEBUG(D_INFO, "Writing inode %lu, "LPSZ" bytes, offset %Lu\n", +- inode->i_ino, chunk, *ppos); ++ inode->i_ino, (unsigned int)chunk, *ppos); + if (tree_locked) { + struct ost_lvb *xtimes; + /* write under locks +@@ -2116,7 +2116,7 @@ + ENTRY; + + CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p),size="LPSZ",offset=%Ld\n", +- inode->i_ino, inode->i_generation, inode, count, *ppos); ++ inode->i_ino, inode->i_generation, inode, (unsigned int)count, *ppos); + + /* "If nbyte is 0, read() will return 0 and have no other results." + * -- Single Unix Spec */ +@@ -2181,7 +2181,7 @@ + } + + CDEBUG(D_INFO, "Send ino %lu, "LPSZ" bytes, offset %lld, i_size %llu\n", +- inode->i_ino, count, *ppos, i_size_read(inode)); ++ inode->i_ino, (unsigned int)count, *ppos, i_size_read(inode)); + + ll_ra_read_init(in_file, &bead, *ppos, count); + /* BUG: 5972 */ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/llite/rw26.c lustre/lustre/llite/rw26.c +--- lustre~/lustre/llite/rw26.c 2010-03-11 13:05:55.000000000 +0100 ++++ lustre/lustre/llite/rw26.c 2010-04-21 11:03:05.157194090 +0200 +@@ -242,8 +242,8 @@ + + CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu/%u(%p), size="LPSZ" (max %lu), " + "offset=%lld=%llx, pages "LPSZ" (max %lu)\n", +- inode->i_ino, inode->i_generation, inode, count, MAX_DIO_SIZE, +- file_offset, file_offset, count >> CFS_PAGE_SHIFT, ++ inode->i_ino, inode->i_generation, inode, (unsigned int)count, MAX_DIO_SIZE, ++ file_offset, file_offset, (unsigned int)count >> CFS_PAGE_SHIFT, + MAX_DIO_SIZE >> CFS_PAGE_SHIFT); + + if (rw == WRITE) +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/lvfs/fsfilt_ext3.c lustre/lustre/lvfs/fsfilt_ext3.c +--- lustre~/lustre/lvfs/fsfilt_ext3.c 2010-03-03 14:44:38.000000000 +0100 ++++ lustre/lustre/lvfs/fsfilt_ext3.c 2010-04-21 11:03:05.157194090 +0200 +@@ -721,7 +721,7 @@ + const int blksize = inode->i_sb->s_blocksize; + + CDEBUG(D_EXT2, "reading "LPSZ" at dir %lu+%llu\n", +- count, inode->i_ino, *off); ++ (unsigned int)count, inode->i_ino, *off); + while (count > 0) { + struct buffer_head *bh; + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/mds/mds_join.c lustre/lustre/mds/mds_join.c +--- lustre~/lustre/mds/mds_join.c 2010-01-23 03:07:58.000000000 +0100 ++++ lustre/lustre/mds/mds_join.c 2010-04-21 11:03:05.157194090 +0200 +@@ -241,7 +241,7 @@ + int max_easize = sizeof(*lmmj); + + CDEBUG(D_INFO, "change the max md size from %d to "LPSZ"\n", +- mds->mds_max_mdsize, sizeof(*lmmj)); ++ mds->mds_max_mdsize, (unsigned int)sizeof(*lmmj)); + + if (mds->mds_max_mdsize < max_easize || + mds->mds_max_cookiesize < max_cookiesize) { +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/obdclass/obd_mount.c lustre/lustre/obdclass/obd_mount.c +--- lustre~/lustre/obdclass/obd_mount.c 2010-03-11 13:05:55.000000000 +0100 ++++ lustre/lustre/obdclass/obd_mount.c 2010-04-21 11:03:05.157194090 +0200 +@@ -279,7 +279,7 @@ + CDEBUG(D_MOUNT, "Have %s, size %lu\n", MOUNT_DATA_FILE, len); + if (len != sizeof(*ldd)) { + CERROR("disk data size does not match: see %lu expect "LPSZ"\n", +- len, sizeof(*ldd)); ++ (long unsigned int)len, (unsigned int)sizeof(*ldd)); + GOTO(out_close, rc = -EINVAL); + } + --- lustre-1.8.3.orig/debian/patches/00list +++ lustre-1.8.3/debian/patches/00list @@ -0,0 +1,28 @@ +# patches +page-size-undef-fixes.dpatch +#inode-no-i_blksize-2.6.20.dpatch +posix_acl.dpatch +ldiskfs-detect-2.6.20-2.6.22.dpatch +no_default_debugging.dpatch +autogen.sh.dpatch +no-darwin.dpatch +libsysio.dpatch +bug12769-ql-fix.dpatch +bug15587_security.capability_xattr.dpatch +# Debian patches +bash_completion.dpatch +lustre_manpage.dpatch +tex2pdf.dpatch +lustre_config.dpatch +fix-2.6.15-versioncheck.dpatch +bug13852-quota_includes.dpatch +fix-lustre-manpage.dpatch +enable-quota.dpatch +fix-symlink-attack.dpatch +use_bash_instead_of_sh.dpatch +#hotfixes for 1.8.2: +fix-oot-builds.dpatch +fix_various_typecasts.dpatch +no-strict-aliasing.dpatch +fix_bashisms_for_dash.dpatch +fix_dentry_conf_test.dpatch --- lustre-1.8.3.orig/debian/patches/autogen.sh.dpatch +++ lustre-1.8.3/debian/patches/autogen.sh.dpatch @@ -0,0 +1,292 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## autogen.dpatch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: autogen.sh script from lustre upstream cvs for 1.6.4.2 + +@DPATCH@ +diff -urNad lustre-1.6.4.2~/autogen.sh lustre-1.6.4.2/autogen.sh +--- lustre-1.6.4.2~/autogen.sh 1970-01-01 01:00:00.000000000 +0100 ++++ lustre-1.6.4.2/autogen.sh 2008-02-13 12:31:39.631640478 +0100 +@@ -0,0 +1,2 @@ ++#!/bin/sh ++exec bash build/autogen.sh $@ +diff -urNad lustre-1.6.4.2~/build/autogen.sh lustre-1.6.4.2/build/autogen.sh +--- lustre-1.6.4.2~/build/autogen.sh 1970-01-01 01:00:00.000000000 +0100 ++++ lustre-1.6.4.2/build/autogen.sh 2008-02-13 12:31:39.631640478 +0100 +@@ -0,0 +1,128 @@ ++#!/bin/bash ++ ++# taken from gnome-common/macros2/autogen.sh ++compare_versions() { ++ ch_min_version=$1 ++ ch_actual_version=$2 ++ ch_status=0 ++ IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." ++ set $ch_actual_version ++ for ch_min in $ch_min_version; do ++ ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes ++ if [ -z "$ch_min" ]; then break; fi ++ if [ -z "$ch_cur" ]; then ch_status=1; break; fi ++ if [ $ch_cur -gt $ch_min ]; then break; fi ++ if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi ++ done ++ IFS="$ch_save_IFS" ++ return $ch_status ++} ++ ++error_msg() { ++ echo "$cmd is $1. version $required is required to build Lustre." ++ ++ if [ -e /usr/lib/autolustre/bin/$cmd ]; then ++ cat >&2 <<-EOF ++ You apparently already have Lustre-specific autoconf/make RPMs ++ installed on your system at /usr/lib/autolustre/share/$cmd. ++ Please set your PATH to point to those versions: ++ ++ export PATH="/usr/lib/autolustre/bin:\$PATH" ++ EOF ++ else ++ cat >&2 <<-EOF ++ CFS provides RPMs which can be installed alongside your ++ existing autoconf/make RPMs, if you are nervous about ++ upgrading. See ++ ++ ftp://ftp.lustre.org/pub/other/autolustre/README.autolustre ++ ++ You may be able to download newer version from: ++ ++ http://ftp.gnu.org/gnu/$tool/$tool-$required.tar.gz ++ EOF ++ fi ++ [ "$cmd" = "autoconf" -a "$required" = "2.57" ] && cat >&2 <&2 </dev/null ; then ++ error_msg "missing" ++ fi ++ version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }") ++ echo "found $version" ++ if ! compare_versions "$required" "$version" ; then ++ error_msg "too old" ++ fi ++} ++ ++echo "Checking for a complete tree..." ++if [ -d kernel_patches ] ; then ++ # This is ldiskfs ++ REQUIRED_DIRS="build" ++ CONFIGURE_DIRS="" ++else ++ REQUIRED_DIRS="build lnet lustre" ++ OPTIONAL_DIRS="snmp portals" ++ CONFIGURE_DIRS="libsysio ldiskfs" ++fi ++ ++for dir in $REQUIRED_DIRS ; do ++ if [ ! -d "$dir" ] ; then ++ cat >&2 </dev/null ++ echo "Running autogen for $dir..." ++ sh autogen.sh || exit $? ++ popd >/dev/null ++ fi ++done +diff -urNad lustre-1.6.4.2~/ldiskfs/autogen.sh lustre-1.6.4.2/ldiskfs/autogen.sh +--- lustre-1.6.4.2~/ldiskfs/autogen.sh 1970-01-01 01:00:00.000000000 +0100 ++++ lustre-1.6.4.2/ldiskfs/autogen.sh 2008-02-13 12:31:39.631640478 +0100 +@@ -0,0 +1,2 @@ ++#!/bin/bash ++exec bash build/autogen.sh $@ +diff -urNad lustre-1.6.4.2~/ldiskfs/build/autogen.sh lustre-1.6.4.2/ldiskfs/build/autogen.sh +--- lustre-1.6.4.2~/ldiskfs/build/autogen.sh 1970-01-01 01:00:00.000000000 +0100 ++++ lustre-1.6.4.2/ldiskfs/build/autogen.sh 2008-02-13 12:31:33.000000000 +0100 +@@ -0,0 +1,128 @@ ++#!/bin/bash ++ ++# taken from gnome-common/macros2/autogen.sh ++compare_versions() { ++ ch_min_version=$1 ++ ch_actual_version=$2 ++ ch_status=0 ++ IFS="${IFS= }"; ch_save_IFS="$IFS"; IFS="." ++ set $ch_actual_version ++ for ch_min in $ch_min_version; do ++ ch_cur=`echo $1 | sed 's/[^0-9].*$//'`; shift # remove letter suffixes ++ if [ -z "$ch_min" ]; then break; fi ++ if [ -z "$ch_cur" ]; then ch_status=1; break; fi ++ if [ $ch_cur -gt $ch_min ]; then break; fi ++ if [ $ch_cur -lt $ch_min ]; then ch_status=1; break; fi ++ done ++ IFS="$ch_save_IFS" ++ return $ch_status ++} ++ ++error_msg() { ++ echo "$cmd is $1. version $required is required to build Lustre." ++ ++ if [ -e /usr/lib/autolustre/bin/$cmd ]; then ++ cat >&2 <<-EOF ++ You apparently already have Lustre-specific autoconf/make RPMs ++ installed on your system at /usr/lib/autolustre/share/$cmd. ++ Please set your PATH to point to those versions: ++ ++ export PATH="/usr/lib/autolustre/bin:\$PATH" ++ EOF ++ else ++ cat >&2 <<-EOF ++ CFS provides RPMs which can be installed alongside your ++ existing autoconf/make RPMs, if you are nervous about ++ upgrading. See ++ ++ ftp://ftp.lustre.org/pub/other/autolustre/README.autolustre ++ ++ You may be able to download newer version from: ++ ++ http://ftp.gnu.org/gnu/$tool/$tool-$required.tar.gz ++ EOF ++ fi ++ [ "$cmd" = "autoconf" -a "$required" = "2.57" ] && cat >&2 <&2 </dev/null ; then ++ error_msg "missing" ++ fi ++ version=$($cmd --version | awk "/$tool \(GNU/ { print \$4 }") ++ echo "found $version" ++ if ! compare_versions "$required" "$version" ; then ++ error_msg "too old" ++ fi ++} ++ ++echo "Checking for a complete tree..." ++if [ -d kernel_patches ] ; then ++ # This is ldiskfs ++ REQUIRED_DIRS="build" ++ CONFIGURE_DIRS="" ++else ++ REQUIRED_DIRS="build lnet lustre" ++ OPTIONAL_DIRS="snmp portals" ++ CONFIGURE_DIRS="libsysio ldiskfs" ++fi ++ ++for dir in $REQUIRED_DIRS ; do ++ if [ ! -d "$dir" ] ; then ++ cat >&2 </dev/null ++ echo "Running autogen for $dir..." ++ sh autogen.sh || exit $? ++ popd >/dev/null ++ fi ++done +diff -urNad lustre-1.6.4.2~/libsysio/autogen.sh lustre-1.6.4.2/libsysio/autogen.sh +--- lustre-1.6.4.2~/libsysio/autogen.sh 1970-01-01 01:00:00.000000000 +0100 ++++ lustre-1.6.4.2/libsysio/autogen.sh 2008-02-13 12:31:39.631640478 +0100 +@@ -0,0 +1,5 @@ ++#!/bin/sh ++ ++aclocal && ++automake --add-missing --copy && ++${AUTOCONF:-autoconf} --- lustre-1.8.3.orig/debian/patches/LBUG_open-unlinked_bug_22177-2.dpatch +++ lustre-1.8.3/debian/patches/LBUG_open-unlinked_bug_22177-2.dpatch @@ -0,0 +1,20 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## LBUG_open-unlinked_bug_22177.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch from Bugzilla #22177, should be fixed in 1.8.3 + +@DPATCH@ +diff --git a/lustre/mds/mds_open.c b/lustre/mds/mds_open.c +index 4feb1d8..31e1768 100644 +--- a/lustre/mds/mds_open.c ++++ b/lustre/mds/mds_open.c +@@ -1496,7 +1496,7 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset, + CDEBUG(D_INODE, "destroying orphan object %s\n", fidname); + + if ((S_ISREG(inode->i_mode) && inode->i_nlink != 1) || +- (S_ISDIR(inode->i_mode) && inode->i_nlink != 2)) ++ (S_ISDIR(inode->i_mode) && inode->i_nlink > 2)) + CERROR("found \"orphan\" %s %s with link count %d\n", + S_ISREG(inode->i_mode) ? "file" : "dir", + fidname, inode->i_nlink); --- lustre-1.8.3.orig/debian/patches/lustre_config.dpatch +++ lustre-1.8.3/debian/patches/lustre_config.dpatch @@ -0,0 +1,103 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## lustre_config.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Hard coded path to lc_common... not the best solution, but a solution + +@DPATCH@ +diff -urNad lustre-1.6.4.1~/lustre/scripts/lc_cluman.in lustre-1.6.4.1/lustre/scripts/lc_cluman.in +--- lustre-1.6.4.1~/lustre/scripts/lc_cluman.in 2007-03-23 03:31:10.000000000 +0100 ++++ lustre-1.6.4.1/lustre/scripts/lc_cluman.in 2007-12-21 12:04:45.000000000 +0100 +@@ -38,7 +38,7 @@ + } + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + #****************************** Global variables ******************************# + TMP_DIR=${CLUMGR_TMP_DIR} # Temporary directory +diff -urNad lustre-1.6.4.1~/lustre/scripts/lc_hb.in lustre-1.6.4.1/lustre/scripts/lc_hb.in +--- lustre-1.6.4.1~/lustre/scripts/lc_hb.in 2007-03-23 03:31:10.000000000 +0100 ++++ lustre-1.6.4.1/lustre/scripts/lc_hb.in 2007-12-21 12:04:58.000000000 +0100 +@@ -31,7 +31,7 @@ + } + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + #****************************** Global variables ******************************# + # Heartbeat tools +diff -urNad lustre-1.6.4.1~/lustre/scripts/lc_lvm.in lustre-1.6.4.1/lustre/scripts/lc_lvm.in +--- lustre-1.6.4.1~/lustre/scripts/lc_lvm.in 2007-03-23 03:31:10.000000000 +0100 ++++ lustre-1.6.4.1/lustre/scripts/lc_lvm.in 2007-12-21 12:05:15.000000000 +0100 +@@ -118,7 +118,7 @@ + } + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + #***************************** Global variables *****************************# + # All the LVM device items in the csv file +diff -urNad lustre-1.6.4.1~/lustre/scripts/lc_md.in lustre-1.6.4.1/lustre/scripts/lc_md.in +--- lustre-1.6.4.1~/lustre/scripts/lc_md.in 2007-06-09 09:09:09.000000000 +0200 ++++ lustre-1.6.4.1/lustre/scripts/lc_md.in 2007-12-21 12:05:31.000000000 +0100 +@@ -70,7 +70,7 @@ + } + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + #***************************** Global variables *****************************# + # All the MD device items in the csv file +diff -urNad lustre-1.6.4.1~/lustre/scripts/lc_modprobe.in lustre-1.6.4.1/lustre/scripts/lc_modprobe.in +--- lustre-1.6.4.1~/lustre/scripts/lc_modprobe.in 2007-03-23 03:31:10.000000000 +0100 ++++ lustre-1.6.4.1/lustre/scripts/lc_modprobe.in 2007-12-21 12:05:50.000000000 +0100 +@@ -6,7 +6,7 @@ + ################################################################################# + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + # Check the kernel version + KERNEL_VERSION=`uname -r` +diff -urNad lustre-1.6.4.1~/lustre/scripts/lc_net.in lustre-1.6.4.1/lustre/scripts/lc_net.in +--- lustre-1.6.4.1~/lustre/scripts/lc_net.in 2007-03-23 03:31:10.000000000 +0100 ++++ lustre-1.6.4.1/lustre/scripts/lc_net.in 2007-12-21 12:06:06.000000000 +0100 +@@ -27,7 +27,7 @@ + } + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + VERBOSE_OUTPUT=false + # Get and check the positional parameters +diff -urNad lustre-1.6.4.1~/lustre/scripts/lustre_config.in lustre-1.6.4.1/lustre/scripts/lustre_config.in +--- lustre-1.6.4.1~/lustre/scripts/lustre_config.in 2007-10-14 06:33:14.000000000 +0200 ++++ lustre-1.6.4.1/lustre/scripts/lustre_config.in 2007-12-21 12:04:25.000000000 +0100 +@@ -230,7 +230,7 @@ + } + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + #***************************** Global variables *****************************# + declare -a MGS_NODENAME # node names of the MGS servers +diff -urNad lustre-1.6.4.1~/lustre/scripts/lustre_createcsv.in lustre-1.6.4.1/lustre/scripts/lustre_createcsv.in +--- lustre-1.6.4.1~/lustre/scripts/lustre_createcsv.in 2007-10-14 06:33:14.000000000 +0200 ++++ lustre-1.6.4.1/lustre/scripts/lustre_createcsv.in 2007-12-21 12:06:43.000000000 +0100 +@@ -37,7 +37,7 @@ + } + + # Get the library of functions +-. @scriptlibdir@/lc_common ++. /usr/share/lustre/lc_common + + #**************************** Global variables ****************************# + # csv file --- lustre-1.8.3.orig/debian/patches/fix_bashisms_for_dash.dpatch +++ lustre-1.8.3/debian/patches/fix_bashisms_for_dash.dpatch @@ -0,0 +1,68 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## remove-set_tunables.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: fix some bashisms by switching the interpreter from sh to bash + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/ldiskfs/configure.ac lustre/ldiskfs/configure.ac +--- lustre~/ldiskfs/configure.ac 2010-07-28 14:28:02.884964948 +0200 ++++ lustre/ldiskfs/configure.ac 2010-07-28 14:28:03.136965577 +0200 +@@ -91,7 +91,7 @@ + fi + + AC_SUBST(BACKFS) +-BACKFSU=${BACKFS/ext/EXT} ++BACKFSU=`echo $BACKFS | sed -e 's#ext#EXT#'` + AC_SUBST(BACKFSU) # We need a Upper string + + AM_CONDITIONAL(USE_EXT4, test x$enable_ext4 = xyes) +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/tests/llog-test.sh lustre/lustre/tests/llog-test.sh +--- lustre~/lustre/tests/llog-test.sh 2010-01-11 04:29:50.000000000 +0100 ++++ lustre/lustre/tests/llog-test.sh 2010-07-28 14:28:03.136965577 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + set -e + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/tests/lnet-selftest.sh lustre/lustre/tests/lnet-selftest.sh +--- lustre~/lustre/tests/lnet-selftest.sh 2010-04-10 02:28:57.000000000 +0200 ++++ lustre/lustre/tests/lnet-selftest.sh 2010-07-28 14:28:24.855977956 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} + . $LUSTRE/tests/test-framework.sh +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/tests/mdsrate-stat-large.sh lustre/lustre/tests/mdsrate-stat-large.sh +--- lustre~/lustre/tests/mdsrate-stat-large.sh 2010-04-10 02:28:57.000000000 +0200 ++++ lustre/lustre/tests/mdsrate-stat-large.sh 2010-07-28 14:28:03.136965577 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + # + # This test was used in a set of CMD3 tests (cmd3-8 test). + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/tests/rundbench lustre/lustre/tests/rundbench +--- lustre~/lustre/tests/rundbench 2010-01-11 04:29:50.000000000 +0100 ++++ lustre/lustre/tests/rundbench 2010-07-28 14:28:03.136965577 +0200 +@@ -1,4 +1,4 @@ +-#!/bin/sh ++#!/bin/bash + + LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)} + . $LUSTRE/tests/test-framework.sh +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre-1.8.3~/lustre/liblustre/genlib.sh lustre-1.8.3/lustre/liblustre/genlib.sh +--- lustre-1.8.3~/lustre/liblustre/genlib.sh 2010-04-10 02:28:57.000000000 +0200 ++++ lustre-1.8.3/lustre/liblustre/genlib.sh 2010-06-25 12:04:34.000000000 +0200 +@@ -14,7 +14,7 @@ + AR=/usr/bin/ar + # see http://osdir.com/ml/gmane.comp.gnu.binutils.bugs/2006-01/msg00016.php + ppc64_CPU=`uname -p` +-if [ ${ppc64_CPU} == "ppc64" ]; then ++if [ ${ppc64_CPU} = "ppc64" ]; then + LD="gcc -m64" + else + LD="gcc" + --- lustre-1.8.3.orig/debian/patches/bash_completion.dpatch +++ lustre-1.8.3/debian/patches/bash_completion.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bash_completion.dpatch by Alastair McKinstry +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Support for Bash completion. Work in progress. + +@DPATCH@ +diff -urNad lustre/lustre-1.6.0.1/lustre/contrib/bash_completion/lctl /tmp/dpep.59jPKV/lustre/lustre-1.6.0.1/lustre/contrib/bash_completion/lctl +--- lustre-1.6.0.1/lustre/contrib/bash_completion/lctl 1970-01-01 01:00:00.000000000 +0100 ++++ lustre-1.6.0.1/lustre/contrib/bash_completion/lctl 2006-08-11 17:10:01.000000000 +0100 +@@ -0,0 +1,13 @@ ++#-*- mode: shell-script;-*- ++ ++have lctl && ++_lctl() ++{ ++ local cur ++ COMPREPLY=() ++ cur=${COMP_WORDS[COMP_CWORD]} ++ COMPREPLY=($( compgen -W '--device --threads --ignore-errors ignore-errors dump --net network net list_nids which_nid interface_list add_interface del_interface peer_list add_peer del_peer conn_list disconnect active_tc mynid add_uuid close_uuid del_uuid add_route del_route set_route fail ping newdev device cfg_device device_list dl lustre_build_version attach setup cleanup detach lov_setup lov_modify_tgts lov_getconfig record endrecord parse dump_log clear_log conf_param probe close getattr setattr create destroy test_getattr test_setattr test_brw get_stripe set_stripe unset_stripe dump_ldlm activate deactivate recover lookup notransno readonly abort_recovery mount_option del_mount_option set_timeout set_lustre_upcall add_conn del_conn local_param llog_catlist llog_info llog_print llog_check llog_cancel llog_remove debug_daemon debug_kernel dk debug_file df clear mark filter show debug_list modules panic lwt memhog help' -- $cur ) ) ++} ++ ++complete -F _lctl lctl ++ +diff -urNad lustre/lustre-1.6.0.1/lustre/contrib/bash_completion/lfs /tmp/dpep.59jPKV/lustre/lustre-1.6.0.1/lustre/contrib/bash_completion/lfs +--- lustre-1.6.0.1/lustre/contrib/bash_completion/lfs 1970-01-01 01:00:00.000000000 +0100 ++++ lustre-1.6.0.1/lustre/contrib/bash_completion/lfs 2006-08-11 16:40:23.000000000 +0100 +@@ -0,0 +1,13 @@ ++#-*- mode: shell-script;-*- ++ ++have lfs && ++_lfs() ++{ ++ local cur ++ COMPREPLY=() ++ cur=${COMP_WORDS[COMP_CWORD]} ++ COMPREPLY=($( compgen -W 'catinfo join osts help find getstripe setstripe quotachown quotacheck quotaon setquota quota setstripe check df' -- $cur ) ) ++} ++ ++complete -F _lfs lfs ++ --- lustre-1.8.3.orig/debian/patches/bug15587_security.capability_xattr.dpatch +++ lustre-1.8.3/debian/patches/bug15587_security.capability_xattr.dpatch @@ -0,0 +1,35 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## bug15587_security.capability_xattr.dpatch by Patrick Winnertz +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: ignore security.capability xattr for now + +@DPATCH@ +diff --git a/lustre/llite/xattr.c b/lustre/llite/xattr.c +index 8fbc7bf..819e7bb 100644 +--- a/lustre/llite/xattr.c ++++ b/lustre/llite/xattr.c +@@ -142,6 +142,11 @@ int ll_setxattr_common(struct inode *inode, const char *name, + (xattr_type == XATTR_LUSTRE_T && strcmp(name, "lustre.lov") == 0)) + RETURN(0); + ++ /* b15587: ignore security.capability xattr for now */ ++ if ((xattr_type == XATTR_SECURITY_T && ++ strcmp(name, "security.capability") == 0)) ++ RETURN(0); ++ + ll_inode2fid(&fid, inode); + rc = mdc_setxattr(sbi->ll_mdc_exp, &fid, valid, + name, value, size, 0, flags, &req); +@@ -254,6 +259,11 @@ int ll_getxattr_common(struct inode *inode, const char *name, + if (rc) + RETURN(rc); + ++ /* b15587: ignore security.capability xattr for now */ ++ if ((xattr_type == XATTR_SECURITY_T && ++ strcmp(name, "security.capability") == 0)) ++ RETURN(-ENODATA); ++ + /* posix acl is under protection of LOOKUP lock. when calling to this, + * we just have path resolution to the target inode, so we have great + * chance that cached ACL is uptodate. --- lustre-1.8.3.orig/debian/patches/lustre_manpage.dpatch +++ lustre-1.8.3/debian/patches/lustre_manpage.dpatch @@ -0,0 +1,17 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## lustre_manpatch.dpatch by Patrick Winnert +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: registred symbol not allowed. + +--- lustre-1.6.0.1/lustre/doc/lustre.7 2007-07-20 14:27:09.000000000 +0200 ++++ lustre-1.6.0.1/lustre/doc/lustre.7 2007-07-20 14:29:35.000000000 +0200 +@@ -8,7 +8,7 @@ + .SH SYNOPSIS + A high-performance file system designed for clusters. + .SH DESCRIPTION +-.B LustreĀ® ++.B Lustre\[rg] + is a high-performance, massively-scalable, POSIX-compliant network file system + designed for the world's largest high-performance compute clusters. Lustre + is under active development from Cluster FileSystems (http://clusterfs.com). --- lustre-1.8.3.orig/debian/patches/no-darwin.dpatch +++ lustre-1.8.3/debian/patches/no-darwin.dpatch @@ -0,0 +1,528 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## no-darwin.dpatch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Remove faulty 'if DARWIN' blocks from autoMakefile.am files +## DP: Remove darwin subdirs from autoMakefile.am files + +@DPATCH@ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lnet/include/libcfs/Makefile.am lustre/lnet/include/libcfs/Makefile.am +--- lustre~/lnet/include/libcfs/Makefile.am 2010-05-05 11:24:03.000000000 +0200 ++++ lustre/lnet/include/libcfs/Makefile.am 2010-05-05 11:40:59.198032073 +0200 +@@ -1,8 +1,8 @@ + SUBDIRS := linux +-if DARWIN +-SUBDIRS += darwin +-endif +-DIST_SUBDIRS := linux darwin ++#if DARWIN ++#SUBDIRS += darwin ++#endif ++DIST_SUBDIRS := $(SUBDIRS) + + EXTRA_DIST := curproc.h kp30.h libcfs.h list.h lltrace.h \ + portals_utils.h types.h user-lock.h user-prim.h user-time.h \ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lnet/include/libcfs/Makefile.am.~1~ lustre/lnet/include/libcfs/Makefile.am.~1~ +--- lustre~/lnet/include/libcfs/Makefile.am.~1~ 1970-01-01 01:00:00.000000000 +0100 ++++ lustre/lnet/include/libcfs/Makefile.am.~1~ 2010-05-05 11:24:03.000000000 +0200 +@@ -0,0 +1,9 @@ ++SUBDIRS := linux ++if DARWIN ++SUBDIRS += darwin ++endif ++DIST_SUBDIRS := linux darwin ++ ++EXTRA_DIST := curproc.h kp30.h libcfs.h list.h lltrace.h \ ++ portals_utils.h types.h user-lock.h user-prim.h user-time.h \ ++ user-tcpip.h user-bitops.h bitmap.h +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lnet/include/lnet/Makefile.am lustre/lnet/include/lnet/Makefile.am +--- lustre~/lnet/include/lnet/Makefile.am 2010-05-05 11:24:03.000000000 +0200 ++++ lustre/lnet/include/lnet/Makefile.am 2010-05-05 11:39:32.333472438 +0200 +@@ -1,10 +1,10 @@ + lnetdir=$(includedir)/lnet + + SUBDIRS := linux +-if DARWIN +-SUBDIRS += darwin +-endif +-DIST_SUBDIRS := linux darwin ++#if DARWIN ++#SUBDIRS += darwin ++#endif ++DIST_SUBDIRS := $(SUBDIRS) + + EXTRA_DIST = api.h api-support.h \ + lib-lnet.h lib-types.h lnet.h lnetctl.h types.h \ +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lnet/include/lnet/Makefile.am.~1~ lustre/lnet/include/lnet/Makefile.am.~1~ +--- lustre~/lnet/include/lnet/Makefile.am.~1~ 1970-01-01 01:00:00.000000000 +0100 ++++ lustre/lnet/include/lnet/Makefile.am.~1~ 2010-05-05 11:24:03.000000000 +0200 +@@ -0,0 +1,11 @@ ++lnetdir=$(includedir)/lnet ++ ++SUBDIRS := linux ++if DARWIN ++SUBDIRS += darwin ++endif ++DIST_SUBDIRS := linux darwin ++ ++EXTRA_DIST = api.h api-support.h \ ++ lib-lnet.h lib-types.h lnet.h lnetctl.h types.h \ ++ socklnd.h ptllnd.h ptllnd_wire.h lnetst.h lnet-sysctl.h +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lnet/klnds/socklnd/autoMakefile.am lustre/lnet/klnds/socklnd/autoMakefile.am +--- lustre~/lnet/klnds/socklnd/autoMakefile.am 2010-04-10 02:28:56.000000000 +0200 ++++ lustre/lnet/klnds/socklnd/autoMakefile.am 2010-05-05 11:35:37.533473974 +0200 +@@ -6,21 +6,21 @@ + endif # LINUX + endif # MODULES + +-if DARWIN +- +- macos_PROGRAMS := ksocklnd +- +- nodist_ksocklnd_SOURCES := socklnd.c socklnd_cb.c socklnd_proto.c socklnd_modparams.c socklnd_lib-darwin.c +- +- ksocklnd_CFLAGS := $(EXTRA_KCFLAGS) +- ksocklnd_LDFLAGS := $(EXTRA_KLDFLAGS) +- ksocklnd_LDADD := $(EXTRA_KLIBS) +- +- plist_DATA := Info.plist +- install_data_hook := fix-kext-ownership ++#if DARWIN ++# ++# macos_PROGRAMS := ksocklnd ++# ++# nodist_ksocklnd_SOURCES := socklnd.c socklnd_cb.c socklnd_proto.c socklnd_modparams.c socklnd_lib-darwin.c ++# ++# ksocklnd_CFLAGS := $(EXTRA_KCFLAGS) ++# ksocklnd_LDFLAGS := $(EXTRA_KLDFLAGS) ++# ksocklnd_LDADD := $(EXTRA_KLIBS) ++# ++# plist_DATA := Info.plist ++# install_data_hook := fix-kext-ownership + +- EXTRA_DIST := socklnd_lib-darwin.c socklnd_lib-darwin.h $(plist_DATA) +-endif # DARWIN ++# EXTRA_DIST := socklnd_lib-darwin.c socklnd_lib-darwin.h $(plist_DATA) ++#endif # DARWIN + + install-data-hook: $(install_data_hook) + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lnet/libcfs/autoMakefile.am lustre/lnet/libcfs/autoMakefile.am +--- lustre~/lnet/libcfs/autoMakefile.am 2010-05-05 11:24:03.000000000 +0200 ++++ lustre/lnet/libcfs/autoMakefile.am 2010-05-05 11:41:39.355057967 +0200 +@@ -35,10 +35,10 @@ + # + + SUBDIRS := linux +-if DARWIN +-SUBDIRS += darwin +-endif +-DIST_SUBDIRS := linux darwin ++#if DARWIN ++#SUBDIRS += darwin ++#endif ++DIST_SUBDIRS := $(SUBDIRS) + + if LIBLUSTRE + noinst_LIBRARIES= libcfs.a +@@ -53,25 +53,25 @@ + modulenet_DATA := libcfs$(KMODEXT) + endif + +-if DARWIN +-macos_PROGRAMS := libcfs +- +-nodist_libcfs_SOURCES := darwin/darwin-sync.c darwin/darwin-mem.c \ +- darwin/darwin-prim.c darwin/darwin-fs.c darwin/darwin-curproc.c \ +- darwin/darwin-tcpip.c darwin/darwin-utils.c \ +- darwin/darwin-debug.c darwin/darwin-proc.c \ +- darwin/darwin-tracefile.c darwin/darwin-module.c \ +- debug.c module.c tracefile.c nidstrings.c watchdog.c +- +-libcfs_CFLAGS := $(EXTRA_KCFLAGS) +-libcfs_LDFLAGS := $(EXTRA_KLDFLAGS) +-libcfs_LDADD := $(EXTRA_KLIBS) +- +-plist_DATA := Info.plist +- +-install_data_hook := fix-kext-ownership +- +-endif ++#if DARWIN ++#macos_PROGRAMS := libcfs ++# ++#nodist_libcfs_SOURCES := darwin/darwin-sync.c darwin/darwin-mem.c \ ++# darwin/darwin-prim.c darwin/darwin-fs.c darwin/darwin-curproc.c \ ++# darwin/darwin-tcpip.c darwin/darwin-utils.c \ ++# darwin/darwin-debug.c darwin/darwin-proc.c \ ++# darwin/darwin-tracefile.c darwin/darwin-module.c \ ++# debug.c module.c tracefile.c nidstrings.c watchdog.c ++# ++#libcfs_CFLAGS := $(EXTRA_KCFLAGS) ++#libcfs_LDFLAGS := $(EXTRA_KLDFLAGS) ++#libcfs_LDADD := $(EXTRA_KLIBS) ++# ++#plist_DATA := Info.plist ++# ++#install_data_hook := fix-kext-ownership ++# ++#endif + + endif + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lnet/lnet/autoMakefile.am lustre/lnet/lnet/autoMakefile.am +--- lustre~/lnet/lnet/autoMakefile.am 2010-04-10 02:28:56.000000000 +0200 ++++ lustre/lnet/lnet/autoMakefile.am 2010-05-05 11:35:37.533473974 +0200 +@@ -18,23 +18,23 @@ + modulenet_DATA = lnet$(KMODEXT) + endif # LINUX + +-if DARWIN +-macos_PROGRAMS := lnet +- +-lnet_SOURCES := api-errno.c api-ni.c config.c +-lnet_SOURCES += lib-me.c lib-msg.c lib-eq.c lib-md.c +-lnet_SOURCES += lib-move.c module.c lo.c router.c router_proc.c +-lnet_SOURCES += acceptor.c peer.c +- +-lnet_CFLAGS := $(EXTRA_KCFLAGS) +-lnet_LDFLAGS := $(EXTRA_KLDFLAGS) +-lnet_LDADD := $(EXTRA_KLIBS) +- +-plist_DATA := Info.plist +- +-install_data_hook := fix-kext-ownership +- +-endif # DARWIN ++#if DARWIN ++#macos_PROGRAMS := lnet ++# ++#lnet_SOURCES := api-errno.c api-ni.c config.c ++#lnet_SOURCES += lib-me.c lib-msg.c lib-eq.c lib-md.c ++#lnet_SOURCES += lib-move.c module.c lo.c router.c router_proc.c ++#lnet_SOURCES += acceptor.c peer.c ++# ++#lnet_CFLAGS := $(EXTRA_KCFLAGS) ++#lnet_LDFLAGS := $(EXTRA_KLDFLAGS) ++#lnet_LDADD := $(EXTRA_KLIBS) ++# ++#plist_DATA := Info.plist ++# ++#install_data_hook := fix-kext-ownership ++# ++#endif # DARWIN + + endif # MODULES + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/lov/autoMakefile.am lustre/lustre/lov/autoMakefile.am +--- lustre~/lustre/lov/autoMakefile.am 2010-04-10 02:28:57.000000000 +0200 ++++ lustre/lustre/lov/autoMakefile.am 2010-05-05 11:35:37.533473974 +0200 +@@ -46,29 +46,29 @@ + modulefs_DATA = lov$(KMODEXT) + endif + +-if DARWIN +-macos_PROGRAMS := lov ++#if DARWIN ++#macos_PROGRAMS := lov + +-lov_SOURCES := \ +- lov_log.c \ +- lov_pool.c \ +- lov_obd.c \ +- lov_pack.c \ +- lov_request.c \ +- lov_merge.c \ +- lov_qos.c \ +- lov_offset.c \ +- lov_internal.h ++#lov_SOURCES := \ ++# lov_log.c \ ++# lov_pool.c \ ++# lov_obd.c \ ++# lov_pack.c \ ++# lov_request.c \ ++# lov_merge.c \ ++# lov_qos.c \ ++# lov_offset.c \ ++# lov_internal.h + +-lov_CFLAGS := $(EXTRA_KCFLAGS) +-lov_LDFLAGS := $(EXTRA_KLDFLAGS) +-lov_LDADD := $(EXTRA_KLIBS) ++#lov_CFLAGS := $(EXTRA_KCFLAGS) ++#lov_LDFLAGS := $(EXTRA_KLDFLAGS) ++#lov_LDADD := $(EXTRA_KLIBS) + +-plist_DATA := Info.plist ++#plist_DATA := Info.plist + +-install_data_hook := fix-kext-ownership ++#install_data_hook := fix-kext-ownership + +-endif # DARWIN ++#endif # DARWIN + + endif # MODULES + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/lvfs/autoMakefile.am lustre/lustre/lvfs/autoMakefile.am +--- lustre~/lustre/lvfs/autoMakefile.am 2010-04-10 02:28:57.000000000 +0200 ++++ lustre/lustre/lvfs/autoMakefile.am 2010-05-05 11:35:37.533473974 +0200 +@@ -85,21 +85,21 @@ + + endif # LINUX + +-if DARWIN +- +-macos_PROGRAMS := lvfs +- +-lvfs_SOURCES := lvfs_darwin.c +- +-lvfs_CFLAGS := $(EXTRA_KCFLAGS) +-lvfs_LDFLAGS := $(EXTRA_KLDFLAGS) +-lvfs_LDADD := $(EXTRA_KLIBS) +- +-plist_DATA := Info.plist +- +-install_data_hook := fix-kext-ownership +- +-endif # DARWIN ++#if DARWIN ++# ++#macos_PROGRAMS := lvfs ++# ++#lvfs_SOURCES := lvfs_darwin.c ++# ++#lvfs_CFLAGS := $(EXTRA_KCFLAGS) ++#lvfs_LDFLAGS := $(EXTRA_KLDFLAGS) ++#lvfs_LDADD := $(EXTRA_KLIBS) ++# ++#plist_DATA := Info.plist ++# ++#install_data_hook := fix-kext-ownership ++# ++#endif # DARWIN + + else # MODULES + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/obdclass/autoMakefile.am lustre/lustre/obdclass/autoMakefile.am +--- lustre~/lustre/obdclass/autoMakefile.am 2010-05-05 11:24:04.000000000 +0200 ++++ lustre/lustre/obdclass/autoMakefile.am 2010-05-05 11:42:14.697472299 +0200 +@@ -1,8 +1,8 @@ + SUBDIRS := linux +-if DARWIN +-SUBDIRS += darwin +-endif +-DIST_SUBDIRS := linux darwin ++#if DARWIN ++#SUBDIRS += darwin ++#endif ++DIST_SUBDIRS := $(SUBDIRS) + + if LIBLUSTRE + +@@ -25,25 +25,25 @@ + noinst_DATA = llog_test$(KMODEXT) + endif # LINUX + +-if DARWIN +-macos_PROGRAMS := obdclass +- +-obdclass_SOURCES := \ +- darwin/darwin-module.c darwin/darwin-sysctl.c \ +- class_obd.c genops.c lprocfs_status.c \ +- lustre_handles.c lustre_peer.c obd_config.c \ +- obdo.c debug.c llog_ioctl.c uuid.c \ +- llog_swab.c llog_obd.c llog.c llog_cat.c llog_lvfs.c +- +-obdclass_CFLAGS := $(EXTRA_KCFLAGS) +-obdclass_LDFLAGS := $(EXTRA_KLDFLAGS) +-obdclass_LDADD := $(EXTRA_KLIBS) +- +-plist_DATA := Info.plist +- +-install_data_hook := fix-kext-ownership +- +-endif # DARWIN ++#if DARWIN ++#macos_PROGRAMS := obdclass ++# ++#obdclass_SOURCES := \ ++# darwin/darwin-module.c darwin/darwin-sysctl.c \ ++# class_obd.c genops.c lprocfs_status.c \ ++# lustre_handles.c lustre_peer.c obd_config.c \ ++# obdo.c debug.c llog_ioctl.c uuid.c \ ++# llog_swab.c llog_obd.c llog.c llog_cat.c llog_lvfs.c ++# ++#obdclass_CFLAGS := $(EXTRA_KCFLAGS) ++#obdclass_LDFLAGS := $(EXTRA_KLDFLAGS) ++#obdclass_LDADD := $(EXTRA_KLIBS) ++# ++#plist_DATA := Info.plist ++# ++#install_data_hook := fix-kext-ownership ++# ++#endif # DARWIN + + endif # MODULES + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/obdecho/autoMakefile.am lustre/lustre/obdecho/autoMakefile.am +--- lustre~/lustre/obdecho/autoMakefile.am 2010-01-11 04:29:50.000000000 +0100 ++++ lustre/lustre/obdecho/autoMakefile.am 2010-05-05 11:35:37.533473974 +0200 +@@ -46,22 +46,22 @@ + modulefs_DATA = obdecho$(KMODEXT) + endif + +-if DARWIN +-macos_PROGRAMS := obdecho +-obdecho_SOURCES := \ +- lproc_echo.c \ +- echo.c \ +- echo_client.c +- +-obdecho_CFLAGS := $(EXTRA_KCFLAGS) +-obdecho_LDFLAGS := $(EXTRA_KLDFLAGS) +-obdecho_LDADD := $(EXTRA_KLIBS) +- +-plist_DATA := Info.plist +- +-install_data_hook := fix-kext-ownership +- +-endif # darwin ++#if DARWIN ++#macos_PROGRAMS := obdecho ++#obdecho_SOURCES := \ ++# lproc_echo.c \ ++# echo.c \ ++# echo_client.c ++# ++#obdecho_CFLAGS := $(EXTRA_KCFLAGS) ++#obdecho_LDFLAGS := $(EXTRA_KLDFLAGS) ++#obdecho_LDADD := $(EXTRA_KLIBS) ++# ++#plist_DATA := Info.plist ++# ++#install_data_hook := fix-kext-ownership ++# ++#endif # darwin + + endif # MODULES + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/osc/autoMakefile.am lustre/lustre/osc/autoMakefile.am +--- lustre~/lustre/osc/autoMakefile.am 2010-04-10 02:28:57.000000000 +0200 ++++ lustre/lustre/osc/autoMakefile.am 2010-05-05 11:35:37.533473974 +0200 +@@ -47,22 +47,22 @@ + modulefs_DATA = osc$(KMODEXT) + endif + +-if DARWIN +-macos_PROGRAMS := osc +- +-osc_SOURCES := \ +- osc_create.c \ +- osc_request.c +- +-osc_CFLAGS := $(EXTRA_KCFLAGS) +-osc_LDFLAGS := $(EXTRA_KLDFLAGS) +-osc_LDADD := $(EXTRA_KLIBS) +- +-plist_DATA := Info.plist +- +-install_data_hook := fix-kext-ownership +- +-endif # Darwin ++#if DARWIN ++#macos_PROGRAMS := osc ++# ++#osc_SOURCES := \ ++# osc_create.c \ ++# osc_request.c ++# ++#osc_CFLAGS := $(EXTRA_KCFLAGS) ++#osc_LDFLAGS := $(EXTRA_KLDFLAGS) ++#osc_LDADD := $(EXTRA_KLIBS) ++# ++#plist_DATA := Info.plist ++# ++#install_data_hook := fix-kext-ownership ++# ++#endif # Darwin + + endif + +diff -urNad '--exclude=CVS' '--exclude=.svn' '--exclude=.git' '--exclude=.arch' '--exclude=.hg' '--exclude=_darcs' '--exclude=.bzr' lustre~/lustre/ptlrpc/autoMakefile.am lustre/lustre/ptlrpc/autoMakefile.am +--- lustre~/lustre/ptlrpc/autoMakefile.am 2010-04-10 02:28:57.000000000 +0200 ++++ lustre/lustre/ptlrpc/autoMakefile.am 2010-05-05 11:35:37.533473974 +0200 +@@ -68,39 +68,39 @@ + modulefs_DATA = ptlrpc$(KMODEXT) + endif #LINUX + +-if DARWIN +-macos_PROGRAMS := ptlrpc +- +-ptlrpc_SOURCES := \ +- ptlrpc_module.c \ +- client.c \ +- connection.c \ +- events.c \ +- import.c \ +- llog_client.c \ +- llog_net.c \ +- llog_server.c \ +- lproc_ptlrpc.c \ +- niobuf.c \ +- pack_generic.c \ +- pers.c \ +- pinger.c \ +- ptlrpcd.c \ +- recover.c \ +- recov_thread.c \ +- service.c \ +- wiretest.c \ +- $(LDLM_COMM_SOURCES) +- +-ptlrpc_CFLAGS := $(EXTRA_KCFLAGS) +-ptlrpc_LDFLAGS := $(EXTRA_KLDFLAGS) +-ptlrpc_LDADD := $(EXTRA_KLIBS) +- +-plist_DATA := Info.plist +- +-install_data_hook := fix-kext-ownership +- +-endif # DARWIN ++#if DARWIN ++#macos_PROGRAMS := ptlrpc ++# ++#ptlrpc_SOURCES := \ ++# ptlrpc_module.c \ ++# client.c \ ++# connection.c \ ++# events.c \ ++# import.c \ ++# llog_client.c \ ++# llog_net.c \ ++# llog_server.c \ ++# lproc_ptlrpc.c \ ++# niobuf.c \ ++# pack_generic.c \ ++# pers.c \ ++# pinger.c \ ++# ptlrpcd.c \ ++# recover.c \ ++# recov_thread.c \ ++# service.c \ ++# wiretest.c \ ++# $(LDLM_COMM_SOURCES) ++# ++#ptlrpc_CFLAGS := $(EXTRA_KCFLAGS) ++#ptlrpc_LDFLAGS := $(EXTRA_KLDFLAGS) ++#ptlrpc_LDADD := $(EXTRA_KLIBS) ++# ++#plist_DATA := Info.plist ++# ++#install_data_hook := fix-kext-ownership ++# ++#endif # DARWIN + + endif # MODULES + --- lustre-1.8.3.orig/debian/patches/enable-quota.dpatch +++ lustre-1.8.3/debian/patches/enable-quota.dpatch @@ -0,0 +1,28 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: --enable-quota check was only run when building modules. + +@DPATCH@ +diff -urNad lustre~/configure.ac lustre/configure.ac +--- lustre~/configure.ac 2009-03-12 10:32:27.000000000 +0100 ++++ lustre/configure.ac 2009-03-12 11:19:53.000000000 +0100 +@@ -8,6 +8,7 @@ + LB_CHECK_VERSION + + LC_CONFIG_SRCDIR ++LC_CONFIG_QUOTA + + AC_CANONICAL_SYSTEM + +diff -urNad lustre~/lustre/autoconf/lustre-core.m4 lustre/lustre/autoconf/lustre-core.m4 +--- lustre~/lustre/autoconf/lustre-core.m4 2009-03-12 11:19:52.000000000 +0100 ++++ lustre/lustre/autoconf/lustre-core.m4 2009-03-12 11:19:53.000000000 +0100 +@@ -1813,6 +1813,7 @@ + ]) + ]) + ++ + # + # LC_COOKIE_FOLLOW_LINK + # --- lustre-1.8.3.orig/debian/patches/inode-no-i_blksize-2.6.20.dpatch +++ lustre-1.8.3/debian/patches/inode-no-i_blksize-2.6.20.dpatch @@ -0,0 +1,41 @@ +#! /bin/sh /usr/share/dpatch/dpatch-run +## inode-no-i_blksize-2.6.20.patch by Goswin von Brederlow +## +## All lines beginning with `## DP:' are a description of the patch. +## DP: Patch from Q-Leap Networks + +@DPATCH@ +diff -urNad lustre-1.6.2~/lustre/mds/handler.c lustre-1.6.2/lustre/mds/handler.c +--- lustre-1.6.2~/lustre/mds/handler.c 2007-09-06 14:41:18.000000000 +0200 ++++ lustre-1.6.2/lustre/mds/handler.c 2007-09-06 14:47:31.185757912 +0200 +@@ -1191,6 +1191,7 @@ + struct lvfs_run_ctxt saved; + int rc, size[2] = { sizeof(struct ptlrpc_body), sizeof(*repbody) }; + struct lvfs_ucred uc = {NULL,}; ++ int blksize; + ENTRY; + + if (OBD_FAIL_CHECK(OBD_FAIL_MDS_READPAGE_PACK)) +@@ -1223,17 +1224,18 @@ + if (IS_ERR(file)) + GOTO(out_pop, rc = PTR_ERR(file)); + ++ blksize = de->d_inode->i_sb->s_blocksize; + /* body->size is actually the offset -eeb */ +- if ((body->size & (de->d_inode->i_sb->s_blocksize - 1)) != 0) { ++ if ((body->size & (blksize - 1)) != 0) { + CERROR("offset "LPU64" not on a block boundary of %lu\n", +- body->size, de->d_inode->i_sb->s_blocksize); ++ body->size, blksize); + GOTO(out_file, rc = -EFAULT); + } + + /* body->nlink is actually the #bytes to read -eeb */ +- if (body->nlink & (de->d_inode->i_sb->s_blocksize - 1)) { ++ if (body->nlink & (blksize - 1)) { + CERROR("size %u is not multiple of blocksize %lu\n", +- body->nlink, de->d_inode->i_sb->s_blocksize); ++ body->nlink, blksize); + GOTO(out_file, rc = -EFAULT); + } + --- lustre-1.8.3.orig/ldiskfs/kernel_patches/series/ldiskfs-2.6.18-debian.series +++ lustre-1.8.3/ldiskfs/kernel_patches/series/ldiskfs-2.6.18-debian.series @@ -0,0 +1,20 @@ +ext3-wantedi-2.6-rhel4.patch +iopen-2.6-fc5.patch +ext3-map_inode_page-2.6.18.patch +export-ext3-2.6-rhel4.patch +ext3-include-fixes-2.6-rhel4.patch +ext3-extents-2.6.18-vanilla.patch +ext3-mballoc3-core.patch +ext3-mballoc3-2.6.18.patch +ext3-nlinks-2.6.9.patch +ext3-ialloc-2.6.patch +ext3-remove-cond_resched-calls-2.6.12.patch +ext3-filterdata-sles10.patch +ext3-16tb-overflow-fixes.patch +ext3-uninit-2.6.18.patch +ext3-nanosecond-2.6.18-vanilla.patch +ext3-inode-version-2.6.18-vanilla.patch +ext3-ea-expand-lose-block.patch +ext3-mmp-2.6.18-vanilla.patch +ext3-fiemap-2.6.18-vanilla.patch +ext3-lookup-dotdot-2.6.9.patch