From owner-xfs@oss.sgi.com Tue Jul 1 00:57:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 00:57:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63, J_CHICKENPOX_65,J_CHICKENPOX_66 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m617vh7S003945 for ; Tue, 1 Jul 2008 00:57:45 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA23222 for ; Tue, 1 Jul 2008 17:58:44 +1000 Date: Tue, 01 Jul 2008 18:00:17 +1000 To: "xfs@oss.sgi.com" Subject: REVIEW: xfs_repair fixes for bad directories From: "Barry Naujok" Organization: SGI Content-Type: multipart/mixed; boundary=----------KBCi25FieZfzpyKYHMgMHb MIME-Version: 1.0 Message-ID: User-Agent: Opera Mail/9.50 (Win32) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16669 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs ------------KBCi25FieZfzpyKYHMgMHb Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 Content-Transfer-Encoding: 7bit Two issues have been encounted with xfs_repair and badly corrupted directories. 1. A huge size (inode di_size) can cause malloc which will fail. Patch dir_size_check.patch checks for a valid directory size and if it's bad, junks the directory. The di_size for a dir only counts the data blocks being used, not all the other associated metadata. This is limited to 32GB by the XFS_DIR2_LEAF_OFFSET value in XFS. Anything greater than this must be invalid. 2. An update a while ago to xfs_repair attempts to fix invalid ".." entries for subdirectories where there is a valid parent with the appropriate entry. It was a partial fix that never did the full job, especially if the subdirectory was short- form or it has already been processed. Patch fix_dir_rebuild_without_dotdot_entry.patch creates a post-processing queue after the main scan to update any directories with an invalid ".." entry. Both these patches sit on top of the dinode.patch that has been posted out for review previously. ------------KBCi25FieZfzpyKYHMgMHb Content-Disposition: attachment; filename=dinode.patch Content-Type: text/x-patch; name=dinode.patch Content-Transfer-Encoding: 7bit =========================================================================== xfsprogs/repair/dino_chunks.c =========================================================================== Index: ci/xfsprogs/repair/dino_chunks.c =================================================================== --- ci.orig/xfsprogs/repair/dino_chunks.c 2007-11-16 14:45:56.000000000 +1100 +++ ci/xfsprogs/repair/dino_chunks.c 2008-01-18 14:50:42.000000000 +1100 @@ -593,7 +593,6 @@ xfs_agino_t agino; xfs_agblock_t agbno; int dirty = 0; - int cleared = 0; int isa_dir = 0; int blks_per_cluster; int cluster_count; @@ -777,8 +776,7 @@ status = process_dinode(mp, dino, agno, agino, is_inode_free(ino_rec, irec_offset), - &ino_dirty, &cleared, &is_used, - ino_discovery, check_dups, + &ino_dirty, &is_used,ino_discovery, check_dups, extra_attr_check, &isa_dir, &parent); ASSERT(is_used != 3); Index: ci/xfsprogs/repair/dinode.c =================================================================== --- ci.orig/xfsprogs/repair/dinode.c 2007-11-16 14:45:56.000000000 +1100 +++ ci/xfsprogs/repair/dinode.c 2008-01-18 14:57:36.000000000 +1100 @@ -58,9 +58,6 @@ case XFS_DINODE_FMT_LOCAL: offset += INT_GET(dinoc->di_size, ARCH_CONVERT); break; - case XFS_DINODE_FMT_UUID: - offset += sizeof(uuid_t); - break; case XFS_DINODE_FMT_EXTENTS: offset += INT_GET(dinoc->di_nextents, ARCH_CONVERT) * sizeof(xfs_bmbt_rec_32_t); break; @@ -1563,8 +1560,11 @@ * bogus */ int -process_symlink(xfs_mount_t *mp, xfs_ino_t lino, xfs_dinode_t *dino, - blkmap_t *blkmap) +process_symlink( + xfs_mount_t *mp, + xfs_ino_t lino, + xfs_dinode_t *dino, + blkmap_t *blkmap) { xfs_dfsbno_t fsbno; xfs_dinode_core_t *dinoc = &dino->di_core; @@ -1673,8 +1673,7 @@ * called to process the set of misc inode special inode types * that have no associated data storage (fifos, pipes, devices, etc.). */ -/* ARGSUSED */ -int +static int process_misc_ino_types(xfs_mount_t *mp, xfs_dinode_t *dino, xfs_ino_t lino, @@ -1693,27 +1692,27 @@ /* * must also have a zero size */ - if (INT_GET(dino->di_core.di_size, ARCH_CONVERT) != 0) { + if (dino->di_core.di_size) { switch (type) { case XR_INO_CHRDEV: do_warn(_("size of character device inode %llu != 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; case XR_INO_BLKDEV: do_warn(_("size of block device inode %llu != 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; case XR_INO_SOCK: do_warn(_("size of socket inode %llu != 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; case XR_INO_FIFO: do_warn(_("size of fifo inode %llu != 0 " "(%lld bytes)\n"), lino, - INT_GET(dino->di_core.di_size, ARCH_CONVERT)); + be64_to_cpu(dino->di_core.di_size)); break; default: do_warn(_("Internal error - process_misc_ino_types, " @@ -1769,712 +1768,395 @@ return (0); } -/* - * returns 0 if the inode is ok, 1 if the inode is corrupt - * check_dups can be set to 1 *only* when called by the - * first pass of the duplicate block checking of phase 4. - * *dirty is set > 0 if the dinode has been altered and - * needs to be written out. - * - * for detailed, info, look at process_dinode() comments. - */ -/* ARGSUSED */ -int -process_dinode_int(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino, - int was_free, /* 1 if inode is currently free */ - int *dirty, /* out == > 0 if inode is now dirty */ - int *cleared, /* out == 1 if inode was cleared */ - int *used, /* out == 1 if inode is in use */ - int verify_mode, /* 1 == verify but don't modify inode */ - int uncertain, /* 1 == inode is uncertain */ - int ino_discovery, /* 1 == check dirs for unknown inodes */ - int check_dups, /* 1 == check if inode claims - * duplicate blocks */ - int extra_attr_check, /* 1 == do attribute format and value checks */ - int *isa_dir, /* out == 1 if inode is a directory */ - xfs_ino_t *parent) /* out -- parent if ino is a dir */ +static inline int +dinode_fmt( + xfs_dinode_core_t *dinoc) { - xfs_drfsbno_t totblocks = 0; - xfs_drfsbno_t atotblocks = 0; - xfs_dinode_core_t *dinoc; - char *rstring; - int type; - int rtype; - int do_rt; - int err; - int retval = 0; - __uint64_t nextents; - __uint64_t anextents; - xfs_ino_t lino; - const int is_free = 0; - const int is_used = 1; - int repair = 0; - blkmap_t *ablkmap = NULL; - blkmap_t *dblkmap = NULL; - static char okfmts[] = { - 0, /* free inode */ - 1 << XFS_DINODE_FMT_DEV, /* FIFO */ - 1 << XFS_DINODE_FMT_DEV, /* CHR */ - 0, /* type 3 unused */ - (1 << XFS_DINODE_FMT_LOCAL) | - (1 << XFS_DINODE_FMT_EXTENTS) | - (1 << XFS_DINODE_FMT_BTREE), /* DIR */ - 0, /* type 5 unused */ - 1 << XFS_DINODE_FMT_DEV, /* BLK */ - 0, /* type 7 unused */ - (1 << XFS_DINODE_FMT_EXTENTS) | - (1 << XFS_DINODE_FMT_BTREE), /* REG */ - 0, /* type 9 unused */ - (1 << XFS_DINODE_FMT_LOCAL) | - (1 << XFS_DINODE_FMT_EXTENTS), /* LNK */ - 0, /* type 11 unused */ - 1 << XFS_DINODE_FMT_DEV, /* SOCK */ - 0, /* type 13 unused */ - 1 << XFS_DINODE_FMT_UUID, /* MNT */ - 0 /* type 15 unused */ - }; - - retval = 0; - totblocks = atotblocks = 0; - *dirty = *isa_dir = *cleared = 0; - *used = is_used; - type = rtype = XR_INO_UNKNOWN; - rstring = NULL; - do_rt = 0; + return be16_to_cpu(dinoc->di_mode) & S_IFMT; +} - dinoc = &dino->di_core; - lino = XFS_AGINO_TO_INO(mp, agno, ino); +static inline void +change_dinode_fmt( + xfs_dinode_core_t *dinoc, + int new_fmt) +{ + int mode = be16_to_cpu(dinoc->di_mode); - /* - * if in verify mode, don't modify the inode. - * - * if correcting, reset stuff that has known values - * - * if in uncertain mode, be silent on errors since we're - * trying to find out if these are inodes as opposed - * to assuming that they are. Just return the appropriate - * return code in that case. - */ + ASSERT((new_fmt & ~S_IFMT) == 0); - if (INT_GET(dinoc->di_magic, ARCH_CONVERT) != XFS_DINODE_MAGIC) { - retval++; - if (!verify_mode) { - do_warn(_("bad magic number 0x%x on inode %llu, "), - INT_GET(dinoc->di_magic, ARCH_CONVERT), lino); + mode &= ~S_IFMT; + mode |= new_fmt; + dinoc->di_mode = cpu_to_be16(mode); +} + +static int +check_dinode_mode_format( + xfs_dinode_core_t *dinoc) +{ + if ((uchar_t)dinoc->di_format >= XFS_DINODE_FMT_UUID) + return -1; /* FMT_UUID is not used */ + + switch (dinode_fmt(dinoc)) { + case S_IFIFO: + case S_IFCHR: + case S_IFBLK: + case S_IFSOCK: + return (dinoc->di_format != XFS_DINODE_FMT_DEV) ? -1 : 0; + + case S_IFDIR: + return (dinoc->di_format < XFS_DINODE_FMT_LOCAL || + dinoc->di_format > XFS_DINODE_FMT_BTREE) ? -1 : 0; + + case S_IFREG: + return (dinoc->di_format < XFS_DINODE_FMT_EXTENTS || + dinoc->di_format > XFS_DINODE_FMT_BTREE) ? -1 : 0; + + case S_IFLNK: + return (dinoc->di_format < XFS_DINODE_FMT_LOCAL || + dinoc->di_format > XFS_DINODE_FMT_EXTENTS) ? -1 : 0; + + default: ; + } + return 0; /* invalid modes are checked elsewhere */ +} + +/* + * If inode is a superblock inode, does type check to make sure is it valid. + * Returns 0 if it's valid, non-zero if it needs to be cleared. + */ + +static int +process_check_sb_inodes( + xfs_mount_t *mp, + xfs_dinode_core_t *dinoc, + xfs_ino_t lino, + int *type, + int *dirty) +{ + if (lino == mp->m_sb.sb_rootino) { + if (*type != XR_INO_DIR) { + do_warn(_("root inode %llu has bad type 0x%x\n"), + lino, dinode_fmt(dinoc)); + *type = XR_INO_DIR; if (!no_modify) { - do_warn(_("resetting magic number\n")); + do_warn(_("resetting to directory\n")); + change_dinode_fmt(dinoc, S_IFDIR); *dirty = 1; - INT_SET(dinoc->di_magic, ARCH_CONVERT, - XFS_DINODE_MAGIC); - } else { - do_warn(_("would reset magic number\n")); - } - } else if (!uncertain) { - do_warn(_("bad magic number 0x%x on inode %llu\n"), - INT_GET(dinoc->di_magic, ARCH_CONVERT), lino); + } else + do_warn(_("would reset to directory\n")); } + return 0; } - - if (!XFS_DINODE_GOOD_VERSION(dinoc->di_version) || - (!fs_inode_nlink && dinoc->di_version > XFS_DINODE_VERSION_1)) { - retval++; - if (!verify_mode) { - do_warn(_("bad version number 0x%x on inode %llu, "), - dinoc->di_version, lino); + if (lino == mp->m_sb.sb_uquotino) { + if (*type != XR_INO_DATA) { + do_warn(_("user quota inode %llu has bad type 0x%x\n"), + lino, dinode_fmt(dinoc)); + mp->m_sb.sb_uquotino = NULLFSINO; + return 1; + } + return 0; + } + if (lino == mp->m_sb.sb_gquotino) { + if (*type != XR_INO_DATA) { + do_warn(_("group quota inode %llu has bad type 0x%x\n"), + lino, dinode_fmt(dinoc)); + mp->m_sb.sb_gquotino = NULLFSINO; + return 1; + } + return 0; + } + if (lino == mp->m_sb.sb_rsumino) { + if (*type != XR_INO_RTSUM) { + do_warn(_("realtime summary inode %llu has bad type 0x%x, "), + lino, dinode_fmt(dinoc)); if (!no_modify) { - do_warn(_("resetting version number\n")); + do_warn(_("resetting to regular file\n")); + change_dinode_fmt(dinoc, S_IFREG); *dirty = 1; - dinoc->di_version = (fs_inode_nlink) ? - XFS_DINODE_VERSION_2 : - XFS_DINODE_VERSION_1; } else { - do_warn(_("would reset version number\n")); + do_warn(_("would reset to regular file\n")); } - } else if (!uncertain) { - do_warn(_("bad version number 0x%x on inode %llu\n"), - dinoc->di_version, lino); } + if (mp->m_sb.sb_rblocks == 0 && dinoc->di_nextents != 0) { + do_warn(_("bad # of extents (%u) for realtime summary inode %llu\n"), + be32_to_cpu(dinoc->di_nextents), lino); + return 1; + } + return 0; } - - /* - * blow out of here if the inode size is < 0 - */ - if (INT_GET(dinoc->di_size, ARCH_CONVERT) < 0) { - retval++; - if (!verify_mode) { - do_warn(_("bad (negative) size %lld on inode %llu\n"), - INT_GET(dinoc->di_size, ARCH_CONVERT), lino); + if (lino == mp->m_sb.sb_rbmino) { + if (*type != XR_INO_RTBITMAP) { + do_warn(_("realtime bitmap inode %llu has bad type 0x%x, "), + lino, dinode_fmt(dinoc)); if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - *cleared = 1; - } else { + do_warn(_("resetting to regular file\n")); + change_dinode_fmt(dinoc, S_IFREG); *dirty = 1; - *cleared = 1; + } else { + do_warn(_("would reset to regular file\n")); } - *used = is_free; - } else if (!uncertain) { - do_warn(_("bad (negative) size %lld on inode %llu\n"), - INT_GET(dinoc->di_size, ARCH_CONVERT), lino); } - - return(1); - } - - /* - * was_free value is not meaningful if we're in verify mode - */ - if (!verify_mode && INT_GET(dinoc->di_mode, ARCH_CONVERT) == 0 && was_free == 1) { - /* - * easy case, inode free -- inode and map agree, clear - * it just in case to ensure that format, etc. are - * set correctly - */ - if (!no_modify) { - err = clear_dinode(mp, dino, lino); - if (err) { - *dirty = 1; - *cleared = 1; - } + if (mp->m_sb.sb_rblocks == 0 && dinoc->di_nextents != 0) { + do_warn(_("bad # of extents (%u) for realtime bitmap inode %llu\n"), + be32_to_cpu(dinoc->di_nextents), lino); + return 1; } - *used = is_free; - return(0); - } else if (!verify_mode && INT_GET(dinoc->di_mode, ARCH_CONVERT) == 0 && was_free == 0) { - /* - * the inode looks free but the map says it's in use. - * clear the inode just to be safe and mark the inode - * free. - */ - do_warn(_("imap claims a free inode %llu is in use, "), lino); + return 0; + } + return 0; +} - if (!no_modify) { - do_warn(_("correcting imap and clearing inode\n")); +/* + * general size/consistency checks: + * + * if the size <= size of the data fork, directories must be + * local inodes unlike regular files which would be extent inodes. + * all the other mentioned types have to have a zero size value. + * + * if the size and format don't match, get out now rather than + * risk trying to process a non-existent extents or btree + * type data fork. + */ +static int +process_check_inode_sizes( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_ino_t lino, + int type) +{ + xfs_dinode_core_t *dinoc = &dino->di_core; + xfs_fsize_t size = be64_to_cpu(dinoc->di_size); - err = clear_dinode(mp, dino, lino); - if (err) { - retval++; - *dirty = 1; - *cleared = 1; - } - } else { - do_warn(_("would correct imap and clear inode\n")); + switch (type) { - *dirty = 1; - *cleared = 1; + case XR_INO_DIR: + if (size <= XFS_DFORK_DSIZE(dino, mp) && + dinoc->di_format != XFS_DINODE_FMT_LOCAL) { + do_warn(_("mismatch between format (%d) and size " + "(%lld) in directory ino %llu\n"), + dinoc->di_format, size, lino); + return 1; } + break; - *used = is_free; - - return(retval > 0 ? 1 : 0); - } - - /* - * because of the lack of any write ordering guarantee, it's - * possible that the core got updated but the forks didn't. - * so rather than be ambitious (and probably incorrect), - * if there's an inconsistency, we get conservative and - * just pitch the file. blow off checking formats of - * free inodes since technically any format is legal - * as we reset the inode when we re-use it. - */ - if (INT_GET(dinoc->di_mode, ARCH_CONVERT) != 0 && - ((((INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12) > 15) || - (uchar_t) dinoc->di_format > XFS_DINODE_FMT_UUID || - (!(okfmts[(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) >> 12] & - (1 << dinoc->di_format))))) { - /* bad inode format */ - retval++; - if (!uncertain) - do_warn(_("bad inode format in inode %llu\n"), lino); - if (!verify_mode) { - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } + case XR_INO_SYMLINK: + if (process_symlink_extlist(mp, lino, dino)) { + do_warn(_("bad data fork in symlink %llu\n"), lino); + return 1; } - *cleared = 1; - *used = is_free; - - return(retval > 0 ? 1 : 0); - } - - if (verify_mode) - return(retval > 0 ? 1 : 0); - - /* - * clear the next unlinked field if necessary on a good - * inode only during phase 4 -- when checking for inodes - * referencing duplicate blocks. then it's safe because - * we've done the inode discovery and have found all the inodes - * we're going to find. check_dups is set to 1 only during - * phase 4. Ugly. - */ - if (check_dups && !no_modify) - *dirty += clear_dinode_unlinked(mp, dino); - - /* set type and map type info */ + break; - switch (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT) { - case S_IFDIR: - type = XR_INO_DIR; - *isa_dir = 1; + case XR_INO_CHRDEV: /* fall through to FIFO case ... */ + case XR_INO_BLKDEV: /* fall through to FIFO case ... */ + case XR_INO_SOCK: /* fall through to FIFO case ... */ + case XR_INO_MOUNTPOINT: /* fall through to FIFO case ... */ + case XR_INO_FIFO: + if (process_misc_ino_types(mp, dino, lino, type)) + return 1; break; - case S_IFREG: - if (INT_GET(dinoc->di_flags, ARCH_CONVERT) & XFS_DIFLAG_REALTIME) - type = XR_INO_RTDATA; - else if (lino == mp->m_sb.sb_rbmino) - type = XR_INO_RTBITMAP; - else if (lino == mp->m_sb.sb_rsumino) - type = XR_INO_RTSUM; - else - type = XR_INO_DATA; + + case XR_INO_RTDATA: + /* + * if we have no realtime blocks, any inode claiming + * to be a real-time file is bogus + */ + if (mp->m_sb.sb_rblocks == 0) { + do_warn(_("found inode %llu claiming to be a " + "real-time file\n"), lino); + return 1; + } break; - case S_IFLNK: - type = XR_INO_SYMLINK; + + case XR_INO_RTBITMAP: + if (size != (__int64_t)mp->m_sb.sb_rbmblocks * + mp->m_sb.sb_blocksize) { + do_warn(_("realtime bitmap inode %llu has bad size " + "%lld (should be %lld)\n"), + lino, size, (__int64_t) mp->m_sb.sb_rbmblocks * + mp->m_sb.sb_blocksize); + return 1; + } break; - case S_IFCHR: - type = XR_INO_CHRDEV; + + case XR_INO_RTSUM: + if (size != mp->m_rsumsize) { + do_warn(_("realtime summary inode %llu has bad size " + "%lld (should be %d)\n"), + lino, size, mp->m_rsumsize); + return 1; + } break; - case S_IFBLK: - type = XR_INO_BLKDEV; + + default: break; - case S_IFSOCK: - type = XR_INO_SOCK; + } + return 0; +} + +/* + * check for illegal values of forkoff + */ +static int +process_check_inode_forkoff( + xfs_mount_t *mp, + xfs_dinode_core_t *dinoc, + xfs_ino_t lino) +{ + if (dinoc->di_forkoff == 0) + return 0; + + switch (dinoc->di_format) { + case XFS_DINODE_FMT_DEV: + if (dinoc->di_forkoff != (roundup(sizeof(xfs_dev_t), 8) >> 3)) { + do_warn(_("bad attr fork offset %d in dev inode %llu, " + "should be %d\n"), dinoc->di_forkoff, lino, + (int)(roundup(sizeof(xfs_dev_t), 8) >> 3)); + return 1; + } break; - case S_IFIFO: - type = XR_INO_FIFO; + case XFS_DINODE_FMT_LOCAL: /* fall through ... */ + case XFS_DINODE_FMT_EXTENTS: /* fall through ... */ + case XFS_DINODE_FMT_BTREE: + if (dinoc->di_forkoff >= (XFS_LITINO(mp) >> 3)) { + do_warn(_("bad attr fork offset %d in inode %llu, " + "max=%d\n"), dinoc->di_forkoff, lino, + XFS_LITINO(mp) >> 3); + return 1; + } break; default: - retval++; - if (!verify_mode) { - do_warn(_("bad inode type %#o inode %llu\n"), - (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); - if (!no_modify) - *dirty += clear_dinode(mp, dino, lino); - else - *dirty = 1; - *cleared = 1; - *used = is_free; - } else if (!uncertain) { - do_warn(_("bad inode type %#o inode %llu\n"), - (int) (INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT), lino); - } - return 1; + do_error(_("unexpected inode format %d\n"), dinoc->di_format); + break; } + return 0; +} - /* - * type checks for root, realtime inodes, and quota inodes - */ - if (lino == mp->m_sb.sb_rootino && type != XR_INO_DIR) { - do_warn(_("bad inode type for root inode %llu, "), lino); - type = XR_INO_DIR; - +/* + * Updates the inodes block and extent counts if they are wrong + */ +static int +process_inode_blocks_and_extents( + xfs_dinode_core_t *dinoc, + xfs_drfsbno_t nblocks, + __uint64_t nextents, + __uint64_t anextents, + xfs_ino_t lino, + int *dirty) +{ + if (nblocks != be64_to_cpu(dinoc->di_nblocks)) { if (!no_modify) { - do_warn(_("resetting to directory\n")); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT)); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFDIR); + do_warn(_("correcting nblocks for inode %llu, " + "was %llu - counted %llu\n"), lino, + be64_to_cpu(dinoc->di_nblocks), nblocks); + dinoc->di_nblocks = cpu_to_be64(nblocks); + *dirty = 1; } else { - do_warn(_("would reset to directory\n")); + do_warn(_("bad nblocks %llu for inode %llu, " + "would reset to %llu\n"), + be64_to_cpu(dinoc->di_nblocks), lino, nblocks); } - } else if (lino == mp->m_sb.sb_rsumino) { - do_rt = 1; - rstring = _("summary"); - rtype = XR_INO_RTSUM; - } else if (lino == mp->m_sb.sb_rbmino) { - do_rt = 1; - rstring = _("bitmap"); - rtype = XR_INO_RTBITMAP; - } else if (lino == mp->m_sb.sb_uquotino) { - if (type != XR_INO_DATA) { - do_warn(_("user quota inode has bad type 0x%x\n"), - INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT); + } - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - mp->m_sb.sb_uquotino = NULLFSINO; - - return(1); - } - } else if (lino == mp->m_sb.sb_gquotino) { - if (type != XR_INO_DATA) { - do_warn(_("group quota inode has bad type 0x%x\n"), - INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT); - - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - mp->m_sb.sb_gquotino = NULLFSINO; - - return(1); - } + if (nextents > MAXEXTNUM) { + do_warn(_("too many data fork extents (%llu) in inode %llu\n"), + nextents, lino); + return 1; } - - if (do_rt && type != rtype) { - type = XR_INO_DATA; - - do_warn(_("bad inode type for realtime %s inode %llu, "), - rstring, lino); - + if (nextents != be32_to_cpu(dinoc->di_nextents)) { if (!no_modify) { - do_warn(_("resetting to regular file\n")); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - &= ~(INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFMT)); - INT_MOD_EXPR(dinoc->di_mode, ARCH_CONVERT, - |= INT_GET(dinoc->di_mode, ARCH_CONVERT) & S_IFREG); + do_warn(_("correcting nextents for inode %llu, " + "was %d - counted %llu\n"), lino, + be32_to_cpu(dinoc->di_nextents), nextents); + dinoc->di_nextents = cpu_to_be32(nextents); + *dirty = 1; } else { - do_warn(_("would reset to regular file\n")); - } - } - - /* - * only regular files with REALTIME or EXTSIZE flags set can have - * extsize set, or directories with EXTSZINHERIT. - */ - if (INT_GET(dinoc->di_extsize, ARCH_CONVERT) != 0) { - if ((type == XR_INO_RTDATA) || - (type == XR_INO_DIR && - (INT_GET(dinoc->di_flags, ARCH_CONVERT) & - XFS_DIFLAG_EXTSZINHERIT)) || - (type == XR_INO_DATA && - (INT_GET(dinoc->di_flags, ARCH_CONVERT) & - XFS_DIFLAG_EXTSIZE))) { - /* s'okay */ ; - } else { - do_warn( - _("bad non-zero extent size %u for non-realtime/extsize inode %llu, "), - INT_GET(dinoc->di_extsize, ARCH_CONVERT), lino); - - if (!no_modify) { - do_warn(_("resetting to zero\n")); - dinoc->di_extsize = 0; - *dirty = 1; - } else { - do_warn(_("would reset to zero\n")); - } + do_warn(_("bad nextents %d for inode %llu, would reset " + "to %llu\n"), be32_to_cpu(dinoc->di_nextents), + lino, nextents); } } - /* - * for realtime inodes, check sizes to see that - * they are consistent with the # of realtime blocks. - * also, verify that they contain only one extent and - * are extent format files. If anything's wrong, clear - * the inode -- we'll recreate it in phase 6. - */ - if (do_rt && - ((lino == mp->m_sb.sb_rbmino && - INT_GET(dinoc->di_size, ARCH_CONVERT) - != mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize) || - (lino == mp->m_sb.sb_rsumino && - INT_GET(dinoc->di_size, ARCH_CONVERT) != mp->m_rsumsize))) { - - do_warn(_("bad size %llu for realtime %s inode %llu\n"), - INT_GET(dinoc->di_size, ARCH_CONVERT), rstring, lino); - - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); + if (anextents > MAXAEXTNUM) { + do_warn(_("too many attr fork extents (%llu) in inode %llu\n"), + anextents, lino); + return 1; } - - if (do_rt && mp->m_sb.sb_rblocks == 0 && INT_GET(dinoc->di_nextents, ARCH_CONVERT) != 0) { - do_warn(_("bad # of extents (%u) for realtime %s inode %llu\n"), - INT_GET(dinoc->di_nextents, ARCH_CONVERT), rstring, lino); - + if (anextents != be16_to_cpu(dinoc->di_anextents)) { if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - - /* - * Setup nextents and anextents for blkmap_alloc calls. - */ - nextents = INT_GET(dinoc->di_nextents, ARCH_CONVERT); - if (nextents > INT_GET(dinoc->di_nblocks, ARCH_CONVERT) || nextents > XFS_MAX_INCORE_EXTENTS) - nextents = 1; - anextents = INT_GET(dinoc->di_anextents, ARCH_CONVERT); - if (anextents > INT_GET(dinoc->di_nblocks, ARCH_CONVERT) || anextents > XFS_MAX_INCORE_EXTENTS) - anextents = 1; - - /* - * general size/consistency checks: - * - * if the size <= size of the data fork, directories must be - * local inodes unlike regular files which would be extent inodes. - * all the other mentioned types have to have a zero size value. - * - * if the size and format don't match, get out now rather than - * risk trying to process a non-existent extents or btree - * type data fork. - */ - switch (type) { - case XR_INO_DIR: - if (INT_GET(dinoc->di_size, ARCH_CONVERT) <= - XFS_DFORK_DSIZE(dino, mp) && - (dinoc->di_format != XFS_DINODE_FMT_LOCAL)) { - do_warn( -_("mismatch between format (%d) and size (%lld) in directory ino %llu\n"), - dinoc->di_format, - INT_GET(dinoc->di_size, ARCH_CONVERT), - lino); - - if (!no_modify) { - *dirty += clear_dinode(mp, - dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - if (dinoc->di_format != XFS_DINODE_FMT_LOCAL) - dblkmap = blkmap_alloc(nextents); - break; - case XR_INO_SYMLINK: - if (process_symlink_extlist(mp, lino, dino)) { - do_warn(_("bad data fork in symlink %llu\n"), lino); - - if (!no_modify) { - *dirty += clear_dinode(mp, - dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - if (dinoc->di_format != XFS_DINODE_FMT_LOCAL) - dblkmap = blkmap_alloc(nextents); - break; - case XR_INO_CHRDEV: /* fall through to FIFO case ... */ - case XR_INO_BLKDEV: /* fall through to FIFO case ... */ - case XR_INO_SOCK: /* fall through to FIFO case ... */ - case XR_INO_MOUNTPOINT: /* fall through to FIFO case ... */ - case XR_INO_FIFO: - if (process_misc_ino_types(mp, dino, lino, type)) { - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - break; - case XR_INO_RTDATA: - /* - * if we have no realtime blocks, any inode claiming - * to be a real-time file is bogus - */ - if (mp->m_sb.sb_rblocks == 0) { - do_warn( - _("found inode %llu claiming to be a real-time file\n"), - lino); - - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - break; - case XR_INO_RTBITMAP: - if (INT_GET(dinoc->di_size, ARCH_CONVERT) != - (__int64_t)mp->m_sb.sb_rbmblocks * mp->m_sb.sb_blocksize) { - do_warn( - _("realtime bitmap inode %llu has bad size %lld (should be %lld)\n"), - lino, INT_GET(dinoc->di_size, ARCH_CONVERT), - (__int64_t) mp->m_sb.sb_rbmblocks * - mp->m_sb.sb_blocksize); - - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - dblkmap = blkmap_alloc(nextents); - break; - case XR_INO_RTSUM: - if (INT_GET(dinoc->di_size, ARCH_CONVERT) != mp->m_rsumsize) { - do_warn( - _("realtime summary inode %llu has bad size %lld (should be %d)\n"), - lino, INT_GET(dinoc->di_size, ARCH_CONVERT), - mp->m_rsumsize); - - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - dblkmap = blkmap_alloc(nextents); - break; - default: - break; - } - - /* - * check for illegal values of forkoff - */ - err = 0; - if (dinoc->di_forkoff != 0) { - switch (dinoc->di_format) { - case XFS_DINODE_FMT_DEV: - if (dinoc->di_forkoff != - (roundup(sizeof(xfs_dev_t), 8) >> 3)) { - do_warn( - _("bad attr fork offset %d in dev inode %llu, should be %d\n"), - (int) dinoc->di_forkoff, - lino, - (int) (roundup(sizeof(xfs_dev_t), 8) >> 3)); - err = 1; - } - break; - case XFS_DINODE_FMT_UUID: - if (dinoc->di_forkoff != - (roundup(sizeof(uuid_t), 8) >> 3)) { - do_warn( - _("bad attr fork offset %d in uuid inode %llu, should be %d\n"), - (int) dinoc->di_forkoff, - lino, - (int)(roundup(sizeof(uuid_t), 8) >> 3)); - err = 1; - } - break; - case XFS_DINODE_FMT_LOCAL: /* fall through ... */ - case XFS_DINODE_FMT_EXTENTS: /* fall through ... */ - case XFS_DINODE_FMT_BTREE: { - if (dinoc->di_forkoff >= (XFS_LITINO(mp) >> 3)) { - do_warn( - _("bad attr fork offset %d in inode %llu, max=%d\n"), - (int) dinoc->di_forkoff, - lino, XFS_LITINO(mp) >> 3); - err = 1; - } - break; - } - default: - do_error(_("unexpected inode format %d\n"), - (int) dinoc->di_format); - break; + do_warn(_("correcting anextents for inode %llu, " + "was %d - counted %llu\n"), lino, + be16_to_cpu(dinoc->di_anextents), anextents); + dinoc->di_anextents = cpu_to_be16(anextents); + *dirty = 1; + } else { + do_warn(_("bad anextents %d for inode %llu, would reset" + " to %llu\n"), be16_to_cpu(dinoc->di_anextents), + lino, anextents); } } + return 0; +} - if (err) { - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } +/* + * check data fork -- if it's bad, clear the inode + */ +static int +process_inode_data_fork( + xfs_mount_t *mp, + xfs_agnumber_t agno, + xfs_agino_t ino, + xfs_dinode_t *dino, + int type, + int *dirty, + xfs_drfsbno_t *totblocks, + __uint64_t *nextents, + blkmap_t **dblkmap, + int check_dups) +{ + xfs_dinode_core_t *dinoc = &dino->di_core; + xfs_ino_t lino = XFS_AGINO_TO_INO(mp, agno, ino); + int err = 0; - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); - return(1); - } + *nextents = be32_to_cpu(dinoc->di_nextents); + if (*nextents > be64_to_cpu(dinoc->di_nblocks) || + *nextents > XFS_MAX_INCORE_EXTENTS) + *nextents = 1; + + if (dinoc->di_format != XFS_DINODE_FMT_LOCAL && type != XR_INO_RTDATA) + *dblkmap = blkmap_alloc(*nextents); + *nextents = 0; - /* - * check data fork -- if it's bad, clear the inode - */ - nextents = 0; switch (dinoc->di_format) { case XFS_DINODE_FMT_LOCAL: - err = process_lclinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, - XFS_DATA_FORK, check_dups); + err = process_lclinode(mp, agno, ino, dino, type, dirty, + totblocks, nextents, dblkmap, XFS_DATA_FORK, + check_dups); break; case XFS_DINODE_FMT_EXTENTS: - err = process_exinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, - XFS_DATA_FORK, check_dups); + err = process_exinode(mp, agno, ino, dino, type, dirty, + totblocks, nextents, dblkmap, XFS_DATA_FORK, + check_dups); break; case XFS_DINODE_FMT_BTREE: - err = process_btinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, - XFS_DATA_FORK, check_dups); + err = process_btinode(mp, agno, ino, dino, type, dirty, + totblocks, nextents, dblkmap, XFS_DATA_FORK, + check_dups); break; case XFS_DINODE_FMT_DEV: /* fall through */ - case XFS_DINODE_FMT_UUID: err = 0; break; default: do_error(_("unknown format %d, ino %llu (mode = %d)\n"), - dinoc->di_format, lino, - INT_GET(dinoc->di_mode, ARCH_CONVERT)); + dinoc->di_format, lino, be16_to_cpu(dinoc->di_mode)); } if (err) { - /* - * problem in the data fork, clear out the inode - * and get out - */ do_warn(_("bad data fork in inode %llu\n"), lino); - if (!no_modify) { *dirty += clear_dinode(mp, dino, lino); ASSERT(*dirty > 0); } - - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); - return(1); + return 1; } if (check_dups) { @@ -2486,465 +2168,635 @@ switch (dinoc->di_format) { case XFS_DINODE_FMT_LOCAL: err = process_lclinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, + dirty, totblocks, nextents, dblkmap, XFS_DATA_FORK, 0); break; case XFS_DINODE_FMT_EXTENTS: err = process_exinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, + dirty, totblocks, nextents, dblkmap, XFS_DATA_FORK, 0); break; case XFS_DINODE_FMT_BTREE: err = process_btinode(mp, agno, ino, dino, type, - dirty, &totblocks, &nextents, &dblkmap, + dirty, totblocks, nextents, dblkmap, XFS_DATA_FORK, 0); break; case XFS_DINODE_FMT_DEV: /* fall through */ - case XFS_DINODE_FMT_UUID: err = 0; break; default: do_error(_("unknown format %d, ino %llu (mode = %d)\n"), dinoc->di_format, lino, - INT_GET(dinoc->di_mode, ARCH_CONVERT)); + be16_to_cpu(dinoc->di_mode)); } - if (no_modify && err != 0) { - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); - return(1); - } + if (no_modify && err != 0) + return 1; ASSERT(err == 0); } + return 0; +} - /* - * check attribute fork if necessary. attributes are - * always stored in the regular filesystem. - */ +/* + * Process extended attribute fork in inode + */ +static int +process_inode_attr_fork( + xfs_mount_t *mp, + xfs_agnumber_t agno, + xfs_agino_t ino, + xfs_dinode_t *dino, + int type, + int *dirty, + xfs_drfsbno_t *atotblocks, + __uint64_t *anextents, + int check_dups, + int extra_attr_check, + int *retval) +{ + xfs_dinode_core_t *dinoc = &dino->di_core; + xfs_ino_t lino = XFS_AGINO_TO_INO(mp, agno, ino); + blkmap_t *ablkmap = NULL; + int repair = 0; + int err; + + if (!XFS_DFORK_Q(dino)) { + *anextents = 0; + if (dinoc->di_aformat != XFS_DINODE_FMT_EXTENTS) { + do_warn(_("bad attribute format %d in inode %llu, "), + dinoc->di_aformat, lino); + if (!no_modify) { + do_warn(_("resetting value\n")); + dinoc->di_aformat = XFS_DINODE_FMT_EXTENTS; + *dirty = 1; + } else + do_warn(_("would reset value\n")); + } + return 0; + } - if (!XFS_DFORK_Q(dino) && - dinoc->di_aformat != XFS_DINODE_FMT_EXTENTS) { - do_warn(_("bad attribute format %d in inode %llu, "), - dinoc->di_aformat, lino); - if (!no_modify) { - do_warn(_("resetting value\n")); - dinoc->di_aformat = XFS_DINODE_FMT_EXTENTS; - *dirty = 1; - } else - do_warn(_("would reset value\n")); - anextents = 0; - } else if (XFS_DFORK_Q(dino)) { + *anextents = be16_to_cpu(dinoc->di_anextents); + if (*anextents > be64_to_cpu(dinoc->di_nblocks) || + *anextents > XFS_MAX_INCORE_EXTENTS) + *anextents = 1; + + switch (dinoc->di_aformat) { + case XFS_DINODE_FMT_LOCAL: + *anextents = 0; + err = process_lclinode(mp, agno, ino, dino, type, dirty, + atotblocks, anextents, &ablkmap, + XFS_ATTR_FORK, check_dups); + break; + case XFS_DINODE_FMT_EXTENTS: + ablkmap = blkmap_alloc(*anextents); + *anextents = 0; + err = process_exinode(mp, agno, ino, dino, type, dirty, + atotblocks, anextents, &ablkmap, + XFS_ATTR_FORK, check_dups); + break; + case XFS_DINODE_FMT_BTREE: + ablkmap = blkmap_alloc(*anextents); + *anextents = 0; + err = process_btinode(mp, agno, ino, dino, type, dirty, + atotblocks, anextents, &ablkmap, + XFS_ATTR_FORK, check_dups); + break; + default: + do_warn(_("illegal attribute format %d, ino %llu\n"), + dinoc->di_aformat, lino); + err = 1; + break; + } + + if (err) { + /* + * clear the attribute fork if necessary. we can't + * clear the inode because we've already put the + * inode space info into the blockmap. + * + * XXX - put the inode onto the "move it" list and + * log the the attribute scrubbing + */ + do_warn(_("bad attribute fork in inode %llu"), lino); + + if (!no_modify) { + if (delete_attr_ok) { + do_warn(_(", clearing attr fork\n")); + *dirty += clear_dinode_attr(mp, dino, lino); + dinoc->di_aformat = XFS_DINODE_FMT_LOCAL; + } else { + do_warn("\n"); + *dirty += clear_dinode(mp, dino, lino); + } + ASSERT(*dirty > 0); + } else { + do_warn(_(", would clear attr fork\n")); + } + + *atotblocks = 0; + *anextents = 0; + blkmap_free(ablkmap); + *retval = 1; + + return delete_attr_ok ? 0 : 1; + } + + if (check_dups) { switch (dinoc->di_aformat) { case XFS_DINODE_FMT_LOCAL: - anextents = 0; err = process_lclinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, &ablkmap, - XFS_ATTR_FORK, check_dups); + type, dirty, atotblocks, anextents, + &ablkmap, XFS_ATTR_FORK, 0); break; case XFS_DINODE_FMT_EXTENTS: - ablkmap = blkmap_alloc(anextents); - anextents = 0; err = process_exinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, &ablkmap, - XFS_ATTR_FORK, check_dups); + type, dirty, atotblocks, anextents, + &ablkmap, XFS_ATTR_FORK, 0); break; case XFS_DINODE_FMT_BTREE: - ablkmap = blkmap_alloc(anextents); - anextents = 0; err = process_btinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, &ablkmap, - XFS_ATTR_FORK, check_dups); + type, dirty, atotblocks, anextents, + &ablkmap, XFS_ATTR_FORK, 0); break; default: - anextents = 0; - do_warn(_("illegal attribute format %d, ino %llu\n"), - dinoc->di_aformat, lino); - err = 1; - break; + do_error(_("illegal attribute fmt %d, ino %llu\n"), + dinoc->di_aformat, lino); } - if (err) { - /* - * clear the attribute fork if necessary. we can't - * clear the inode because we've already put the - * inode space info into the blockmap. - * - * XXX - put the inode onto the "move it" list and - * log the the attribute scrubbing - */ - do_warn(_("bad attribute fork in inode %llu"), lino); + if (no_modify && err != 0) { + blkmap_free(ablkmap); + return 1; + } + ASSERT(err == 0); + } + + /* + * do attribute semantic-based consistency checks now + */ + + /* get this only in phase 3, not in both phase 3 and 4 */ + if (extra_attr_check && + process_attributes(mp, lino, dino, ablkmap, &repair)) { + do_warn(_("problem with attribute contents in inode %llu\n"), + lino); + if (!repair) { + /* clear attributes if not done already */ if (!no_modify) { - if (delete_attr_ok) { - do_warn(_(", clearing attr fork\n")); - *dirty += clear_dinode_attr(mp, - dino, lino); - } else { - do_warn("\n"); - *dirty += clear_dinode(mp, - dino, lino); - } - ASSERT(*dirty > 0); + *dirty += clear_dinode_attr(mp, dino, lino); + dinoc->di_aformat = XFS_DINODE_FMT_LOCAL; } else { - do_warn(_(", would clear attr fork\n")); + do_warn(_("would clear attr fork\n")); } + *atotblocks = 0; + *anextents = 0; + } + else { + *dirty = 1; /* it's been repaired */ + } + } + blkmap_free(ablkmap); + return 0; +} - atotblocks = 0; - anextents = 0; +/* + * check nlinks feature, if it's a version 1 inode, + * just leave nlinks alone. even if it's set wrong, + * it'll be reset when read in. + */ - if (delete_attr_ok) { - if (!no_modify) - dinoc->di_aformat = XFS_DINODE_FMT_LOCAL; +static int +process_check_inode_nlink_version( + xfs_dinode_core_t *dinoc, + xfs_ino_t lino) +{ + int dirty = 0; + + if (dinoc->di_version > XFS_DINODE_VERSION_1 && !fs_inode_nlink) { + /* + * do we have a fs/inode version mismatch with a valid + * version 2 inode here that has to stay version 2 or + * lose links? + */ + if (be32_to_cpu(dinoc->di_nlink) > XFS_MAXLINK_1) { + /* + * yes. are nlink inodes allowed? + */ + if (fs_inode_nlink_allowed) { + /* + * yes, update status variable which will + * cause sb to be updated later. + */ + fs_inode_nlink = 1; + do_warn(_("version 2 inode %llu claims > %u links, "), + lino, XFS_MAXLINK_1); + if (!no_modify) { + do_warn(_("updating superblock " + "version number\n")); + } else { + do_warn(_("would update superblock " + "version number\n")); + } } else { - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); - blkmap_free(ablkmap); + /* + * no, have to convert back to onlinks + * even if we lose some links + */ + do_warn(_("WARNING: version 2 inode %llu " + "claims > %u links, "), + lino, XFS_MAXLINK_1); + if (!no_modify) { + do_warn(_("converting back to version 1,\n" + "this may destroy %d links\n"), + be32_to_cpu(dinoc->di_nlink) - + XFS_MAXLINK_1); + + dinoc->di_version = XFS_DINODE_VERSION_1; + dinoc->di_nlink = cpu_to_be32(XFS_MAXLINK_1); + dinoc->di_onlink = cpu_to_be16(XFS_MAXLINK_1); + dirty = 1; + } else { + do_warn(_("would convert back to version 1,\n" + "\tthis might destroy %d links\n"), + be32_to_cpu(dinoc->di_nlink) - + XFS_MAXLINK_1); + } } - return(1); - - } else if (check_dups) { - switch (dinoc->di_aformat) { - case XFS_DINODE_FMT_LOCAL: - err = process_lclinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, - &ablkmap, XFS_ATTR_FORK, 0); - break; - case XFS_DINODE_FMT_EXTENTS: - err = process_exinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, - &ablkmap, XFS_ATTR_FORK, 0); - break; - case XFS_DINODE_FMT_BTREE: - err = process_btinode(mp, agno, ino, dino, - type, dirty, &atotblocks, &anextents, - &ablkmap, XFS_ATTR_FORK, 0); - break; - default: - do_error( - _("illegal attribute fmt %d, ino %llu\n"), - dinoc->di_aformat, lino); + } else { + /* + * do we have a v2 inode that we could convert back + * to v1 without losing any links? if we do and + * we have a mismatch between superblock bits and the + * version bit, alter the version bit in this case. + * + * the case where we lost links was handled above. + */ + do_warn(_("found version 2 inode %llu, "), lino); + if (!no_modify) { + do_warn(_("converting back to version 1\n")); + dinoc->di_version = XFS_DINODE_VERSION_1; + dinoc->di_onlink = cpu_to_be16( + be32_to_cpu(dinoc->di_nlink)); + dirty = 1; + } else { + do_warn(_("would convert back to version 1\n")); } + } + } + + /* + * ok, if it's still a version 2 inode, it's going + * to stay a version 2 inode. it should have a zero + * onlink field, so clear it. + */ + if (dinoc->di_version > XFS_DINODE_VERSION_1 && + dinoc->di_onlink != 0 && fs_inode_nlink > 0) { + if (!no_modify) { + do_warn(_("clearing obsolete nlink field in " + "version 2 inode %llu, was %d, now 0\n"), + lino, be16_to_cpu(dinoc->di_onlink)); + dinoc->di_onlink = 0; + dirty = 1; + } else { + do_warn(_("would clear obsolete nlink field in " + "version 2 inode %llu, currently %d\n"), + lino, be16_to_cpu(dinoc->di_onlink)); + } + } + return dirty; +} + +/* + * returns 0 if the inode is ok, 1 if the inode is corrupt + * check_dups can be set to 1 *only* when called by the + * first pass of the duplicate block checking of phase 4. + * *dirty is set > 0 if the dinode has been altered and + * needs to be written out. + * + * for detailed, info, look at process_dinode() comments. + */ +/* ARGSUSED */ +int +process_dinode_int(xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino, + int was_free, /* 1 if inode is currently free */ + int *dirty, /* out == > 0 if inode is now dirty */ + int *used, /* out == 1 if inode is in use */ + int verify_mode, /* 1 == verify but don't modify inode */ + int uncertain, /* 1 == inode is uncertain */ + int ino_discovery, /* 1 == check dirs for unknown inodes */ + int check_dups, /* 1 == check if inode claims + * duplicate blocks */ + int extra_attr_check, /* 1 == do attribute format and value checks */ + int *isa_dir, /* out == 1 if inode is a directory */ + xfs_ino_t *parent) /* out -- parent if ino is a dir */ +{ + xfs_drfsbno_t totblocks = 0; + xfs_drfsbno_t atotblocks = 0; + xfs_dinode_core_t *dinoc; + int di_mode; + int type; + int retval = 0; + __uint64_t nextents; + __uint64_t anextents; + xfs_ino_t lino; + const int is_free = 0; + const int is_used = 1; + blkmap_t *dblkmap = NULL; + + *dirty = *isa_dir = 0; + *used = is_used; + type = XR_INO_UNKNOWN; + + dinoc = &dino->di_core; + lino = XFS_AGINO_TO_INO(mp, agno, ino); + di_mode = be16_to_cpu(dinoc->di_mode); + + /* + * if in verify mode, don't modify the inode. + * + * if correcting, reset stuff that has known values + * + * if in uncertain mode, be silent on errors since we're + * trying to find out if these are inodes as opposed + * to assuming that they are. Just return the appropriate + * return code in that case. + * + * If uncertain is set, verify_mode MUST be set. + */ + ASSERT(uncertain == 0 || verify_mode != 0); + + if (be16_to_cpu(dinoc->di_magic) != XFS_DINODE_MAGIC) { + retval = 1; + if (!uncertain) + do_warn(_("bad magic number 0x%x on inode %llu%c"), + be16_to_cpu(dinoc->di_magic), lino, + verify_mode ? '\n' : ','); + if (!verify_mode) { + if (!no_modify) { + do_warn(_(" resetting magic number\n")); + dinoc->di_magic = cpu_to_be16(XFS_DINODE_MAGIC); + *dirty = 1; + } else + do_warn(_(" would reset magic number\n")); + } + } + + if (!XFS_DINODE_GOOD_VERSION(dinoc->di_version) || + (!fs_inode_nlink && dinoc->di_version > XFS_DINODE_VERSION_1)) { + retval = 1; + if (!uncertain) + do_warn(_("bad version number 0x%x on inode %llu%c"), + dinoc->di_version, lino, + verify_mode ? '\n' : ','); + if (!verify_mode) { + if (!no_modify) { + do_warn(_(" resetting version number\n")); + dinoc->di_version = (fs_inode_nlink) ? + XFS_DINODE_VERSION_2 : + XFS_DINODE_VERSION_1; + *dirty = 1; + } else + do_warn(_(" would reset version number\n")); + } + } + + /* + * blow out of here if the inode size is < 0 + */ + if ((xfs_fsize_t)be64_to_cpu(dinoc->di_size) < 0) { + if (!uncertain) + do_warn(_("bad (negative) size %lld on inode %llu\n"), + be64_to_cpu(dinoc->di_size), lino); + if (verify_mode) + return 1; + goto clear_bad_out; + } + + /* + * if not in verify mode, check to sii if the inode and imap + * agree that the inode is free + */ + if (!verify_mode && di_mode == 0) { + /* + * was_free value is not meaningful if we're in verify mode + */ + if (was_free) { + /* + * easy case, inode free -- inode and map agree, clear + * it just in case to ensure that format, etc. are + * set correctly + */ + if (!no_modify) + *dirty += clear_dinode(mp, dino, lino); + *used = is_free; + return 0; + } + /* + * the inode looks free but the map says it's in use. + * clear the inode just to be safe and mark the inode + * free. + */ + do_warn(_("imap claims a free inode %llu is in use, "), lino); + if (!no_modify) { + do_warn(_("correcting imap and clearing inode\n")); + *dirty += clear_dinode(mp, dino, lino); + retval = 1; + } else + do_warn(_("would correct imap and clear inode\n")); + *used = is_free; + return retval; + } - if (no_modify && err != 0) { - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); - blkmap_free(ablkmap); - return(1); - } + /* + * because of the lack of any write ordering guarantee, it's + * possible that the core got updated but the forks didn't. + * so rather than be ambitious (and probably incorrect), + * if there's an inconsistency, we get conservative and + * just pitch the file. blow off checking formats of + * free inodes since technically any format is legal + * as we reset the inode when we re-use it. + */ + if (di_mode != 0 && check_dinode_mode_format(dinoc) != 0) { + if (!uncertain) + do_warn(_("bad inode format in inode %llu\n"), lino); + if (verify_mode) + return 1; + goto clear_bad_out; + } - ASSERT(err == 0); - } + if (verify_mode) + return retval; - /* - * do attribute semantic-based consistency checks now - */ + /* + * clear the next unlinked field if necessary on a good + * inode only during phase 4 -- when checking for inodes + * referencing duplicate blocks. then it's safe because + * we've done the inode discovery and have found all the inodes + * we're going to find. check_dups is set to 1 only during + * phase 4. Ugly. + */ + if (check_dups && !no_modify) + *dirty += clear_dinode_unlinked(mp, dino); - /* get this only in phase 3, not in both phase 3 and 4 */ - if (extra_attr_check) { - if ((err = process_attributes(mp, lino, dino, ablkmap, - &repair))) { - do_warn( - _("problem with attribute contents in inode %llu\n"), lino); - if(!repair) { - /* clear attributes if not done already */ - if (!no_modify) { - *dirty += clear_dinode_attr( - mp, dino, lino); - dinoc->di_aformat = - XFS_DINODE_FMT_LOCAL; - } else { - do_warn( - _("would clear attr fork\n")); - } - atotblocks = 0; - anextents = 0; - } - else { - *dirty = 1; /* it's been repaired */ - } - } - } - blkmap_free(ablkmap); + /* set type and map type info */ - } else - anextents = 0; + switch (di_mode & S_IFMT) { + case S_IFDIR: + type = XR_INO_DIR; + *isa_dir = 1; + break; + case S_IFREG: + if (be16_to_cpu(dinoc->di_flags) & XFS_DIFLAG_REALTIME) + type = XR_INO_RTDATA; + else if (lino == mp->m_sb.sb_rbmino) + type = XR_INO_RTBITMAP; + else if (lino == mp->m_sb.sb_rsumino) + type = XR_INO_RTSUM; + else + type = XR_INO_DATA; + break; + case S_IFLNK: + type = XR_INO_SYMLINK; + break; + case S_IFCHR: + type = XR_INO_CHRDEV; + break; + case S_IFBLK: + type = XR_INO_BLKDEV; + break; + case S_IFSOCK: + type = XR_INO_SOCK; + break; + case S_IFIFO: + type = XR_INO_FIFO; + break; + default: + do_warn(_("bad inode type %#o inode %llu\n"), + di_mode & S_IFMT, lino); + goto clear_bad_out; + } /* - * enforce totblocks is 0 for misc types - */ - if (process_misc_ino_types_blocks(totblocks, lino, type)) { - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); - return(1); - } + * type checks for superblock inodes + */ + if (process_check_sb_inodes(mp, dinoc, lino, &type, dirty) != 0) + goto clear_bad_out; /* - * correct space counters if required + * only regular files with REALTIME or EXTSIZE flags set can have + * extsize set, or directories with EXTSZINHERIT. */ - if (totblocks + atotblocks != INT_GET(dinoc->di_nblocks, ARCH_CONVERT)) { - if (!no_modify) { - do_warn( - _("correcting nblocks for inode %llu, was %llu - counted %llu\n"), - lino, INT_GET(dinoc->di_nblocks, ARCH_CONVERT), - totblocks + atotblocks); - *dirty = 1; - INT_SET(dinoc->di_nblocks, ARCH_CONVERT, totblocks + atotblocks); - } else { - do_warn( - _("bad nblocks %llu for inode %llu, would reset to %llu\n"), - INT_GET(dinoc->di_nblocks, ARCH_CONVERT), lino, - totblocks + atotblocks); + if (dinoc->di_extsize) { + if ((type == XR_INO_RTDATA) || + (type == XR_INO_DIR && (be16_to_cpu(dinoc->di_flags) & + XFS_DIFLAG_EXTSZINHERIT)) || + (type == XR_INO_DATA && (be16_to_cpu(dinoc->di_flags) & + XFS_DIFLAG_EXTSIZE))) { + /* s'okay */ ; + } else { + do_warn(_("bad non-zero extent size %u for " + "non-realtime/extsize inode %llu, "), + be32_to_cpu(dinoc->di_extsize), lino); + if (!no_modify) { + do_warn(_("resetting to zero\n")); + dinoc->di_extsize = 0; + *dirty = 1; + } else + do_warn(_("would reset to zero\n")); } } - if (nextents > MAXEXTNUM) { - do_warn(_("too many data fork extents (%llu) in inode %llu\n"), - nextents, lino); + /* + * general size/consistency checks: + */ + if (process_check_inode_sizes(mp, dino, lino, type) != 0) + goto clear_bad_out; - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); + /* + * check for illegal values of forkoff + */ + if (process_check_inode_forkoff(mp, dinoc, lino) != 0) + goto clear_bad_out; - return(1); - } - if (nextents != INT_GET(dinoc->di_nextents, ARCH_CONVERT)) { - if (!no_modify) { - do_warn( - _("correcting nextents for inode %llu, was %d - counted %llu\n"), - lino, INT_GET(dinoc->di_nextents, ARCH_CONVERT), - nextents); - *dirty = 1; - INT_SET(dinoc->di_nextents, ARCH_CONVERT, - (xfs_extnum_t) nextents); - } else { - do_warn( - _("bad nextents %d for inode %llu, would reset to %llu\n"), - INT_GET(dinoc->di_nextents, ARCH_CONVERT), - lino, nextents); - } - } + /* + * check data fork -- if it's bad, clear the inode + */ + if (process_inode_data_fork(mp, agno, ino, dino, type, dirty, + &totblocks, &nextents, &dblkmap, check_dups) != 0) + goto bad_out; - if (anextents > MAXAEXTNUM) { - do_warn(_("too many attr fork extents (%llu) in inode %llu\n"), - anextents, lino); + /* + * check attribute fork if necessary. attributes are + * always stored in the regular filesystem. + */ + if (process_inode_attr_fork(mp, agno, ino, dino, type, dirty, + &atotblocks, &anextents, check_dups, extra_attr_check, + &retval)) + goto bad_out; - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared = 1; - *used = is_free; - *isa_dir = 0; - blkmap_free(dblkmap); - return(1); - } - if (anextents != INT_GET(dinoc->di_anextents, ARCH_CONVERT)) { - if (!no_modify) { - do_warn( - _("correcting anextents for inode %llu, was %d - counted %llu\n"), - lino, - INT_GET(dinoc->di_anextents, ARCH_CONVERT), - anextents); - *dirty = 1; - INT_SET(dinoc->di_anextents, ARCH_CONVERT, - (xfs_aextnum_t) anextents); - } else { - do_warn( - _("bad anextents %d for inode %llu, would reset to %llu\n"), - INT_GET(dinoc->di_anextents, ARCH_CONVERT), - lino, anextents); - } - } + /* + * enforce totblocks is 0 for misc types + */ + if (process_misc_ino_types_blocks(totblocks, lino, type)) + goto clear_bad_out; + + /* + * correct space counters if required + */ + if (process_inode_blocks_and_extents(dinoc, totblocks + atotblocks, + nextents, anextents, lino, dirty) != 0) + goto clear_bad_out; /* * do any semantic type-based checking here */ switch (type) { case XR_INO_DIR: - if (XFS_SB_VERSION_HASDIRV2(&mp->m_sb)) - err = process_dir2(mp, lino, dino, ino_discovery, - dirty, "", parent, dblkmap); - else - err = process_dir(mp, lino, dino, ino_discovery, - dirty, "", parent, dblkmap); - if (err) - do_warn( - _("problem with directory contents in inode %llu\n"), - lino); - break; - case XR_INO_RTBITMAP: - /* process_rtbitmap XXX */ - err = 0; - break; - case XR_INO_RTSUM: - /* process_rtsummary XXX */ - err = 0; + if (process_dir2(mp, lino, dino, ino_discovery, dirty, "", + parent, dblkmap) != 0) { + do_warn(_("problem with directory contents in " + "inode %llu\n"), lino); + goto clear_bad_out; + } break; case XR_INO_SYMLINK: - if ((err = process_symlink(mp, lino, dino, dblkmap))) + if (process_symlink(mp, lino, dino, dblkmap) != 0) { do_warn(_("problem with symbolic link in inode %llu\n"), lino); - break; - case XR_INO_DATA: /* fall through to FIFO case ... */ - case XR_INO_RTDATA: /* fall through to FIFO case ... */ - case XR_INO_CHRDEV: /* fall through to FIFO case ... */ - case XR_INO_BLKDEV: /* fall through to FIFO case ... */ - case XR_INO_SOCK: /* fall through to FIFO case ... */ - case XR_INO_FIFO: - err = 0; + goto clear_bad_out; + } break; default: - printf(_("Unexpected inode type\n")); - abort(); + break; } if (dblkmap) blkmap_free(dblkmap); - if (err) { - /* - * problem in the inode type-specific semantic - * checking, clear out the inode and get out - */ - if (!no_modify) { - *dirty += clear_dinode(mp, dino, lino); - ASSERT(*dirty > 0); - } - *cleared = 1; - *used = is_free; - *isa_dir = 0; - - return(1); - } - /* * check nlinks feature, if it's a version 1 inode, * just leave nlinks alone. even if it's set wrong, * it'll be reset when read in. */ - if (dinoc->di_version > XFS_DINODE_VERSION_1 && !fs_inode_nlink) { - /* - * do we have a fs/inode version mismatch with a valid - * version 2 inode here that has to stay version 2 or - * lose links? - */ - if (INT_GET(dinoc->di_nlink, ARCH_CONVERT) > XFS_MAXLINK_1) { - /* - * yes. are nlink inodes allowed? - */ - if (fs_inode_nlink_allowed) { - /* - * yes, update status variable which will - * cause sb to be updated later. - */ - fs_inode_nlink = 1; - do_warn( - _("version 2 inode %llu claims > %u links, "), - lino, XFS_MAXLINK_1); - if (!no_modify) { - do_warn( - _("updating superblock version number\n")); - } else { - do_warn( - _("would update superblock version number\n")); - } - } else { - /* - * no, have to convert back to onlinks - * even if we lose some links - */ - do_warn( - _("WARNING: version 2 inode %llu claims > %u links, "), - lino, XFS_MAXLINK_1); - if (!no_modify) { - do_warn( - _("converting back to version 1,\n\tthis may destroy %d links\n"), - INT_GET(dinoc->di_nlink, - ARCH_CONVERT) - - XFS_MAXLINK_1); - - dinoc->di_version = - XFS_DINODE_VERSION_1; - INT_SET(dinoc->di_nlink, ARCH_CONVERT, - XFS_MAXLINK_1); - INT_SET(dinoc->di_onlink, ARCH_CONVERT, - XFS_MAXLINK_1); - - *dirty = 1; - } else { - do_warn( - _("would convert back to version 1,\n\tthis might destroy %d links\n"), - INT_GET(dinoc->di_nlink, - ARCH_CONVERT) - - XFS_MAXLINK_1); - } - } - } else { - /* - * do we have a v2 inode that we could convert back - * to v1 without losing any links? if we do and - * we have a mismatch between superblock bits and the - * version bit, alter the version bit in this case. - * - * the case where we lost links was handled above. - */ - do_warn(_("found version 2 inode %llu, "), lino); - if (!no_modify) { - do_warn(_("converting back to version 1\n")); - - dinoc->di_version = - XFS_DINODE_VERSION_1; - INT_SET(dinoc->di_onlink, ARCH_CONVERT, - INT_GET(dinoc->di_nlink, ARCH_CONVERT)); - - *dirty = 1; - } else { - do_warn(_("would convert back to version 1\n")); - } - } - } + *dirty = process_check_inode_nlink_version(dinoc, lino); - /* - * ok, if it's still a version 2 inode, it's going - * to stay a version 2 inode. it should have a zero - * onlink field, so clear it. - */ - if (dinoc->di_version > XFS_DINODE_VERSION_1 && - INT_GET(dinoc->di_onlink, ARCH_CONVERT) > 0 && - fs_inode_nlink > 0) { - if (!no_modify) { - do_warn( -_("clearing obsolete nlink field in version 2 inode %llu, was %d, now 0\n"), - lino, INT_GET(dinoc->di_onlink, ARCH_CONVERT)); - dinoc->di_onlink = 0; - *dirty = 1; - } else { - do_warn( -_("would clear obsolete nlink field in version 2 inode %llu, currently %d\n"), - lino, INT_GET(dinoc->di_onlink, ARCH_CONVERT)); - *dirty = 1; - } - } + return retval; - return(retval > 0 ? 1 : 0); +clear_bad_out: + if (!no_modify) { + *dirty += clear_dinode(mp, dino, lino); + ASSERT(*dirty > 0); + } +bad_out: + *used = is_free; + *isa_dir = 0; + if (dblkmap) + blkmap_free(dblkmap); + return 1; } /* @@ -2983,8 +2835,6 @@ * claimed blocks using the bitmap. * Outs: * dirty -- whether we changed the inode (1 == yes) - * cleared -- whether we cleared the inode (1 == yes). In - * no modify mode, if we would have cleared it * used -- 1 if the inode is used, 0 if free. In no modify * mode, whether the inode should be used or free * isa_dir -- 1 if the inode is a directory, 0 if not. In @@ -2994,30 +2844,29 @@ */ int -process_dinode(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino, - int was_free, - int *dirty, - int *cleared, - int *used, - int ino_discovery, - int check_dups, - int extra_attr_check, - int *isa_dir, - xfs_ino_t *parent) +process_dinode( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino, + int was_free, + int *dirty, + int *used, + int ino_discovery, + int check_dups, + int extra_attr_check, + int *isa_dir, + xfs_ino_t *parent) { - const int verify_mode = 0; - const int uncertain = 0; + const int verify_mode = 0; + const int uncertain = 0; #ifdef XR_INODE_TRACE fprintf(stderr, "processing inode %d/%d\n", agno, ino); #endif - return(process_dinode_int(mp, dino, agno, ino, was_free, dirty, - cleared, used, verify_mode, uncertain, - ino_discovery, check_dups, extra_attr_check, - isa_dir, parent)); + return process_dinode_int(mp, dino, agno, ino, was_free, dirty, used, + verify_mode, uncertain, ino_discovery, + check_dups, extra_attr_check, isa_dir, parent); } /* @@ -3027,25 +2876,24 @@ * if the inode passes the cursory sanity check, 1 otherwise. */ int -verify_dinode(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino) -{ - xfs_ino_t parent; - int cleared = 0; - int used = 0; - int dirty = 0; - int isa_dir = 0; - const int verify_mode = 1; - const int check_dups = 0; - const int ino_discovery = 0; - const int uncertain = 0; - - return(process_dinode_int(mp, dino, agno, ino, 0, &dirty, - &cleared, &used, verify_mode, - uncertain, ino_discovery, check_dups, - 0, &isa_dir, &parent)); +verify_dinode( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino) +{ + xfs_ino_t parent; + int used = 0; + int dirty = 0; + int isa_dir = 0; + const int verify_mode = 1; + const int check_dups = 0; + const int ino_discovery = 0; + const int uncertain = 0; + + return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, + verify_mode, uncertain, ino_discovery, + check_dups, 0, &isa_dir, &parent); } /* @@ -3054,23 +2902,22 @@ * returns 0 if the inode passes the cursory sanity check, 1 otherwise. */ int -verify_uncertain_dinode(xfs_mount_t *mp, - xfs_dinode_t *dino, - xfs_agnumber_t agno, - xfs_agino_t ino) -{ - xfs_ino_t parent; - int cleared = 0; - int used = 0; - int dirty = 0; - int isa_dir = 0; - const int verify_mode = 1; - const int check_dups = 0; - const int ino_discovery = 0; - const int uncertain = 1; - - return(process_dinode_int(mp, dino, agno, ino, 0, &dirty, - &cleared, &used, verify_mode, - uncertain, ino_discovery, check_dups, - 0, &isa_dir, &parent)); +verify_uncertain_dinode( + xfs_mount_t *mp, + xfs_dinode_t *dino, + xfs_agnumber_t agno, + xfs_agino_t ino) +{ + xfs_ino_t parent; + int used = 0; + int dirty = 0; + int isa_dir = 0; + const int verify_mode = 1; + const int check_dups = 0; + const int ino_discovery = 0; + const int uncertain = 1; + + return process_dinode_int(mp, dino, agno, ino, 0, &dirty, &used, + verify_mode, uncertain, ino_discovery, + check_dups, 0, &isa_dir, &parent); } Index: ci/xfsprogs/repair/dinode.h =================================================================== --- ci.orig/xfsprogs/repair/dinode.h 2007-11-16 14:45:56.000000000 +1100 +++ ci/xfsprogs/repair/dinode.h 2007-11-16 14:46:32.000000000 +1100 @@ -84,7 +84,6 @@ xfs_agino_t ino, int was_free, int *dirty, - int *tossit, int *used, int check_dirs, int check_dups, ------------KBCi25FieZfzpyKYHMgMHb Content-Disposition: attachment; filename=dir_size_check.patch Content-Type: text/x-patch; name=dir_size_check.patch Content-Transfer-Encoding: 7bit Index: repair/xfsprogs/repair/dinode.c =================================================================== --- repair.orig/xfsprogs/repair/dinode.c +++ repair/xfsprogs/repair/dinode.c @@ -1937,6 +1937,11 @@ process_check_inode_sizes( dinoc->di_format, size, lino); return 1; } + if (size > XFS_DIR2_LEAF_OFFSET) { + do_warn(_("directory inode %llu has bad size %lld\n"), + lino, size); + return 1; + } break; case XR_INO_SYMLINK: ------------KBCi25FieZfzpyKYHMgMHb Content-Disposition: attachment; filename=fix_dir_rebuild_without_dotdot_entry.patch Content-Type: text/x-patch; name=fix_dir_rebuild_without_dotdot_entry.patch Content-Transfer-Encoding: 7bit Index: repair/xfsprogs/repair/phase6.c =================================================================== --- repair.orig/xfsprogs/repair/phase6.c +++ repair/xfsprogs/repair/phase6.c @@ -36,6 +36,40 @@ static struct fsxattr zerofsx; static xfs_ino_t orphanage_ino; /* + * Data structures used to keep track of directories where the ".." + * entries are updated. These must be rebuilt after the initial pass + */ +typedef struct dotdot_update { + struct dotdot_update *next; + ino_tree_node_t *irec; + xfs_agnumber_t agno; + int ino_offset; +} dotdot_update_t; + +static dotdot_update_t *dotdot_update_list; +static int dotdot_update; + +static void +add_dotdot_update( + xfs_agnumber_t agno, + ino_tree_node_t *irec, + int ino_offset) +{ + dotdot_update_t *dir = malloc(sizeof(dotdot_update_t)); + + if (!dir) + do_error(_("malloc failed add_dotdot_update (%u bytes)\n"), + sizeof(dotdot_update_t)); + + dir->next = dotdot_update_list; + dir->irec = irec; + dir->agno = agno; + dir->ino_offset = ino_offset; + + dotdot_update_list = dir; +} + +/* * Data structures and routines to keep track of directory entries * and whether their leaf entry has been seen. Also used for name * duplicate checking and rebuilding step if required. @@ -2276,6 +2310,13 @@ longform_dir2_entry_check_data( } /* + * if just scanning to rebuild a directory due to a ".." + * update, just continue + */ + if (dotdot_update) + continue; + + /* * skip the '..' entry since it's checked when the * directory is reached by something else. if it never * gets reached, it'll be moved to the orphanage and we'll @@ -2364,6 +2405,8 @@ _("entry \"%s\" in dir %llu points to an set_inode_parent(irec, ino_offset, ip->i_ino); add_inode_reached(irec, ino_offset); add_inode_ref(current_irec, current_ino_offset); + add_dotdot_update(XFS_INO_TO_AGNO(mp, inum), irec, + ino_offset); } else { junkit = 1; do_warn( @@ -2613,9 +2656,7 @@ longform_dir2_entry_check(xfs_mount_t *m dir_hash_tab_t *hashtab) { xfs_dir2_block_t *block; - xfs_dir2_leaf_entry_t *blp; xfs_dabuf_t **bplist; - xfs_dir2_block_tail_t *btp; xfs_dablk_t da_bno; freetab_t *freetab; int num_bps; @@ -2678,22 +2719,29 @@ longform_dir2_entry_check(xfs_mount_t *m } fixit = (*num_illegal != 0) || dir2_is_badino(ino) || *need_dot; - /* check btree and freespace */ - if (isblock) { - block = bplist[0]->data; - btp = XFS_DIR2_BLOCK_TAIL_P(mp, block); - blp = XFS_DIR2_BLOCK_LEAF_P(btp); - seeval = dir_hash_see_all(hashtab, blp, - INT_GET(btp->count, ARCH_CONVERT), - INT_GET(btp->stale, ARCH_CONVERT)); - if (dir_hash_check(hashtab, ip, seeval)) - fixit |= 1; - } else if (isleaf) { - fixit |= longform_dir2_check_leaf(mp, ip, hashtab, freetab); - } else { - fixit |= longform_dir2_check_node(mp, ip, hashtab, freetab); + if (!dotdot_update) { + /* check btree and freespace */ + if (isblock) { + xfs_dir2_block_tail_t *btp; + xfs_dir2_leaf_entry_t *blp; + + block = bplist[0]->data; + btp = XFS_DIR2_BLOCK_TAIL_P(mp, block); + blp = XFS_DIR2_BLOCK_LEAF_P(btp); + seeval = dir_hash_see_all(hashtab, blp, + be32_to_cpu(btp->count), + be32_to_cpu(btp->stale)); + if (dir_hash_check(hashtab, ip, seeval)) + fixit |= 1; + } else if (isleaf) { + fixit |= longform_dir2_check_leaf(mp, ip, hashtab, + freetab); + } else { + fixit |= longform_dir2_check_node(mp, ip, hashtab, + freetab); + } } - if (!no_modify && fixit) { + if (!no_modify && (fixit || dotdot_update)) { dir_hash_dup_names(hashtab); for (i = 0; i < freetab->naents; i++) if (bplist[i]) @@ -3141,6 +3189,23 @@ shortform_dir2_entry_check(xfs_mount_t * ASSERT(ip->i_d.di_size <= ifp->if_bytes); /* + * if just rebuild a directory due to a "..", update and return + */ + if (dotdot_update) { + parent = get_inode_parent(current_irec, current_ino_offset); + if (no_modify) { + do_warn(_("would set .. in sf dir inode %llu to %llu\n"), + ino, parent); + } else { + do_warn(_("setting .. in sf dir inode %llu to %llu\n"), + ino, parent); + XFS_DIR2_SF_PUT_INUMBER(sfp, &parent, &sfp->hdr.parent); + *ino_dirty = 1; + } + return; + } + + /* * no '.' entry in shortform dirs, just bump up ref count by 1 * '..' was already (or will be) accounted for and checked when * the directory is reached or will be taken care of when the @@ -3151,7 +3216,8 @@ shortform_dir2_entry_check(xfs_mount_t * /* * Initialise i8 counter -- the parent inode number counts as well. */ - i8 = (XFS_DIR2_SF_GET_INUMBER(sfp, &sfp->hdr.parent) > XFS_DIR2_MAX_SHORT_INUM); + i8 = (XFS_DIR2_SF_GET_INUMBER(sfp, &sfp->hdr.parent) > + XFS_DIR2_MAX_SHORT_INUM); /* * now run through entries, stop at first bad entry, don't need @@ -3283,6 +3349,7 @@ shortform_dir2_entry_check(xfs_mount_t * "duplicate name"), fname, lino, ino); goto do_junkit; } + if (!inode_isadir(irec, ino_offset)) { /* * check easy case first, regular inode, just bump @@ -3315,6 +3382,8 @@ shortform_dir2_entry_check(xfs_mount_t * set_inode_parent(irec, ino_offset, ino); add_inode_reached(irec, ino_offset); add_inode_ref(current_irec, current_ino_offset); + add_dotdot_update(XFS_INO_TO_AGNO(mp, lino), + irec, ino_offset); } else { junkit = 1; do_warn(_("entry \"%s\" in directory inode %llu" @@ -3432,10 +3501,11 @@ do_junkit: static void process_dir_inode( xfs_mount_t *mp, - xfs_ino_t ino, + xfs_agnumber_t agno, ino_tree_node_t *irec, int ino_offset) { + xfs_ino_t ino; xfs_bmap_free_t flist; xfs_fsblock_t first; xfs_inode_t *ip; @@ -3445,13 +3515,15 @@ process_dir_inode( int need_dot, committed; int dirty, num_illegal, error, nres; + ino = XFS_AGINO_TO_INO(mp, agno, irec->ino_startnum + ino_offset); + /* * open up directory inode, check all entries, * then call prune_dir_entries to remove all * remaining illegal directory entries. */ - ASSERT(!is_inode_refchecked(ino, irec, ino_offset)); + ASSERT(!is_inode_refchecked(ino, irec, ino_offset) || dotdot_update); error = libxfs_iget(mp, NULL, ino, 0, &ip, 0); if (error) { @@ -3853,15 +3925,32 @@ traverse_function( for (i = 0; i < XFS_INODES_PER_CHUNK; i++) { if (inode_isadir(irec, i)) - process_dir_inode(wq->mp, - XFS_AGINO_TO_INO(wq->mp, agno, - irec->ino_startnum + i), irec, i); + process_dir_inode(wq->mp, agno, irec, i); } } cleanup_inode_prefetch(pf_args); } static void +update_missing_dotdot_entries( + xfs_mount_t *mp) +{ + dotdot_update_t *dir; + + /* + * these entries parents were updated, rebuild them again + * set dotdot_update flag so processing routines do not count links + */ + dotdot_update = 1; + while (dotdot_update_list) { + dir = dotdot_update_list; + dotdot_update_list = dir->next; + process_dir_inode(mp, dir->agno, dir->irec, dir->ino_offset); + free(dir); + } +} + +static void traverse_ags( xfs_mount_t *mp) { @@ -3974,6 +4063,11 @@ _(" - resetting contents of realt */ traverse_ags(mp); + /* + * any directories that had updated ".." entries, rebuild them now + */ + update_missing_dotdot_entries(mp); + do_log(_(" - traversal finished ...\n")); do_log(_(" - moving disconnected inodes to %s ...\n"), ORPHANAGE); ------------KBCi25FieZfzpyKYHMgMHb-- From owner-xfs@oss.sgi.com Tue Jul 1 01:06:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 01:06:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m61861ON004902 for ; Tue, 1 Jul 2008 01:06:01 -0700 X-ASG-Debug-ID: 1214899622-269e028d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from deliver.uni-koblenz.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 09055185AC70 for ; Tue, 1 Jul 2008 01:07:02 -0700 (PDT) Received: from deliver.uni-koblenz.de (deliver.uni-koblenz.de [141.26.64.15]) by cuda.sgi.com with ESMTP id fUOn0Sp57SoaqrBx for ; Tue, 01 Jul 2008 01:07:02 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id 2C4DC7801972; Tue, 1 Jul 2008 10:07:02 +0200 (CEST) Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 28283-04; Tue, 1 Jul 2008 10:07:01 +0200 (CEST) Received: from bruch.uni-koblenz.de (bruch.uni-koblenz.de [141.26.64.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTP id 14B127898220; Tue, 1 Jul 2008 10:07:01 +0200 (CEST) Message-ID: <4869E5A4.4020900@uni-koblenz.de> Date: Tue, 01 Jul 2008 10:07:00 +0200 From: Christoph Litauer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: rfc: kill ino64 mount option Subject: Re: rfc: kill ino64 mount option References: <20080627153928.GA31384@lst.de> <20080628000914.GE29319@disturbed> <486589E7.9010705@sgi.com> In-Reply-To: <486589E7.9010705@sgi.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at uni-koblenz.de X-Barracuda-Connect: deliver.uni-koblenz.de[141.26.64.15] X-Barracuda-Start-Time: 1214899624 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC5_SA210e X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54841 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC5_SA210e Custom Rule SA210e X-Virus-Status: Clean X-archive-position: 16670 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: litauer@uni-koblenz.de Precedence: bulk X-list: xfs Mark Goodwin schrieb: > > > Dave Chinner wrote: >> On Fri, Jun 27, 2008 at 05:39:28PM +0200, Christoph Hellwig wrote: >>> Does anyone have objections to kill the ino64 mount option? It's purely >>> a debug tool to force inode numbers outside of the range representable >>> in 32bits and is quite invasive for something that could easily be >>> debugged by just having a large enough filesystem.. >> >> It's the "large enough fs" that is the problem. XFSQA uses >> small partitions for the most part, and this allows testing >> of 64 bit inode numbers with a standard qa config. >> >> That being said, I don't really if it goes or stays... > > Although ino64 has interoperability issues with 32bit apps, it does > have significant performance advantages over inode32 for some > storage topologies and workloads, i.e. it's generally desirable to > keep inodes near their data, but with large configs inode32 can't > always oblige. ino64 is not just a debug tool. > > We have a design proposal known as "inode32+" that essentially removes > the direct mapping between inode number and disk offset. This will > provide all the layout and performance benefits of ino64 without the > interop issues. Until inode32+ is available, we need to keep ino64. Hi, as I have massive performance problems using xfs with millions of inodes, I am very interested in this "incode32+". My server is a 32 bit machine, so I am not able to use inode64. Is it available? -- Regards Christoph ________________________________________________________________________ Christoph Litauer litauer@uni-koblenz.de Uni Koblenz, Computing Center, http://www.uni-koblenz.de/~litauer Postfach 201602, 56016 Koblenz Fon: +49 261 287-1311, Fax: -100 1311 PGP-Fingerprint: F39C E314 2650 650D 8092 9514 3A56 FBD8 79E3 27B2 From owner-xfs@oss.sgi.com Tue Jul 1 01:07:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 01:07:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6187n0x005404 for ; Tue, 1 Jul 2008 01:07:49 -0700 X-ASG-Debug-ID: 1214899731-3e4200c70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DC2CE2A242E for ; Tue, 1 Jul 2008 01:08:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 7hUteJ3rcpSyIIq5 for ; Tue, 01 Jul 2008 01:08:51 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KDauq-0005rM-Sh; Tue, 01 Jul 2008 08:08:44 +0000 Date: Tue, 1 Jul 2008 04:08:44 -0400 From: Christoph Hellwig To: Takashi Sato Cc: akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 1/3] Implement generic freeze feature Subject: Re: [PATCH 1/3] Implement generic freeze feature Message-ID: <20080701080844.GA16691@infradead.org> References: <20080630212323t-sato@mail.jp.nec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080630212323t-sato@mail.jp.nec.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1214899731 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54841 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16671 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs > { > struct super_block *sb; > > + if (test_and_set_bit(BD_FREEZE_OP, &bdev->bd_state)) > + return ERR_PTR(-EBUSY); > + > + sb = get_super(bdev); > + > + /* If super_block has been already frozen, return. */ > + if (sb && sb->s_frozen != SB_UNFROZEN) { > + drop_super(sb); > + clear_bit(BD_FREEZE_OP, &bdev->bd_state); > + return sb; > + } > + > + if (sb) > + drop_super(sb); > + > down(&bdev->bd_mount_sem); > sb = get_super(bdev); > if (sb && !(sb->s_flags & MS_RDONLY)) { > @@ -219,6 +234,8 @@ struct super_block *freeze_bdev(struct b > } > > sync_blockdev(bdev); > + clear_bit(BD_FREEZE_OP, &bdev->bd_state); > + Please only clear BD_FREEZE_OP in thaw_bdev, that way you can also get rid of the frozen check above, and the double-get_super. Also bd_mount_sem could be removed that way by checking for BD_FREEZE_OP in the unmount path. > /* > + * ioctl_freeze - Freeze the filesystem. > + * > + * @filp: target file > + * > + * Call freeze_bdev() to freeze the filesystem. > + */ This is not a kerneldoc comment. But I think it can be simply removed anyway, as it's a quite trivial function with static scope. > +/* > + * ioctl_thaw - Thaw the filesystem. > + * > + * @filp: target file > + * > + * Call thaw_bdev() to thaw the filesystem. > + */ Same here. From owner-xfs@oss.sgi.com Tue Jul 1 01:09:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 01:09:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6189R8q005956 for ; Tue, 1 Jul 2008 01:09:27 -0700 X-ASG-Debug-ID: 1214899830-7cb501320000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A5431D7ED8E for ; Tue, 1 Jul 2008 01:10:30 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 4qIVDGZTKMniZ4Vf for ; Tue, 01 Jul 2008 01:10:30 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KDawU-0002q5-OJ; Tue, 01 Jul 2008 08:10:26 +0000 Date: Tue, 1 Jul 2008 04:10:26 -0400 From: Christoph Hellwig To: Takashi Sato Cc: akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080701081026.GB16691@infradead.org> References: <20080630212450t-sato@mail.jp.nec.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080630212450t-sato@mail.jp.nec.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1214899830 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54842 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16672 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs I still disagree with this whole patch. There is not reason to let the freeze request timeout - an auto-unfreezing will only confuse the hell out of the caller. The only reason where the current XFS freeze call can hang and this would be theoretically useful is when the filesystem is already frozen by someone else, but this should be fixed by refusing to do the second freeze, as suggested in my comment to patch 1. From owner-xfs@oss.sgi.com Tue Jul 1 01:12:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 01:12:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m618C4nd006602 for ; Tue, 1 Jul 2008 01:12:04 -0700 X-ASG-Debug-ID: 1214899987-5e21014a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 482A0184F5B4; Tue, 1 Jul 2008 01:13:07 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id tA5t0MK1wz7BdDcK; Tue, 01 Jul 2008 01:13:07 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KDaz4-0005FR-V1; Tue, 01 Jul 2008 08:13:06 +0000 Date: Tue, 1 Jul 2008 04:13:06 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: REVIEW: xfs_repair fixes for bad directories Subject: Re: REVIEW: xfs_repair fixes for bad directories Message-ID: <20080701081306.GA11135@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1214899987 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54841 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16673 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Tue, Jul 01, 2008 at 06:00:17PM +1000, Barry Naujok wrote: > Two issues have been encounted with xfs_repair and badly corrupted > directories. > > 1. A huge size (inode di_size) can cause malloc which will fail. > Patch dir_size_check.patch checks for a valid directory size > and if it's bad, junks the directory. The di_size for a dir > only counts the data blocks being used, not all the other > associated metadata. This is limited to 32GB by the > XFS_DIR2_LEAF_OFFSET value in XFS. Anything greater than this > must be invalid. This one looks good. > 2. An update a while ago to xfs_repair attempts to fix invalid > ".." entries for subdirectories where there is a valid parent > with the appropriate entry. It was a partial fix that never > did the full job, especially if the subdirectory was short- > form or it has already been processed. > > Patch fix_dir_rebuild_without_dotdot_entry.patch creates a > post-processing queue after the main scan to update any > directories with an invalid ".." entry. For this one I'll need to read the surrounding code first to do a useful review, so it'll take some time. From owner-xfs@oss.sgi.com Tue Jul 1 01:29:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 01:29:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.5 required=5.0 tests=ANY_BOUNCE_MESSAGE,AWL, BAYES_20,VBOUNCE_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m618TGAn007918 for ; Tue, 1 Jul 2008 01:29:16 -0700 X-ASG-Debug-ID: 1214901018-3e4501a20000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from omr-m23.mx.aol.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 881662A2373 for ; Tue, 1 Jul 2008 01:30:18 -0700 (PDT) Received: from omr-m23.mx.aol.com (omr-m23.mx.aol.com [64.12.136.131]) by cuda.sgi.com with ESMTP id SFpePFG5K2iMJWWk for ; Tue, 01 Jul 2008 01:30:18 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from rly-df05.mx.aol.com (rly-df05.mx.aol.com [205.188.252.9]) by omr-m23.mx.aol.com (v117.7) with ESMTP id MAILOMRM235-7e004869eb0c378; Tue, 01 Jul 2008 04:30:04 -0400 Received: from localhost (localhost) by rly-df05.mx.aol.com (8.14.1/8.14.1) id m618Tu00009417; Tue, 1 Jul 2008 04:30:04 -0400 Date: Tue, 1 Jul 2008 04:30:04 -0400 From: Mail Delivery Subsystem Message-Id: <200807010830.m618Tu00009417@rly-df05.mx.aol.com> To: MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="m618Tu00009417.1214901004/rly-df05.mx.aol.com" X-ASG-Orig-Subj: Returned mail: see transcript for details Subject: Returned mail: see transcript for details Auto-Submitted: auto-generated (failure) X-AOL-INRLY: net-50-114.mweb.co.za [196.211.50.114] rly-df05 X-AOL-IP: 205.188.252.9 X-Barracuda-Connect: omr-m23.mx.aol.com[64.12.136.131] X-Barracuda-Start-Time: 1214901019 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16674 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@aol.com Precedence: bulk X-list: xfs This is a MIME-encapsulated message --m618Tu00009417.1214901004/rly-df05.mx.aol.com The original message was received at Tue, 1 Jul 2008 04:29:37 -0400 from net-50-114.mweb.co.za [196.211.50.114] *** ATTENTION *** Your e-mail is being returned to you because there was a problem with its delivery. The address which was undeliverable is listed in the section labeled: "----- The following addresses had permanent fatal errors -----". The reason your mail is being returned to you is listed in the section labeled: "----- Transcript of Session Follows -----". The line beginning with "<<<" describes the specific reason your e-mail could not be delivered. The next line contains a second error message which is a general translation for other e-mail servers. Please direct further questions regarding this message to your e-mail administrator. --AOL Postmaster ----- The following addresses had permanent fatal errors ----- (reason: 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent.) ----- Transcript of session follows ----- ... while talking to air-df08.mail.aol.com.: >>> DATA <<< 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent. 554 5.0.0 Service unavailable --m618Tu00009417.1214901004/rly-df05.mx.aol.com Content-Type: message/delivery-status Reporting-MTA: dns; rly-df05.mx.aol.com Arrival-Date: Tue, 1 Jul 2008 04:29:37 -0400 Final-Recipient: RFC822; winningtouch@aol.com Action: failed Status: 5.0.0 Remote-MTA: DNS; air-df08.mail.aol.com Diagnostic-Code: SMTP; 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent. Last-Attempt-Date: Tue, 1 Jul 2008 04:30:04 -0400 --m618Tu00009417.1214901004/rly-df05.mx.aol.com Content-Type: text/rfc822-headers Received: from oss.sgi.com (net-50-114.mweb.co.za [196.211.50.114]) by rly-df05.mx.aol.com (v121.5) with ESMTP id MAILRELAYINDF051-54c4869eae839b; Tue, 01 Jul 2008 04:29:33 -0400 From: linux-xfs@oss.sgi.com To: winningtouch@aol.com Subject: Delivery reports about your e-mail Date: Tue, 1 Jul 2008 10:29:26 +0200 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0006_D08D677A.98F7EAF5" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AOL-IP: 196.211.50.114 X-AOL-SCOLL-SCORE:0:2:265791696:9395240 X-AOL-SCOLL-URL_COUNT: X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_helo : n X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_822_from : n Message-ID: <200807010429.54c4869eae839b@rly-df05.mx.aol.com> --m618Tu00009417.1214901004/rly-df05.mx.aol.com-- From owner-xfs@oss.sgi.com Tue Jul 1 02:11:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 02:11:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,STOX_REPLY_TYPE autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m619Be0W010394 for ; Tue, 1 Jul 2008 02:11:41 -0700 X-ASG-Debug-ID: 1214903562-305d00ee0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0611FD7F2B7 for ; Tue, 1 Jul 2008 02:12:42 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id 5Cl7B57YTwXbvMY0 for ; Tue, 01 Jul 2008 02:12:42 -0700 (PDT) Received: from mailgate4.nec.co.jp ([10.7.69.184]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m619CXiZ022778; Tue, 1 Jul 2008 18:12:33 +0900 (JST) Received: (from root@localhost) by mailgate4.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m619CXw03868; Tue, 1 Jul 2008 18:12:33 +0900 (JST) Received: from kuichi.jp.nec.com (kuichi.jp.nec.com [10.26.220.17]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m619CWbR005745; Tue, 1 Jul 2008 18:12:32 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Tue, 1 Jul 2008 18:12:32 +0900 Message-Id: <6B16FAEFB450496A9AA95BFF27BD6AE6@nsl.ad.nec.co.jp> From: "Takashi Sato" To: "Alasdair G Kergon" Cc: , , , , , , , , References: <20080630212005t-sato@mail.jp.nec.com> <20080630135433.GA22522@agk.fab.redhat.com> In-Reply-To: <20080630135433.GA22522@agk.fab.redhat.com> X-ASG-Orig-Subj: Re: [dm-devel] [PATCH 0/3] freeze feature ver 1.8 Subject: Re: [dm-devel] [PATCH 0/3] freeze feature ver 1.8 Date: Tue, 1 Jul 2008 18:12:32 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1214903563 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54846 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16675 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi, Alasdair G Kergon wrote: >> Currently, ext3 in mainline Linux doesn't have the freeze feature which >> suspends write requests. So, we cannot take a backup which keeps >> the filesystem's consistency with the storage device's features >> (snapshot and replication) while it is mounted. >> In many case, a commercial filesystem (e.g. VxFS) has >> the freeze feature and it would be used to get the consistent backup. >> If Linux's standard filesytem ext3 has the freeze feature, we can do it >> without a commercial filesystem. > > Is the following a fair summary? Yes, you are right. We'd like to use the freeze feature without device-mapper/LVM. > 1. Some filesystems have a freeze/thaw feature. XFS exports this to > userspace directly through a couple of ioctls, but other filesystems > don't. For filesystems on device-mapper block devices it is exported to > userspace through the DM_DEV_SUSPEND ioctl which LVM uses. > > 2. There is a desire to access this feature from userspace on non-XFS > filesystems without having to use device-mapper/LVM. > > Alasdair Cheers, Takashi From owner-xfs@oss.sgi.com Tue Jul 1 03:52:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 03:52:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m61Aq0QT016501 for ; Tue, 1 Jul 2008 03:52:00 -0700 X-ASG-Debug-ID: 1214909580-69f8015a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 84451123A92A for ; Tue, 1 Jul 2008 03:53:00 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id ntehcwwXRHrqHbHK for ; Tue, 01 Jul 2008 03:53:00 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m61AqrNK027962; Tue, 1 Jul 2008 06:52:53 -0400 Received: from pobox.fab.redhat.com (pobox.fab.redhat.com [10.33.63.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m61Aqpik013057; Tue, 1 Jul 2008 06:52:52 -0400 Received: from agk.fab.redhat.com (agk.fab.redhat.com [10.33.0.19]) by pobox.fab.redhat.com (8.13.1/8.13.1) with ESMTP id m61AqpHv015837; Tue, 1 Jul 2008 06:52:51 -0400 Received: from agk by agk.fab.redhat.com with local (Exim 4.34) id 1KDdTf-0005Sz-6u; Tue, 01 Jul 2008 11:52:51 +0100 Date: Tue, 1 Jul 2008 11:52:51 +0100 From: Alasdair G Kergon To: Takashi Sato Cc: Christoph Hellwig , axboe@kernel.dk, mtk.manpages@googlemail.com, "linux-kernel@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , viro@ZenIV.linux.org.uk, "linux-fsdevel@vger.kernel.org" , akpm@linux-foundation.org, "linux-ext4@vger.kernel.org" X-ASG-Orig-Subj: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Subject: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Message-ID: <20080701105251.GC22522@agk.fab.redhat.com> Mail-Followup-To: Takashi Sato , Christoph Hellwig , axboe@kernel.dk, mtk.manpages@googlemail.com, "linux-kernel@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , viro@ZenIV.linux.org.uk, "linux-fsdevel@vger.kernel.org" , akpm@linux-foundation.org, "linux-ext4@vger.kernel.org" References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080701081026.GB16691@infradead.org> User-Agent: Mutt/1.4.1i Organization: Red Hat UK Ltd. Registered in England and Wales, number 03798903. Registered Office: Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE. X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1214909583 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16676 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: agk@redhat.com Precedence: bulk X-list: xfs On Tue, Jul 01, 2008 at 04:10:26AM -0400, Christoph Hellwig wrote: > I still disagree with this whole patch. Same here - if you want a timeout, what stops you from implementing it in a userspace process? If your concern is that the process might die without thawing the filesystem, take a look at the userspace LVM/multipath code for ideas - lock into memory, disable OOM killer, run from ramdisk etc. In practice, those techniques seem to be good enough. > call can hang and this would be theoretically useful is when the > filesystem is already frozen by someone else, but this should be fixed > by refusing to do the second freeze, as suggested in my comment to patch > 1. Similarly if a device-mapper device is involved, how should the following sequence behave - A, B or C? 1. dmsetup suspend (freezes) 2. FIFREEZE 3. FITHAW 4. dmsetup resume (thaws) A: 1 succeeds, freezes 2 succeeds, remains frozen 3 succeeds, remains frozen 4 succeeds, thaws B: 1 succeeds, freezes 2 fails, remains frozen 3 shouldn't be called because 2 failed but if it is: succeeds, thaws 4 succeeds (already thawed, but still does the device-mapper parts) C: 1 succeeds, freezes 2 fails, remains frozen 3 fails (because device-mapper owns the freeze/thaw), remains frozen 4 succeeds, thaws Alasdair -- agk@redhat.com From owner-xfs@oss.sgi.com Tue Jul 1 07:12:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 07:12:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m61EBuEL002280 for ; Tue, 1 Jul 2008 07:12:33 -0700 Received: from [134.15.251.2] (melb-sw-corp-251-2.corp.sgi.com [134.15.251.2]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id AAA01516; Wed, 2 Jul 2008 00:12:46 +1000 Message-ID: <486A3B5B.20402@sgi.com> Date: Wed, 02 Jul 2008 00:12:43 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Christoph Litauer CC: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: rfc: kill ino64 mount option References: <20080627153928.GA31384@lst.de> <20080628000914.GE29319@disturbed> <486589E7.9010705@sgi.com> <4869E5A4.4020900@uni-koblenz.de> In-Reply-To: <4869E5A4.4020900@uni-koblenz.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16677 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Christoph Litauer wrote: > Mark Goodwin schrieb: > .. >> We have a design proposal known as "inode32+" that essentially removes >> the direct mapping between inode number and disk offset. This will >> provide all the layout and performance benefits of ino64 without the >> interop issues. Until inode32+ is available, we need to keep ino64. > > Hi, > > as I have massive performance problems using xfs with millions of > inodes, I am very interested in this "incode32+". can you please post some details of the problems you're seeing? > My server is a 32 bit machine, so I am not able to use inode64. > Is it available? inode32+ is only a design at the moment. An implementation is several months away. Until then, you'll have to update your server to 64bit. Thanks -- Mark From owner-xfs@oss.sgi.com Tue Jul 1 07:44:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 07:44:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m61Ei9gM004650 for ; Tue, 1 Jul 2008 07:44:10 -0700 X-ASG-Debug-ID: 1214923510-4d26019e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from deliver.uni-koblenz.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1032D2A4684 for ; Tue, 1 Jul 2008 07:45:10 -0700 (PDT) Received: from deliver.uni-koblenz.de (deliver.uni-koblenz.de [141.26.64.15]) by cuda.sgi.com with ESMTP id Vr1ESNTtDBUP33I0 for ; Tue, 01 Jul 2008 07:45:10 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by deliver.uni-koblenz.de (Postfix) with ESMTP id C193C789A3D6; Tue, 1 Jul 2008 16:45:09 +0200 (CEST) Received: from deliver.uni-koblenz.de ([127.0.0.1]) by localhost (deliver.uni-koblenz.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 26174-06; Tue, 1 Jul 2008 16:45:08 +0200 (CEST) Received: from bruch.uni-koblenz.de (bruch.uni-koblenz.de [141.26.64.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by deliver.uni-koblenz.de (Postfix) with ESMTP id 143BF789A177; Tue, 1 Jul 2008 16:45:08 +0200 (CEST) Message-ID: <486A42F3.3090207@uni-koblenz.de> Date: Tue, 01 Jul 2008 16:45:07 +0200 From: Christoph Litauer User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: rfc: kill ino64 mount option Subject: Re: rfc: kill ino64 mount option References: <20080627153928.GA31384@lst.de> <20080628000914.GE29319@disturbed> <486589E7.9010705@sgi.com> <4869E5A4.4020900@uni-koblenz.de> <486A3B5B.20402@sgi.com> In-Reply-To: <486A3B5B.20402@sgi.com> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at uni-koblenz.de X-Barracuda-Connect: deliver.uni-koblenz.de[141.26.64.15] X-Barracuda-Start-Time: 1214923512 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1099 1.0000 -1.3335 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.33 X-Barracuda-Spam-Status: No, SCORE=-1.33 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC5_SA210e X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54866 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 BSF_SC5_SA210e Custom Rule SA210e X-Virus-Status: Clean X-archive-position: 16678 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: litauer@uni-koblenz.de Precedence: bulk X-list: xfs Mark Goodwin schrieb: > > > Christoph Litauer wrote: >> Mark Goodwin schrieb: >> .. >>> We have a design proposal known as "inode32+" that essentially removes >>> the direct mapping between inode number and disk offset. This will >>> provide all the layout and performance benefits of ino64 without the >>> interop issues. Until inode32+ is available, we need to keep ino64. >> >> Hi, >> >> as I have massive performance problems using xfs with millions of >> inodes, I am very interested in this "incode32+". > > can you please post some details of the problems you're seeing? Please see thread "Performance problems with millions of inodes". If you don't have it anymore, I can send it to you. > >> My server is a 32 bit machine, so I am not able to use inode64. >> Is it available? > > inode32+ is only a design at the moment. An implementation is several > months away. Until then, you'll have to update your server to 64bit. This is, sadly, not an option at the moment ... -- Regards Christoph ________________________________________________________________________ Christoph Litauer litauer@uni-koblenz.de Uni Koblenz, Computing Center, http://www.uni-koblenz.de/~litauer Postfach 201602, 56016 Koblenz Fon: +49 261 287-1311, Fax: -100 1311 PGP-Fingerprint: F39C E314 2650 650D 8092 9514 3A56 FBD8 79E3 27B2 From owner-xfs@oss.sgi.com Tue Jul 1 08:14:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 08:14:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m61FEerY007384 for ; Tue, 1 Jul 2008 08:14:41 -0700 X-ASG-Debug-ID: 1214925342-4d2402fd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sovereign.computergmbh.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1498F2A4A08 for ; Tue, 1 Jul 2008 08:15:42 -0700 (PDT) Received: from sovereign.computergmbh.de (sovereign.computergmbh.de [85.214.69.204]) by cuda.sgi.com with ESMTP id DrSSskCD9XhUYagD for ; Tue, 01 Jul 2008 08:15:42 -0700 (PDT) Received: by sovereign.computergmbh.de (Postfix, from userid 25121) id E92CA18032F4A; Tue, 1 Jul 2008 17:15:40 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by sovereign.computergmbh.de (Postfix) with ESMTP id E19871C0E7213 for ; Tue, 1 Jul 2008 17:15:40 +0200 (CEST) Date: Tue, 1 Jul 2008 17:15:40 +0200 (CEST) From: Jan Engelhardt To: xfs@oss.sgi.com X-ASG-Orig-Subj: grub fails boot after update Subject: grub fails boot after update Message-ID: User-Agent: Alpine 1.10 (LNX 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Barracuda-Connect: sovereign.computergmbh.de[85.214.69.204] X-Barracuda-Start-Time: 1214925343 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0002 1.0000 -2.0195 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54869 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16679 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jengelh@medozas.de Precedence: bulk X-list: xfs From Novell Bugzilla, I gather that XFS has a serious problem with grub. Since I'd like to keep XFS for the time being, is there any way to fix this issue, or make dead sure that a given file is on disk? Like ioctl(fd, XFS_FLUSH_I_MEAN_IT)? ---------- Forwarded message ---------- https://bugzilla.novell.com/show_bug.cgi?id=223773 --- Comment #39 2008-07-01 08:44:49 MDT --- I agree with comment #37: XFS really does suck, especially when it comes to booting Linux on a PC. Fortunately we do not support it any more for new installations, an ext2 /boot partition is highly recommended. The problem is that with XFS, sync(2) returns, but the data isn't synced. The first time yast calls grub install, grub does not find the new stage1.5, because it is not on the disk yet, despite a successful sync; thus it modifies stage2 to do the job. On the second invocation, stage1.5 is found and installed, but stage2 already is modified. So once again this isn't a grub bug, but an XFS bug with FS semantics. From owner-xfs@oss.sgi.com Tue Jul 1 08:48:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 08:48:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m61FmtS3014919 for ; Tue, 1 Jul 2008 08:48:55 -0700 X-ASG-Debug-ID: 1214927396-153700570000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from filer.fsl.cs.sunysb.edu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 60C231BAADDE; Tue, 1 Jul 2008 08:49:57 -0700 (PDT) Received: from filer.fsl.cs.sunysb.edu (filer.fsl.cs.sunysb.edu [130.245.126.2]) by cuda.sgi.com with ESMTP id sTmWh6PidrY4kK7P; Tue, 01 Jul 2008 08:49:57 -0700 (PDT) Received: from josefsipek.net (baal.fsl.cs.sunysb.edu [130.245.126.78]) by filer.fsl.cs.sunysb.edu (8.12.11.20060308/8.13.8) with ESMTP id m61Fnj7e023020; Tue, 1 Jul 2008 11:49:46 -0400 Received: by josefsipek.net (Postfix, from userid 1000) id 6044B1C00D88; Tue, 1 Jul 2008 11:49:46 -0400 (EDT) Date: Tue, 1 Jul 2008 11:49:46 -0400 From: "Josef 'Jeff' Sipek" To: Niv Sardi , xfs@oss.sgi.com, Niv Sardi X-ASG-Orig-Subj: Re: [PATCH] Give a transaction to xfs_attr_set_int Subject: Re: [PATCH] Give a transaction to xfs_attr_set_int Message-ID: <20080701154946.GB20383@josefsipek.net> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1214196150-5427-2-git-send-email-xaiki@sgi.com> <1214196150-5427-3-git-send-email-xaiki@sgi.com> <1214196150-5427-4-git-send-email-xaiki@sgi.com> <1214196150-5427-5-git-send-email-xaiki@sgi.com> <20080629220859.GL29319@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080629220859.GL29319@disturbed> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: filer.fsl.cs.sunysb.edu[130.245.126.2] X-Barracuda-Start-Time: 1214927397 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54873 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16680 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jeffpc@josefsipek.net Precedence: bulk X-list: xfs On Mon, Jun 30, 2008 at 08:08:59AM +1000, Dave Chinner wrote: ... > > @@ -356,6 +381,8 @@ xfs_attr_set_int(xfs_inode_t *dp, const char *name, int namelen, > > if (!error && (flags & ATTR_KERNOTIME) == 0) { > > xfs_ichgtime(dp, XFS_ICHGTIME_CHG); > > } > > + if (tpp) > > + tpp = &args.trans; > > That's busted too. Can you please review all the places where you > return transactio pointers to the caller via a function parameterrr > for this bug as you've made in at least a couple of places. Niv: Why not return the pointer as a return value? Josef 'Jeff' Sipek. -- Humans were created by water to transport it upward. From owner-xfs@oss.sgi.com Tue Jul 1 08:54:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 08:54:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.0 required=5.0 tests=BAYES_50,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m61FsKbk015537 for ; Tue, 1 Jul 2008 08:54:20 -0700 X-ASG-Debug-ID: 1214927721-0bad01240000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from edge.itt.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 73D1012D2C62 for ; Tue, 1 Jul 2008 08:55:21 -0700 (PDT) Received: from edge.itt.com (edge.itt.com [151.190.254.13]) by cuda.sgi.com with ESMTP id ONFV2UKkSzBzVYSn for ; Tue, 01 Jul 2008 08:55:21 -0700 (PDT) Received: from fwexhub3.itt.net (10.32.76.113) by edge.itt.com (10.32.16.13) with Microsoft SMTP Server (TLS) id 8.1.278.0; Tue, 1 Jul 2008 11:55:10 -0400 Received: from corpchsert01.edocorp.com (10.240.16.17) by fwexhub3.itt.net (10.32.76.113) with Microsoft SMTP Server (TLS) id 8.1.278.0; Tue, 1 Jul 2008 11:55:21 -0400 Received: from corpchsefe01.edocorp.com ([10.240.16.22]) by corpchsert01.edocorp.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jul 2008 11:56:05 -0400 Received: from corpistert01.edocorp.com ([10.244.194.17]) by corpchsefe01.edocorp.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jul 2008 11:56:04 -0400 Received: from corpistemb01.edocorp.com ([10.244.194.14]) by corpistert01.edocorp.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jul 2008 11:56:04 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 X-ASG-Orig-Subj: XFS Compatibility Questions Subject: XFS Compatibility Questions Date: Tue, 1 Jul 2008 11:54:50 -0400 Message-ID: <0EEA30D7D649274EB38B0B140022557F23B36C@corpistemb01.edocorp.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: XFS Compatibility Questions Thread-Index: AcjbksuaLgg19kLgRYm2fT61/hoe0g== From: "Arensdorf, Christopher" To: X-OriginalArrivalTime: 01 Jul 2008 15:56:04.0678 (UTC) FILETIME=[F7A87660:01C8DB92] X-Barracuda-Connect: edge.itt.com[151.190.254.13] X-Barracuda-Start-Time: 1214927722 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4997 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54872 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1446 X-archive-position: 16681 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Chris.Arensdorf@itt.com Precedence: bulk X-list: xfs Hello, My name is Chris and I'm with ITT Corporation in Nashua, NH. We're currently looking to upgrade one of our products to make use of InfiniBand technology, and unfortunately we're running QFS which does not support InfiniBand. We're interested in exploring the idea of using XFS so I had a few questions I was hoping you might be able to answer that I didn't seem to find in the FAQ section. Is XFS compatible with InfiniBand? Is XFS compatible with RHEL 5.0 or higher? Is XFS compatible with Fibre Channel? Is XFS compatible with Solaris 10 x86? Thanks very much for your time and I look forward to hearing back from you. Chris Arensdorf ITT Corporation 85 Northwest Blvd Nashua, NH 03063 Ph: (603) 459-2290 (Direct) Ph: (603) 459-2200 (Main) chris.arensdorf@edocorp.com ________________________________ This e-mail and any files transmitted with it may be proprietary and are intended solely for the use of the individual or entity to whom they are addressed. If you have received this e-mail in error please notify the sender. Please note that any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of ITT Corporation. The recipient should check this e-mail and any attachments for the presence of viruses. ITT accepts no liability for any damage caused by any virus transmitted by this e-mail. [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Jul 1 08:54:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 08:54:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m61FsK10015547 for ; Tue, 1 Jul 2008 08:54:20 -0700 X-ASG-Debug-ID: 1214927723-158702170000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B2BE82A4DF4 for ; Tue, 1 Jul 2008 08:55:23 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id o2aCQAMFSN3UPp2K for ; Tue, 01 Jul 2008 08:55:23 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KDiCQ-00084C-GL; Tue, 01 Jul 2008 15:55:22 +0000 Date: Tue, 1 Jul 2008 11:55:22 -0400 From: Christoph Hellwig To: Jan Engelhardt Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: grub fails boot after update Subject: Re: grub fails boot after update Message-ID: <20080701155522.GA29722@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1214927723 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54873 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16682 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs sync works perfectly fine on xfs. Grub just doesn't understand what sync means, and because of that it's buggy on all filesystems, just with less a chance on others. The fix is pretty simple and that is stopping to try to access the filesystem with it's own driver through the block device node. From owner-xfs@oss.sgi.com Tue Jul 1 18:58:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 18:58:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m621wYZj030941 for ; Tue, 1 Jul 2008 18:58:37 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA16381; Wed, 2 Jul 2008 11:59:20 +1000 Message-ID: <486AE0F8.5080506@sgi.com> Date: Wed, 02 Jul 2008 11:59:20 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Mark Goodwin CC: Christoph Hellwig , Lachlan McIlroy , xfs-dev , xfs-oss Subject: Re: [PATCH] Fix use after free when closing log/rt devices References: <48647746.5010007@sgi.com> <20080627063219.GA25015@infradead.org> <48648B2B.3080709@sgi.com> <20080627090822.GA17374@infradead.org> In-Reply-To: <20080627090822.GA17374@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16683 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Fri, Jun 27, 2008 at 04:39:39PM +1000, Mark Goodwin wrote: >> do we have any QA tests that test external log? > > Most QA tests will use the external log if you set it up that way. But > ithout slab poisoning this won't be noticed either. I think you need: USE_EXTERNAL=yes SCRATCH_LOGDEV=somelogdevice TEST_LOGDEV=somelogdevice to get the scratch and test mounts using an external log. There are no explicit external log tests (logdev=) that I can see. --Tim From owner-xfs@oss.sgi.com Tue Jul 1 19:53:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 19:53:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m622rtVV001504 for ; Tue, 1 Jul 2008 19:53:55 -0700 X-ASG-Debug-ID: 1214967296-4995018b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6C4071860317 for ; Tue, 1 Jul 2008 19:54:57 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 6KUdSymz7qdWpfBu for ; Tue, 01 Jul 2008 19:54:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALaJakh5LBzp/2dsb2JhbACyPw X-IronPort-AV: E=Sophos;i="4.27,735,1204464600"; d="scan'208";a="140003910" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Jul 2008 12:24:55 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KDsUg-0003m9-Cw; Wed, 02 Jul 2008 12:54:54 +1000 Date: Wed, 2 Jul 2008 12:54:54 +1000 From: Dave Chinner To: Timothy Shimmin Cc: Mark Goodwin , Christoph Hellwig , Lachlan McIlroy , xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] Fix use after free when closing log/rt devices Subject: Re: [PATCH] Fix use after free when closing log/rt devices Message-ID: <20080702025454.GW29319@disturbed> Mail-Followup-To: Timothy Shimmin , Mark Goodwin , Christoph Hellwig , Lachlan McIlroy , xfs-dev , xfs-oss References: <48647746.5010007@sgi.com> <20080627063219.GA25015@infradead.org> <48648B2B.3080709@sgi.com> <20080627090822.GA17374@infradead.org> <486AE0F8.5080506@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <486AE0F8.5080506@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1214967298 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54916 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16684 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 02, 2008 at 11:59:20AM +1000, Timothy Shimmin wrote: > Christoph Hellwig wrote: > > On Fri, Jun 27, 2008 at 04:39:39PM +1000, Mark Goodwin wrote: > >> do we have any QA tests that test external log? > > > > Most QA tests will use the external log if you set it up that way. But > > ithout slab poisoning this won't be noticed either. > > I think you need: > USE_EXTERNAL=yes > SCRATCH_LOGDEV=somelogdevice > TEST_LOGDEV=somelogdevice > to get the scratch and test mounts using an external log. Yes. Typically I used to use SCRATCH_LOGDEV=/dev/ram0 so I didn't need another block device on the machine just for an external log on a throw-away filesystem.... > There are no explicit external log tests (logdev=) that I can see. It should be easy to write one using files and multiple loopback devices. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 1 20:42:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 20:42:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m623fxr3008701 for ; Tue, 1 Jul 2008 20:42:00 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA18319; Wed, 2 Jul 2008 13:42:58 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id 0250058C4C29; Wed, 2 Jul 2008 13:42:57 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 983964 - fix mount option parsing in remount Message-Id: <20080702034258.0250058C4C29@chook.melbourne.sgi.com> Date: Wed, 2 Jul 2008 13:42:57 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16685 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Fix mount option parsing in remount. Remount currently happily accept any option thrown at it, although the only filesystem specific option it actually handles is barrier/nobarrier. And it actually doesn't handle these correctly either because it only uses the value it parsed when we're doing a ro->rw transition. In addition to that there's also a bad bug in xfs_parseargs which doesn't touch the actual option in the mount point except for a single one, XFS_MOUNT_SMALL_INUMS and thus forced any filesystem that's every remounted in some way to not support 64bit inodes with no way to recover unless unmounted. This patch changes xfs_fs_remount to use it's own linux/parser.h based options parse instead of xfs_parseargs and reject all options except for barrier/nobarrier and to the right thing in general. Eventually I'd like to have a single big option table used for mount aswell but that can wait for a while. Signed-off-by: Christoph Hellwig Date: Wed Jul 2 13:41:58 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31382a fs/xfs/linux-2.6/xfs_super.c - 1.434 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.434&r2=text&tr2=1.433&f=h - fix mount option parsing in remount From owner-xfs@oss.sgi.com Tue Jul 1 21:17:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 21:17:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m624HnCB010902 for ; Tue, 1 Jul 2008 21:17:51 -0700 X-ASG-Debug-ID: 1214972331-235301510000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta03.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4904FD80B3F for ; Tue, 1 Jul 2008 21:18:51 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (bby1mta03.pmc-sierra.com [216.241.235.118]) by cuda.sgi.com with ESMTP id W6hCAbKDnJsQ8LlT for ; Tue, 01 Jul 2008 21:18:51 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 6159610704C3 for ; Tue, 1 Jul 2008 21:21:24 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta03.pmc-sierra.bc.ca (Postfix) with SMTP id 1779610703BC for ; Tue, 1 Jul 2008 21:21:22 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jul 2008 21:19:24 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Tue, 1 Jul 2008 21:19:23 -0700 Message-ID: <486B01A6.4030104@pmc-sierra.com> Date: Wed, 02 Jul 2008 09:48:46 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Sagar Borikar , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080625084931.GI16257@build-svl-1.agami.com> <340C71CD25A7EB49BFA81AE8C839266701323BE8@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080626070215.GI11558@disturbed> <4864BD5D.1050202@pmc-sierra.com> <4864C001.2010308@pmc-sierra.com> <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> In-Reply-To: <20080701064437.GR29319@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Jul 2008 04:19:24.0141 (UTC) FILETIME=[CF0271D0:01C8DBFA] X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.7.2.40440 X-PMC-SpamCheck: Gauge=IIIIIII, Probability=7%, Report='BODY_SIZE_1300_1399 0, BODY_SIZE_5000_LESS 0, __BOUNCE_CHALLENGE_SUBJ 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __USER_AGENT 0' X-Barracuda-Connect: bby1mta03.pmc-sierra.com[216.241.235.118] X-Barracuda-Start-Time: 1214972332 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4130 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54920 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16686 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Mon, Jun 30, 2008 at 03:54:44PM +0530, Sagar Borikar wrote: > >> After running my test for 20 min, when I check the fragmentation status >> of file system, I observe that it >> is severely fragmented. >> > > Depends on your definition of fragmentation.... > > >> [root@NAS001ee5ab9c85 ~]# xfs_db -c frag -r /dev/RAIDA/vol >> actual 94343, ideal 107, fragmentation factor 99.89% >> > > And that one is a bad one ;) > > Still, there are a lot of extents - ~1000 to a file - which > will be stressing the btree extent format code. > > >> Do you think, this can cause the issue? >> > > Sure - just like any other workload that generates enough > extents. Like I said originally, we've fixed so many problems > in this code since 2.6.18 I'd suggest that your only sane > hope for us to help you track done the problem is to upgrade > to a current kernel and go from there.... > > Cheers,, > > Dave. > Thanks again Dave. But we can't upgrade the kernel as it is already in production and on field. So do you think, periodic cleaning of file system using xfs_fsr can solve the issue? If not, could you kindly direct me what all patches were fixing similar problem? I can try back porting them. Thanks Sagar From owner-xfs@oss.sgi.com Tue Jul 1 22:12:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 22:12:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m625CcBU013973 for ; Tue, 1 Jul 2008 22:12:38 -0700 X-ASG-Debug-ID: 1214975619-436302710000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6648118597D3 for ; Tue, 1 Jul 2008 22:13:39 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id xh9PaNPGl2nEPnse for ; Tue, 01 Jul 2008 22:13:39 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAPqoakh5LBzp/2dsb2JhbACyHw X-IronPort-AV: E=Sophos;i="4.27,735,1204464600"; d="scan'208";a="140102806" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 02 Jul 2008 14:43:38 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KDuev-0006jG-Fs; Wed, 02 Jul 2008 15:13:37 +1000 Date: Wed, 2 Jul 2008 15:13:37 +1000 From: Dave Chinner To: Sagar Borikar Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash Message-ID: <20080702051337.GX29319@disturbed> Mail-Followup-To: Sagar Borikar , xfs@oss.sgi.com References: <20080626070215.GI11558@disturbed> <4864BD5D.1050202@pmc-sierra.com> <4864C001.2010308@pmc-sierra.com> <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <486B01A6.4030104@pmc-sierra.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1214975621 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3523 1.0000 -0.1448 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.14 X-Barracuda-Spam-Status: No, SCORE=-0.14 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54923 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16687 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 02, 2008 at 09:48:46AM +0530, Sagar Borikar wrote: > Dave Chinner wrote: >> On Mon, Jun 30, 2008 at 03:54:44PM +0530, Sagar Borikar wrote: >> Sure - just like any other workload that generates enough >> extents. Like I said originally, we've fixed so many problems >> in this code since 2.6.18 I'd suggest that your only sane >> hope for us to help you track done the problem is to upgrade >> to a current kernel and go from there.... >> > Thanks again Dave. But we can't upgrade the kernel as it is already in > production and on field. Yes, but you can run it in your test environment where you are reproducing this problem, right? > So do you think, periodic cleaning of file system using xfs_fsr can > solve the issue? No, at best it would only delay the problem (whatever it is). > If not, could you > kindly direct me what all patches were fixing similar problem? I can try > back porting them. I don't have time to try to identify some set of changes from the past 3-4 years that might fix your problem. There may not even be a patch that fixes your problem, which is one of the reasons why I've asked if you can reproduce it on a current kernel.... I pointed you the files that the bug could lie in earlier in the thread. You can find the history of changes to those files via the mainline git repository or via the XFS CVS repository. You'd probably do best to look at the git tree because all the changes are well described in the commit logs and you should be able to isolate ones that fix btree problems fairly easily... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 1 22:34:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 22:34:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m625Yg7d015697 for ; Tue, 1 Jul 2008 22:34:44 -0700 X-ASG-Debug-ID: 1214976944-310903e60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 49111D8107D for ; Tue, 1 Jul 2008 22:35:45 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id qFXhqzqvzD8QsATh for ; Tue, 01 Jul 2008 22:35:45 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 495D08E0246 for ; Tue, 1 Jul 2008 22:38:19 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id 4025D8E023C for ; Tue, 1 Jul 2008 22:38:19 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Tue, 1 Jul 2008 22:36:20 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Tue, 1 Jul 2008 22:36:19 -0700 Message-ID: <486B13AD.2010500@pmc-sierra.com> Date: Wed, 02 Jul 2008 11:05:41 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Sagar Borikar , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080626070215.GI11558@disturbed> <4864BD5D.1050202@pmc-sierra.com> <4864C001.2010308@pmc-sierra.com> <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> In-Reply-To: <20080702051337.GX29319@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Jul 2008 05:36:20.0111 (UTC) FILETIME=[8E5791F0:01C8DC05] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1214976945 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4868 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54926 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16688 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Wed, Jul 02, 2008 at 09:48:46AM +0530, Sagar Borikar wrote: > >> Dave Chinner wrote: >> >>> On Mon, Jun 30, 2008 at 03:54:44PM +0530, Sagar Borikar wrote: >>> Sure - just like any other workload that generates enough >>> extents. Like I said originally, we've fixed so many problems >>> in this code since 2.6.18 I'd suggest that your only sane >>> hope for us to help you track done the problem is to upgrade >>> to a current kernel and go from there.... >>> >>> >> Thanks again Dave. But we can't upgrade the kernel as it is already in >> production and on field. >> > > Yes, but you can run it in your test environment where you are > reproducing this problem, right? > > Unfortunately the architecture is customized mips for which the standard kernel port is not available and we have to port the new kernel in order to try this which is why I was hesitating to do this. >> So do you think, periodic cleaning of file system using xfs_fsr can >> solve the issue? >> > > No, at best it would only delay the problem (whatever it is). > > >> If not, could you >> kindly direct me what all patches were fixing similar problem? I can try >> back porting them. >> > > I don't have time to try to identify some set of changes from the > past 3-4 years that might fix your problem. There may not even be a > patch that fixes your problem, which is one of the reasons why I've > asked if you can reproduce it on a current kernel.... > > I pointed you the files that the bug could lie in earlier in the > thread. You can find the history of changes to those files via the > mainline git repository or via the XFS CVS repository. You'd > probably do best to look at the git tree because all the changes are > well described in the commit logs and you should be able to isolate > ones that fix btree problems fairly easily... > > Cheers, > > Dave. > Sure I'll go through these changelogs. Thanks for all your help and really appreciate your time. I hope you don't mind to help me in future if I find something new :) Regards, Sagar From owner-xfs@oss.sgi.com Tue Jul 1 23:13:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 23:13:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m626DSSY018353 for ; Tue, 1 Jul 2008 23:13:29 -0700 X-ASG-Debug-ID: 1214979270-79f602900000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice2.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0541718607AE for ; Tue, 1 Jul 2008 23:14:30 -0700 (PDT) Received: from postoffice2.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id A78DuKs9sroIDqmm for ; Tue, 01 Jul 2008 23:14:30 -0700 (PDT) Received: from postoffice.aconex.com (localhost [127.0.0.1]) by postoffice2.aconex.com (Spam Firewall) with ESMTP id 8522D2DA56C; Wed, 2 Jul 2008 16:14:25 +1000 (EST) Received: from postoffice.aconex.com (postoffice.yarra.acx [192.168.3.1]) by postoffice2.aconex.com with ESMTP id baqKr9sjY5amGsbW; Wed, 02 Jul 2008 16:14:25 +1000 (EST) Received: from [192.168.0.100] (c220-239-214-222.fernt2.vic.optusnet.com.au [220.239.214.222]) by postoffice.aconex.com (Postfix) with ESMTP id 4D77C92C0E3; Wed, 2 Jul 2008 16:14:25 +1000 (EST) X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash From: Nathan Scott To: Sagar Borikar Cc: xfs@oss.sgi.com In-Reply-To: <486B13AD.2010500@pmc-sierra.com> References: <20080626070215.GI11558@disturbed> <4864BD5D.1050202@pmc-sierra.com> <4864C001.2010308@pmc-sierra.com> <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> Content-Type: text/plain Date: Wed, 02 Jul 2008 16:13:11 +1000 Message-Id: <1214979191.6025.22.camel@verge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1214979271 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0024 1.0000 -2.0055 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54927 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16689 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Wed, 2008-07-02 at 11:05 +0530, Sagar Borikar wrote: > > Unfortunately the architecture is customized mips for which the > standard > kernel port is > not available and we have to port the new kernel in order to try > this > which is why I was > hesitating to do this. You can always try the reverse - replace fs/xfs from your mips build tree with the one from the current/a recent kernel. Theres very few changes in the surrounding kernel code that xfs needs. cheers. -- Nathan From owner-xfs@oss.sgi.com Tue Jul 1 23:37:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 23:37:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m626b7LE020112 for ; Tue, 1 Jul 2008 23:37:09 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA21948; Wed, 2 Jul 2008 16:38:00 +1000 Message-ID: <486B2248.5080400@sgi.com> Date: Wed, 02 Jul 2008 16:38:00 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Niv Sardi CC: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH] Move attr log alloc size calculator to another function. References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1214196150-5427-2-git-send-email-xaiki@sgi.com> <20080626082438.GB23954@infradead.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16690 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Niv Sardi wrote: > Attached updated patch. > > Christoph Hellwig writes: >> On Mon, Jun 23, 2008 at 02:42:27PM +1000, Niv Sardi wrote: >>> From: Niv Sardi >>> >>> We will need that to be able to calculate the size of log we need for >>> a specific attr (for parent pointers in create). We need the local so >>> that we can fail if we run into ENOSPC when trying to alloc blocks > > Updated Comments, structs instead of typdefs > >>> Signed-off-by: Niv Sardi >>> --- >>> fs/xfs/xfs_attr.c | 78 +++++++++++++++++++++++++++++++--------------------- >>> fs/xfs/xfs_attr.h | 2 +- >>> 2 files changed, 47 insertions(+), 33 deletions(-) >>> >>> diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c >>> index e58f321..0d19e90 100644 >>> --- a/fs/xfs/xfs_attr.c >>> +++ b/fs/xfs/xfs_attr.c >>> @@ -185,6 +185,43 @@ xfs_attr_get( >>> } >>> >>> int >>> +xfs_attr_calc_size( >> should be marked STATIC, > > The whole idea is to be able to use it in xfs_create(). > I guess in isolation it just looks weird as the only caller is within the file. In isolation it would make sense to be STATIC. (Then again, in isolation, it looks strange returning the "local" parameter - as you said, you need it elsewhere). And I guess, Christoph's point was that it could go in as an isolated cleanup patch if it was made static. --Tim From owner-xfs@oss.sgi.com Tue Jul 1 23:56:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 01 Jul 2008 23:56:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m626u7FV021416 for ; Tue, 1 Jul 2008 23:56:09 -0700 X-ASG-Debug-ID: 1214981830-7488016d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from build-svl-1.agami.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CDD0A2A6978 for ; Tue, 1 Jul 2008 23:57:10 -0700 (PDT) Received: from build-svl-1.agami.com (colo-nat-pool.agami.com [216.218.227.40]) by cuda.sgi.com with ESMTP id fAr2CMyef5nfFFET for ; Tue, 01 Jul 2008 23:57:10 -0700 (PDT) Received: from build-svl-1.agami.com (localhost.localdomain [127.0.0.1]) by build-svl-1.agami.com (8.13.7/8.13.7) with ESMTP id m626utqG004043; Tue, 1 Jul 2008 23:56:55 -0700 Received: (from dchinner@localhost) by build-svl-1.agami.com (8.13.7/8.13.7/Submit) id m626uqri004042; Tue, 1 Jul 2008 23:56:52 -0700 X-Authentication-Warning: build-svl-1.agami.com: dchinner set sender to dchinner@agami.com using -f Date: Tue, 1 Jul 2008 23:56:52 -0700 From: Dave Chinner To: Nathan Scott Cc: Sagar Borikar , xfs@oss.sgi.com, sandeen@sandeen.net X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash Message-ID: <20080702065652.GS14251@build-svl-1.agami.com> Mail-Followup-To: Nathan Scott , Sagar Borikar , xfs@oss.sgi.com, sandeen@sandeen.net References: <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1214979191.6025.22.camel@verge.scott.net.au> User-Agent: Mutt/1.4.2.3i X-Barracuda-Connect: colo-nat-pool.agami.com[216.218.227.40] X-Barracuda-Start-Time: 1214981830 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0002 1.0000 -2.0195 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54929 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16691 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dchinner@agami.com Precedence: bulk X-list: xfs On Wed, Jul 02, 2008 at 04:13:11PM +1000, Nathan Scott wrote: > On Wed, 2008-07-02 at 11:05 +0530, Sagar Borikar wrote: > > > > Unfortunately the architecture is customized mips for which the > > standard > > kernel port is > > not available and we have to port the new kernel in order to try > > this > > which is why I was > > hesitating to do this. > > You can always try the reverse - replace fs/xfs from your mips build > tree with the one from the current/a recent kernel. Theres very few > changes in the surrounding kernel code that xfs needs. Eric should be able to comment on the pitfalls in doing this having tried to backport a 2.6.25 fs/xfs to a 2.6.18 RHEL kernel. Eric - any comments? Cheers, Dave. -- Dave Chinner dchinner@agami.com From owner-xfs@oss.sgi.com Wed Jul 2 00:13:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 00:13:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m627DKs2025195 for ; Wed, 2 Jul 2008 00:13:22 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA22889; Wed, 2 Jul 2008 17:14:18 +1000 Message-ID: <486B2ACA.2050506@sgi.com> Date: Wed, 02 Jul 2008 17:14:18 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Niv Sardi CC: xfs@oss.sgi.com Subject: Re: [PATCH] Move xfs_attr_rolltrans to xfs_trans_roll References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1214196150-5427-2-git-send-email-xaiki@sgi.com> <1214196150-5427-3-git-send-email-xaiki@sgi.com> In-Reply-To: <1214196150-5427-3-git-send-email-xaiki@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16692 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Niv Sardi wrote: > Move it from the attr code to the transaction code and make the attr > code call the new function. > > We rolltrans is really usefull whenever we want to use rolling > transaction, should be generic, it isn't dependent on any part of the > attr code anyway. > So you just have some renames on calls and change where func definition is located. And you've added comments. > +/* > + * Roll from one trans in the sequence of PERMANENT transactions to > + * the next: permanent transactions are only flushed out when commited > + * with XFS_TRANS_RELEASE_LOG_RES, but we still want as soon as > + * possible to let chunks of it go to the log. So we commit the chunck > + * we've been working on and get a new transaction to continue. > + */ typos: s/chunck/chunk/ s/commited/committed/ --Tim From owner-xfs@oss.sgi.com Wed Jul 2 01:24:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 01:25:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m628OZef001976 for ; Wed, 2 Jul 2008 01:24:37 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA24539; Wed, 2 Jul 2008 18:25:26 +1000 Message-ID: <486B3B76.8020303@sgi.com> Date: Wed, 02 Jul 2008 18:25:26 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Niv Sardi CC: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH] Introduce xfs_trans_bmap_add_attrfork. References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1214196150-5427-2-git-send-email-xaiki@sgi.com> <1214196150-5427-3-git-send-email-xaiki@sgi.com> <1214196150-5427-4-git-send-email-xaiki@sgi.com> <20080626092856.GA27069@infradead.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16693 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Niv Sardi wrote: > Updated patch attached, > Moved case where there is no transaction back into > xfs_bmap_add_attrfork() and rely on caller to call xfs_trans_roll(), > > Christoph Hellwig writes: >>> +xfs_bmap_add_attrfork( > [...] >> Care to add this below xfs_trans_bmap_add_attrfork? Also please >> us struct xfs_inode instead of the typedef. > > Done, > >>> + if (tpp) { >>> + ASSERT(*tpp); >>> + tp = *tpp; >>> + } else { > [...] >> I think it would be much cleaner if all the transaction setup, joining >> etc was done in xfs_bmap_add_attrfork, and xfs_trans_bmap_add_attrfork >> just gets an always non-NULL xfs_trans pointer. That would mean >> the common code would become just a helper, and >> xfs_trans_bmap_add_attrfork would be a small wrapper including the >> xfs_trans_roll. Alternatively the caller could always do the roll. > > I think I got it right, but error handeling is a bit weird this way, > looks logically identical. > > > > ------------------------------------------------------------------------ > > > Thanks for this extensive review =) > > + if (error) > + goto error1; > + > + if (XFS_IFORK_Q(ip)) > + goto error1; > + > + ASSERT(ip->i_d.di_anextents == 0); > + VN_HOLD(XFS_ITOV(ip)); > + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); > + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > + > + error = xfs_trans_bmap_add_attrfork(NULL, ip, size, rsvd); > + if (error) > + return error; > + return xfs_trans_commit(tp, XFS_TRANS_PERM_LOG_RES); I was kind of expecting the transaction, &tp, to be passed into xfs_trans_bmap_add_attrfork(). (And then xfs_trans_bmap_add_attrfork() which calls xfs_bmap_finish() which calls xfs_trans_dup() and so from that point on we would then have to update tp if we were to use it.) So how come we pass in NULL? I'm tired so I'm probably missing something obvious. --Tim From owner-xfs@oss.sgi.com Wed Jul 2 04:02:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 04:02:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m62B20WU012270 for ; Wed, 2 Jul 2008 04:02:02 -0700 X-ASG-Debug-ID: 1214996582-6cb802fe0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta01.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 23A89D82AEC for ; Wed, 2 Jul 2008 04:03:02 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (bby1mta01.pmc-sierra.com [216.241.235.116]) by cuda.sgi.com with ESMTP id egSCjQAobVNjBnYh for ; Wed, 02 Jul 2008 04:03:02 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id DBBA91890433; Wed, 2 Jul 2008 04:06:05 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta01.pmc-sierra.bc.ca (Postfix) with SMTP id CF0BB1890426; Wed, 2 Jul 2008 04:06:05 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Wed, 2 Jul 2008 04:03:37 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Wed, 2 Jul 2008 04:03:37 -0700 Message-ID: <486B6062.6040201@pmc-sierra.com> Date: Wed, 02 Jul 2008 16:32:58 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Nathan Scott , Sagar Borikar , xfs@oss.sgi.com, sandeen@sandeen.net X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> In-Reply-To: <20080702065652.GS14251@build-svl-1.agami.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 Jul 2008 11:03:37.0269 (UTC) FILETIME=[47001650:01C8DC33] X-Barracuda-Connect: bby1mta01.pmc-sierra.com[216.241.235.116] X-Barracuda-Start-Time: 1214996583 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0069 1.0000 -1.9760 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.98 X-Barracuda-Spam-Status: No, SCORE=-1.98 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54944 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16694 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Wed, Jul 02, 2008 at 04:13:11PM +1000, Nathan Scott wrote: > >> On Wed, 2008-07-02 at 11:05 +0530, Sagar Borikar wrote: >> >>> Unfortunately the architecture is customized mips for which the >>> standard >>> kernel port is >>> not available and we have to port the new kernel in order to try >>> this >>> which is why I was >>> hesitating to do this. >>> >> You can always try the reverse - replace fs/xfs from your mips build >> tree with the one from the current/a recent kernel. Theres very few >> changes in the surrounding kernel code that xfs needs. >> > > Eric should be able to comment on the pitfalls in doing this having > tried to backport a 2.6.25 fs/xfs to a 2.6.18 RHEL kernel. Eric - > any comments? > > Cheers, > > Dave. > Eric, Could you please let me know about bits and pieces that we need to remember while back porting xfs to 2.6.18? If you share patches which takes care of it, that would be great. Thanks Sagar From owner-xfs@oss.sgi.com Wed Jul 2 12:21:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 12:21:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m62JL6pF024974 for ; Wed, 2 Jul 2008 12:21:07 -0700 X-ASG-Debug-ID: 1215026528-1e8802510000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B652E186317B for ; Wed, 2 Jul 2008 12:22:08 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id BegmWCwKjpfuogWC for ; Wed, 02 Jul 2008 12:22:08 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m62JLxNW018879 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 2 Jul 2008 21:21:59 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m62JLxEW018877 for xfs@oss.sgi.com; Wed, 2 Jul 2008 21:21:59 +0200 Date: Wed, 2 Jul 2008 21:21:59 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: "a" and "foo" files in the top dir of linux-2.6-xfs Subject: "a" and "foo" files in the top dir of linux-2.6-xfs Message-ID: <20080702192159.GA18817@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215026529 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54978 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16695 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs There's two empty files named "a" and "foo" in the top level directory of linux-2.6-xfs. cvs log claims they're Niv's faul with some really strange commit messages.. From owner-xfs@oss.sgi.com Wed Jul 2 12:21:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 12:21:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m62JLV6X025031 for ; Wed, 2 Jul 2008 12:21:31 -0700 X-ASG-Debug-ID: 1215026553-796003a60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 553461863193 for ; Wed, 2 Jul 2008 12:22:33 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id vbxtqEwJpka1o69e for ; Wed, 02 Jul 2008 12:22:33 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m62JMONW018914 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 2 Jul 2008 21:22:24 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m62JMOn8018912 for xfs@oss.sgi.com; Wed, 2 Jul 2008 21:22:24 +0200 Date: Wed, 2 Jul 2008 21:22:24 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] kill XFS_PURGE_INODE Subject: Re: [PATCH] kill XFS_PURGE_INODE Message-ID: <20080702192224.GB18817@lst.de> References: <20080616062634.GA5971@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080616062634.GA5971@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215026554 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54978 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16696 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Ping? Already got a review from Dave. On Mon, Jun 16, 2008 at 08:26:34AM +0200, Christoph Hellwig wrote: > Just a useless alias for IRELE. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.c 2008-06-05 20:21:04.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.c 2008-06-05 20:22:37.000000000 +0200 > @@ -444,11 +444,11 @@ xfs_qm_unmount_quotas( > } > } > if (uqp) { > - XFS_PURGE_INODE(uqp); > + IRELE(uqp); > mp->m_quotainfo->qi_uquotaip = NULL; > } > if (gqp) { > - XFS_PURGE_INODE(gqp); > + IRELE(gqp); > mp->m_quotainfo->qi_gquotaip = NULL; > } > out: > @@ -1239,11 +1239,11 @@ xfs_qm_destroy_quotainfo( > xfs_qm_list_destroy(&qi->qi_dqlist); > > if (qi->qi_uquotaip) { > - XFS_PURGE_INODE(qi->qi_uquotaip); > + IRELE(qi->qi_uquotaip); > qi->qi_uquotaip = NULL; /* paranoia */ > } > if (qi->qi_gquotaip) { > - XFS_PURGE_INODE(qi->qi_gquotaip); > + IRELE(qi->qi_gquotaip); > qi->qi_gquotaip = NULL; > } > mutex_destroy(&qi->qi_quotaofflock); > @@ -1393,7 +1393,7 @@ xfs_qm_qino_alloc( > * locked exclusively and joined to the transaction already. > */ > ASSERT(xfs_isilocked(*ip, XFS_ILOCK_EXCL)); > - VN_HOLD(XFS_ITOV((*ip))); > + IHOLD(*ip); > > /* > * Make the changes in the superblock, and log those too. > Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c 2008-05-23 09:31:39.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c 2008-06-05 20:21:09.000000000 +0200 > @@ -362,11 +362,11 @@ xfs_qm_scall_quotaoff( > * if we don't need them anymore. > */ > if ((dqtype & XFS_QMOPT_UQUOTA) && XFS_QI_UQIP(mp)) { > - XFS_PURGE_INODE(XFS_QI_UQIP(mp)); > + IRELE(XFS_QI_UQIP(mp)); > XFS_QI_UQIP(mp) = NULL; > } > if ((dqtype & (XFS_QMOPT_GQUOTA|XFS_QMOPT_PQUOTA)) && XFS_QI_GQIP(mp)) { > - XFS_PURGE_INODE(XFS_QI_GQIP(mp)); > + IRELE(XFS_QI_GQIP(mp)); > XFS_QI_GQIP(mp) = NULL; > } > out_error: > Index: linux-2.6-xfs/fs/xfs/quota/xfs_quota_priv.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_quota_priv.h 2008-05-23 09:31:39.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/quota/xfs_quota_priv.h 2008-06-05 20:21:09.000000000 +0200 > @@ -158,9 +158,6 @@ for ((dqp) = (qlist)->qh_next; (dqp) != > #define XFS_IS_SUSER_DQUOT(dqp) \ > (!((dqp)->q_core.d_id)) > > -#define XFS_PURGE_INODE(ip) \ > - IRELE(ip); > - > #define DQFLAGTO_TYPESTR(d) (((d)->dq_flags & XFS_DQ_USER) ? "USR" : \ > (((d)->dq_flags & XFS_DQ_GROUP) ? "GRP" : \ > (((d)->dq_flags & XFS_DQ_PROJ) ? "PRJ":"???"))) ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 2 12:35:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 12:35:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m62JZc0U026515 for ; Wed, 2 Jul 2008 12:35:38 -0700 X-ASG-Debug-ID: 1215027399-1c0700340000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 083CF12D6607 for ; Wed, 2 Jul 2008 12:36:39 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id XTzys3CWWks2qK9y for ; Wed, 02 Jul 2008 12:36:39 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m62JaUNW019830 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 2 Jul 2008 21:36:30 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m62JaUx2019828 for xfs@oss.sgi.com; Wed, 2 Jul 2008 21:36:30 +0200 Date: Wed, 2 Jul 2008 21:36:30 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] fix compilation without CONFIG_PROC_FS Subject: [PATCH] fix compilation without CONFIG_PROC_FS Message-ID: <20080702193630.GA19715@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215027401 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.54979 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16697 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.h 2008-06-27 15:16:21.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h 2008-06-27 15:19:18.000000000 +0200 @@ -146,11 +146,12 @@ extern void xfs_cleanup_procfs(void); static inline int xfs_init_procfs(void) { - return 0 -}; + return 0; +} + static inline void xfs_cleanup_procfs(void) { -}; +} #endif /* !CONFIG_PROC_FS */ From owner-xfs@oss.sgi.com Wed Jul 2 16:39:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 16:39:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from relay.sgi.com (relay1.corp.sgi.com [192.26.58.214]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m62NdS4a013490 for ; Wed, 2 Jul 2008 16:39:28 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by relay1.corp.sgi.com (Postfix) with ESMTP id C73958F80F4; Wed, 2 Jul 2008 16:40:28 -0700 (PDT) Received: from itchy (xaiki@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m62NeLjm2421942; Thu, 3 Jul 2008 09:40:23 +1000 (AEST) From: Niv Sardi To: Timothy Shimmin Cc: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH] Introduce xfs_trans_bmap_add_attrfork. References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1214196150-5427-2-git-send-email-xaiki@sgi.com> <1214196150-5427-3-git-send-email-xaiki@sgi.com> <1214196150-5427-4-git-send-email-xaiki@sgi.com> <20080626092856.GA27069@infradead.org> <486B3B76.8020303@sgi.com> Date: Thu, 03 Jul 2008 09:39:52 +1000 In-Reply-To: <486B3B76.8020303@sgi.com> (Timothy Shimmin's message of "Wed, 02 Jul 2008 18:25:26 +1000") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (i486-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16698 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Timothy Shimmin writes: [...] >> + if (error) >> + goto error1; >> + >> + if (XFS_IFORK_Q(ip)) >> + goto error1; >> + >> + ASSERT(ip->i_d.di_anextents == 0); >> + VN_HOLD(XFS_ITOV(ip)); >> + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); >> + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); >> + >> + error = xfs_trans_bmap_add_attrfork(NULL, ip, size, rsvd); >> + if (error) >> + return error; >> + return xfs_trans_commit(tp, XFS_TRANS_PERM_LOG_RES); > > I was kind of expecting the transaction, &tp, to be passed into > xfs_trans_bmap_add_attrfork(). > (And then xfs_trans_bmap_add_attrfork() which calls > xfs_bmap_finish() which calls xfs_trans_dup() and so from that > point on we would then have to update tp if we were to use it.) > > So how come we pass in NULL? > I'm tired so I'm probably missing something obvious. No you're right, it took me a while to remember you're working out of git. I haven't really re-read it properly yet but thanks for this one. Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Wed Jul 2 18:56:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 18:57:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m631uvSX022088 for ; Wed, 2 Jul 2008 18:56:58 -0700 X-ASG-Debug-ID: 1215050279-77ff01d90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5F96E12D7D86 for ; Wed, 2 Jul 2008 18:57:59 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id QVO2rzJUalrtdOFE for ; Wed, 02 Jul 2008 18:57:59 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 3C59FAC626C; Wed, 2 Jul 2008 20:57:59 -0500 (CDT) Message-ID: <486C322D.7080203@sandeen.net> Date: Wed, 02 Jul 2008 20:58:05 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Donald Douwsma CC: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] re-remove xfs custom bitops Subject: Re: [PATCH] re-remove xfs custom bitops References: <480EB397.1040304@sandeen.net> <4829C360.5060500@sandeen.net> <482BF841.8050704@sgi.com> <48669A45.1050104@sandeen.net> <4868A114.9080106@sgi.com> In-Reply-To: <4868A114.9080106@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215050280 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55001 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16699 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Donald Douwsma wrote: > First time round I hit an Oops on xfstests/177 while running the auto group > on ppc32. I dont seem to hit it running the single test, its intermittent. Funky. Do you ever hit it w/ the patch reverted? -Eric From owner-xfs@oss.sgi.com Wed Jul 2 20:53:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 20:53:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m633raxT000632 for ; Wed, 2 Jul 2008 20:53:36 -0700 X-ASG-Debug-ID: 1215057279-406203bd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C1B022AE471 for ; Wed, 2 Jul 2008 20:54:39 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id wy1UmpstozGgGG7r for ; Wed, 02 Jul 2008 20:54:39 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 7957AAC626C; Wed, 2 Jul 2008 22:54:38 -0500 (CDT) Message-ID: <486C4D7E.8060608@sandeen.net> Date: Wed, 02 Jul 2008 22:54:38 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: Jan Engelhardt , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: grub fails boot after update Subject: Re: grub fails boot after update References: <20080701155522.GA29722@infradead.org> In-Reply-To: <20080701155522.GA29722@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215057279 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55009 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16700 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Christoph Hellwig wrote: > sync works perfectly fine on xfs. Grub just doesn't understand what > sync means, and because of that it's buggy on all filesystems, just > with less a chance on others. The fix is pretty simple and that is > stopping to try to access the filesystem with it's own driver through > the block device node. Aye. And from the bug: >> I agree with comment #37: XFS really does suck, especially when it comes to >> booting Linux on a PC. Now that's just inflammatory. :) >> Fortunately we do not support it any more for new >> installations, an ext2 /boot partition is highly recommended. I didn't read the details of the bug but the conclusion is right though - grub is busted, just use ext3 on /boot to work around it. >> The problem is that with XFS, sync(2) returns, but the data isn't synced. >> The first time yast calls grub install, grub does not find the new stage1.5, >> because it is not on the disk yet, despite a successful sync; thus it modifies >> stage2 to do the job. On the second invocation, stage1.5 is found and >> installed, but stage2 already is modified. >> >> So once again this isn't a grub bug, but an XFS bug with FS semantics. No, that's wrong as hch said. (FWIW the issue is that xfs data is safe on disk, metadata is safe in the log, but grub tries to read the fs directly as if it were frozen and expects to find metadata at the final spot on disk, .) Syncing a live filesystem and then thinking you can go read (or worse, write!) directly from (to) disk is a busted notion in many ways. It's the same problem as thinking you can do "sync" and then take a block-based snapshot. There's a reason DM for example freezes before this. There was a bug w/ grub vs. ext3 causing corruption for the exact same sorts of reasons; it's just a little harder to hit. This really is grub that is busted, but I'd still just suggest using ext3 to (mostly) work around the breakage for the foreseeable future. The other option is to teach grub to always do its io via the filesystem not the block device while the fs is mounted (IIRC there are various & sundry non-intuitive commands which actually nudge grub towards or away from this desired behavior... --with-stage2=/path is one I think, skipping the "verification" phase (i.e. trying to read the block dev while mounted) is another) BTW the patch to "wait 10s for the fs to settle" is pure bunk and will not definitively fix the problem. It's not even worth committing IMHO. -Eric From owner-xfs@oss.sgi.com Wed Jul 2 20:56:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 20:56:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m633uAWm001060 for ; Wed, 2 Jul 2008 20:56:11 -0700 X-ASG-Debug-ID: 1215057433-29ba00f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6A2F5A644E5 for ; Wed, 2 Jul 2008 20:57:14 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id A6AKOiWz2kPSJoSe for ; Wed, 02 Jul 2008 20:57:14 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id A335FA84103; Wed, 2 Jul 2008 22:57:13 -0500 (CDT) Message-ID: <486C4E19.6080203@sandeen.net> Date: Wed, 02 Jul 2008 22:57:13 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: "Arensdorf, Christopher" CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS Compatibility Questions Subject: Re: XFS Compatibility Questions References: <0EEA30D7D649274EB38B0B140022557F23B36C@corpistemb01.edocorp.com> In-Reply-To: <0EEA30D7D649274EB38B0B140022557F23B36C@corpistemb01.edocorp.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215057434 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1731 1.0000 -0.9725 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16701 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Arensdorf, Christopher wrote: > Hello, > > My name is Chris and I'm with ITT Corporation in Nashua, NH. We're currently looking to upgrade one of our products to make use of InfiniBand technology, and unfortunately we're running QFS which does not support InfiniBand. We're interested in exploring the idea of using XFS so I had a few questions I was hoping you might be able to answer that I didn't seem to find in the FAQ section. > > Is XFS compatible with InfiniBand? XFS just needs a block device to talk to; the transport to the block device etc should not matter. > Is XFS compatible with RHEL 5.0 or higher? Compatible yes but not supported or shipped by Red Hat. > Is XFS compatible with Fibre Channel? See the first answer. (but anyway the the short answer is Yes.) > Is XFS compatible with Solaris 10 x86? AFAIK XFS has never been ported to Solaris. It's only a production FS on Linux & Irix. -Eric > Thanks very much for your time and I look forward to hearing back from you. From owner-xfs@oss.sgi.com Wed Jul 2 21:02:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 21:02:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6342JCL001822 for ; Wed, 2 Jul 2008 21:02:19 -0700 X-ASG-Debug-ID: 1215057801-240101810000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 71EEBD9443D for ; Wed, 2 Jul 2008 21:03:22 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 6BB6OGih8wPCQQ4R for ; Wed, 02 Jul 2008 21:03:22 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 8B630A84102; Wed, 2 Jul 2008 23:03:21 -0500 (CDT) Message-ID: <486C4F89.9030009@sandeen.net> Date: Wed, 02 Jul 2008 23:03:21 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> In-Reply-To: <486B6062.6040201@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215057802 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16702 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > > Dave Chinner wrote: >> On Wed, Jul 02, 2008 at 04:13:11PM +1000, Nathan Scott wrote: >>> You can always try the reverse - replace fs/xfs from your mips build >>> tree with the one from the current/a recent kernel. Theres very few >>> changes in the surrounding kernel code that xfs needs. >>> >> Eric should be able to comment on the pitfalls in doing this having >> tried to backport a 2.6.25 fs/xfs to a 2.6.18 RHEL kernel. Eric - >> any comments? >> >> Cheers, >> >> Dave. >> > Eric, Could you please let me know about bits and pieces that we need to > remember while back porting xfs to 2.6.18? > If you share patches which takes care of it, that would be great. http://sandeen.net/rhel5_xfs/xfs-2.6.25-for-rhel5-testing.tar.bz2 should be pretty close. It was quick 'n' dirty and it has some warts but would give an idea of what backporting was done (see patches/ and the associated quilt series; quilt push -a to apply them all) -Eric From owner-xfs@oss.sgi.com Wed Jul 2 21:47:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 21:47:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m634l1s4004597 for ; Wed, 2 Jul 2008 21:47:01 -0700 X-ASG-Debug-ID: 1215060483-3097025b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from opera.rednote.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 98BD4D94A82 for ; Wed, 2 Jul 2008 21:48:04 -0700 (PDT) Received: from opera.rednote.net (opera.rednote.net [75.125.70.226]) by cuda.sgi.com with ESMTP id bOqkML1GLIWk3nEb for ; Wed, 02 Jul 2008 21:48:04 -0700 (PDT) Received: from jdc.jasonjgw.net (localhost6.localdomain6 [IPv6:::1]) by opera.rednote.net (8.14.2/8.14.2) with ESMTP id m634m0MH003787 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Thu, 3 Jul 2008 04:48:02 GMT Received: from jdc.jasonjgw.net (ip6-localhost [IPv6:::1]) by jdc.jasonjgw.net (8.14.3/8.14.3/Debian-4) with ESMTP id m634ltwF020723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 3 Jul 2008 14:47:55 +1000 Received: (from jason@localhost) by jdc.jasonjgw.net (8.14.3/8.14.3/Submit) id m634ltlq020722 for xfs@oss.sgi.com; Thu, 3 Jul 2008 14:47:55 +1000 Date: Thu, 3 Jul 2008 14:47:55 +1000 From: Jason White To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: grub fails boot after update Subject: Re: grub fails boot after update Message-ID: <20080703044755.GA13630@jdc.jasonjgw.net> Mail-Followup-To: xfs@oss.sgi.com References: <20080701155522.GA29722@infradead.org> <486C4D7E.8060608@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <486C4D7E.8060608@sandeen.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.93.1/7623/Thu Jul 3 01:28:16 2008 on opera.rednote.net X-Virus-Status: Clean X-Barracuda-Connect: opera.rednote.net[75.125.70.226] X-Barracuda-Start-Time: 1215060484 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55011 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 16703 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jason@jasonjgw.net Precedence: bulk X-list: xfs On Wed, Jul 02, 2008 at 10:54:38PM -0500, Eric Sandeen wrote: > This really is grub that is busted, but I'd still just suggest using > ext3 to (mostly) work around the breakage for the foreseeable future. > > The other option is to teach grub to always do its io via the filesystem > not the block device while the fs is mounted (IIRC there are various & > sundry non-intuitive commands which actually nudge grub towards or away > from this desired behavior... --with-stage2=/path is one I think, > skipping the "verification" phase (i.e. trying to read the block dev > while mounted) is another) Does grub 2 (still in development when last I checked) improve on this situation? I managed to get Grub 1 installed on machines with XFS root file systems by running the install from within the grub "shell" environment rather than using grub-install. Maybe this skips the checks that attempt to read the block device directly. I also recall that grub-install failed. From owner-xfs@oss.sgi.com Wed Jul 2 22:14:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 22:14:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m635E2Tr007042 for ; Wed, 2 Jul 2008 22:14:04 -0700 X-ASG-Debug-ID: 1215062104-6dad005d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta01.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 82E6AD94B21 for ; Wed, 2 Jul 2008 22:15:05 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (bby1mta01.pmc-sierra.com [216.241.235.116]) by cuda.sgi.com with ESMTP id X46MIiRAmP9gobKW for ; Wed, 02 Jul 2008 22:15:05 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 5A7E11890173; Wed, 2 Jul 2008 22:18:09 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta01.pmc-sierra.bc.ca (Postfix) with SMTP id 4C0981890156; Wed, 2 Jul 2008 22:18:09 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Wed, 2 Jul 2008 22:15:39 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Wed, 2 Jul 2008 22:15:38 -0700 Message-ID: <486C6053.7010503@pmc-sierra.com> Date: Thu, 03 Jul 2008 10:44:59 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> In-Reply-To: <486C4F89.9030009@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 03 Jul 2008 05:15:39.0155 (UTC) FILETIME=[D5167630:01C8DCCB] X-Barracuda-Connect: bby1mta01.pmc-sierra.com[216.241.235.116] X-Barracuda-Start-Time: 1215062105 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0186 1.0000 -1.8999 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.90 X-Barracuda-Spam-Status: No, SCORE=-1.90 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55013 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16704 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Sagar Borikar wrote: > >> Dave Chinner wrote: >> >>> On Wed, Jul 02, 2008 at 04:13:11PM +1000, Nathan Scott wrote: >>> > > > >>>> You can always try the reverse - replace fs/xfs from your mips build >>>> tree with the one from the current/a recent kernel. Theres very few >>>> changes in the surrounding kernel code that xfs needs. >>>> >>>> >>> Eric should be able to comment on the pitfalls in doing this having >>> tried to backport a 2.6.25 fs/xfs to a 2.6.18 RHEL kernel. Eric - >>> any comments? >>> >>> Cheers, >>> >>> Dave. >>> >>> >> Eric, Could you please let me know about bits and pieces that we need to >> remember while back porting xfs to 2.6.18? >> If you share patches which takes care of it, that would be great. >> > > http://sandeen.net/rhel5_xfs/xfs-2.6.25-for-rhel5-testing.tar.bz2 > > should be pretty close. It was quick 'n' dirty and it has some warts > but would give an idea of what backporting was done (see patches/ and > the associated quilt series; quilt push -a to apply them all) > Thanks a lot Eric. I'll go through it .I am actually trying another option of regularly defragmenting the file system under stress. I wanted to understand couple of things for using xfs_fsr utility: 1. What should be the state of filesystem when I am running xfs_fsr. Ideally we should stop all io before running defragmentation. 2. How effective is the utility when ran on highly fragmented file system? I saw that if filesystem is 99.89% fragmented, the recovery is very slow. It took around 25 min to clean up 100GB JBOD volume and after that system was fragmented to 82%. So I was confused on how exactly the fragmentation works. Any pointers on probable optimum use of xfs_fsr? 3. Any precautions I need to take when working with that from data consistency, robustness point of view? Any disadvantages? 4. Any threshold for starting the defragmentation on xfs? Thanks Sagar > -Eric > From owner-xfs@oss.sgi.com Wed Jul 2 22:44:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 22:44:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=AWL,BAYES_05,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m635iIfc009310 for ; Wed, 2 Jul 2008 22:44:19 -0700 X-ASG-Debug-ID: 1215063920-01ee031a0001-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wanadoo.es (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 16A6418676DE for ; Wed, 2 Jul 2008 22:45:20 -0700 (PDT) Received: from wanadoo.es (host-200-62-193-18.telmex.com.pe [200.62.193.18]) by cuda.sgi.com with SMTP id eRk0iqDT9YPLPJ8T for ; Wed, 02 Jul 2008 22:45:20 -0700 (PDT) From: "Jehn Sanders" To: "Linux-xfs" X-ASG-Orig-Subj: web site noticed Subject: web site noticed Date: Thu, 3 Jul 2008 00:45:15 -0500 Reply-To: "Jehn Sanders" Message-ID: <62354217.20080703004515@gmail.com> X-Priority: 5 (Low) MIME-Version: 1.0 Organization: K-Media Solutions Content-Type: text/plain; charset="ISO-8859-1" X-Barracuda-Connect: host-200-62-193-18.telmex.com.pe[200.62.193.18] X-Barracuda-Start-Time: 1215063922 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5693 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.85 X-Barracuda-Spam-Status: No, SCORE=0.85 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55014 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m635iJfc009312 X-archive-position: 16705 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jehnsanders@gmail.com Precedence: bulk X-list: xfs Dear Linux-xfs, Its time to get your web site noticed. We can increase your monthly web traffic and get you the best position on every major search engines (Eg: Google, Yahoo!, AOL, AltaVista, etc). We would like to show you how with a free site review. Email us today and we will do a no cost site assessment so that you can see for yourself what your online business could produce. Sincerely Jehn Sanders jehnsanders@gmail.com ________________________________________ K-Media Solutions Yahoo!, Google, MSN, AltaVista, AOL This promotion is only valid for USA websites If you wish to be removed from this list, please reply the word "REMOVE" in your subject line From owner-xfs@oss.sgi.com Wed Jul 2 23:45:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 02 Jul 2008 23:46:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m636jtJP013215 for ; Wed, 2 Jul 2008 23:45:57 -0700 Received: from cxfsmac10.melbourne.sgi.com (cxfsmac10.melbourne.sgi.com [134.14.55.100]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA20116; Thu, 3 Jul 2008 16:46:53 +1000 Message-ID: <486C75DD.2040109@sgi.com> Date: Thu, 03 Jul 2008 16:46:53 +1000 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss Subject: Re: [PATCH] re-remove xfs custom bitops References: <480EB397.1040304@sandeen.net> <4829C360.5060500@sandeen.net> <482BF841.8050704@sgi.com> <48669A45.1050104@sandeen.net> <4868A114.9080106@sgi.com> <486C322D.7080203@sandeen.net> In-Reply-To: <486C322D.7080203@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16706 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Donald Douwsma wrote: > >> First time round I hit an Oops on xfstests/177 while running the auto group >> on ppc32. I dont seem to hit it running the single test, its intermittent. > > Funky. Do you ever hit it w/ the patch reverted? That's the question. So far no, the QA guys said they hit it a while ago, but the time frame still matches last time. I dont think this is related but I need to get some more ppc32 runs without. I'm probably being over cautious but I'd like to avoid the inagain/outagain/inagain/outagain approach we keep using with some of these cleanups. Don From owner-xfs@oss.sgi.com Thu Jul 3 05:10:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 05:11:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,STOX_REPLY_TYPE autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m63CArhW018280 for ; Thu, 3 Jul 2008 05:10:53 -0700 X-ASG-Debug-ID: 1215087115-18ee03b70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AEA722B0496 for ; Thu, 3 Jul 2008 05:11:55 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id l3BDMOBw7YDqnJyg for ; Thu, 03 Jul 2008 05:11:55 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.197]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m63CB6ou027688; Thu, 3 Jul 2008 21:11:06 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m63CB6Z11313; Thu, 3 Jul 2008 21:11:06 +0900 (JST) Received: from shoin.jp.nec.com (shoin.jp.nec.com [10.26.220.3]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id m63CB5XW011656; Thu, 3 Jul 2008 21:11:05 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Thu, 3 Jul 2008 21:11:05 +0900 Message-Id: <9942A69CB65D4A41B39F36AF8EEF6F22@nsl.ad.nec.co.jp> From: "Takashi Sato" To: "Christoph Hellwig" , "Alasdair G Kergon" Cc: , "Andrew Morton" , , , , , , , References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080701105251.GC22522@agk.fab.redhat.com> In-Reply-To: <20080701105251.GC22522@agk.fab.redhat.com> X-ASG-Orig-Subj: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Subject: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Date: Thu, 3 Jul 2008 21:11:05 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1215087116 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55039 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16707 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi Christoph and Alasdair, > On Tue, Jul 01, 2008 at 04:10:26AM -0400, Christoph Hellwig wrote: >> I still disagree with this whole patch. > > Same here - if you want a timeout, what stops you from implementing it in a > userspace process? If your concern is that the process might die without > thawing the filesystem, take a look at the userspace LVM/multipath code for > ideas - lock into memory, disable OOM killer, run from ramdisk etc. > In practice, those techniques seem to be good enough. If the freezer accesses the frozen filesystem and causes a deadlock, the above ideas can't solve it. The timeout is useful to solve such a deadlock. If you don't need the timeout, you can disable it by specifying "0" as the timeout period. > Similarly if a device-mapper device is involved, how should the following > sequence behave - A, B or C? > > 1. dmsetup suspend (freezes) > 2. FIFREEZE > 3. FITHAW > 4. dmsetup resume (thaws) [...] > C: > 1 succeeds, freezes > 2 fails, remains frozen > 3 fails (because device-mapper owns the freeze/thaw), remains frozen > 4 succeeds, thaws I think C is appropriate and the following change makes it possible. How do you think? 1. Add the new bit flag(BD_FREEZE_DM) in block_device.bd_state. It means that the volume is frozen by the device-mapper. 2. Operate and check this bit flag as followings. - Bit operations in the device-mapper's freeze/thaw FREEZE: dm_suspend(): set BD_FREEZE_DM freeze_bdev():set BD_FREEZE_OP THAW: thaw_bdev(): clear BD_FREEZE_OP dm_resume(): clear BD_FREEZE_DM - Checks in FIFREEZE/FITHAW FREEZE: ioctl_freeze(): Not need to check BD_FREEZE_DM freeze_bdev():set BD_FREEZE_OP THAW: ioctl_thaw(): If BD_FREEZE_DM is set, fail, otherwise, call thaw_bdev() thaw_bdev(): clear BD_FREEZE_OP Cheers, Takashi From owner-xfs@oss.sgi.com Thu Jul 3 05:47:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 05:47:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m63ClMK4022226 for ; Thu, 3 Jul 2008 05:47:22 -0700 X-ASG-Debug-ID: 1215089304-77ac02960000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6690E12D8F10 for ; Thu, 3 Jul 2008 05:48:24 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id fUVCY0DofqBBSrFL for ; Thu, 03 Jul 2008 05:48:24 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m63ClBAo001234; Thu, 3 Jul 2008 08:47:11 -0400 Received: from pobox.fab.redhat.com (pobox.fab.redhat.com [10.33.63.12]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m63ClAji005840; Thu, 3 Jul 2008 08:47:11 -0400 Received: from agk.fab.redhat.com (agk.fab.redhat.com [10.33.0.19]) by pobox.fab.redhat.com (8.13.1/8.13.1) with ESMTP id m63ClAug004756; Thu, 3 Jul 2008 08:47:10 -0400 Received: from agk by agk.fab.redhat.com with local (Exim 4.34) id 1KEODO-00008L-37; Thu, 03 Jul 2008 13:47:10 +0100 Date: Thu, 3 Jul 2008 13:47:10 +0100 From: Alasdair G Kergon To: Takashi Sato Cc: Christoph Hellwig , linux-ext4@vger.kernel.org, Andrew Morton , linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk, dm-devel@redhat.com, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, mtk.manpages@googlemail.com, axboe@kernel.dk X-ASG-Orig-Subj: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Subject: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Message-ID: <20080703124709.GI22522@agk.fab.redhat.com> Mail-Followup-To: Takashi Sato , Christoph Hellwig , linux-ext4@vger.kernel.org, Andrew Morton , linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk, dm-devel@redhat.com, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, mtk.manpages@googlemail.com, axboe@kernel.dk References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080701105251.GC22522@agk.fab.redhat.com> <9942A69CB65D4A41B39F36AF8EEF6F22@nsl.ad.nec.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9942A69CB65D4A41B39F36AF8EEF6F22@nsl.ad.nec.co.jp> User-Agent: Mutt/1.4.1i Organization: Red Hat UK Ltd. Registered in England and Wales, number 03798903. Registered Office: Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE. X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1215089306 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16708 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: agk@redhat.com Precedence: bulk X-list: xfs On Thu, Jul 03, 2008 at 09:11:05PM +0900, Takashi Sato wrote: > If the freezer accesses the frozen filesystem and causes a deadlock, > the above ideas can't solve it But you could also say that if the 'freezer' process accesses the frozen filesystem and deadlocks then that's just a bug and that userspace code should be fixed and there's no need to introduce the complexity of a timeout parameter. > >Similarly if a device-mapper device is involved, how should the following > >sequence behave - A, B or C? > > > >1. dmsetup suspend (freezes) > >2. FIFREEZE > >3. FITHAW > >4. dmsetup resume (thaws) > [...] > >C: > > 1 succeeds, freezes > > 2 fails, remains frozen > > 3 fails (because device-mapper owns the freeze/thaw), remains frozen > > 4 succeeds, thaws > > I think C is appropriate and the following change makes it possible. > How do you think? The point I'm trying to make here is: Under what real-world circumstances might multiple concurrent freezing attempts occur, and which of A, B or C (or other variations) would be the most appropriate way of handling such situations? A common example is people running xfs_freeze followed by an lvm command which also attempts to freeze the filesystem. I can see a case for B or C, but personally I prefer A: > > 1 succeeds, freezes > > 2 succeeds, remains frozen > > 3 succeeds, remains frozen > > 4 succeeds, thaws Alasdair -- agk@redhat.com From owner-xfs@oss.sgi.com Thu Jul 3 07:45:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 07:45:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-3.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m63Ejcff031660 for ; Thu, 3 Jul 2008 07:45:38 -0700 X-ASG-Debug-ID: 1215096401-400e003f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.redhat.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0044F12D95E5 for ; Thu, 3 Jul 2008 07:46:41 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [66.187.233.31]) by cuda.sgi.com with ESMTP id oG1qPdTLOm7RH1xg for ; Thu, 03 Jul 2008 07:46:41 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id m63EjpL3015262; Thu, 3 Jul 2008 10:45:51 -0400 Received: from pobox-2.corp.redhat.com (pobox-2.corp.redhat.com [10.11.255.15]) by int-mx1.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m63Ejosh000446; Thu, 3 Jul 2008 10:45:50 -0400 Received: from liberator.sandeen.net (sebastian-int.corp.redhat.com [172.16.52.221]) by pobox-2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m63EjmqB019280; Thu, 3 Jul 2008 10:45:48 -0400 Message-ID: <486CE61C.50706@redhat.com> Date: Thu, 03 Jul 2008 09:45:48 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Takashi Sato CC: Christoph Hellwig , Alasdair G Kergon , linux-ext4@vger.kernel.org, Andrew Morton , linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk, dm-devel@redhat.com, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, mtk.manpages@googlemail.com, axboe@kernel.dk X-ASG-Orig-Subj: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Subject: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080701105251.GC22522@agk.fab.redhat.com> <9942A69CB65D4A41B39F36AF8EEF6F22@nsl.ad.nec.co.jp> In-Reply-To: <9942A69CB65D4A41B39F36AF8EEF6F22@nsl.ad.nec.co.jp> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.58 on 172.16.52.254 X-Barracuda-Connect: mx1.redhat.com[66.187.233.31] X-Barracuda-Start-Time: 1215096402 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16709 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@redhat.com Precedence: bulk X-list: xfs Takashi Sato wrote: > Hi Christoph and Alasdair, > >> On Tue, Jul 01, 2008 at 04:10:26AM -0400, Christoph Hellwig wrote: >>> I still disagree with this whole patch. >> Same here - if you want a timeout, what stops you from implementing it in a >> userspace process? If your concern is that the process might die without >> thawing the filesystem, take a look at the userspace LVM/multipath code for >> ideas - lock into memory, disable OOM killer, run from ramdisk etc. >> In practice, those techniques seem to be good enough. > > If the freezer accesses the frozen filesystem and causes a deadlock, > the above ideas can't solve it. The timeout is useful to solve such a deadlock. > If you don't need the timeout, you can disable it by specifying "0" as the > timeout period. > >> Similarly if a device-mapper device is involved, how should the following >> sequence behave - A, B or C? >> >> 1. dmsetup suspend (freezes) >> 2. FIFREEZE >> 3. FITHAW >> 4. dmsetup resume (thaws) > [...] >> C: >> 1 succeeds, freezes >> 2 fails, remains frozen >> 3 fails (because device-mapper owns the freeze/thaw), remains frozen >> 4 succeeds, thaws > > I think C is appropriate and the following change makes it possible. > How do you think? > > 1. Add the new bit flag(BD_FREEZE_DM) in block_device.bd_state. > It means that the volume is frozen by the device-mapper. Will we add a new bit/flag for every possible subysstem that may call freeze/thaw? This seems odd to me. They are different paths to the same underlying mechanism; it should not matter if it is an existing freeze from DM or via FIFREEZE or via the xfs ioctl, or any other mechanism should it? I don't think this generic interface should use any flag named *_DM, personally. It seems that nested freeze requests must be handled in a generic way regardless of what initiates any of the requests? Refcounting freezes as Alasdair suggests seems to make sense to me, i.e. freeze, freeze, thaw, thaw leads to: >> > > 1 (freeze) succeeds, freezes (frozen++) >> > > 2 (freeze) succeeds, remains frozen (frozen++) >> > > 3 (thaw) succeeds, remains frozen (frozen--) >> > > 4 (thaw) succeeds, thaws (frozen--) that way each caller of freeze is guaranteed that the fs is frozen at least until they call thaw? Thanks, -Eric From owner-xfs@oss.sgi.com Thu Jul 3 07:48:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 07:48:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m63EmUBW032112 for ; Thu, 3 Jul 2008 07:48:30 -0700 X-ASG-Debug-ID: 1215096569-2cd202c90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A2AC31869440 for ; Thu, 3 Jul 2008 07:49:29 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 6vnMJCyQeHkO7ZG3 for ; Thu, 03 Jul 2008 07:49:29 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 60AC7AC626C for ; Thu, 3 Jul 2008 09:49:29 -0500 (CDT) Message-ID: <486CE6F9.7000003@sandeen.net> Date: Thu, 03 Jul 2008 09:49:29 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: grub fails boot after update Subject: Re: grub fails boot after update References: <20080701155522.GA29722@infradead.org> <486C4D7E.8060608@sandeen.net> <20080703044755.GA13630@jdc.jasonjgw.net> In-Reply-To: <20080703044755.GA13630@jdc.jasonjgw.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215096570 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55051 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16710 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Jason White wrote: > On Wed, Jul 02, 2008 at 10:54:38PM -0500, Eric Sandeen wrote: > >> This really is grub that is busted, but I'd still just suggest using >> ext3 to (mostly) work around the breakage for the foreseeable future. >> >> The other option is to teach grub to always do its io via the filesystem >> not the block device while the fs is mounted (IIRC there are various & >> sundry non-intuitive commands which actually nudge grub towards or away >> from this desired behavior... --with-stage2=/path is one I think, >> skipping the "verification" phase (i.e. trying to read the block dev >> while mounted) is another) > > Does grub 2 (still in development when last I checked) improve on this > situation? No idea. Does anyone use grub2? My impression is that each distro is currently just maintaining a fork of grub(1). If grub2 is using more than "sync and hope" I'd be pleasantly surprised. :) > I managed to get Grub 1 installed on machines with XFS root file systems by > running the install from within the grub "shell" environment rather than using > grub-install. Maybe this skips the checks that attempt to read the block > device directly. I also recall that grub-install failed. Yep, this might be some of the "magic" I talked about w.r.t. behavior of different grub incantations. -Eric From owner-xfs@oss.sgi.com Thu Jul 3 08:01:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 08:01:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m63F10kq000760 for ; Thu, 3 Jul 2008 08:01:00 -0700 X-ASG-Debug-ID: 1215097322-43e8012c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 86EC812D9798 for ; Thu, 3 Jul 2008 08:02:03 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id wAh3CEXjxhLwBsXm for ; Thu, 03 Jul 2008 08:02:03 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 8C73EAC626C; Thu, 3 Jul 2008 10:02:02 -0500 (CDT) Message-ID: <486CE9EA.90502@sandeen.net> Date: Thu, 03 Jul 2008 10:02:02 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> In-Reply-To: <486C6053.7010503@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215097323 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55050 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16711 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > > Eric Sandeen wrote: >>> Eric, Could you please let me know about bits and pieces that we need to >>> remember while back porting xfs to 2.6.18? >>> If you share patches which takes care of it, that would be great. >>> >> http://sandeen.net/rhel5_xfs/xfs-2.6.25-for-rhel5-testing.tar.bz2 >> >> should be pretty close. It was quick 'n' dirty and it has some warts >> but would give an idea of what backporting was done (see patches/ and >> the associated quilt series; quilt push -a to apply them all) >> > Thanks a lot Eric. I'll go through it .I am actually trying another > option of regularly defragmenting the file system under stress. Ok, but that won't get to the bottom of the problem. It might alleviate it at best, but if I were shipping a product using xfs I'd want to know that it was properly solved. :) The tarball above should give you almost everything you need to run your testcase with current xfs code on your older kernel to see if the bug persists or if it's been fixed upstream, in which case you have a relatively easy path to an actual solution that your customers can depend on. > I wanted to understand couple of things for using xfs_fsr utility: > > 1. What should be the state of filesystem when I am running xfs_fsr. > Ideally we should stop all io before running defragmentation. you can run in any state. Some files will not get defragmented due to busy-ness or other conditions; look at the xfs_swap_extents() function in the kernel which is very well documented; some cases return EBUSY. > 2. How effective is the utility when ran on highly fragmented file > system? I saw that if filesystem is 99.89% fragmented, the recovery is > very slow. It took around 25 min to clean up 100GB JBOD volume and after > that system was fragmented to 82%. So I was confused on how exactly the > fragmentation works. Again read the code, but basically it tries to preallocate as much space as the file is currently using, then checks that it is more contiguous space than the file currently has and if so, it copies the data from old to new and swaps the new allocation for the old. Note, this involves a fair amount of IO. Also don't get hung up on that fragmentation factor, at least not until you've read xfs_db code to see how it's reported, and you've thought about what that means. For example: a 100G filesystem with 10 10G files each with 5x2G extents will report 80% fragmentation. Now, ask yourself, is a 10G file in 5x2G extents "bad" fragmentation? > Any pointers on probable optimum use of xfs_fsr? > 3. Any precautions I need to take when working with that from data > consistency, robustness point of view? Any disadvantages? Anything which corrupts data is a bug, and I'm not aware of any such bugs in the defragmentation process. > 4. Any threshold for starting the defragmentation on xfs? Pretty well determined by your individual use case and requirements, I think. -Eric From owner-xfs@oss.sgi.com Thu Jul 3 08:01:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 08:01:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m63F1pVX001143 for ; Thu, 3 Jul 2008 08:01:51 -0700 X-ASG-Debug-ID: 1215097374-43e9011b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7C18A12D97C8 for ; Thu, 3 Jul 2008 08:02:54 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id bQy9oFoRFOqIz93V for ; Thu, 03 Jul 2008 08:02:54 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id C3FB5AC626C; Thu, 3 Jul 2008 10:02:53 -0500 (CDT) Message-ID: <486CEA1D.5010106@sandeen.net> Date: Thu, 03 Jul 2008 10:02:53 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Donald Douwsma CC: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] re-remove xfs custom bitops Subject: Re: [PATCH] re-remove xfs custom bitops References: <480EB397.1040304@sandeen.net> <4829C360.5060500@sandeen.net> <482BF841.8050704@sgi.com> <48669A45.1050104@sandeen.net> <4868A114.9080106@sgi.com> <486C322D.7080203@sandeen.net> <486C75DD.2040109@sgi.com> In-Reply-To: <486C75DD.2040109@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215097374 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0207 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55050 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16712 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Donald Douwsma wrote: > Eric Sandeen wrote: >> Donald Douwsma wrote: >> >>> First time round I hit an Oops on xfstests/177 while running the auto group >>> on ppc32. I dont seem to hit it running the single test, its intermittent. >> Funky. Do you ever hit it w/ the patch reverted? > > That's the question. So far no, the QA guys said they hit it a while > ago, but the time frame still matches last time. I dont think this > is related but I need to get some more ppc32 runs without. > > I'm probably being over cautious but I'd like to avoid the > inagain/outagain/inagain/outagain approach we keep using with > some of these cleanups. Yep, I totally understand, I'd do just the same. :) -Eric From owner-xfs@oss.sgi.com Thu Jul 3 15:10:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 15:10:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m63MAYWu013646 for ; Thu, 3 Jul 2008 15:10:36 -0700 X-ASG-Debug-ID: 1215123097-0ce102d70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail04.adl2.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3811ED9F322 for ; Thu, 3 Jul 2008 15:11:37 -0700 (PDT) Received: from ipmail04.adl2.internode.on.net (ipmail04.adl2.internode.on.net [203.16.214.57]) by cuda.sgi.com with ESMTP id AndQk6ab3zobVQte for ; Thu, 03 Jul 2008 15:11:37 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEANexXkh5LBzp/2dsb2JhbACuPg X-IronPort-AV: E=Sophos;i="4.27,744,1204464600"; d="scan'208";a="149412958" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail04.adl2.internode.on.net with ESMTP; 04 Jul 2008 07:41:35 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KEX1a-0001JX-0F; Fri, 04 Jul 2008 08:11:34 +1000 Date: Fri, 4 Jul 2008 08:11:33 +1000 From: Dave Chinner To: Takashi Sato , Christoph Hellwig , linux-ext4@vger.kernel.org, Andrew Morton , linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk, dm-devel@redhat.com, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, mtk.manpages@googlemail.com, axboe@kernel.dk X-ASG-Orig-Subj: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Subject: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Message-ID: <20080703221133.GA29319@disturbed> Mail-Followup-To: Takashi Sato , Christoph Hellwig , linux-ext4@vger.kernel.org, Andrew Morton , linux-fsdevel@vger.kernel.org, viro@ZenIV.linux.org.uk, dm-devel@redhat.com, xfs@oss.sgi.com, linux-kernel@vger.kernel.org, mtk.manpages@googlemail.com, axboe@kernel.dk References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080701105251.GC22522@agk.fab.redhat.com> <9942A69CB65D4A41B39F36AF8EEF6F22@nsl.ad.nec.co.jp> <20080703124709.GI22522@agk.fab.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080703124709.GI22522@agk.fab.redhat.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail04.adl2.internode.on.net[203.16.214.57] X-Barracuda-Start-Time: 1215123098 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55080 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16713 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Jul 03, 2008 at 01:47:10PM +0100, Alasdair G Kergon wrote: > On Thu, Jul 03, 2008 at 09:11:05PM +0900, Takashi Sato wrote: > > If the freezer accesses the frozen filesystem and causes a deadlock, > > the above ideas can't solve it > > But you could also say that if the 'freezer' process accesses the frozen > filesystem and deadlocks then that's just a bug and that userspace code > should be fixed and there's no need to introduce the complexity of a > timeout parameter. Seconded - that was also my primary objection to the timeout code. > The point I'm trying to make here is: > Under what real-world circumstances might multiple concurrent freezing > attempts occur, and which of A, B or C (or other variations) would be > the most appropriate way of handling such situations? > > A common example is people running xfs_freeze followed by an lvm command > which also attempts to freeze the filesystem. Yes, I've seen that reported a number of times. > I can see a case for B or C, but personally I prefer A: > > > > 1 succeeds, freezes > > > 2 succeeds, remains frozen > > > 3 succeeds, remains frozen > > > 4 succeeds, thaws Agreed, though I'd modify the definition of that case to be "remain frozen until the last thaw occurs". That has the advantage that it's relatively simple to implement with just a counter... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 3 19:39:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 19:39:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m642d4Ro004263 for ; Thu, 3 Jul 2008 19:39:04 -0700 X-ASG-Debug-ID: 1215139206-529201a10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx200i.civica.com.au (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 107C6DA21C9 for ; Thu, 3 Jul 2008 19:40:06 -0700 (PDT) Received: from mx200i.civica.com.au (mx200i.civica.com.au [203.56.2.222]) by cuda.sgi.com with ESMTP id n9jQRFspkQlo8uq9 for ; Thu, 03 Jul 2008 19:40:06 -0700 (PDT) Received: from gateway.civica.com.au (gateway.civica.com.au [10.61.100.12]) by mx200i.civica.com.au (BorderWare MXtreme Mail Firewall) with ESMTP id CECE625897 for ; Fri, 4 Jul 2008 12:40:05 +1000 (EST) Received: from newmail.civica.com.au ([10.61.106.3]) by gateway.civica.com.au with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Jul 2008 12:40:05 +1000 Received: from 10.61.106.153 ([10.61.106.153]) by newmail.civica.com.au ([10.61.106.3]) with Microsoft Exchange Server HTTP-DAV ; Fri, 4 Jul 2008 02:40:04 +0000 Received: from quadski by newmail.civica.com.au; 04 Jul 2008 12:40:05 +1000 X-ASG-Orig-Subj: user defined cache Subject: user defined cache From: Warwick Boote To: xfs@oss.sgi.com Content-Type: text/plain; charset=UTF-8 Date: Fri, 04 Jul 2008 12:40:05 +1000 Message-Id: <1215139205.7187.33.camel@quadski> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 X-OriginalArrivalTime: 04 Jul 2008 02:40:06.0140 (UTC) FILETIME=[449723C0:01C8DD7F] X-Barracuda-Connect: mx200i.civica.com.au[203.56.2.222] X-Barracuda-Start-Time: 1215139208 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4995 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55097 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m642d4Ro004265 X-archive-position: 16714 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: wboote@civica.com.au Precedence: bulk X-list: xfs Hi all, Do you know of setting or layered file system that enables me to define a large buffer in main memory and cache writes to this buffer? Obviously i'd need the file system to also read from this buffer if the data hasn't been flushed to the disk yet. Waz. =) (apologies for inappropriate disclaimer) -- This email is from Civica Pty Limited and it, together with any attachments, is confidential to the intended recipient(s) and the contents may be legally privileged or contain proprietary and private information. It is intended solely for the person to whom it is addressed. If you are not an intended recipient, you may not review, copy or distribute this email. If received in error, please notify the sender and delete the message from your system immediately. Any views or opinions expressed in this email and any files transmitted with it are those of the author only and may not necessarily reflect the views of Civica and do not create any legally binding rights or obligations whatsoever. Unless otherwise pre-agreed by exchange of hard copy documents signed by duly authorised representatives, contracts may not be concluded on behalf of Civica by email. Please note that neither Civica nor the sender accepts any responsibility for any viruses and it is your responsibility to scan the email and the attachments (if any). All email received and sent by Civica may be monitored to protect the business interests of Civica. From owner-xfs@oss.sgi.com Thu Jul 3 20:50:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 20:50:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_81, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m643oKkV012452 for ; Thu, 3 Jul 2008 20:50:21 -0700 X-ASG-Debug-ID: 1215143483-352500cf0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from web34507.mail.mud.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 226321877C48 for ; Thu, 3 Jul 2008 20:51:23 -0700 (PDT) Received: from web34507.mail.mud.yahoo.com (web34507.mail.mud.yahoo.com [66.163.178.173]) by cuda.sgi.com with SMTP id wzh0PhFdVmhGNAHW for ; Thu, 03 Jul 2008 20:51:23 -0700 (PDT) Received: (qmail 36251 invoked by uid 60001); 4 Jul 2008 03:51:23 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=MRLwc9RNPoS1Q6s7hrKJ5FM/mkdOUQ2JB8Nb2f9N+OfUbb3uCGLh4JZ3NVzHwOSdWY/27ijNiLsZjmEK2WDWo00dDFKnIH0uk59j17gczs3RIAJ19MB3UOUTJR1102t81jbR3ZtTz8mLo9qIh5aS1bUTz4SUXZCHP0ZBw3LGU6o=; Received: from [96.14.189.102] by web34507.mail.mud.yahoo.com via HTTP; Thu, 03 Jul 2008 20:51:23 PDT X-Mailer: YahooMailWebService/0.7.199 Date: Thu, 3 Jul 2008 20:51:23 -0700 (PDT) From: Mark Reply-To: MusicMan529@yahoo.com X-ASG-Orig-Subj: Re: user defined cache Subject: Re: user defined cache To: xfs@oss.sgi.com, Warwick Boote In-Reply-To: <1215139205.7187.33.camel@quadski> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <328802.35603.qm@web34507.mail.mud.yahoo.com> X-Barracuda-Connect: web34507.mail.mud.yahoo.com[66.163.178.173] X-Barracuda-Start-Time: 1215143484 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4938 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55101 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16715 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: musicman529@yahoo.com Precedence: bulk X-list: xfs --- On Thu, 7/3/08, Warwick Boote wrote: > Hi all, > > Do you know of setting or layered file system that enables > me to define > a large buffer in main memory and cache writes to this > buffer? > > Obviously i'd need the file system to also read from > this buffer if the > data hasn't been flushed to the disk yet. XFS supports the following mount options, and they do increase throughput somewhat on my system: logbufs=N (helps concurrency) logbsize=N (helps log buffering) If you are using an internal XFS log, you may also try "nobarrier" to reduce force-to-disk write frequency. NB: I have seen this option discussed on this mailing list, but I do not see it in the mount(8) man page. Bear in mind that the XFS log is for metadata, rather than actual file data. This may be what you're looking for, or at least sufficient; if not, my apologies. -- Mark "What better place to find oneself than on the streets of one's home village?" --Capt. Jean-Luc Picard, "Family" From owner-xfs@oss.sgi.com Thu Jul 3 21:02:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 21:02:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6442SEe013458 for ; Thu, 3 Jul 2008 21:02:28 -0700 X-ASG-Debug-ID: 1215144210-144e01df0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B4387DA25BA for ; Thu, 3 Jul 2008 21:03:30 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id O75QAt5Cj2EK0LMP for ; Thu, 03 Jul 2008 21:03:30 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAA8+bUh5LBzp/2dsb2JhbACxVA X-IronPort-AV: E=Sophos;i="4.30,300,1212330600"; d="scan'208";a="141604450" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 04 Jul 2008 13:33:16 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KEcVv-0000bO-Gk; Fri, 04 Jul 2008 14:03:15 +1000 Date: Fri, 4 Jul 2008 14:03:15 +1000 From: Dave Chinner To: Warwick Boote Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: user defined cache Subject: Re: user defined cache Message-ID: <20080704040315.GD29319@disturbed> Mail-Followup-To: Warwick Boote , xfs@oss.sgi.com References: <1215139205.7187.33.camel@quadski> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1215139205.7187.33.camel@quadski> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215144211 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4597 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55101 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16716 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 04, 2008 at 12:40:05PM +1000, Warwick Boote wrote: > Hi all, > > Do you know of setting or layered file system that enables me to define > a large buffer in main memory and cache writes to this buffer? I know there's wrapper libraries that do this - like FFIO - but I don't think there's a free one. However, why doesn't the page cache do what you want already? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 3 22:14:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 22:15:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m645EBqu018246 for ; Thu, 3 Jul 2008 22:14:14 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA15768; Fri, 4 Jul 2008 15:15:05 +1000 Message-ID: <486DB1D9.20207@sgi.com> Date: Fri, 04 Jul 2008 15:15:05 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH] kill XFS_PURGE_INODE References: <20080616062634.GA5971@lst.de> <20080702192224.GB18817@lst.de> In-Reply-To: <20080702192224.GB18817@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16717 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Ping? Already got a review from Dave. > Yeah, this is basically a substitute and replace. Okay, looks like there is also a s/VN_HOLD(XFS_ITOV())/IHOLD()/ thrown in too (which is what IHOLD is defined as). I'll check it in. --Tim > On Mon, Jun 16, 2008 at 08:26:34AM +0200, Christoph Hellwig wrote: >> Just a useless alias for IRELE. >> >> >> Signed-off-by: Christoph Hellwig >> >> Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.c >> =================================================================== >> --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.c 2008-06-05 20:21:04.000000000 +0200 >> +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.c 2008-06-05 20:22:37.000000000 +0200 >> @@ -444,11 +444,11 @@ xfs_qm_unmount_quotas( >> } >> } >> if (uqp) { >> - XFS_PURGE_INODE(uqp); >> + IRELE(uqp); >> mp->m_quotainfo->qi_uquotaip = NULL; >> } >> if (gqp) { >> - XFS_PURGE_INODE(gqp); >> + IRELE(gqp); >> mp->m_quotainfo->qi_gquotaip = NULL; >> } >> out: >> @@ -1239,11 +1239,11 @@ xfs_qm_destroy_quotainfo( >> xfs_qm_list_destroy(&qi->qi_dqlist); >> >> if (qi->qi_uquotaip) { >> - XFS_PURGE_INODE(qi->qi_uquotaip); >> + IRELE(qi->qi_uquotaip); >> qi->qi_uquotaip = NULL; /* paranoia */ >> } >> if (qi->qi_gquotaip) { >> - XFS_PURGE_INODE(qi->qi_gquotaip); >> + IRELE(qi->qi_gquotaip); >> qi->qi_gquotaip = NULL; >> } >> mutex_destroy(&qi->qi_quotaofflock); >> @@ -1393,7 +1393,7 @@ xfs_qm_qino_alloc( >> * locked exclusively and joined to the transaction already. >> */ >> ASSERT(xfs_isilocked(*ip, XFS_ILOCK_EXCL)); >> - VN_HOLD(XFS_ITOV((*ip))); >> + IHOLD(*ip); >> >> /* >> * Make the changes in the superblock, and log those too. >> Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c >> =================================================================== >> --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c 2008-05-23 09:31:39.000000000 +0200 >> +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c 2008-06-05 20:21:09.000000000 +0200 >> @@ -362,11 +362,11 @@ xfs_qm_scall_quotaoff( >> * if we don't need them anymore. >> */ >> if ((dqtype & XFS_QMOPT_UQUOTA) && XFS_QI_UQIP(mp)) { >> - XFS_PURGE_INODE(XFS_QI_UQIP(mp)); >> + IRELE(XFS_QI_UQIP(mp)); >> XFS_QI_UQIP(mp) = NULL; >> } >> if ((dqtype & (XFS_QMOPT_GQUOTA|XFS_QMOPT_PQUOTA)) && XFS_QI_GQIP(mp)) { >> - XFS_PURGE_INODE(XFS_QI_GQIP(mp)); >> + IRELE(XFS_QI_GQIP(mp)); >> XFS_QI_GQIP(mp) = NULL; >> } >> out_error: >> Index: linux-2.6-xfs/fs/xfs/quota/xfs_quota_priv.h >> =================================================================== >> --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_quota_priv.h 2008-05-23 09:31:39.000000000 +0200 >> +++ linux-2.6-xfs/fs/xfs/quota/xfs_quota_priv.h 2008-06-05 20:21:09.000000000 +0200 >> @@ -158,9 +158,6 @@ for ((dqp) = (qlist)->qh_next; (dqp) != >> #define XFS_IS_SUSER_DQUOT(dqp) \ >> (!((dqp)->q_core.d_id)) >> >> -#define XFS_PURGE_INODE(ip) \ >> - IRELE(ip); >> - >> #define DQFLAGTO_TYPESTR(d) (((d)->dq_flags & XFS_DQ_USER) ? "USR" : \ >> (((d)->dq_flags & XFS_DQ_GROUP) ? "GRP" : \ >> (((d)->dq_flags & XFS_DQ_PROJ) ? "PRJ":"???"))) > ---end quoted text--- > From owner-xfs@oss.sgi.com Thu Jul 3 23:40:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 23:40:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m646eM2m025979 for ; Thu, 3 Jul 2008 23:40:23 -0700 X-ASG-Debug-ID: 1215153685-1a70001c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailgate01.web.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 10AB52B6700 for ; Thu, 3 Jul 2008 23:41:25 -0700 (PDT) Received: from mailgate01.web.de (mailgate01.web.de [217.72.192.251]) by cuda.sgi.com with ESMTP id niGYqJEbPdcJabmX for ; Thu, 03 Jul 2008 23:41:25 -0700 (PDT) Received: by lxjbe.webde.local (Postfix, from userid 1000) id DC94A41241; Fri, 4 Jul 2008 08:41:26 +0200 (CEST) (R201) Date: Fri, 4 Jul 2008 08:41:26 +0200 From: Jens Beyer To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS perfomance degradation on growing filesystem size Subject: XFS perfomance degradation on growing filesystem size Message-ID: <20080704064126.GA14847@webde.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: mailgate01.web.de[217.72.192.251] X-Barracuda-Start-Time: 1215153686 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0071 1.0000 -1.9747 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.97 X-Barracuda-Spam-Status: No, SCORE=-1.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55111 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16718 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jens.beyer@1und1.de Precedence: bulk X-list: xfs Hi, I have encountered a strange performance problem during some hardware evaluation tests: I am running a benchmark to measure especially random read/write I/O on an raid device and found that (under some circumstances) the performance of Random Read I/O is inverse proportional to the size of the tested XFS filesystem. In numbers this means that on a 100GB partition I get a throughput of ~25 MB/s and on the same hardware at 1TB FS size only 18 MB/s (and at 2+ TB like 14 MB/s) (absolute values depend on options, kernel version and are for random read i/o at 8k test block size). Surprisingly this degradation does not affect random write or seq read/write (at least not by this factor). Even more surprising using an ext3 filesystem I always get ~25 MB/s. My test setups included: - kernel vanilla 2.6.24, 2.6.25.8, 2.6.24-ubuntu_8.04, 2.6.20, 32/64bit - xfsprogs v2.9.8/7 - benchmarks: - iozone: iozone -i 0 -i 2 -r 8k -s 1g -t 32 -+p 100 - tiobench: tiobench.pl --size 32000 --random 100000 --block 8192 \ --dir /mnt --threads 32 --numruns 1 (Bench is for 8k blocksize, 32 Threads with enough data to be beyond simple ram cache). - The hardware itself where recent HP dual/quadcores with 4GB RAM with external SAS Raids (MSA60, MSA70) and 15k SAS disks (different types). I tried most options like but not limited to: agcount, logbufs, nobarrier, blockdev --setra, (...), but none had an significant impact. All benchmarks where run using deadline i/o scheduler Does anyone has a clue on what is going on - or even can reproduce this? Or, is this the default behavior? Could this be an hardware problem ? Thanks for any comment, Jens From owner-xfs@oss.sgi.com Thu Jul 3 23:44:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 03 Jul 2008 23:44:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m646iquR026566 for ; Thu, 3 Jul 2008 23:44:53 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA17395; Fri, 4 Jul 2008 16:45:51 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id 8798E58C4C29; Fri, 4 Jul 2008 16:45:51 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - kill XFS_PURGE_INODE Message-Id: <20080704064551.8798E58C4C29@chook.melbourne.sgi.com> Date: Fri, 4 Jul 2008 16:45:51 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16719 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs s/XFS_PURGE_INODE/IRELE/g s/VN_HOLD(XFS_ITOV())/IHOLD()/ Signed-off-by: Christoph Hellwig Date: Fri Jul 4 16:44:37 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: hch@lst.de,dchinner@agami.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31405a fs/xfs/quota/xfs_quota_priv.h - 1.12 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_quota_priv.h.diff?r1=text&tr1=1.12&r2=text&tr2=1.11&f=h - s/XFS_PURGE_INODE/IRELE/g fs/xfs/quota/xfs_qm_syscalls.c - 1.44 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm_syscalls.c.diff?r1=text&tr1=1.44&r2=text&tr2=1.43&f=h - s/XFS_PURGE_INODE/IRELE/g fs/xfs/quota/xfs_qm.c - 1.71 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm.c.diff?r1=text&tr1=1.71&r2=text&tr2=1.70&f=h - s/XFS_PURGE_INODE/IRELE/g From owner-xfs@oss.sgi.com Fri Jul 4 00:10:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 00:10:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6479vK1030505 for ; Fri, 4 Jul 2008 00:09:58 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA17871; Fri, 4 Jul 2008 17:10:53 +1000 Message-ID: <486DCCFD.1070007@sgi.com> Date: Fri, 04 Jul 2008 17:10:53 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH] fix compilation without CONFIG_PROC_FS References: <20080702193630.GA19715@lst.de> In-Reply-To: <20080702193630.GA19715@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16720 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs I'll check it in. --Tim Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.h 2008-06-27 15:16:21.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h 2008-06-27 15:19:18.000000000 +0200 > @@ -146,11 +146,12 @@ extern void xfs_cleanup_procfs(void); > > static inline int xfs_init_procfs(void) > { > - return 0 > -}; > + return 0; > +} > + > static inline void xfs_cleanup_procfs(void) > { > -}; > +} > > #endif /* !CONFIG_PROC_FS */ > > From owner-xfs@oss.sgi.com Fri Jul 4 00:52:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 00:52:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m647qXg7005370 for ; Fri, 4 Jul 2008 00:52:35 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA18618; Fri, 4 Jul 2008 17:53:31 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id EF20858C4C29; Fri, 4 Jul 2008 17:53:30 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 984019 - fix compilation without CONFIG_PROC_FS Message-Id: <20080704075330.EF20858C4C29@chook.melbourne.sgi.com> Date: Fri, 4 Jul 2008 17:53:30 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16721 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs fix compilation without CONFIG_PROC_FS Signed-off-by: Christoph Hellwig Date: Fri Jul 4 17:52:09 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31408a fs/xfs/linux-2.6/xfs_stats.h - 1.19 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_stats.h.diff?r1=text&tr1=1.19&r2=text&tr2=1.18&f=h - fix compilation without CONFIG_PROC_FS very obvious problem :) From owner-xfs@oss.sgi.com Fri Jul 4 00:59:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 00:59:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m647xNPK006061 for ; Fri, 4 Jul 2008 00:59:25 -0700 X-ASG-Debug-ID: 1215158425-29cf019a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from build-svl-1.agami.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 03A3F187862B for ; Fri, 4 Jul 2008 01:00:26 -0700 (PDT) Received: from build-svl-1.agami.com (colo-nat-pool.agami.com [216.218.227.40]) by cuda.sgi.com with ESMTP id MzlpqpIUkyrhGccQ for ; Fri, 04 Jul 2008 01:00:26 -0700 (PDT) Received: from build-svl-1.agami.com (localhost.localdomain [127.0.0.1]) by build-svl-1.agami.com (8.13.7/8.13.7) with ESMTP id m647xgPR032635; Fri, 4 Jul 2008 00:59:42 -0700 Received: (from dchinner@localhost) by build-svl-1.agami.com (8.13.7/8.13.7/Submit) id m647xfMR032634; Fri, 4 Jul 2008 00:59:41 -0700 X-Authentication-Warning: build-svl-1.agami.com: dchinner set sender to dchinner@agami.com using -f Date: Fri, 4 Jul 2008 00:59:41 -0700 From: Dave Chinner To: Jens Beyer Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS perfomance degradation on growing filesystem size Subject: Re: XFS perfomance degradation on growing filesystem size Message-ID: <20080704075941.GP16257@build-svl-1.agami.com> Mail-Followup-To: Jens Beyer , xfs@oss.sgi.com References: <20080704064126.GA14847@webde.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080704064126.GA14847@webde.de> User-Agent: Mutt/1.4.2.3i X-Barracuda-Connect: colo-nat-pool.agami.com[216.218.227.40] X-Barracuda-Start-Time: 1215158427 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0391 1.0000 -1.7685 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.77 X-Barracuda-Spam-Status: No, SCORE=-1.77 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55117 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16722 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: dchinner@agami.com Precedence: bulk X-list: xfs On Fri, Jul 04, 2008 at 08:41:26AM +0200, Jens Beyer wrote: > > Hi, > > I have encountered a strange performance problem during some > hardware evaluation tests: > > I am running a benchmark to measure especially random read/write > I/O on an raid device and found that (under some circumstances) > the performance of Random Read I/O is inverse proportional to the > size of the tested XFS filesystem. > > In numbers this means that on a 100GB partition I get a throughput > of ~25 MB/s and on the same hardware at 1TB FS size only 18 MB/s > (and at 2+ TB like 14 MB/s) (absolute values depend on options, > kernel version and are for random read i/o at 8k test block size). Of course - as the filesystem size grows, so does the amount of each disk in use so the average seek distance increases and hence read I/Os take longer. Cheers, Dave. -- Dave Chinner dchinner@agami.com From owner-xfs@oss.sgi.com Fri Jul 4 03:17:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 03:17:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m64AHWXd015038 for ; Fri, 4 Jul 2008 03:17:34 -0700 X-ASG-Debug-ID: 1215166711-258102100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 051072B6EA1 for ; Fri, 4 Jul 2008 03:18:34 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id esAysl4yWohFJAJn for ; Fri, 04 Jul 2008 03:18:34 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 205818E00AB; Fri, 4 Jul 2008 03:21:07 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id 074348E00A6; Fri, 4 Jul 2008 03:21:07 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Jul 2008 03:19:04 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Fri, 4 Jul 2008 03:19:03 -0700 Message-ID: <486DF8F0.5010700@pmc-sierra.com> Date: Fri, 04 Jul 2008 15:48:24 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> In-Reply-To: <486CE9EA.90502@sandeen.net> Content-Type: multipart/mixed; boundary="------------000503030107080700050305" X-OriginalArrivalTime: 04 Jul 2008 10:19:04.0320 (UTC) FILETIME=[629FF000:01C8DDBF] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215166715 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0208 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55127 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16723 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs This is a multi-part message in MIME format. --------------000503030107080700050305 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Eric Sandeen wrote: > Sagar Borikar wrote: > >> Eric Sandeen wrote: >> > > > >>>> Eric, Could you please let me know about bits and pieces that we need to >>>> remember while back porting xfs to 2.6.18? >>>> If you share patches which takes care of it, that would be great. >>>> >>>> >>> http://sandeen.net/rhel5_xfs/xfs-2.6.25-for-rhel5-testing.tar.bz2 >>> >>> should be pretty close. It was quick 'n' dirty and it has some warts >>> but would give an idea of what backporting was done (see patches/ and >>> the associated quilt series; quilt push -a to apply them all) >>> >>> >> Thanks a lot Eric. I'll go through it .I am actually trying another >> option of regularly defragmenting the file system under stress. >> > > Ok, but that won't get to the bottom of the problem. It might alleviate > it at best, but if I were shipping a product using xfs I'd want to know > that it was properly solved. :) > > Even we too don't want to leave it as it is. I still am working on back porting the latest xfs code. Your patches are helping a lot . Just to check whether that issue lies with 2.6.18 or MIPS port, I tested it on 2.6.24 x86 platform. Here we created a loop back device of 10 GB and mounted xfs on that. What I observe that xfs_repair reports quite a few bad blocks and bad extents here as well. So is developing bad blocks and extents normal behavior in xfs which would be recovered in background or is it a bug? I still didn't see the exception but the bad blocks and extents are generated within 10 minutes or running the tests. Attaching the log . > The tarball above should give you almost everything you need to run your > testcase with current xfs code on your older kernel to see if the bug > persists or if it's been fixed upstream, in which case you have a > relatively easy path to an actual solution that your customers can > depend on. > > >> I wanted to understand couple of things for using xfs_fsr utility: >> >> 1. What should be the state of filesystem when I am running xfs_fsr. >> Ideally we should stop all io before running defragmentation. >> > > you can run in any state. Some files will not get defragmented due to > busy-ness or other conditions; look at the xfs_swap_extents() function > in the kernel which is very well documented; some cases return EBUSY. > > >> 2. How effective is the utility when ran on highly fragmented file >> system? I saw that if filesystem is 99.89% fragmented, the recovery is >> very slow. It took around 25 min to clean up 100GB JBOD volume and after >> that system was fragmented to 82%. So I was confused on how exactly the >> fragmentation works. >> > > Again read the code, but basically it tries to preallocate as much space > as the file is currently using, then checks that it is more contiguous > space than the file currently has and if so, it copies the data from old > to new and swaps the new allocation for the old. Note, this involves a > fair amount of IO. > > Also don't get hung up on that fragmentation factor, at least not until > you've read xfs_db code to see how it's reported, and you've thought > about what that means. For example: a 100G filesystem with 10 10G files > each with 5x2G extents will report 80% fragmentation. Now, ask > yourself, is a 10G file in 5x2G extents "bad" fragmentation? > > Agreed as in x86 too I see 99.12% fragmentation when I run above mentioned test. and xfs_fsr doesn't help much even after freezing the file system. >> Any pointers on probable optimum use of xfs_fsr? >> 3. Any precautions I need to take when working with that from data >> consistency, robustness point of view? Any disadvantages? >> > > Anything which corrupts data is a bug, and I'm not aware of any such > bugs in the defragmentation process. > > Assuming that we get some improvement by running xfs_fsr, is it safe to run regularly in some periodic interval the defragmentation utility? >> 4. Any threshold for starting the defragmentation on xfs? >> > > Pretty well determined by your individual use case and requirements, I > think. > > -Eric > Thanks for the detailed response Eric. Sagar --------------000503030107080700050305 Content-Type: text/plain; name="xfs_repair_log" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="xfs_repair_log" bad nblocks 13345 for inode 50331785, would reset to 19431 bad nextents 156 for inode 50331785, would reset to 251 - process newly discovered inodes... Phase 4 - check for duplicate blocks... - setting up duplicate extent list... - check for inodes claiming duplicate blocks... - agno = 1 - agno = 0 entry "testfile" in shortform directory 132 references free inode 142 would have junked entry "testfile" in directory inode 132 entry "testfile" in shortform directory 138 references free inode 143 would have junked entry "testfile" in directory inode 138 entry "testfile" in shortform directory 140 references free inode 144 would have junked entry "testfile" in directory inode 140 bad nblocks 15848 for inode 141, would reset to 18634 bad nextents 269 for inode 141, would reset to 306 bad nblocks 18888 for inode 16777350, would reset to 19144 bad nextents 303 for inode 16777350, would reset to 309 bad nblocks 18704 for inode 16777351, would reset to 19144 bad nextents 291 for inode 16777351, would reset to 299 bad fwd (right) sibling pointer (saw 107678 should be NULLDFSBNO) in inode 142 ((null) fork) bmap btree block 236077307437232 would have cleared inode 142 bad fwd (right) sibling pointer (saw 1139882 should be NULLDFSBNO) in inode 143 ((null) fork) bmap btree block 4556402090352816 would have cleared inode 143 bad fwd (right) sibling pointer (saw 1138473 should be NULLDFSBNO) in inode 144 ((null) fork) bmap btree block 4564279060373680 would have cleared inode 144 bad nblocks 13825 for inode 145, would reset to 18503 bad nextents 221 for inode 145, would reset to 222 - agno = 2 entry "testfile" in shortform directory 33595588 references free inode 33595593 would have junked entry "testfile" in directory inode 33595588 bad nblocks 18704 for inode 33595589, would reset to 19121 bad nextents 306 for inode 33595589, would reset to 314 bad nblocks 18704 for inode 33595590, would reset to 19432 bad nextents 302 for inode 33595590, would reset to 313 bad nblocks 18640 for inode 33595591, would reset to 19432 bad nextents 311 for inode 33595591, would reset to 317 bad nblocks 18888 for inode 33595592, would reset to 19432 bad nextents 312 for inode 33595592, would reset to 322 bad fwd (right) sibling pointer (saw 104113 should be NULLDFSBNO) in inode 33595593 ((null) fork) bmap btree block 9041060911947952 would have cleared inode 33595593 - agno = 3 bad nblocks 18888 for inode 50331781, would reset to 19432 bad nextents 315 for inode 50331781, would reset to 324 bad nblocks 18888 for inode 50331782, would reset to 19432 bad nextents 326 for inode 50331782, would reset to 333 bad nblocks 18888 for inode 50331783, would reset to 19432 bad nblocks 18428 for inode 50331784, would reset to 19784 bad nextents 285 for inode 50331784, would reset to 306 bad nblocks 18704 for inode 16777352, would reset to 19144 bad nextents 311 for inode 16777352, would reset to 315 bad nblocks 13345 for inode 50331785, would reset to 19431 bad nextents 156 for inode 50331785, would reset to 251 bad nblocks 18888 for inode 16777353, would reset to 19144 bad nextents 318 for inode 16777353, would reset to 321 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity... - traversing filesystem ... - agno = 0 entry "testfile" in shortform directory inode 132 points to free inode 142would junk entry entry "testfile" in shortform directory inode 138 points to free inode 143would junk entry entry "testfile" in shortform directory inode 140 points to free inode 144would junk entry - agno = 1 - agno = 2 entry "testfile" in shortform directory inode 33595588 points to free inode 33595593would junk entry - agno = 3 - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify link counts... No modify flag set, skipping filesystem flush and exiting. XFS_REPAIR Summary Fri Jul 4 15:34:47 2008 Phase Start End Duration Phase 1: 07/04 15:34:00 07/04 15:34:04 4 seconds Phase 2: 07/04 15:34:04 07/04 15:34:31 27 seconds Phase 3: 07/04 15:34:31 07/04 15:34:47 16 seconds Phase 4: 07/04 15:34:47 07/04 15:34:47 Phase 5: Skipped Phase 6: 07/04 15:34:47 07/04 15:34:47 Phase 7: 07/04 15:34:47 07/04 15:34:47 Total run time: 47 seconds --------------000503030107080700050305-- From owner-xfs@oss.sgi.com Fri Jul 4 05:07:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 05:07:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,STOX_REPLY_TYPE autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m64C7iKP026200 for ; Fri, 4 Jul 2008 05:07:44 -0700 X-ASG-Debug-ID: 1215173326-697300550000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CAC0BDA407E for ; Fri, 4 Jul 2008 05:08:47 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id SeAPJYjmHsfYpsN7 for ; Fri, 04 Jul 2008 05:08:47 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.195]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m64C8BUD015874; Fri, 4 Jul 2008 21:08:11 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m64C8B318276; Fri, 4 Jul 2008 21:08:11 +0900 (JST) Received: from yonosuke.jp.nec.com (yonosuke.jp.nec.com [10.26.220.15]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id m64C8AGk027786; Fri, 4 Jul 2008 21:08:10 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Fri, 4 Jul 2008 21:08:10 +0900 Message-Id: From: "Takashi Sato" To: "Eric Sandeen" , "Alasdair G Kergon" , "Dave Chinner" Cc: , , "Andrew Morton" , , , , "Christoph Hellwig" , , , References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080701105251.GC22522@agk.fab.redhat.com> <9942A69CB65D4A41B39F36AF8EEF6F22@nsl.ad.nec.co.jp> <20080703124709.GI22522@agk.fab.redhat.com> <20080703221133.GA29319@disturbed> In-Reply-To: <20080703221133.GA29319@disturbed> X-ASG-Orig-Subj: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Subject: Re: [dm-devel] Re: [PATCH 3/3] Add timeout feature Date: Fri, 4 Jul 2008 21:08:09 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1215173327 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55133 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16724 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi Alasdair, Eric and Dave, > On Thu, Jul 03, 2008 at 01:47:10PM +0100, Alasdair G Kergon wrote: >> On Thu, Jul 03, 2008 at 09:11:05PM +0900, Takashi Sato wrote: >> > If the freezer accesses the frozen filesystem and causes a deadlock, >> > the above ideas can't solve it >> >> But you could also say that if the 'freezer' process accesses the frozen >> filesystem and deadlocks then that's just a bug and that userspace code >> should be fixed and there's no need to introduce the complexity of a >> timeout parameter. > > Seconded - that was also my primary objection to the timeout code. I will consider removing the timeout. >> The point I'm trying to make here is: >> Under what real-world circumstances might multiple concurrent freezing >> attempts occur, and which of A, B or C (or other variations) would be >> the most appropriate way of handling such situations? >> >> A common example is people running xfs_freeze followed by an lvm command >> which also attempts to freeze the filesystem. > > Yes, I've seen that reported a number of times. > >> I can see a case for B or C, but personally I prefer A: >> >> > > 1 succeeds, freezes >> > > 2 succeeds, remains frozen >> > > 3 succeeds, remains frozen >> > > 4 succeeds, thaws > > Agreed, though I'd modify the definition of that case to be "remain > frozen until the last thaw occurs". That has the advantage that > it's relatively simple to implement with just a counter... I agree this idea. But I have one concern. When device-mapper's freeze follows FIFREEZE, can device-mapper freeze only device-mapper's part correctly? And when device-mapper's thaw follows FITHAW, can device-mapper thaw only device-mapper's part? Cheers, Takashi From owner-xfs@oss.sgi.com Fri Jul 4 05:26:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 05:26:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m64CQeKH027761 for ; Fri, 4 Jul 2008 05:26:40 -0700 X-ASG-Debug-ID: 1215174462-6e5200320000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D2A201878EEC for ; Fri, 4 Jul 2008 05:27:42 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 8cv2Ffabi6dDN0sJ for ; Fri, 04 Jul 2008 05:27:42 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAFCybUh5LBzp/2dsb2JhbACwYQ X-IronPort-AV: E=Sophos;i="4.30,302,1212330600"; d="scan'208";a="141906783" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 04 Jul 2008 21:57:33 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KEkNr-0004Z7-F8; Fri, 04 Jul 2008 22:27:27 +1000 Date: Fri, 4 Jul 2008 22:27:26 +1000 From: Dave Chinner To: Sagar Borikar Cc: Eric Sandeen , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash Message-ID: <20080704122726.GG29319@disturbed> Mail-Followup-To: Sagar Borikar , Eric Sandeen , Nathan Scott , xfs@oss.sgi.com References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <486DF8F0.5010700@pmc-sierra.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215174463 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1737 1.0000 -0.9694 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55134 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16725 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 04, 2008 at 03:48:24PM +0530, Sagar Borikar wrote: > Even we too don't want to leave it as it is. I still am working on back > porting the latest xfs code. > Your patches are helping a lot . > Just to check whether that issue lies with 2.6.18 or MIPS port, I tested > it on 2.6.24 x86 platform. > Here we created a loop back device of 10 GB and mounted xfs on that. And the script that generates the workload can be found where? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Jul 4 08:32:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 08:32:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m64FWILs010600 for ; Fri, 4 Jul 2008 08:32:18 -0700 X-ASG-Debug-ID: 1215185601-6f1f03660000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BBA21DA4502 for ; Fri, 4 Jul 2008 08:33:21 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id uO6rbXTRI59yw1tF for ; Fri, 04 Jul 2008 08:33:21 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id A600BAC626C; Fri, 4 Jul 2008 10:33:20 -0500 (CDT) Message-ID: <486E42C0.4090108@sandeen.net> Date: Fri, 04 Jul 2008 10:33:20 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <20080628000516.GD29319@disturbed> <340C71CD25A7EB49BFA81AE8C8392667028A1CA7@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <20080629215647.GJ29319@disturbed> <20080630034112.055CF18904C4@bby1mta01.pmc-sierra.bc.ca> <4868B46C.9000200@pmc-sierra.com> <20080701064437.GR29319@disturbed> <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> In-Reply-To: <486DF8F0.5010700@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215185601 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55145 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16726 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: >> > Even we too don't want to leave it as it is. I still am working on back > porting the latest xfs code. > Your patches are helping a lot . > Just to check whether that issue lies with 2.6.18 or MIPS port, I tested > it on 2.6.24 x86 platform. > Here we created a loop back device of 10 GB and mounted xfs on that. > What I observe that xfs_repair reports quite a few bad blocks and bad > extents here as well. > So is developing bad blocks and extents normal behavior in xfs which > would be recovered > in background or is it a bug? I still didn't see the exception but the > bad blocks and extents are > generated within 10 minutes or running the tests. > Attaching the log . Repair finding corruption indicates a bug (or hardware problem) somewhere. As a long shot you might re-test with this patch in place: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff_plain;h=6ab455eeaff6893cd06da33843e840d888cdc04a But, as Dave said, please also provide the testcase. -Eric From owner-xfs@oss.sgi.com Fri Jul 4 10:29:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 10:29:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m64HTDCi017373 for ; Fri, 4 Jul 2008 10:29:13 -0700 X-ASG-Debug-ID: 1215192616-401802440000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta03.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DAA4E2B9B44 for ; Fri, 4 Jul 2008 10:30:16 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (bby1mta03.pmc-sierra.com [216.241.235.118]) by cuda.sgi.com with ESMTP id YbYGtgpMB9d3OeXn for ; Fri, 04 Jul 2008 10:30:16 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id A42B81070055; Fri, 4 Jul 2008 10:32:54 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta03.pmc-sierra.bc.ca (Postfix) with SMTP id 57A991070078; Fri, 4 Jul 2008 10:32:52 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Jul 2008 10:30:50 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Xfs Access to block zero exception and system crash Subject: RE: Xfs Access to block zero exception and system crash Date: Fri, 4 Jul 2008 10:30:47 -0700 Message-ID: <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <20080704122726.GG29319@disturbed> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xfs Access to block zero exception and system crash Thread-Index: Acjd0XqTpmYpOyWKRFqgEcr8p0zAnAAKfNgg References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> From: "Sagar Borikar" To: "Dave Chinner" Cc: "Eric Sandeen" , "Nathan Scott" , X-OriginalArrivalTime: 04 Jul 2008 17:30:50.0943 (UTC) FILETIME=[B42CE4F0:01C8DDFB] X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.7.4.171340 X-PMC-SpamCheck: Gauge=IIIIIII, Probability=7%, Report='BODY_SIZE_1000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_700_799 0, __BOUNCE_CHALLENGE_SUBJ 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __IMS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0' X-Barracuda-Connect: bby1mta03.pmc-sierra.com[216.241.235.118] X-Barracuda-Start-Time: 1215192616 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2293 1.0000 -0.6770 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.68 X-Barracuda-Spam-Status: No, SCORE=-0.68 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55151 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m64HTDCi017375 X-archive-position: 16727 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Sagar_Borikar@pmc-sierra.com Precedence: bulk X-list: xfs The script is pretty straight forward: While [ 1 ] Do Cp -f $1 $2 Done Where I pass the first parameter as the 300+ MB file in one directory and $2 are is other directory. I run 30 instances of the script in parallel. Thanks Sagar On Fri, Jul 04, 2008 at 03:48:24PM +0530, Sagar Borikar wrote: > Even we too don't want to leave it as it is. I still am working on back > porting the latest xfs code. > Your patches are helping a lot . > Just to check whether that issue lies with 2.6.18 or MIPS port, I tested > it on 2.6.24 x86 platform. > Here we created a loop back device of 10 GB and mounted xfs on that. And the script that generates the workload can be found where? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Jul 4 10:34:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 10:34:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m64HY7x0017997 for ; Fri, 4 Jul 2008 10:34:07 -0700 X-ASG-Debug-ID: 1215192910-0e8200f90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 29A2C12DB36A for ; Fri, 4 Jul 2008 10:35:10 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id ZXpsJwPZE96jDeNf for ; Fri, 04 Jul 2008 10:35:10 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 7CCCBAC626C; Fri, 4 Jul 2008 12:35:09 -0500 (CDT) Message-ID: <486E5F4D.1010009@sandeen.net> Date: Fri, 04 Jul 2008 12:35:09 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215192911 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55151 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16728 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > The script is pretty straight forward: > > While [ 1 ] > Do > Cp -f $1 $2 > Done > > Where I pass the first parameter as the 300+ MB file in one directory > and $2 are is other directory. I run 30 instances of the script in > parallel. Copying the same file to the same directory, or 30 different files to 30 different directories? Or the ame file to 30 different directories? If different directories what is the layout of the target directories? Etc... -Eric From owner-xfs@oss.sgi.com Fri Jul 4 10:50:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 04 Jul 2008 10:50:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m64Ho9Tk021003 for ; Fri, 4 Jul 2008 10:50:09 -0700 X-ASG-Debug-ID: 1215193872-581201ad0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta01.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 115D12B8A17 for ; Fri, 4 Jul 2008 10:51:12 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (bby1mta01.pmc-sierra.com [216.241.235.116]) by cuda.sgi.com with ESMTP id NcJj7Sk7q68QF8Ar for ; Fri, 04 Jul 2008 10:51:12 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 6B3F818900CE; Fri, 4 Jul 2008 10:54:22 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta01.pmc-sierra.bc.ca (Postfix) with SMTP id 5861718900CC; Fri, 4 Jul 2008 10:54:22 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Jul 2008 10:51:49 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Xfs Access to block zero exception and system crash Subject: RE: Xfs Access to block zero exception and system crash Date: Fri, 4 Jul 2008 10:51:47 -0700 Message-ID: <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <486E5F4D.1010009@sandeen.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xfs Access to block zero exception and system crash Thread-Index: Acjd/GZGEkjrCO1FRleVG+92X5o3mgAATRaw References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> From: "Sagar Borikar" To: "Eric Sandeen" Cc: "Dave Chinner" , "Nathan Scott" , X-OriginalArrivalTime: 04 Jul 2008 17:51:49.0545 (UTC) FILETIME=[A25C5190:01C8DDFE] X-Barracuda-Connect: bby1mta01.pmc-sierra.com[216.241.235.116] X-Barracuda-Start-Time: 1215193873 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0025 1.0000 -2.0050 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55153 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m64Ho9Tk021007 X-archive-position: 16729 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Sagar_Borikar@pmc-sierra.com Precedence: bulk X-list: xfs Copy is of the same file to 30 different directories and it is basically overwrite. Here is the setup: It's a JBOD with Volume size 20 GB. The directories are empty and this is basically continuous copy of the file on all thirty directories. But surprisingly none of the copy succeeds. All the copy processes are in Uninterruptible sleep state and xfs_repair log I have already attached With the prep. As mentioned it is with 2.6.24 Fedora kernel. Thanks Sagar -----Original Message----- From: Eric Sandeen [mailto:sandeen@sandeen.net] Sent: Friday, July 04, 2008 11:05 PM To: Sagar Borikar Cc: Dave Chinner; Nathan Scott; xfs@oss.sgi.com Subject: Re: Xfs Access to block zero exception and system crash Sagar Borikar wrote: > The script is pretty straight forward: > > While [ 1 ] > Do > Cp -f $1 $2 > Done > > Where I pass the first parameter as the 300+ MB file in one directory > and $2 are is other directory. I run 30 instances of the script in > parallel. Copying the same file to the same directory, or 30 different files to 30 different directories? Or the ame file to 30 different directories? If different directories what is the layout of the target directories? Etc... -Eric From owner-xfs@oss.sgi.com Sat Jul 5 09:24:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 09:25:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_31 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65GOu1V013339 for ; Sat, 5 Jul 2008 09:24:56 -0700 X-ASG-Debug-ID: 1215275159-725300b50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C2D3DDA7644 for ; Sat, 5 Jul 2008 09:25:59 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id YQt8TxzrH9rj1mHL for ; Sat, 05 Jul 2008 09:25:59 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 25354AC626C; Sat, 5 Jul 2008 11:25:58 -0500 (CDT) Message-ID: <486FA095.1050106@sandeen.net> Date: Sat, 05 Jul 2008 11:25:57 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215275160 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55236 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16730 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > Copy is of the same file to 30 different directories and it is basically > overwrite. > > Here is the setup: > > It's a JBOD with Volume size 20 GB. The directories are empty and this > is basically continuous copy of the file on all thirty directories. But > surprisingly none of the copy succeeds. All the copy processes are in > Uninterruptible sleep state and xfs_repair log I have already attached > With the prep. As mentioned it is with 2.6.24 Fedora kernel. It would probably be best to try a 2.6.26 kernel from rawhide to be sure you're closest to the bleeding edge. I tested on 2.6.24.7-92.fc8 on x86_64, and I did this, specifically, in the root of a 30G xfs fs: # for I in `seq 1 30`; do mkdir dir$I; done # vi copyit.sh (your script) # chmod +x copyit.sh # dd if=/dev/zero of=300mbfile bs=1M count=300 # for I in `seq 1 30`; do ./copyit.sh 300mbfile dir$I & done I got no errors or corruption after several iterations. Might also be worth checking dmesg for any errors when you run. -Eric From owner-xfs@oss.sgi.com Sat Jul 5 09:56:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 09:56:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65Gu2gC015084 for ; Sat, 5 Jul 2008 09:56:02 -0700 X-ASG-Debug-ID: 1215277025-726101950000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 58FD2DA79E1 for ; Sat, 5 Jul 2008 09:57:05 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id x5kFSFQTByDXjZDp for ; Sat, 05 Jul 2008 09:57:05 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 24D815A562; Sat, 5 Jul 2008 12:57:04 -0400 (EDT) Date: Sat, 5 Jul 2008 12:57:04 -0400 (EDT) From: Justin Piszcz To: linux-kernel@vger.kernel.org cc: linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Lots of con-current I/O = resets SATA link? (2.6.25.10) Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215277026 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55238 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16731 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs I've read the best way to 'deal' with this issue is to turn off apic/acpi etc, is there any downside to turning them off? Particularly APIC for IRQ routing? This happens on drives on both the Intel 965 chipset motherboard ports and PCI-e x1 cards, and the cables are not the issue (the cables with 12 other 150 raptors have no issues) (same cables I used with them)). With NCQ on or OFF it occurs. $ ls 0/ 10/ 12/ 14/ 16/ 18/ 2/ 3/ 5/ 7/ 9/ runtest.sh* 1/ 11/ 13/ 15/ 17/ 19/ 20/ 4/ 6/ 8/ linux-2.6.25.10.tar $ cat runtest.sh #!/bin/bash for i in `seq 0 20` do cd $i tar xf ../linux-2.6.25.10.tar & cd .. done With NCQ off (earlier) (from just heavy I/O on the raid5): Jul 5 11:50:06 p34 kernel: [112161.433913] ata6.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen Jul 5 11:50:06 p34 kernel: [112161.433923] ata6.00: cmd b0/d8:00:00:4f:c2/00:00:00:00:00/00 tag 0 Jul 5 11:50:06 p34 kernel: [112161.433924] res 40/00:ff:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) Jul 5 11:50:06 p34 kernel: [112161.433927] ata6.00: status: { DRDY } Jul 5 11:50:06 p34 kernel: [112161.736858] ata6: soft resetting link Jul 5 11:50:07 p34 kernel: [112161.889840] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) Jul 5 11:50:07 p34 kernel: [112161.911418] ata6.00: configured for UDMA/133 Jul 5 11:50:07 p34 kernel: [112161.656792] sd 5:0:0:0: [sdf] Write Protect is off Jul 5 11:50:07 p34 kernel: [112161.656797] sd 5:0:0:0: [sdf] Mode Sense: 00 3a 00 00 Jul 5 11:50:07 p34 kernel: [112161.659296] sd 5:0:0:0: [sdf] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA With NCQ on (with the test shown above): [115786.990237] ata6.00: exception Emask 0x0 SAct 0x3ffff SErr 0x0 action 0x2 frozen [115786.990247] ata6.00: cmd 60/80:00:bf:07:94/00:00:10:00:00/40 tag 0 ncq 65536 in [115786.990249] res 40/00:00:00:00:00/00:00:00:00:00/a0 Emask 0x4 (timeout) [115786.990254] ata6.00: status: { DRDY } [115786.990259] ata6.00: cmd 60/88:08:b7:ee:c1/01:00:1d:00:00/40 tag 1 ncq 200704 in [115786.990261] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990265] ata6.00: status: { DRDY } [115786.990270] ata6.00: cmd 60/f8:10:bf:eb:c1/02:00:1d:00:00/40 tag 2 ncq 389120 in [115786.990271] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990275] ata6.00: status: { DRDY } [115786.990280] ata6.00: cmd 60/c0:18:3f:e8:c1/01:00:1d:00:00/40 tag 3 ncq 229376 in [115786.990282] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990286] ata6.00: status: { DRDY } [115786.990291] ata6.00: cmd 60/c0:20:ff:e9:c1/01:00:1d:00:00/40 tag 4 ncq 229376 in [115786.990293] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990297] ata6.00: status: { DRDY } [115786.990302] ata6.00: cmd 61/08:28:0f:c6:b6/00:00:1f:00:00/40 tag 5 ncq 4096 out [115786.990303] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990307] ata6.00: status: { DRDY } [115786.990312] ata6.00: cmd 61/10:30:df:b0:17/00:00:01:00:00/40 tag 6 ncq 8192 out [115786.990313] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990318] ata6.00: status: { DRDY } [115786.990323] ata6.00: cmd 61/10:38:4f:88:79/00:00:03:00:00/40 tag 7 ncq 8192 out [115786.990324] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990328] ata6.00: status: { DRDY } [115786.990333] ata6.00: cmd 61/10:40:3f:18:95/00:00:05:00:00/40 tag 8 ncq 8192 out [115786.990335] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990339] ata6.00: status: { DRDY } [115786.990344] ata6.00: cmd 61/08:48:d7:f6:a9/00:00:06:00:00/40 tag 9 ncq 4096 out [115786.990345] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990350] ata6.00: status: { DRDY } [115786.990355] ata6.00: cmd 61/08:50:9f:37:b7/00:00:07:00:00/40 tag 10 ncq 4096 out [115786.990356] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990360] ata6.00: status: { DRDY } [115786.990365] ata6.00: cmd 61/08:58:27:7c:d1/00:00:08:00:00/40 tag 11 ncq 4096 out [115786.990367] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990371] ata6.00: status: { DRDY } [115786.990376] ata6.00: cmd 61/08:60:97:48:46/00:00:0d:00:00/40 tag 12 ncq 4096 out [115786.990377] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990381] ata6.00: status: { DRDY } [115786.990386] ata6.00: cmd 61/08:68:cf:b4:68/00:00:0e:00:00/40 tag 13 ncq 4096 out [115786.990388] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990392] ata6.00: status: { DRDY } [115786.990397] ata6.00: cmd 61/80:70:3f:06:94/01:00:10:00:00/40 tag 14 ncq 196608 out [115786.990398] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990402] ata6.00: status: { DRDY } [115786.990408] ata6.00: cmd 61/08:78:7f:a4:88/00:00:11:00:00/40 tag 15 ncq 4096 out [115786.990409] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990413] ata6.00: status: { DRDY } [115786.990418] ata6.00: cmd 61/08:80:37:b8:d5/00:00:13:00:00/40 tag 16 ncq 4096 out [115786.990419] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990423] ata6.00: status: { DRDY } [115786.990428] ata6.00: cmd 61/08:88:c7:a4:8b/00:00:1d:00:00/40 tag 17 ncq 4096 out [115786.990430] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [115786.990454] ata6.00: status: { DRDY } [115787.293177] ata6: soft resetting link [115787.446158] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [115788.133592] ata6.00: configured for UDMA/133 [115788.133628] ata6: EH complete [115787.877547] sd 5:0:0:0: [sdf] 586072368 512-byte hardware sectors (300069 MB) [115787.877689] sd 5:0:0:0: [sdf] Write Protect is off [115787.877692] sd 5:0:0:0: [sdf] Mode Sense: 00 3a 00 00 [115787.878746] sd 5:0:0:0: [sdf] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA What is the true cause of this, is there anyway to get more information? I will test soon with apic/acpi=off. Justin. From owner-xfs@oss.sgi.com Sat Jul 5 10:19:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 10:19:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65HJVBI016955 for ; Sat, 5 Jul 2008 10:19:31 -0700 X-ASG-Debug-ID: 1215278431-724f023d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EF986DAC2AB for ; Sat, 5 Jul 2008 10:20:32 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id nBFcK0dWgfMAMY5T for ; Sat, 05 Jul 2008 10:20:32 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m65HKLNW007284 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 5 Jul 2008 19:20:21 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m65HKLXU007282 for xfs@oss.sgi.com; Sat, 5 Jul 2008 19:20:21 +0200 Date: Sat, 5 Jul 2008 19:20:21 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] simplify xfs_setattr Subject: Re: [PATCH 2/3] simplify xfs_setattr Message-ID: <20080705172021.GA7177@lst.de> References: <20080627154557.GB31476@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080627154557.GB31476@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215278433 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55240 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16732 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jun 27, 2008 at 05:45:57PM +0200, Christoph Hellwig wrote: > Now that xfs_setattr is only used for attributes set from ->setattr it > can be switched to take struct iattr directly and thus simplify the > implementation greatly. Also rename the ATTR_ flags to XFS_ATTR_ to > not conflict with the ATTR_ flags used by the VFS. As per discussion with Tim here's a version that doesn't require the generic ACL patch applied before: Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-04 14:59:13.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-04 14:59:21.000000000 +0200 @@ -2460,7 +2460,8 @@ xfs_dm_punch_hole( #endif error = xfs_change_file_space(ip, XFS_IOC_UNRESVSP, &bf, - (xfs_off_t)off, sys_cred, ATTR_DMI|ATTR_NOLOCK); + (xfs_off_t)off, sys_cred, + XFS_ATTR_DMI|XFS_ATTR_NOLOCK); /* * if punching to end of file, kill any blocks past EOF that @@ -2663,7 +2664,7 @@ xfs_dm_set_fileattr( dm_fileattr_t __user *statp) { dm_fileattr_t stat; - bhv_vattr_t vat; + struct iattr iattr; int error; /* Returns negative errors to DMAPI */ @@ -2674,52 +2675,52 @@ xfs_dm_set_fileattr( if (copy_from_user( &stat, statp, sizeof(stat))) return(-EFAULT); - vat.va_mask = 0; + iattr.ia_valid = 0; if (mask & DM_AT_MODE) { - vat.va_mask |= XFS_AT_MODE; - vat.va_mode = stat.fa_mode; + iattr.ia_valid |= ATTR_MODE; + iattr.ia_mode = stat.fa_mode; } if (mask & DM_AT_UID) { - vat.va_mask |= XFS_AT_UID; - vat.va_uid = stat.fa_uid; + iattr.ia_valid |= ATTR_UID; + iattr.ia_uid = stat.fa_uid; } if (mask & DM_AT_GID) { - vat.va_mask |= XFS_AT_GID; - vat.va_gid = stat.fa_gid; + iattr.ia_valid |= ATTR_GID; + iattr.ia_gid = stat.fa_gid; } if (mask & DM_AT_ATIME) { - vat.va_mask |= XFS_AT_ATIME; - vat.va_atime.tv_sec = stat.fa_atime; - vat.va_atime.tv_nsec = 0; + iattr.ia_valid |= ATTR_ATIME; + iattr.ia_atime.tv_sec = stat.fa_atime; + iattr.ia_atime.tv_nsec = 0; inode->i_atime.tv_sec = stat.fa_atime; } if (mask & DM_AT_MTIME) { - vat.va_mask |= XFS_AT_MTIME; - vat.va_mtime.tv_sec = stat.fa_mtime; - vat.va_mtime.tv_nsec = 0; + iattr.ia_valid |= ATTR_MTIME; + iattr.ia_mtime.tv_sec = stat.fa_mtime; + iattr.ia_mtime.tv_nsec = 0; } if (mask & DM_AT_CTIME) { - vat.va_mask |= XFS_AT_CTIME; - vat.va_ctime.tv_sec = stat.fa_ctime; - vat.va_ctime.tv_nsec = 0; + iattr.ia_valid |= ATTR_CTIME; + iattr.ia_ctime.tv_sec = stat.fa_ctime; + iattr.ia_ctime.tv_nsec = 0; } - /* DM_AT_DTIME only takes effect if DM_AT_CTIME is not specified. We - overload ctime to also act as dtime, i.e. DM_CONFIG_DTIME_OVERLOAD. - */ - + /* + * DM_AT_DTIME only takes effect if DM_AT_CTIME is not specified. We + * overload ctime to also act as dtime, i.e. DM_CONFIG_DTIME_OVERLOAD. + */ if ((mask & DM_AT_DTIME) && !(mask & DM_AT_CTIME)) { - vat.va_mask |= XFS_AT_CTIME; - vat.va_ctime.tv_sec = stat.fa_dtime; - vat.va_ctime.tv_nsec = 0; + iattr.ia_valid |= ATTR_CTIME; + iattr.ia_ctime.tv_sec = stat.fa_dtime; + iattr.ia_ctime.tv_nsec = 0; } if (mask & DM_AT_SIZE) { - vat.va_mask |= XFS_AT_SIZE; - vat.va_size = stat.fa_size; + iattr.ia_valid |= ATTR_SIZE; + iattr.ia_size = stat.fa_size; } - error = xfs_setattr(XFS_I(inode), &vat, ATTR_DMI, NULL); + error = xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); if (!error) vn_revalidate(vn_from_inode(inode)); /* update Linux inode flags */ return(-error); /* Return negative error to DMAPI */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-04 14:59:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-04 15:03:53.000000000 +0200 @@ -656,54 +656,20 @@ xfs_vn_getattr( STATIC int xfs_vn_setattr( struct dentry *dentry, - struct iattr *attr) + struct iattr *iattr) { struct inode *inode = dentry->d_inode; - unsigned int ia_valid = attr->ia_valid; - bhv_vattr_t vattr = { 0 }; - int flags = 0; int error; - if (ia_valid & ATTR_UID) { - vattr.va_mask |= XFS_AT_UID; - vattr.va_uid = attr->ia_uid; - } - if (ia_valid & ATTR_GID) { - vattr.va_mask |= XFS_AT_GID; - vattr.va_gid = attr->ia_gid; - } - if (ia_valid & ATTR_SIZE) { - vattr.va_mask |= XFS_AT_SIZE; - vattr.va_size = attr->ia_size; - } - if (ia_valid & ATTR_ATIME) { - vattr.va_mask |= XFS_AT_ATIME; - vattr.va_atime = attr->ia_atime; - inode->i_atime = attr->ia_atime; - } - if (ia_valid & ATTR_MTIME) { - vattr.va_mask |= XFS_AT_MTIME; - vattr.va_mtime = attr->ia_mtime; - } - if (ia_valid & ATTR_CTIME) { - vattr.va_mask |= XFS_AT_CTIME; - vattr.va_ctime = attr->ia_ctime; - } - if (ia_valid & ATTR_MODE) { - vattr.va_mask |= XFS_AT_MODE; - vattr.va_mode = attr->ia_mode; + if (iattr->ia_valid & ATTR_ATIME) + inode->i_atime = iattr->ia_atime; + + if (iattr->ia_valid & ATTR_MODE) { if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) inode->i_mode &= ~S_ISGID; } - if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) - flags |= ATTR_UTIME; -#ifdef ATTR_NO_BLOCK - if ((ia_valid & ATTR_NO_BLOCK)) - flags |= ATTR_NONBLOCK; -#endif - - error = xfs_setattr(XFS_I(inode), &vattr, flags, NULL); + error = xfs_setattr(XFS_I(inode), iattr, 0, NULL); if (likely(!error)) vn_revalidate(vn_from_inode(inode)); return -error; @@ -747,18 +713,18 @@ xfs_vn_fallocate( xfs_ilock(ip, XFS_IOLOCK_EXCL); error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf, - 0, NULL, ATTR_NOLOCK); + 0, NULL, XFS_ATTR_NOLOCK); if (!error && !(mode & FALLOC_FL_KEEP_SIZE) && offset + len > i_size_read(inode)) new_size = offset + len; /* Change file size if needed */ if (new_size) { - bhv_vattr_t va; + struct iattr iattr; - va.va_mask = XFS_AT_SIZE; - va.va_size = new_size; - error = xfs_setattr(ip, &va, ATTR_NOLOCK, NULL); + iattr.ia_valid = ATTR_SIZE; + iattr.ia_size = new_size; + error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK, NULL); } xfs_iunlock(ip, XFS_IOLOCK_EXCL); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-04 14:59:14.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-04 14:59:21.000000000 +0200 @@ -19,7 +19,6 @@ #define __XFS_VNODE_H__ struct file; -struct bhv_vattr; struct xfs_iomap; struct attrlist_cursor_kern; @@ -66,69 +65,6 @@ static inline struct inode *vn_to_inode( Prevent VM access to the pages until the operation completes. */ -/* - * Vnode attributes. va_mask indicates those attributes the caller - * wants to set or extract. - */ -typedef struct bhv_vattr { - int va_mask; /* bit-mask of attributes present */ - mode_t va_mode; /* file access mode and type */ - xfs_nlink_t va_nlink; /* number of references to file */ - uid_t va_uid; /* owner user id */ - gid_t va_gid; /* owner group id */ - xfs_ino_t va_nodeid; /* file id */ - xfs_off_t va_size; /* file size in bytes */ - u_long va_blocksize; /* blocksize preferred for i/o */ - struct timespec va_atime; /* time of last access */ - struct timespec va_mtime; /* time of last modification */ - struct timespec va_ctime; /* time file changed */ - u_int va_gen; /* generation number of file */ - xfs_dev_t va_rdev; /* device the special file represents */ - __int64_t va_nblocks; /* number of blocks allocated */ - u_long va_xflags; /* random extended file flags */ - u_long va_extsize; /* file extent size */ - u_long va_nextents; /* number of extents in file */ - u_long va_anextents; /* number of attr extents in file */ - prid_t va_projid; /* project id */ -} bhv_vattr_t; - -/* - * setattr or getattr attributes - */ -#define XFS_AT_TYPE 0x00000001 -#define XFS_AT_MODE 0x00000002 -#define XFS_AT_UID 0x00000004 -#define XFS_AT_GID 0x00000008 -#define XFS_AT_FSID 0x00000010 -#define XFS_AT_NODEID 0x00000020 -#define XFS_AT_NLINK 0x00000040 -#define XFS_AT_SIZE 0x00000080 -#define XFS_AT_ATIME 0x00000100 -#define XFS_AT_MTIME 0x00000200 -#define XFS_AT_CTIME 0x00000400 -#define XFS_AT_RDEV 0x00000800 -#define XFS_AT_BLKSIZE 0x00001000 -#define XFS_AT_NBLOCKS 0x00002000 -#define XFS_AT_VCODE 0x00004000 -#define XFS_AT_MAC 0x00008000 -#define XFS_AT_UPDATIME 0x00010000 -#define XFS_AT_UPDMTIME 0x00020000 -#define XFS_AT_UPDCTIME 0x00040000 -#define XFS_AT_ACL 0x00080000 -#define XFS_AT_CAP 0x00100000 -#define XFS_AT_INF 0x00200000 -#define XFS_AT_NEXTENTS 0x01000000 -#define XFS_AT_ANEXTENTS 0x02000000 -#define XFS_AT_SIZE_NOPERM 0x08000000 -#define XFS_AT_GENCOUNT 0x10000000 - -#define XFS_AT_TIMES (XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME) - -#define XFS_AT_UPDTIMES (XFS_AT_UPDATIME|XFS_AT_UPDMTIME|XFS_AT_UPDCTIME) - -#define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\ - XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ - XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) extern void vn_init(void); extern int vn_revalidate(bhv_vnode_t *); @@ -204,15 +140,6 @@ static inline void vn_atime_to_time_t(bh #define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \ PAGECACHE_TAG_DIRTY) -/* - * Flags to vop_setattr/getattr. - */ -#define ATTR_UTIME 0x01 /* non-default utime(2) request */ -#define ATTR_DMI 0x08 /* invocation from a DMI function */ -#define ATTR_LAZY 0x80 /* set/get attributes lazily */ -#define ATTR_NONBLOCK 0x100 /* return EAGAIN if operation would block */ -#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */ -#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */ /* * Tracking vnode activity. Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-04 14:59:14.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-04 14:59:21.000000000 +0200 @@ -75,19 +75,16 @@ xfs_open( return 0; } -/* - * xfs_setattr - */ int xfs_setattr( - xfs_inode_t *ip, - bhv_vattr_t *vap, + struct xfs_inode *ip, + struct iattr *iattr, int flags, cred_t *credp) { xfs_mount_t *mp = ip->i_mount; + int mask = iattr->ia_valid; xfs_trans_t *tp; - int mask; int code; uint lock_flags; uint commit_flags=0; @@ -103,30 +100,9 @@ xfs_setattr( if (mp->m_flags & XFS_MOUNT_RDONLY) return XFS_ERROR(EROFS); - /* - * Cannot set certain attributes. - */ - mask = vap->va_mask; - if (mask & XFS_AT_NOSET) { - return XFS_ERROR(EINVAL); - } - if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); - /* - * Timestamps do not need to be logged and hence do not - * need to be done within a transaction. - */ - if (mask & XFS_AT_UPDTIMES) { - ASSERT((mask & ~XFS_AT_UPDTIMES) == 0); - timeflags = ((mask & XFS_AT_UPDATIME) ? XFS_ICHGTIME_ACC : 0) | - ((mask & XFS_AT_UPDCTIME) ? XFS_ICHGTIME_CHG : 0) | - ((mask & XFS_AT_UPDMTIME) ? XFS_ICHGTIME_MOD : 0); - xfs_ichgtime(ip, timeflags); - return 0; - } - olddquot1 = olddquot2 = NULL; udqp = gdqp = NULL; @@ -138,17 +114,17 @@ xfs_setattr( * If the IDs do change before we take the ilock, we're covered * because the i_*dquot fields will get updated anyway. */ - if (XFS_IS_QUOTA_ON(mp) && (mask & (XFS_AT_UID|XFS_AT_GID))) { + if (XFS_IS_QUOTA_ON(mp) && (mask & (ATTR_UID|ATTR_GID))) { uint qflags = 0; - if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) { - uid = vap->va_uid; + if ((mask & ATTR_UID) && XFS_IS_UQUOTA_ON(mp)) { + uid = iattr->ia_uid; qflags |= XFS_QMOPT_UQUOTA; } else { uid = ip->i_d.di_uid; } - if ((mask & XFS_AT_GID) && XFS_IS_GQUOTA_ON(mp)) { - gid = vap->va_gid; + if ((mask & ATTR_GID) && XFS_IS_GQUOTA_ON(mp)) { + gid = iattr->ia_gid; qflags |= XFS_QMOPT_GQUOTA; } else { gid = ip->i_d.di_gid; @@ -173,10 +149,10 @@ xfs_setattr( */ tp = NULL; lock_flags = XFS_ILOCK_EXCL; - if (flags & ATTR_NOLOCK) + if (flags & XFS_ATTR_NOLOCK) need_iolock = 0; - if (!(mask & XFS_AT_SIZE)) { - if ((mask != (XFS_AT_CTIME|XFS_AT_ATIME|XFS_AT_MTIME)) || + if (!(mask & ATTR_SIZE)) { + if ((mask != (ATTR_CTIME|ATTR_ATIME|ATTR_MTIME)) || (mp->m_flags & XFS_MOUNT_WSYNC)) { tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); commit_flags = 0; @@ -189,10 +165,10 @@ xfs_setattr( } } else { if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) && - !(flags & ATTR_DMI)) { + !(flags & XFS_ATTR_DMI)) { int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, ip, - vap->va_size, 0, dmflags, NULL); + iattr->ia_size, 0, dmflags, NULL); if (code) { lock_flags = 0; goto error_return; @@ -212,7 +188,7 @@ xfs_setattr( * Only the owner or users with CAP_FOWNER * capability may do these things. */ - if (mask & (XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID)) { + if (mask & (ATTR_MODE|ATTR_UID|ATTR_GID)) { /* * CAP_FOWNER overrides the following restrictions: * @@ -236,21 +212,21 @@ xfs_setattr( * IDs of the calling process shall match the group owner of * the file when setting the set-group-ID bit on that file */ - if (mask & XFS_AT_MODE) { + if (mask & ATTR_MODE) { mode_t m = 0; - if ((vap->va_mode & S_ISUID) && !file_owner) + if ((iattr->ia_mode & S_ISUID) && !file_owner) m |= S_ISUID; - if ((vap->va_mode & S_ISGID) && + if ((iattr->ia_mode & S_ISGID) && !in_group_p((gid_t)ip->i_d.di_gid)) m |= S_ISGID; #if 0 /* Linux allows this, Irix doesn't. */ - if ((vap->va_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode)) + if ((iattr->ia_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode)) m |= S_ISVTX; #endif if (m && !capable(CAP_FSETID)) - vap->va_mode &= ~m; + iattr->ia_mode &= ~m; } } @@ -261,7 +237,7 @@ xfs_setattr( * and can change the group id only to a group of which he * or she is a member. */ - if (mask & (XFS_AT_UID|XFS_AT_GID)) { + if (mask & (ATTR_UID|ATTR_GID)) { /* * These IDs could have changed since we last looked at them. * But, we're assured that if the ownership did change @@ -270,8 +246,8 @@ xfs_setattr( */ iuid = ip->i_d.di_uid; igid = ip->i_d.di_gid; - gid = (mask & XFS_AT_GID) ? vap->va_gid : igid; - uid = (mask & XFS_AT_UID) ? vap->va_uid : iuid; + gid = (mask & ATTR_GID) ? iattr->ia_gid : igid; + uid = (mask & ATTR_UID) ? iattr->ia_uid : iuid; /* * CAP_CHOWN overrides the following restrictions: @@ -308,13 +284,13 @@ xfs_setattr( /* * Truncate file. Must have write permission and not be a directory. */ - if (mask & XFS_AT_SIZE) { + if (mask & ATTR_SIZE) { /* Short circuit the truncate case for zero length files */ - if ((vap->va_size == 0) && - (ip->i_size == 0) && (ip->i_d.di_nextents == 0)) { + if (iattr->ia_size == 0 && + ip->i_size == 0 && ip->i_d.di_nextents == 0) { xfs_iunlock(ip, XFS_ILOCK_EXCL); lock_flags &= ~XFS_ILOCK_EXCL; - if (mask & XFS_AT_CTIME) + if (mask & ATTR_CTIME) xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); code = 0; goto error_return; @@ -337,9 +313,9 @@ xfs_setattr( /* * Change file access or modified times. */ - if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) { + if (mask & (ATTR_ATIME|ATTR_MTIME)) { if (!file_owner) { - if ((flags & ATTR_UTIME) && + if ((mask & (ATTR_MTIME_SET|ATTR_ATIME_SET)) && !capable(CAP_FOWNER)) { code = XFS_ERROR(EPERM); goto error_return; @@ -349,23 +325,22 @@ xfs_setattr( /* * Now we can make the changes. Before we join the inode - * to the transaction, if XFS_AT_SIZE is set then take care of + * to the transaction, if ATTR_SIZE is set then take care of * the part of the truncation that must be done without the * inode lock. This needs to be done before joining the inode * to the transaction, because the inode cannot be unlocked * once it is a part of the transaction. */ - if (mask & XFS_AT_SIZE) { + if (mask & ATTR_SIZE) { code = 0; - if ((vap->va_size > ip->i_size) && - (flags & ATTR_NOSIZETOK) == 0) { + if (iattr->ia_size > ip->i_size) { /* * Do the first part of growing a file: zero any data * in the last block that is beyond the old EOF. We * need to do this before the inode is joined to the * transaction to modify the i_size. */ - code = xfs_zero_eof(ip, vap->va_size, ip->i_size); + code = xfs_zero_eof(ip, iattr->ia_size, ip->i_size); } xfs_iunlock(ip, XFS_ILOCK_EXCL); @@ -382,10 +357,10 @@ xfs_setattr( * not within the range we care about here. */ if (!code && - (ip->i_size != ip->i_d.di_size) && - (vap->va_size > ip->i_d.di_size)) { + ip->i_size != ip->i_d.di_size && + iattr->ia_size > ip->i_d.di_size) { code = xfs_flush_pages(ip, - ip->i_d.di_size, vap->va_size, + ip->i_d.di_size, iattr->ia_size, XFS_B_ASYNC, FI_NONE); } @@ -393,7 +368,7 @@ xfs_setattr( vn_iowait(ip); if (!code) - code = xfs_itruncate_data(ip, vap->va_size); + code = xfs_itruncate_data(ip, iattr->ia_size); if (code) { ASSERT(tp == NULL); lock_flags &= ~XFS_ILOCK_EXCL; @@ -422,31 +397,30 @@ xfs_setattr( /* * Truncate file. Must have write permission and not be a directory. */ - if (mask & XFS_AT_SIZE) { + if (mask & ATTR_SIZE) { /* * Only change the c/mtime if we are changing the size * or we are explicitly asked to change it. This handles * the semantic difference between truncate() and ftruncate() * as implemented in the VFS. */ - if (vap->va_size != ip->i_size || (mask & XFS_AT_CTIME)) + if (iattr->ia_size != ip->i_size || (mask & ATTR_CTIME)) timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; - if (vap->va_size > ip->i_size) { - ip->i_d.di_size = vap->va_size; - ip->i_size = vap->va_size; - if (!(flags & ATTR_DMI)) + if (iattr->ia_size > ip->i_size) { + ip->i_d.di_size = iattr->ia_size; + ip->i_size = iattr->ia_size; + if (!(flags & XFS_ATTR_DMI)) xfs_ichgtime(ip, XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - } else if ((vap->va_size <= ip->i_size) || - ((vap->va_size == 0) && ip->i_d.di_nextents)) { + } else if (iattr->ia_size <= ip->i_size || + (iattr->ia_size == 0 && ip->i_d.di_nextents)) { /* * signal a sync transaction unless * we're truncating an already unlinked * file on a wsync filesystem */ - code = xfs_itruncate_finish(&tp, ip, - (xfs_fsize_t)vap->va_size, + code = xfs_itruncate_finish(&tp, ip, iattr->ia_size, XFS_DATA_FORK, ((ip->i_d.di_nlink != 0 || !(mp->m_flags & XFS_MOUNT_WSYNC)) @@ -468,9 +442,9 @@ xfs_setattr( /* * Change file access modes. */ - if (mask & XFS_AT_MODE) { + if (mask & ATTR_MODE) { ip->i_d.di_mode &= S_IFMT; - ip->i_d.di_mode |= vap->va_mode & ~S_IFMT; + ip->i_d.di_mode |= iattr->ia_mode & ~S_IFMT; xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); timeflags |= XFS_ICHGTIME_CHG; @@ -483,7 +457,7 @@ xfs_setattr( * and can change the group id only to a group of which he * or she is a member. */ - if (mask & (XFS_AT_UID|XFS_AT_GID)) { + if (mask & (ATTR_UID|ATTR_GID)) { /* * CAP_FSETID overrides the following restrictions: * @@ -501,7 +475,7 @@ xfs_setattr( */ if (iuid != uid) { if (XFS_IS_UQUOTA_ON(mp)) { - ASSERT(mask & XFS_AT_UID); + ASSERT(mask & ATTR_UID); ASSERT(udqp); olddquot1 = XFS_QM_DQVOPCHOWN(mp, tp, ip, &ip->i_udquot, udqp); @@ -511,7 +485,7 @@ xfs_setattr( if (igid != gid) { if (XFS_IS_GQUOTA_ON(mp)) { ASSERT(!XFS_IS_PQUOTA_ON(mp)); - ASSERT(mask & XFS_AT_GID); + ASSERT(mask & ATTR_GID); ASSERT(gdqp); olddquot2 = XFS_QM_DQVOPCHOWN(mp, tp, ip, &ip->i_gdquot, gdqp); @@ -527,31 +501,31 @@ xfs_setattr( /* * Change file access or modified times. */ - if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) { - if (mask & XFS_AT_ATIME) { - ip->i_d.di_atime.t_sec = vap->va_atime.tv_sec; - ip->i_d.di_atime.t_nsec = vap->va_atime.tv_nsec; + if (mask & (ATTR_ATIME|ATTR_MTIME)) { + if (mask & ATTR_ATIME) { + ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; + ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; ip->i_update_core = 1; timeflags &= ~XFS_ICHGTIME_ACC; } - if (mask & XFS_AT_MTIME) { - ip->i_d.di_mtime.t_sec = vap->va_mtime.tv_sec; - ip->i_d.di_mtime.t_nsec = vap->va_mtime.tv_nsec; + if (mask & ATTR_MTIME) { + ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; + ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; timeflags &= ~XFS_ICHGTIME_MOD; timeflags |= XFS_ICHGTIME_CHG; } - if (tp && (flags & ATTR_UTIME)) + if (tp && (mask & (ATTR_MTIME_SET|ATTR_ATIME_SET))) xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); } /* - * Change file inode change time only if XFS_AT_CTIME set + * Change file inode change time only if ATTR_CTIME set * AND we have been called by a DMI function. */ - if ( (flags & ATTR_DMI) && (mask & XFS_AT_CTIME) ) { - ip->i_d.di_ctime.t_sec = vap->va_ctime.tv_sec; - ip->i_d.di_ctime.t_nsec = vap->va_ctime.tv_nsec; + if ((flags & XFS_ATTR_DMI) && (mask & ATTR_CTIME)) { + ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; + ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; ip->i_update_core = 1; timeflags &= ~XFS_ICHGTIME_CHG; } @@ -560,7 +534,7 @@ xfs_setattr( * Send out timestamp changes that need to be set to the * current time. Not done when called by a DMI function. */ - if (timeflags && !(flags & ATTR_DMI)) + if (timeflags && !(flags & XFS_ATTR_DMI)) xfs_ichgtime(ip, timeflags); XFS_STATS_INC(xs_ig_attrchg); @@ -598,7 +572,7 @@ xfs_setattr( } if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && - !(flags & ATTR_DMI)) { + !(flags & XFS_ATTR_DMI)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, NULL, NULL, 0, 0, AT_DELAY_FLAG(flags)); @@ -3033,7 +3007,7 @@ xfs_alloc_file_space( /* Generate a DMAPI event if needed. */ if (alloc_type != 0 && offset < ip->i_size && - (attr_flags&ATTR_DMI) == 0 && + (attr_flags & XFS_ATTR_DMI) == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { xfs_off_t end_dmi_offset; @@ -3147,7 +3121,7 @@ retry: allocatesize_fsb -= allocated_fsb; } dmapi_enospc_check: - if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 && + if (error == ENOSPC && (attr_flags & XFS_ATTR_DMI) == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, ip, DM_RIGHT_NULL, @@ -3294,7 +3268,7 @@ xfs_free_file_space( end_dmi_offset = offset + len; endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset); - if (offset < ip->i_size && (attr_flags & ATTR_DMI) == 0 && + if (offset < ip->i_size && (attr_flags & XFS_ATTR_DMI) == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { if (end_dmi_offset > ip->i_size) end_dmi_offset = ip->i_size; @@ -3305,7 +3279,7 @@ xfs_free_file_space( return error; } - if (attr_flags & ATTR_NOLOCK) + if (attr_flags & XFS_ATTR_NOLOCK) need_iolock = 0; if (need_iolock) { xfs_ilock(ip, XFS_IOLOCK_EXCL); @@ -3482,7 +3456,7 @@ xfs_change_file_space( xfs_off_t startoffset; xfs_off_t llen; xfs_trans_t *tp; - bhv_vattr_t va; + struct iattr iattr; xfs_itrace_entry(ip); @@ -3556,10 +3530,10 @@ xfs_change_file_space( break; } - va.va_mask = XFS_AT_SIZE; - va.va_size = startoffset; + iattr.ia_valid = ATTR_SIZE; + iattr.ia_size = startoffset; - error = xfs_setattr(ip, &va, attr_flags, credp); + error = xfs_setattr(ip, &iattr, attr_flags, credp); if (error) return error; @@ -3589,7 +3563,7 @@ xfs_change_file_space( xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_ihold(tp, ip); - if ((attr_flags & ATTR_DMI) == 0) { + if ((attr_flags & XFS_ATTR_DMI) == 0) { ip->i_d.di_mode &= ~S_ISUID; /* Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2008-07-04 14:58:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2008-07-04 14:59:21.000000000 +0200 @@ -2,9 +2,9 @@ #define _XFS_VNODEOPS_H 1 struct attrlist_cursor_kern; -struct bhv_vattr; struct cred; struct file; +struct iattr; struct inode; struct iovec; struct kiocb; @@ -15,8 +15,12 @@ struct xfs_iomap; int xfs_open(struct xfs_inode *ip); -int xfs_setattr(struct xfs_inode *ip, struct bhv_vattr *vap, int flags, +int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags, struct cred *credp); +#define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */ +#define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */ +#define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */ + int xfs_readlink(struct xfs_inode *ip, char *link); int xfs_fsync(struct xfs_inode *ip); int xfs_release(struct xfs_inode *ip); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-04 14:59:14.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-04 14:59:21.000000000 +0200 @@ -685,9 +685,9 @@ xfs_ioc_space( return -XFS_ERROR(EFAULT); if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) - attr_flags |= ATTR_NONBLOCK; + attr_flags |= XFS_ATTR_NONBLOCK; if (ioflags & IO_INVIS) - attr_flags |= ATTR_DMI; + attr_flags |= XFS_ATTR_DMI; error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, NULL, attr_flags); Index: linux-2.6-xfs/fs/xfs/xfs_dmapi.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dmapi.h 2008-07-04 14:58:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dmapi.h 2008-07-04 14:59:21.000000000 +0200 @@ -166,6 +166,6 @@ typedef enum { #define FILP_DELAY_FLAG(filp) ((filp->f_flags&(O_NDELAY|O_NONBLOCK)) ? \ DM_FLAGS_NDELAY : 0) -#define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) +#define AT_DELAY_FLAG(f) ((f & XFS_ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) #endif /* __XFS_DMAPI_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_acl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-04 15:01:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-04 15:02:47.000000000 +0200 @@ -720,7 +720,7 @@ xfs_acl_setmode( xfs_acl_t *acl, int *basicperms) { - bhv_vattr_t va; + struct iattr iattr; xfs_acl_entry_t *ap; xfs_acl_entry_t *gap = NULL; int i, nomask = 1; @@ -734,25 +734,25 @@ xfs_acl_setmode( * Copy the u::, g::, o::, and m:: bits from the ACL into the * mode. The m:: bits take precedence over the g:: bits. */ - va.va_mask = XFS_AT_MODE; - va.va_mode = xfs_vtoi(vp)->i_d.di_mode; - va.va_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); + iattr.ia_mask = XFS_AT_MODE; + iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; + iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); ap = acl->acl_entry; for (i = 0; i < acl->acl_cnt; ++i) { switch (ap->ae_tag) { case ACL_USER_OBJ: - va.va_mode |= ap->ae_perm << 6; + iattr.ia_mode |= ap->ae_perm << 6; break; case ACL_GROUP_OBJ: gap = ap; break; case ACL_MASK: /* more than just standard modes */ nomask = 0; - va.va_mode |= ap->ae_perm << 3; + iattr.ia_mode |= ap->ae_perm << 3; *basicperms = 0; break; case ACL_OTHER: - va.va_mode |= ap->ae_perm; + iattr.ia_mode |= ap->ae_perm; break; default: /* more than just standard modes */ *basicperms = 0; @@ -763,9 +763,9 @@ xfs_acl_setmode( /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */ if (gap && nomask) - va.va_mode |= gap->ae_perm << 3; + iattr.ia_mode |= gap->ae_perm << 3; - return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred); + return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred); } /* From owner-xfs@oss.sgi.com Sat Jul 5 10:20:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 10:20:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65HKHuR017276 for ; Sat, 5 Jul 2008 10:20:17 -0700 X-ASG-Debug-ID: 1215278479-726902310000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1713CDAC2B3 for ; Sat, 5 Jul 2008 10:21:19 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id VcEeXkIFL2WqAEYS for ; Sat, 05 Jul 2008 10:21:19 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m65HLANW007316 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 5 Jul 2008 19:21:10 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m65HLAg0007314 for xfs@oss.sgi.com; Sat, 5 Jul 2008 19:21:10 +0200 Date: Sat, 5 Jul 2008 19:21:10 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] kill vn_revalidate Subject: Re: [PATCH 3/3] kill vn_revalidate Message-ID: <20080705172110.GB7177@lst.de> References: <20080627154602.GC31476@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080627154602.GC31476@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215278481 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55240 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16733 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jun 27, 2008 at 05:46:02PM +0200, Christoph Hellwig wrote: > These days most of the attributes in struct inode are properly kept in > sync by XFS. This patch removes the need for vn_revalidate completely > by: > > - keeping inode.i_flags uptodate after any flags are updated in > xfs_ioctl_setattr > - keeping i_mode, i_uid and i_gid uptodate in xfs_setattr Version that doesn't require the generic ACL patch below: Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-05 10:04:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-05 12:02:24.000000000 +0200 @@ -2665,7 +2665,6 @@ xfs_dm_set_fileattr( { dm_fileattr_t stat; struct iattr iattr; - int error; /* Returns negative errors to DMAPI */ @@ -2720,10 +2719,7 @@ xfs_dm_set_fileattr( iattr.ia_size = stat.fa_size; } - error = xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); - if (!error) - vn_revalidate(vn_from_inode(inode)); /* update Linux inode flags */ - return(-error); /* Return negative error to DMAPI */ + return -xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-05 10:04:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-05 12:02:24.000000000 +0200 @@ -920,6 +920,30 @@ xfs_set_diflags( ip->i_d.di_flags = di_flags; } +STATIC void +xfs_diflags_to_linux( + struct xfs_inode *ip) +{ + struct inode *inode = XFS_ITOV(ip); + unsigned int xflags = xfs_ip2xflags(ip); + + if (xflags & XFS_XFLAG_IMMUTABLE) + inode->i_flags |= S_IMMUTABLE; + else + inode->i_flags &= ~S_IMMUTABLE; + if (xflags & XFS_XFLAG_APPEND) + inode->i_flags |= S_APPEND; + else + inode->i_flags &= ~S_APPEND; + if (xflags & XFS_XFLAG_SYNC) + inode->i_flags |= S_SYNC; + else + inode->i_flags &= ~S_SYNC; + if (xflags & XFS_XFLAG_NOATIME) + inode->i_flags |= S_NOATIME; + else + inode->i_flags &= ~S_NOATIME; +} #define FSX_PROJID 1 #define FSX_EXTSIZE 2 @@ -1118,8 +1142,10 @@ xfs_ioctl_setattr( if (mask & FSX_EXTSIZE) ip->i_d.di_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog; - if (mask & FSX_XFLAGS) + if (mask & FSX_XFLAGS) { xfs_set_diflags(ip, fa->fsx_xflags); + xfs_diflags_to_linux(ip); + } xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_ichgtime(ip, XFS_ICHGTIME_CHG); @@ -1157,7 +1183,6 @@ xfs_ioctl_setattr( (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); } - vn_revalidate(XFS_ITOV(ip)); /* update flags */ return 0; error_return: Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-05 10:04:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-05 12:02:24.000000000 +0200 @@ -658,21 +658,7 @@ xfs_vn_setattr( struct dentry *dentry, struct iattr *iattr) { - struct inode *inode = dentry->d_inode; - int error; - - if (iattr->ia_valid & ATTR_ATIME) - inode->i_atime = iattr->ia_atime; - - if (iattr->ia_valid & ATTR_MODE) { - if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) - inode->i_mode &= ~S_ISGID; - } - - error = xfs_setattr(XFS_I(inode), iattr, 0, NULL); - if (likely(!error)) - vn_revalidate(vn_from_inode(inode)); - return -error; + return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0, NULL); } /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-05 10:04:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-05 12:02:24.000000000 +0200 @@ -177,7 +177,6 @@ EXPORT_SYMBOL(uuid_hash64); EXPORT_SYMBOL(uuid_is_nil); EXPORT_SYMBOL(uuid_table_remove); EXPORT_SYMBOL(vn_hold); -EXPORT_SYMBOL(vn_revalidate); #if defined(CONFIG_XFS_POSIX_ACL) EXPORT_SYMBOL(xfs_acl_vtoacl); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-05 10:02:09.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-05 10:04:57.000000000 +0200 @@ -82,56 +82,6 @@ vn_ioerror( xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l); } -/* - * Revalidate the Linux inode from the XFS inode. - * Note: i_size _not_ updated; we must hold the inode - * semaphore when doing that - callers responsibility. - */ -int -vn_revalidate( - bhv_vnode_t *vp) -{ - struct inode *inode = vn_to_inode(vp); - struct xfs_inode *ip = XFS_I(inode); - struct xfs_mount *mp = ip->i_mount; - unsigned long xflags; - - xfs_itrace_entry(ip); - - if (XFS_FORCED_SHUTDOWN(mp)) - return -EIO; - - xfs_ilock(ip, XFS_ILOCK_SHARED); - inode->i_mode = ip->i_d.di_mode; - inode->i_uid = ip->i_d.di_uid; - inode->i_gid = ip->i_d.di_gid; - inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; - inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; - inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; - inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; - - xflags = xfs_ip2xflags(ip); - if (xflags & XFS_XFLAG_IMMUTABLE) - inode->i_flags |= S_IMMUTABLE; - else - inode->i_flags &= ~S_IMMUTABLE; - if (xflags & XFS_XFLAG_APPEND) - inode->i_flags |= S_APPEND; - else - inode->i_flags &= ~S_APPEND; - if (xflags & XFS_XFLAG_SYNC) - inode->i_flags |= S_SYNC; - else - inode->i_flags &= ~S_SYNC; - if (xflags & XFS_XFLAG_NOATIME) - inode->i_flags |= S_NOATIME; - else - inode->i_flags &= ~S_NOATIME; - xfs_iunlock(ip, XFS_ILOCK_SHARED); - - xfs_iflags_clear(ip, XFS_IMODIFIED); - return 0; -} /* * Add a reference to a referenced vnode. Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-05 10:04:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-05 10:04:57.000000000 +0200 @@ -67,7 +67,6 @@ static inline struct inode *vn_to_inode( extern void vn_init(void); -extern int vn_revalidate(bhv_vnode_t *); /* * Yeah, these don't take vnode anymore at all, all this should be Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-05 10:04:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-05 10:04:57.000000000 +0200 @@ -83,6 +83,7 @@ xfs_setattr( cred_t *credp) { xfs_mount_t *mp = ip->i_mount; + struct inode *inode = XFS_ITOV(ip); int mask = iattr->ia_valid; xfs_trans_t *tp; int code; @@ -446,6 +447,9 @@ xfs_setattr( ip->i_d.di_mode &= S_IFMT; ip->i_d.di_mode |= iattr->ia_mode & ~S_IFMT; + inode->i_mode &= S_IFMT; + inode->i_mode |= iattr->ia_mode & ~S_IFMT; + xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); timeflags |= XFS_ICHGTIME_CHG; } @@ -481,6 +485,7 @@ xfs_setattr( &ip->i_udquot, udqp); } ip->i_d.di_uid = uid; + inode->i_uid = uid; } if (igid != gid) { if (XFS_IS_GQUOTA_ON(mp)) { @@ -491,6 +496,7 @@ xfs_setattr( &ip->i_gdquot, gdqp); } ip->i_d.di_gid = gid; + inode->i_gid = gid; } xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); @@ -503,12 +509,14 @@ xfs_setattr( */ if (mask & (ATTR_ATIME|ATTR_MTIME)) { if (mask & ATTR_ATIME) { + inode->i_atime = iattr->ia_atime; ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; ip->i_update_core = 1; timeflags &= ~XFS_ICHGTIME_ACC; } if (mask & ATTR_MTIME) { + inode->i_mtime = iattr->ia_mtime; ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; timeflags &= ~XFS_ICHGTIME_MOD; @@ -524,6 +532,7 @@ xfs_setattr( */ if ((flags & XFS_ATTR_DMI) && (mask & ATTR_CTIME)) { + inode->i_ctime = iattr->ia_ctime; ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; ip->i_update_core = 1; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-05 10:02:09.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-05 12:02:24.000000000 +0200 @@ -64,7 +64,7 @@ static int xfs_xattr_system_set(struct inode *inode, const char *name, const void *value, size_t size, int flags) { - int error, acl; + int acl; acl = xfs_decode_acl(name); if (acl < 0) @@ -75,10 +75,7 @@ xfs_xattr_system_set(struct inode *inode if (!value) return xfs_acl_vremove(inode, acl); - error = xfs_acl_vset(inode, (void *)value, size, acl); - if (!error) - vn_revalidate(inode); - return error; + return xfs_acl_vset(inode, (void *)value, size, acl); } static struct xattr_handler xfs_xattr_system_handler = { Index: linux-2.6-xfs/fs/xfs/xfs_acl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-05 12:26:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-05 12:26:53.000000000 +0200 @@ -734,7 +734,7 @@ xfs_acl_setmode( * Copy the u::, g::, o::, and m:: bits from the ACL into the * mode. The m:: bits take precedence over the g:: bits. */ - iattr.ia_mask = XFS_AT_MODE; + iattr.ia_valid = ATTR_MODE; iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); ap = acl->acl_entry; From owner-xfs@oss.sgi.com Sat Jul 5 10:34:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 10:34:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65HYLX5018716 for ; Sat, 5 Jul 2008 10:34:22 -0700 X-ASG-Debug-ID: 1215279324-724d02750000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wr-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3BF3ADAC575 for ; Sat, 5 Jul 2008 10:35:24 -0700 (PDT) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by cuda.sgi.com with ESMTP id P6Y6Zvep63oPt4FL for ; Sat, 05 Jul 2008 10:35:24 -0700 (PDT) Received: by wr-out-0506.google.com with SMTP id 57so1130389wri.12 for ; Sat, 05 Jul 2008 10:35:24 -0700 (PDT) Received: by 10.90.96.1 with SMTP id t1mr2888993agb.105.1215279324170; Sat, 05 Jul 2008 10:35:24 -0700 (PDT) Received: by 10.90.102.9 with HTTP; Sat, 5 Jul 2008 10:35:24 -0700 (PDT) Message-ID: Date: Sat, 5 Jul 2008 12:35:24 -0500 From: "Jon Nelson" To: "Justin Piszcz" X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, "Alan Piszcz" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Barracuda-Connect: wr-out-0506.google.com[64.233.184.227] X-Barracuda-Start-Time: 1215279325 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55240 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16734 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jnelson@jamponi.net Precedence: bulk X-list: xfs Try booting with: nolapic That largely fixed my problems on my motherboard (2.6.18+, EPoX MF-570SLI). I hope to try 2.6.25+ soon. -- Jon From owner-xfs@oss.sgi.com Sat Jul 5 10:34:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 10:34:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65HYbi2018770 for ; Sat, 5 Jul 2008 10:34:37 -0700 X-ASG-Debug-ID: 1215279324-724d02750001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wr-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D575F12DCA02 for ; Sat, 5 Jul 2008 10:35:41 -0700 (PDT) Received: from wr-out-0506.google.com (wr-out-0506.google.com [64.233.184.227]) by cuda.sgi.com with ESMTP id jUp8tCEPaaxI5R37 for ; Sat, 05 Jul 2008 10:35:41 -0700 (PDT) Received: by wr-out-0506.google.com with SMTP id 57so1130389wri.12 for ; Sat, 05 Jul 2008 10:35:41 -0700 (PDT) Received: by 10.90.119.20 with SMTP id r20mr2931010agc.10.1215279341343; Sat, 05 Jul 2008 10:35:41 -0700 (PDT) Received: by 10.90.102.9 with HTTP; Sat, 5 Jul 2008 10:35:41 -0700 (PDT) Message-ID: Date: Sat, 5 Jul 2008 12:35:41 -0500 From: "Jon Nelson" To: "Justin Piszcz" X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, "Alan Piszcz" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Google-Sender-Auth: 90cacceae9125cc1 X-Barracuda-Connect: wr-out-0506.google.com[64.233.184.227] X-Barracuda-Start-Time: 1215279341 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55240 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16735 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jnelson-linux-raid@jamponi.net Precedence: bulk X-list: xfs Try booting with: nolapic That largely fixed my problems on my motherboard (2.6.18+, EPoX MF-570SLI). I hope to try 2.6.25+ soon. -- Jon From owner-xfs@oss.sgi.com Sat Jul 5 11:37:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 11:37:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65IbgEH023424 for ; Sat, 5 Jul 2008 11:37:42 -0700 X-ASG-Debug-ID: 1215283123-6368011c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pd2mo3so.prod.shaw.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 677DADACA10 for ; Sat, 5 Jul 2008 11:38:43 -0700 (PDT) Received: from pd2mo3so.prod.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by cuda.sgi.com with ESMTP id qSQy0ZrLE25xCIcy for ; Sat, 05 Jul 2008 11:38:43 -0700 (PDT) Received: from pd3mr2so.prod.shaw.ca (pd3mr2so-qfe3.prod.shaw.ca [10.0.141.178]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0K3J00JW8QGJGW10@l-daemon> for xfs@oss.sgi.com; Sat, 05 Jul 2008 12:38:43 -0600 (MDT) Received: from pn2ml7so.prod.shaw.ca ([10.0.121.151]) by pd3mr2so.prod.shaw.ca (Sun Java System Messaging Server 6.2-7.05 (built Sep 5 2006)) with ESMTP id <0K3J00BIFQGHVL60@pd3mr2so.prod.shaw.ca> for xfs@oss.sgi.com; Sat, 05 Jul 2008 12:38:43 -0600 (MDT) Received: from [192.168.1.113] ([70.64.130.4]) by l-daemon (Sun ONE Messaging Server 6.0 HotFix 1.01 (built Mar 15 2004)) with ESMTP id <0K3J00BM5QGG4630@l-daemon> for xfs@oss.sgi.com; Sat, 05 Jul 2008 12:38:41 -0600 (MDT) Date: Sat, 05 Jul 2008 12:38:35 -0600 From: Robert Hancock X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-reply-to: To: Justin Piszcz Cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz Message-id: <486FBFAB.5050303@shaw.ca> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit References: User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) X-Barracuda-Connect: idcmail-mo1so.shaw.ca[24.71.223.10] X-Barracuda-Start-Time: 1215283125 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55240 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16736 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hancockr@shaw.ca Precedence: bulk X-list: xfs Justin Piszcz wrote: > I've read the best way to 'deal' with this issue is to turn off > apic/acpi etc, is there any downside to turning them off? Particularly > APIC for IRQ routing? It's not the best way to deal with it, more just a workaround, and if it does help it should be reported because it indicates something else is wrong. The main downsides to disabling APIC is that all interrupts will be handled by one core and you'll end up with much more IRQ sharing. Disabling ACPI on modern systems tends to be a bad idea, you'll get no multi-core support, for one. > > This happens on drives on both the Intel 965 chipset motherboard ports > and PCI-e x1 cards, and the cables are not the issue (the cables with 12 > other 150 raptors have no issues) (same cables I used with them)). > > With NCQ on or OFF it occurs. > > $ ls > 0/ 10/ 12/ 14/ 16/ 18/ 2/ 3/ 5/ 7/ 9/ runtest.sh* > 1/ 11/ 13/ 15/ 17/ 19/ 20/ 4/ 6/ 8/ linux-2.6.25.10.tar > > $ cat runtest.sh > #!/bin/bash > > for i in `seq 0 20` > do > cd $i > tar xf ../linux-2.6.25.10.tar & > cd .. > done > > With NCQ off (earlier) (from just heavy I/O on the raid5): > Jul 5 11:50:06 p34 kernel: [112161.433913] ata6.00: exception Emask 0x0 > SAct > 0x0 SErr 0x0 action 0x2 frozen > Jul 5 11:50:06 p34 kernel: [112161.433923] ata6.00: cmd > b0/d8:00:00:4f:c2/00:00:00:00:00/00 tag 0 > Jul 5 11:50:06 p34 kernel: [112161.433924] res > 40/00:ff:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) > Jul 5 11:50:06 p34 kernel: [112161.433927] ata6.00: status: { DRDY } > Jul 5 11:50:06 p34 kernel: [112161.736858] ata6: soft resetting link > Jul 5 11:50:07 p34 kernel: [112161.889840] ata6: SATA link up 3.0 Gbps > (SStatus > 123 SControl 300) > Jul 5 11:50:07 p34 kernel: [112161.911418] ata6.00: configured for > UDMA/133 > Jul 5 11:50:07 p34 kernel: [112161.656792] sd 5:0:0:0: [sdf] Write > Protect is > off > Jul 5 11:50:07 p34 kernel: [112161.656797] sd 5:0:0:0: [sdf] Mode > Sense: 00 3a > 00 00 > Jul 5 11:50:07 p34 kernel: [112161.659296] sd 5:0:0:0: [sdf] Write cache: > enabled, read cache: enabled, doesn't support DPO or FUA > > With NCQ on (with the test shown above): > [115786.990237] ata6.00: exception Emask 0x0 SAct 0x3ffff SErr 0x0 > action 0x2 frozen > [115786.990247] ata6.00: cmd 60/80:00:bf:07:94/00:00:10:00:00/40 tag 0 > ncq 65536 in > [115786.990249] res 40/00:00:00:00:00/00:00:00:00:00/a0 Emask > 0x4 (timeout) > [115786.990254] ata6.00: status: { DRDY } > [115786.990259] ata6.00: cmd 60/88:08:b7:ee:c1/01:00:1d:00:00/40 tag 1 > ncq 200704 in > [115786.990261] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990265] ata6.00: status: { DRDY } > [115786.990270] ata6.00: cmd 60/f8:10:bf:eb:c1/02:00:1d:00:00/40 tag 2 > ncq 389120 in > [115786.990271] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990275] ata6.00: status: { DRDY } > [115786.990280] ata6.00: cmd 60/c0:18:3f:e8:c1/01:00:1d:00:00/40 tag 3 > ncq 229376 in > [115786.990282] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990286] ata6.00: status: { DRDY } > [115786.990291] ata6.00: cmd 60/c0:20:ff:e9:c1/01:00:1d:00:00/40 tag 4 > ncq 229376 in > [115786.990293] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990297] ata6.00: status: { DRDY } > [115786.990302] ata6.00: cmd 61/08:28:0f:c6:b6/00:00:1f:00:00/40 tag 5 > ncq 4096 out > [115786.990303] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990307] ata6.00: status: { DRDY } > [115786.990312] ata6.00: cmd 61/10:30:df:b0:17/00:00:01:00:00/40 tag 6 > ncq 8192 out > [115786.990313] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990318] ata6.00: status: { DRDY } > [115786.990323] ata6.00: cmd 61/10:38:4f:88:79/00:00:03:00:00/40 tag 7 > ncq 8192 out > [115786.990324] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990328] ata6.00: status: { DRDY } > [115786.990333] ata6.00: cmd 61/10:40:3f:18:95/00:00:05:00:00/40 tag 8 > ncq 8192 out > [115786.990335] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990339] ata6.00: status: { DRDY } > [115786.990344] ata6.00: cmd 61/08:48:d7:f6:a9/00:00:06:00:00/40 tag 9 > ncq 4096 out > [115786.990345] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990350] ata6.00: status: { DRDY } > [115786.990355] ata6.00: cmd 61/08:50:9f:37:b7/00:00:07:00:00/40 tag 10 > ncq 4096 out > [115786.990356] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990360] ata6.00: status: { DRDY } > [115786.990365] ata6.00: cmd 61/08:58:27:7c:d1/00:00:08:00:00/40 tag 11 > ncq 4096 out > [115786.990367] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990371] ata6.00: status: { DRDY } > [115786.990376] ata6.00: cmd 61/08:60:97:48:46/00:00:0d:00:00/40 tag 12 > ncq 4096 out > [115786.990377] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990381] ata6.00: status: { DRDY } > [115786.990386] ata6.00: cmd 61/08:68:cf:b4:68/00:00:0e:00:00/40 tag 13 > ncq 4096 out > [115786.990388] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990392] ata6.00: status: { DRDY } > [115786.990397] ata6.00: cmd 61/80:70:3f:06:94/01:00:10:00:00/40 tag 14 > ncq 196608 out > [115786.990398] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990402] ata6.00: status: { DRDY } > [115786.990408] ata6.00: cmd 61/08:78:7f:a4:88/00:00:11:00:00/40 tag 15 > ncq 4096 out > [115786.990409] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990413] ata6.00: status: { DRDY } > [115786.990418] ata6.00: cmd 61/08:80:37:b8:d5/00:00:13:00:00/40 tag 16 > ncq 4096 out > [115786.990419] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990423] ata6.00: status: { DRDY } > [115786.990428] ata6.00: cmd 61/08:88:c7:a4:8b/00:00:1d:00:00/40 tag 17 > ncq 4096 out > [115786.990430] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [115786.990454] ata6.00: status: { DRDY } > [115787.293177] ata6: soft resetting link > [115787.446158] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [115788.133592] ata6.00: configured for UDMA/133 > [115788.133628] ata6: EH complete > [115787.877547] sd 5:0:0:0: [sdf] 586072368 512-byte hardware sectors > (300069 MB) > [115787.877689] sd 5:0:0:0: [sdf] Write Protect is off > [115787.877692] sd 5:0:0:0: [sdf] Mode Sense: 00 3a 00 00 > [115787.878746] sd 5:0:0:0: [sdf] Write cache: enabled, read cache: > enabled, doesn't support DPO or FUA > > What is the true cause of this, is there anyway to get more information? > > I will test soon with apic/acpi=off. Can you post your dmesg from bootup with the controller/drive detection? From owner-xfs@oss.sgi.com Sat Jul 5 12:27:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 12:27:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_16, J_CHICKENPOX_33,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65JRYuE031188 for ; Sat, 5 Jul 2008 12:27:34 -0700 X-ASG-Debug-ID: 1215286114-029a027e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 236161878321 for ; Sat, 5 Jul 2008 12:28:34 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id JHKEBWJ8ZodB5L63 for ; Sat, 05 Jul 2008 12:28:34 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 1A0225A563; Sat, 5 Jul 2008 15:28:34 -0400 (EDT) Date: Sat, 5 Jul 2008 15:28:34 -0400 (EDT) From: Justin Piszcz To: Robert Hancock cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: <486FBFAB.5050303@shaw.ca> Message-ID: References: <486FBFAB.5050303@shaw.ca> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215286115 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55238 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16737 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sat, 5 Jul 2008, Robert Hancock wrote: > Justin Piszcz wrote: >> I've read the best way to 'deal' with this issue is to turn off apic/acpi >> etc, is there any downside to turning them off? Particularly APIC for IRQ >> routing? > > It's not the best way to deal with it, more just a workaround, and if it does > help it should be reported because it indicates something else is wrong. The > main downsides to disabling APIC is that all interrupts will be handled by > one core and you'll end up with much more IRQ sharing. Disabling ACPI on > modern systems tends to be a bad idea, you'll get no multi-core support, for > one. > >> [115787.446158] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) >> [115788.133592] ata6.00: configured for UDMA/133 >> [115788.133628] ata6: EH complete >> [115787.877547] sd 5:0:0:0: [sdf] 586072368 512-byte hardware sectors >> (300069 MB) >> [115787.877689] sd 5:0:0:0: [sdf] Write Protect is off >> [115787.877692] sd 5:0:0:0: [sdf] Mode Sense: 00 3a 00 00 >> [115787.878746] sd 5:0:0:0: [sdf] Write cache: enabled, read cache: >> enabled, doesn't support DPO or FUA >> >> What is the true cause of this, is there anyway to get more information? >> >> I will test soon with apic/acpi=off. > > Can you post your dmesg from bootup with the controller/drive detection? Below: [ 0.000000] Linux version 2.6.25.10 (root@p34.internal.lan) (gcc version 4.3.1 (Debian 4.3.1-2) ) #1 SMP Thu Jul 3 04:57:42 EDT 2008 [ 0.000000] Command line: auto BOOT_IMAGE=2.6.25.10-1 ro root=902 [ 0.000000] BIOS-provided physical RAM map: [ 0.000000] BIOS-e820: 0000000000000000 - 000000000008f000 (usable) [ 0.000000] BIOS-e820: 000000000008f000 - 00000000000a0000 (reserved) [ 0.000000] BIOS-e820: 00000000000e0000 - 0000000000100000 (reserved) [ 0.000000] BIOS-e820: 0000000000100000 - 00000000cf58f000 (usable) [ 0.000000] BIOS-e820: 00000000cf58f000 - 00000000cf59c000 (reserved) [ 0.000000] BIOS-e820: 00000000cf59c000 - 00000000cf639000 (usable) [ 0.000000] BIOS-e820: 00000000cf639000 - 00000000cf694000 (ACPI NVS) [ 0.000000] BIOS-e820: 00000000cf694000 - 00000000cf697000 (ACPI data) [ 0.000000] BIOS-e820: 00000000cf697000 - 00000000cf6ef000 (ACPI NVS) [ 0.000000] BIOS-e820: 00000000cf6ef000 - 00000000cf6f1000 (ACPI data) [ 0.000000] BIOS-e820: 00000000cf6f1000 - 00000000cf6f2000 (usable) [ 0.000000] BIOS-e820: 00000000cf6f2000 - 00000000cf6ff000 (ACPI data) [ 0.000000] BIOS-e820: 00000000cf6ff000 - 00000000cf700000 (usable) [ 0.000000] BIOS-e820: 00000000cf700000 - 00000000d0000000 (reserved) [ 0.000000] BIOS-e820: 00000000f0000000 - 00000000f8000000 (reserved) [ 0.000000] BIOS-e820: 00000000fff00000 - 0000000100000000 (reserved) [ 0.000000] BIOS-e820: 0000000100000000 - 000000022c000000 (usable) [ 0.000000] Entering add_active_range(0, 0, 143) 0 entries of 256 used [ 0.000000] Entering add_active_range(0, 256, 849295) 1 entries of 256 used [ 0.000000] Entering add_active_range(0, 849308, 849465) 2 entries of 256 used [ 0.000000] Entering add_active_range(0, 849649, 849650) 3 entries of 256 used [ 0.000000] Entering add_active_range(0, 849663, 849664) 4 entries of 256 used [ 0.000000] Entering add_active_range(0, 1048576, 2277376) 5 entries of 256 used [ 0.000000] end_pfn_map = 2277376 [ 0.000000] DMI 2.4 present. [ 0.000000] ACPI: RSDP 000FE020, 0014 (r0 INTEL ) [ 0.000000] ACPI: RSDT CF6FD038, 0050 (r1 INTEL DG965WH 6CA 1000013) [ 0.000000] ACPI: FACP CF6FC000, 0074 (r1 INTEL DG965WH 6CA MSFT 1000013) [ 0.000000] ACPI: DSDT CF6F7000, 442C (r1 INTEL DG965WH 6CA MSFT 1000013) [ 0.000000] ACPI: FACS CF697000, 0040 [ 0.000000] ACPI: APIC CF6F6000, 0078 (r1 INTEL DG965WH 6CA MSFT 1000013) [ 0.000000] ACPI: WDDT CF6F5000, 0040 (r1 INTEL DG965WH 6CA MSFT 1000013) [ 0.000000] ACPI: MCFG CF6F4000, 003C (r1 INTEL DG965WH 6CA MSFT 1000013) [ 0.000000] ACPI: ASF! CF6F3000, 00A6 (r32 INTEL DG965WH 6CA MSFT 1000013) [ 0.000000] ACPI: HPET CF6F2000, 0038 (r1 INTEL DG965WH 6CA MSFT 1000013) [ 0.000000] ACPI: SSDT CF6F0000, 020C (r1 INTEL CpuPm 6CA MSFT 1000013) [ 0.000000] ACPI: SSDT CF6EF000, 0175 (r1 INTEL Cpu0Ist 6CA MSFT 1000013) [ 0.000000] ACPI: SSDT CF696000, 0175 (r1 INTEL Cpu1Ist 6CA MSFT 1000013) [ 0.000000] ACPI: SSDT CF695000, 0175 (r1 INTEL Cpu2Ist 6CA MSFT 1000013) [ 0.000000] ACPI: SSDT CF694000, 0175 (r1 INTEL Cpu3Ist 6CA MSFT 1000013) [ 0.000000] Entering add_active_range(0, 0, 143) 0 entries of 256 used [ 0.000000] Entering add_active_range(0, 256, 849295) 1 entries of 256 used [ 0.000000] Entering add_active_range(0, 849308, 849465) 2 entries of 256 used [ 0.000000] Entering add_active_range(0, 849649, 849650) 3 entries of 256 used [ 0.000000] Entering add_active_range(0, 849663, 849664) 4 entries of 256 used [ 0.000000] Entering add_active_range(0, 1048576, 2277376) 5 entries of 256 used [ 0.000000] early res: 0 [0-fff] BIOS data page [ 0.000000] early res: 1 [6000-7fff] SMP_TRAMPOLINE [ 0.000000] early res: 2 [200000-7c93a7] TEXT DATA BSS [ 0.000000] early res: 3 [9a400-a03ff] EBDA [ 0.000000] early res: 4 [8000-11fff] PGTABLE [ 0.000000] [ffffe20000000000-ffffe200001fffff] PMD ->ffff810001200000 on node 0 [ 0.000000] [ffffe20000200000-ffffe200003fffff] PMD ->ffff810001600000 on node 0 [ 0.000000] [ffffe20000400000-ffffe200005fffff] PMD ->ffff810001a00000 on node 0 [ 0.000000] [ffffe20000600000-ffffe200007fffff] PMD ->ffff810001e00000 on node 0 [ 0.000000] [ffffe20000800000-ffffe200009fffff] PMD ->ffff810002200000 on node 0 [ 0.000000] [ffffe20000a00000-ffffe20000bfffff] PMD ->ffff810002600000 on node 0 [ 0.000000] [ffffe20000c00000-ffffe20000dfffff] PMD ->ffff810002a00000 on node 0 [ 0.000000] [ffffe20000e00000-ffffe20000ffffff] PMD ->ffff810002e00000 on node 0 [ 0.000000] [ffffe20001000000-ffffe200011fffff] PMD ->ffff810003200000 on node 0 [ 0.000000] [ffffe20001200000-ffffe200013fffff] PMD ->ffff810003600000 on node 0 [ 0.000000] [ffffe20001400000-ffffe200015fffff] PMD ->ffff810003a00000 on node 0 [ 0.000000] [ffffe20001600000-ffffe200017fffff] PMD ->ffff810003e00000 on node 0 [ 0.000000] [ffffe20001800000-ffffe200019fffff] PMD ->ffff810004200000 on node 0 [ 0.000000] [ffffe20001a00000-ffffe20001bfffff] PMD ->ffff810004600000 on node 0 [ 0.000000] [ffffe20001c00000-ffffe20001dfffff] PMD ->ffff810004a00000 on node 0 [ 0.000000] [ffffe20001e00000-ffffe20001ffffff] PMD ->ffff810004e00000 on node 0 [ 0.000000] [ffffe20002000000-ffffe200021fffff] PMD ->ffff810005200000 on node 0 [ 0.000000] [ffffe20002200000-ffffe200023fffff] PMD ->ffff810005600000 on node 0 [ 0.000000] [ffffe20002400000-ffffe200025fffff] PMD ->ffff810005a00000 on node 0 [ 0.000000] [ffffe20002600000-ffffe200027fffff] PMD ->ffff810005e00000 on node 0 [ 0.000000] [ffffe20002800000-ffffe200029fffff] PMD ->ffff810006200000 on node 0 [ 0.000000] [ffffe20002a00000-ffffe20002bfffff] PMD ->ffff810006600000 on node 0 [ 0.000000] [ffffe20002c00000-ffffe20002dfffff] PMD ->ffff810006a00000 on node 0 [ 0.000000] [ffffe20002e00000-ffffe20002ffffff] PMD ->ffff810006e00000 on node 0 [ 0.000000] [ffffe20003000000-ffffe200031fffff] PMD ->ffff810007200000 on node 0 [ 0.000000] [ffffe20003200000-ffffe200033fffff] PMD ->ffff810007600000 on node 0 [ 0.000000] [ffffe20003400000-ffffe200035fffff] PMD ->ffff810007a00000 on node 0 [ 0.000000] [ffffe20003600000-ffffe200037fffff] PMD ->ffff810007e00000 on node 0 [ 0.000000] [ffffe20003800000-ffffe200039fffff] PMD ->ffff810008200000 on node 0 [ 0.000000] [ffffe20003a00000-ffffe20003bfffff] PMD ->ffff810008600000 on node 0 [ 0.000000] [ffffe20003c00000-ffffe20003dfffff] PMD ->ffff810008a00000 on node 0 [ 0.000000] [ffffe20003e00000-ffffe20003ffffff] PMD ->ffff810008e00000 on node 0 [ 0.000000] [ffffe20004000000-ffffe200041fffff] PMD ->ffff810009200000 on node 0 [ 0.000000] [ffffe20004200000-ffffe200043fffff] PMD ->ffff810009600000 on node 0 [ 0.000000] [ffffe20004400000-ffffe200045fffff] PMD ->ffff810009a00000 on node 0 [ 0.000000] [ffffe20004600000-ffffe200047fffff] PMD ->ffff810009e00000 on node 0 [ 0.000000] [ffffe20004800000-ffffe200049fffff] PMD ->ffff81000a200000 on node 0 [ 0.000000] [ffffe20004a00000-ffffe20004bfffff] PMD ->ffff81000a600000 on node 0 [ 0.000000] [ffffe20004c00000-ffffe20004dfffff] PMD ->ffff81000aa00000 on node 0 [ 0.000000] [ffffe20004e00000-ffffe20004ffffff] PMD ->ffff81000ae00000 on node 0 [ 0.000000] [ffffe20005000000-ffffe200051fffff] PMD ->ffff81000b200000 on node 0 [ 0.000000] [ffffe20005200000-ffffe200053fffff] PMD ->ffff81000b600000 on node 0 [ 0.000000] [ffffe20005400000-ffffe200055fffff] PMD ->ffff81000ba00000 on node 0 [ 0.000000] [ffffe20005600000-ffffe200057fffff] PMD ->ffff81000be00000 on node 0 [ 0.000000] [ffffe20005800000-ffffe200059fffff] PMD ->ffff81000c200000 on node 0 [ 0.000000] [ffffe20005a00000-ffffe20005bfffff] PMD ->ffff81000c600000 on node 0 [ 0.000000] [ffffe20005c00000-ffffe20005dfffff] PMD ->ffff81000ca00000 on node 0 [ 0.000000] [ffffe20005e00000-ffffe20005ffffff] PMD ->ffff81000ce00000 on node 0 [ 0.000000] [ffffe20006000000-ffffe200061fffff] PMD ->ffff81000d200000 on node 0 [ 0.000000] [ffffe20006200000-ffffe200063fffff] PMD ->ffff81000d600000 on node 0 [ 0.000000] [ffffe20006400000-ffffe200065fffff] PMD ->ffff81000da00000 on node 0 [ 0.000000] [ffffe20006600000-ffffe200067fffff] PMD ->ffff81000de00000 on node 0 [ 0.000000] [ffffe20006800000-ffffe200069fffff] PMD ->ffff81000e200000 on node 0 [ 0.000000] [ffffe20006a00000-ffffe20006bfffff] PMD ->ffff81000e600000 on node 0 [ 0.000000] [ffffe20006c00000-ffffe20006dfffff] PMD ->ffff81000ea00000 on node 0 [ 0.000000] [ffffe20006e00000-ffffe20006ffffff] PMD ->ffff81000ee00000 on node 0 [ 0.000000] [ffffe20007000000-ffffe200071fffff] PMD ->ffff81000f200000 on node 0 [ 0.000000] [ffffe20007200000-ffffe200073fffff] PMD ->ffff81000f600000 on node 0 [ 0.000000] [ffffe20007400000-ffffe200075fffff] PMD ->ffff81000fa00000 on node 0 [ 0.000000] [ffffe20007600000-ffffe200077fffff] PMD ->ffff81000fe00000 on node 0 [ 0.000000] [ffffe20007800000-ffffe200079fffff] PMD ->ffff810010200000 on node 0 [ 0.000000] [ffffe20007a00000-ffffe20007bfffff] PMD ->ffff810010600000 on node 0 [ 0.000000] Zone PFN ranges: [ 0.000000] DMA 0 -> 4096 [ 0.000000] DMA32 4096 -> 1048576 [ 0.000000] Normal 1048576 -> 2277376 [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[6] active PFN ranges [ 0.000000] 0: 0 -> 143 [ 0.000000] 0: 256 -> 849295 [ 0.000000] 0: 849308 -> 849465 [ 0.000000] 0: 849649 -> 849650 [ 0.000000] 0: 849663 -> 849664 [ 0.000000] 0: 1048576 -> 2277376 [ 0.000000] On node 0 totalpages: 2078141 [ 0.000000] DMA zone: 56 pages used for memmap [ 0.000000] DMA zone: 1502 pages reserved [ 0.000000] DMA zone: 2425 pages, LIFO batch:0 [ 0.000000] DMA32 zone: 14280 pages used for memmap [ 0.000000] DMA32 zone: 831078 pages, LIFO batch:31 [ 0.000000] Normal zone: 16800 pages used for memmap [ 0.000000] Normal zone: 1212000 pages, LIFO batch:31 [ 0.000000] Movable zone: 0 pages used for memmap [ 0.000000] ACPI: PM-Timer IO Port: 0x408 [ 0.000000] ACPI: Local APIC address 0xfee00000 [ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled) [ 0.000000] Processor #0 (Bootup-CPU) [ 0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x02] enabled) [ 0.000000] Processor #2 [ 0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled) [ 0.000000] Processor #1 [ 0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x03] enabled) [ 0.000000] Processor #3 [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] dfl dfl lint[0x1]) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x02] dfl dfl lint[0x1]) [ 0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0]) [ 0.000000] IOAPIC[0]: apic_id 2, address 0xfec00000, GSI 0-23 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) [ 0.000000] ACPI: IRQ0 used by override. [ 0.000000] ACPI: IRQ2 used by override. [ 0.000000] ACPI: IRQ9 used by override. [ 0.000000] Setting APIC routing to flat [ 0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000 [ 0.000000] Using ACPI (MADT) for SMP configuration information [ 0.000000] Allocating PCI resources starting at d2000000 (gap: d0000000:20000000) [ 0.000000] PERCPU: Allocating 21960 bytes of per cpu data [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 2045503 [ 0.000000] Kernel command line: auto BOOT_IMAGE=2.6.25.10-1 ro root=902 [ 0.000000] Initializing CPU#0 [ 0.000000] PID hash table entries: 4096 (order: 12, 32768 bytes) [ 0.000000] TSC calibrated against PM_TIMER [ 0.000001] time.c: Detected 2397.601 MHz processor. [ 0.000017] Console: colour dummy device 80x25 [ 0.000020] console [tty0] enabled [ 0.000999] Dentry cache hash table entries: 1048576 (order: 11, 8388608 bytes) [ 0.000999] Inode-cache hash table entries: 524288 (order: 10, 4194304 bytes) [ 0.000999] Checking aperture... [ 0.000999] PCI-DMA: Using software bounce buffering for IO (SWIOTLB) [ 0.000999] Placing software IO TLB between 0x11433000 - 0x15433000 [ 0.000999] Memory: 8100044k/9109504k available (3999k kernel code, 211796k reserved, 1251k data, 256k init) [ 0.000999] CPA: page pool initialized 1 of 1 pages preallocated [ 0.000999] hpet clockevent registered [ 0.059992] Calibrating delay using timer specific routine.. 4797.82 BogoMIPS (lpj=2398913) [ 0.060037] Mount-cache hash table entries: 256 [ 0.060140] CPU: L1 I cache: 32K, L1 D cache: 32K [ 0.060143] CPU: L2 cache: 4096K [ 0.060146] CPU: Physical Processor ID: 0 [ 0.060148] CPU: Processor Core ID: 0 [ 0.060155] CPU0: Thermal monitoring enabled (TM2) [ 0.060157] using mwait in idle threads. [ 0.060165] Freeing SMP alternatives: 35k freed [ 0.060183] ACPI: Core revision 20070126 [ 0.077084] Using local APIC timer interrupts. [ 0.077989] APIC timer calibration result 16649993 [ 0.077990] Detected 16.649 MHz APIC timer. [ 0.078079] Booting processor 1/4 APIC 0x2 [ 0.000999] Initializing CPU#1 [ 0.000999] Calibrating delay using timer specific routine.. 4794.99 BogoMIPS (lpj=2397499) [ 0.000999] CPU: L1 I cache: 32K, L1 D cache: 32K [ 0.000999] CPU: L2 cache: 4096K [ 0.000999] CPU: Physical Processor ID: 0 [ 0.000999] CPU: Processor Core ID: 2 [ 0.000999] CPU1: Thermal monitoring enabled (TM2) [ 0.000999] Intel(R) Core(TM)2 Quad CPU @ 2.40GHz stepping 07 [ 0.149473] checking TSC synchronization [CPU#0 -> CPU#1]: passed. [ 0.150050] Booting processor 2/4 APIC 0x1 [ 0.000999] Initializing CPU#2 [ 0.000999] Calibrating delay using timer specific routine.. 4795.02 BogoMIPS (lpj=2397514) [ 0.000999] CPU: L1 I cache: 32K, L1 D cache: 32K [ 0.000999] CPU: L2 cache: 4096K [ 0.000999] CPU: Physical Processor ID: 0 [ 0.000999] CPU: Processor Core ID: 1 [ 0.000999] CPU2: Thermal monitoring enabled (TM2) [ 0.000999] Intel(R) Core(TM)2 Quad CPU @ 2.40GHz stepping 07 [ 0.221461] checking TSC synchronization [CPU#0 -> CPU#2]: passed. [ 0.222057] Booting processor 3/4 APIC 0x3 [ 0.000999] Initializing CPU#3 [ 0.000999] Calibrating delay using timer specific routine.. 4794.98 BogoMIPS (lpj=2397491) [ 0.000999] CPU: L1 I cache: 32K, L1 D cache: 32K [ 0.000999] CPU: L2 cache: 4096K [ 0.000999] CPU: Physical Processor ID: 0 [ 0.000999] CPU: Processor Core ID: 3 [ 0.000999] CPU3: Thermal monitoring enabled (TM2) [ 0.000999] Intel(R) Core(TM)2 Quad CPU @ 2.40GHz stepping 07 [ 0.293467] checking TSC synchronization [CPU#0 -> CPU#3]: passed. [ 0.293961] Brought up 4 CPUs [ 0.294306] net_namespace: 880 bytes [ 0.294415] xor: automatically using best checksumming function: generic_sse [ 0.298955] generic_sse: 8536.000 MB/sec [ 0.298957] xor: using function: generic_sse (8536.000 MB/sec) [ 0.299014] NET: Registered protocol family 16 [ 0.299181] No dock devices found. [ 0.299286] ACPI: bus type pci registered [ 0.303042] PCI: Using MMCONFIG at f0000000 - f7ffffff [ 0.303044] PCI: Using configuration type 1 [ 0.306292] ACPI: EC: Look up EC in DSDT [ 0.308191] ACPI: Interpreter enabled [ 0.308194] ACPI: (supports S0 S5) [ 0.308211] ACPI: Using IOAPIC for interrupt routing [ 0.312322] ACPI: PCI Root Bridge [PCI0] (0000:00) [ 0.313000] pci 0000:00:1f.0: quirk: region 0400-047f claimed by ICH6 ACPI/GPIO/TCO [ 0.313005] pci 0000:00:1f.0: quirk: region 0500-053f claimed by ICH6 GPIO [ 0.313823] PCI: Transparent bridge - 0000:00:1e.0 [ 0.313853] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] [ 0.314182] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.P32_._PRT] [ 0.314416] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX0._PRT] [ 0.314506] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX1._PRT] [ 0.314596] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX2._PRT] [ 0.314685] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX3._PRT] [ 0.314774] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.PEX4._PRT] [ 0.319373] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 5 7 9 10 *11 12) [ 0.319459] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 7 9 *10 11 12) [ 0.319555] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 7 9 10 *11 12) [ 0.319639] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 5 7 9 10 *11 12) [ 0.319722] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 5 7 *9 10 11 12) [ 0.319804] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 7 9 *10 11 12) [ 0.319887] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 5 7 *9 10 11 12) [ 0.319951] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 7 9 10 *11 12) [ 0.320223] Linux Plug and Play Support v0.97 (c) Adam Belay [ 0.320284] pnp: PnP ACPI init [ 0.320293] ACPI: bus type pnp registered [ 0.323494] pnp: PnP ACPI: found 11 devices [ 0.323498] ACPI: ACPI bus type pnp unregistered [ 0.323753] SCSI subsystem initialized [ 0.323851] libata version 3.00 loaded. [ 0.323950] usbcore: registered new interface driver usbfs [ 0.323960] usbcore: registered new interface driver hub [ 0.324020] usbcore: registered new device driver usb [ 0.324274] PCI: Using ACPI for IRQ routing [ 0.324277] PCI: If a device doesn't work, try "pci=routeirq". If it helps, post a report [ 0.328963] PCI-GART: No AMD northbridge found. [ 0.328970] hpet0: at MMIO 0xfed00000, IRQs 2, 8, 0 [ 0.328976] hpet0: 3 64-bit timers, 14318180 Hz [ 0.332963] system 00:01: iomem range 0xf0000000-0xf7ffffff could not be reserved [ 0.332969] system 00:01: iomem range 0xfed13000-0xfed13fff has been reserved [ 0.332974] system 00:01: iomem range 0xfed14000-0xfed17fff has been reserved [ 0.332978] system 00:01: iomem range 0xfed18000-0xfed18fff has been reserved [ 0.332983] system 00:01: iomem range 0xfed19000-0xfed19fff has been reserved [ 0.332987] system 00:01: iomem range 0xfed1c000-0xfed1ffff has been reserved [ 0.332991] system 00:01: iomem range 0xfed20000-0xfed3ffff has been reserved [ 0.332996] system 00:01: iomem range 0xfed45000-0xfed99fff has been reserved [ 0.333000] system 00:01: iomem range 0xc0000-0xdffff has been reserved [ 0.333004] system 00:01: iomem range 0xe0000-0xfffff could not be reserved [ 0.333014] system 00:06: ioport range 0x500-0x53f has been reserved [ 0.333018] system 00:06: ioport range 0x400-0x47f has been reserved [ 0.333022] system 00:06: ioport range 0x360-0x361 has been reserved [ 0.333026] system 00:06: ioport range 0x680-0x6ff has been reserved [ 0.333686] PCI: Bridge: 0000:00:1c.0 [ 0.333689] IO window: disabled. [ 0.333693] MEM window: disabled. [ 0.333696] PREFETCH window: disabled. [ 0.333701] PCI: Bridge: 0000:00:1c.1 [ 0.333703] IO window: 5000-5fff [ 0.333708] MEM window: 0xe0400000-0xe04fffff [ 0.333711] PREFETCH window: disabled. [ 0.333716] PCI: Bridge: 0000:00:1c.2 [ 0.333719] IO window: 4000-4fff [ 0.333723] MEM window: 0xe0300000-0xe03fffff [ 0.333727] PREFETCH window: 0x00000000e0700000-0x00000000e07fffff [ 0.333732] PCI: Bridge: 0000:00:1c.3 [ 0.333735] IO window: 3000-3fff [ 0.333739] MEM window: 0xe0200000-0xe02fffff [ 0.333742] PREFETCH window: 0x00000000e0800000-0x00000000e08fffff [ 0.333748] PCI: Bridge: 0000:00:1c.4 [ 0.333750] IO window: 2000-2fff [ 0.333754] MEM window: 0xe0100000-0xe01fffff [ 0.333758] PREFETCH window: 0x00000000e0900000-0x00000000e09fffff [ 0.333764] PCI: Bridge: 0000:00:1e.0 [ 0.333766] IO window: 1000-1fff [ 0.333770] MEM window: 0xe0000000-0xe00fffff [ 0.333774] PREFETCH window: 0x00000000e0a00000-0x00000000e0afffff [ 0.333794] ACPI: PCI Interrupt 0000:00:1c.0[A] -> GSI 17 (level, low) -> IRQ 17 [ 0.333800] PCI: Setting latency timer of device 0000:00:1c.0 to 64 [ 0.333814] ACPI: PCI Interrupt 0000:00:1c.1[B] -> GSI 16 (level, low) -> IRQ 16 [ 0.333820] PCI: Setting latency timer of device 0000:00:1c.1 to 64 [ 0.333833] ACPI: PCI Interrupt 0000:00:1c.2[C] -> GSI 18 (level, low) -> IRQ 18 [ 0.333839] PCI: Setting latency timer of device 0000:00:1c.2 to 64 [ 0.333872] ACPI: PCI Interrupt 0000:00:1c.3[D] -> GSI 19 (level, low) -> IRQ 19 [ 0.333878] PCI: Setting latency timer of device 0000:00:1c.3 to 64 [ 0.333891] ACPI: PCI Interrupt 0000:00:1c.4[A] -> GSI 17 (level, low) -> IRQ 17 [ 0.333896] PCI: Setting latency timer of device 0000:00:1c.4 to 64 [ 0.333904] PCI: Setting latency timer of device 0000:00:1e.0 to 64 [ 0.333949] NET: Registered protocol family 2 [ 0.345005] IP route cache hash table entries: 262144 (order: 9, 2097152 bytes) [ 0.345590] TCP established hash table entries: 262144 (order: 10, 4194304 bytes) [ 0.347184] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes) [ 0.347731] TCP: Hash tables configured (established 262144 bind 65536) [ 0.347735] TCP reno registered [ 0.056035] Installing knfsd (copyright (C) 1996 okir@monad.swb.de). [ 0.056134] SGI XFS with large block/inode numbers, no debug enabled [ 0.056622] async_tx: api initialized (sync-only) [ 0.056625] io scheduler noop registered [ 0.056649] io scheduler cfq registered (default) [ 0.056657] pci 0000:00:02.0: Boot video device [ 0.056993] PCI: Setting latency timer of device 0000:00:1c.0 to 64 [ 0.057019] assign_interrupt_mode Found MSI capability [ 0.057048] Allocate Port Service[0000:00:1c.0:pcie00] [ 0.057106] Allocate Port Service[0000:00:1c.0:pcie02] [ 0.057152] Allocate Port Service[0000:00:1c.0:pcie03] [ 0.057246] PCI: Setting latency timer of device 0000:00:1c.1 to 64 [ 0.057276] assign_interrupt_mode Found MSI capability [ 0.057308] Allocate Port Service[0000:00:1c.1:pcie00] [ 0.057348] Allocate Port Service[0000:00:1c.1:pcie02] [ 0.057386] Allocate Port Service[0000:00:1c.1:pcie03] [ 0.057468] PCI: Setting latency timer of device 0000:00:1c.2 to 64 [ 0.057498] assign_interrupt_mode Found MSI capability [ 0.057530] Allocate Port Service[0000:00:1c.2:pcie00] [ 0.057570] Allocate Port Service[0000:00:1c.2:pcie02] [ 0.057607] Allocate Port Service[0000:00:1c.2:pcie03] [ 0.057712] PCI: Setting latency timer of device 0000:00:1c.3 to 64 [ 0.057737] assign_interrupt_mode Found MSI capability [ 0.057763] Allocate Port Service[0000:00:1c.3:pcie00] [ 0.057815] Allocate Port Service[0000:00:1c.3:pcie02] [ 0.057861] Allocate Port Service[0000:00:1c.3:pcie03] [ 0.057957] PCI: Setting latency timer of device 0000:00:1c.4 to 64 [ 0.057986] assign_interrupt_mode Found MSI capability [ 0.057991] Allocate Port Service[0000:00:1c.4:pcie00] [ 0.057991] Allocate Port Service[0000:00:1c.4:pcie02] [ 0.058031] Allocate Port Service[0000:00:1c.4:pcie03] [ 0.058403] vesafb: framebuffer at 0xd0000000, mapped to 0xffffc20008100000, using 2560k, total 7616k [ 0.058407] vesafb: mode is 1280x1024x8, linelength=1280, pages=4 [ 0.058409] vesafb: scrolling: redraw [ 0.058412] vesafb: Pseudocolor: size=8:8:8:8, shift=0:0:0:0 [ 0.069212] Console: switching to colour frame buffer device 160x64 [ 0.079909] fb0: VESA VGA frame buffer device [ 0.080054] input: Power Button (FF) as /devices/LNXSYSTM:00/LNXPWRBN:00/input/input0 [ 0.080170] ACPI: Power Button (FF) [PWRF] [ 0.080298] input: Sleep Button (CM) as /devices/LNXSYSTM:00/device:00/PNP0C0E:00/input/input1 [ 0.080417] ACPI: Sleep Button (CM) [SLPB] [ 0.090085] Real Time Clock Driver v1.12ac [ 0.090232] hpet_resources: 0xfed00000 is busy [ 0.090273] Linux agpgart interface v0.103 [ 0.090341] agpgart: Detected an Intel 965G Chipset. [ 0.091700] agpgart: Detected 7676K stolen memory. [ 0.104465] agpgart: AGP aperture is 256M @ 0xd0000000 [ 0.104650] [drm] Initialized drm 1.1.0 20060810 [ 0.104735] ACPI: PCI Interrupt 0000:00:02.0[A] -> GSI 16 (level, low) -> IRQ 16 [ 0.104840] PCI: Setting latency timer of device 0000:00:02.0 to 64 [ 0.104982] [drm] Initialized i915 1.6.0 20060119 on minor 0 [ 0.105433] loop: module loaded [ 0.105552] Intel(R) PRO/1000 Network Driver - version 7.3.20-k2-NAPI [ 0.105640] Copyright (c) 1999-2006 Intel Corporation. [ 0.105738] ACPI: PCI Interrupt 0000:06:00.0[A] -> GSI 21 (level, low) -> IRQ 21 [ 0.388945] Switched to high resolution mode on CPU 1 [ 0.208970] Switched to high resolution mode on CPU 3 [ 0.296959] Switched to high resolution mode on CPU 2 [ 0.500925] Switched to high resolution mode on CPU 0 [ 0.353439] e1000: 0000:06:00.0: e1000_probe: (PCI:33MHz:32-bit) 00:07:e9:29:37:db [ 0.379214] e1000: eth0: e1000_probe: Intel(R) PRO/1000 Network Connection [ 0.379323] ACPI: PCI Interrupt 0000:06:01.0[A] -> GSI 22 (level, low) -> IRQ 22 [ 0.641506] e1000: 0000:06:01.0: e1000_probe: (PCI:33MHz:32-bit) 00:0e:0c:00:cd:b1 [ 0.789084] e1000: eth1: e1000_probe: Intel(R) PRO/1000 Network Connection [ 0.789212] e1000e: Intel(R) PRO/1000 Network Driver - 0.2.0 [ 0.789288] e1000e: Copyright (c) 1999-2007 Intel Corporation. [ 0.789393] ACPI: PCI Interrupt 0000:00:19.0[A] -> GSI 20 (level, low) -> IRQ 20 [ 0.789502] PCI: Setting latency timer of device 0000:00:19.0 to 64 [ 0.889198] eth2: (PCI Express:2.5GB/s:Width x1) 00:19:d1:6e:9d:43 [ 0.889282] eth2: Intel(R) PRO/1000 Network Connection [ 0.889371] eth2: MAC: 4, PHY: 6, PBA No: ffffff-0ff [ 0.889485] console [netcon0] enabled [ 0.889555] netconsole: network logging started [ 0.889660] Driver 'sd' needs updating - please use bus_type methods [ 0.889819] Driver 'sr' needs updating - please use bus_type methods [ 0.889917] ahci 0000:00:1f.2: version 3.0 [ 0.889931] ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 19 (level, low) -> IRQ 19 [ 1.890735] ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 6 ports 3 Gbps 0x3f impl SATA mode [ 1.890845] ahci 0000:00:1f.2: flags: 64bit ncq sntf led clo pio slum part [ 1.890940] PCI: Setting latency timer of device 0000:00:1f.2 to 64 [ 1.891185] scsi0 : ahci [ 1.891310] scsi1 : ahci [ 1.891419] scsi2 : ahci [ 1.891527] scsi3 : ahci [ 1.891806] scsi4 : ahci [ 1.892805] scsi5 : ahci [ 1.893844] ata1: SATA max UDMA/133 abar m2048@0xe0625000 port 0xe0625100 irq 378 [ 1.894714] ata2: SATA max UDMA/133 abar m2048@0xe0625000 port 0xe0625180 irq 378 [ 1.895713] ata3: SATA max UDMA/133 abar m2048@0xe0625000 port 0xe0625200 irq 378 [ 1.896713] ata4: SATA max UDMA/133 abar m2048@0xe0625000 port 0xe0625280 irq 378 [ 1.897723] ata5: SATA max UDMA/133 abar m2048@0xe0625000 port 0xe0625300 irq 378 [ 1.898713] ata6: SATA max UDMA/133 abar m2048@0xe0625000 port 0xe0625380 irq 378 [ 2.356649] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 2.673654] ata1.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 2.674595] ata1.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) [ 2.679961] ata1.00: configured for UDMA/133 [ 2.836575] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 3.155395] ata2.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 3.155521] ata2.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) [ 3.161112] ata2.00: configured for UDMA/133 [ 3.322501] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 3.633983] ata3.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 3.634449] ata3.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) [ 3.640394] ata3.00: configured for UDMA/133 [ 3.806428] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 4.112403] ata4.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 4.113376] ata4.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) [ 4.119137] ata4.00: configured for UDMA/133 [ 4.397339] ata5: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 4.591563] ata5.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 4.592303] ata5.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) [ 4.598246] ata5.00: configured for UDMA/133 [ 4.881265] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [ 5.069692] ata6.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 5.070230] ata6.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) [ 5.076402] ata6.00: configured for UDMA/133 [ 4.805409] scsi 0:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 4.806411] sd 0:0:0:0: [sda] 586072368 512-byte hardware sectors (300069 MB) [ 4.808276] sd 0:0:0:0: [sda] Write Protect is off [ 4.809270] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 [ 4.809285] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 4.810314] sd 0:0:0:0: [sda] 586072368 512-byte hardware sectors (300069 MB) [ 4.811277] sd 0:0:0:0: [sda] Write Protect is off [ 4.812269] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 [ 4.812284] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 4.813271] sda: sda1 sda2 sda3 [ 5.107470] sd 0:0:0:0: [sda] Attached SCSI disk [ 5.108393] scsi 1:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 5.109362] sd 1:0:0:0: [sdb] 586072368 512-byte hardware sectors (300069 MB) [ 5.110233] sd 1:0:0:0: [sdb] Write Protect is off [ 5.111224] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 [ 5.111239] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.112256] sd 1:0:0:0: [sdb] 586072368 512-byte hardware sectors (300069 MB) [ 5.113230] sd 1:0:0:0: [sdb] Write Protect is off [ 5.114223] sd 1:0:0:0: [sdb] Mode Sense: 00 3a 00 00 [ 5.114238] sd 1:0:0:0: [sdb] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.115223] sdb: sdb1 sdb2 sdb3 [ 5.183395] sd 1:0:0:0: [sdb] Attached SCSI disk [ 5.184338] scsi 2:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 5.185346] sd 2:0:0:0: [sdc] 586072368 512-byte hardware sectors (300069 MB) [ 5.186220] sd 2:0:0:0: [sdc] Write Protect is off [ 5.187213] sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00 [ 5.187227] sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.188239] sd 2:0:0:0: [sdc] 586072368 512-byte hardware sectors (300069 MB) [ 5.189219] sd 2:0:0:0: [sdc] Write Protect is off [ 5.190212] sd 2:0:0:0: [sdc] Mode Sense: 00 3a 00 00 [ 5.190226] sd 2:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.191212] sdc: sdc1 [ 5.196323] sd 2:0:0:0: [sdc] Attached SCSI disk [ 5.197334] scsi 3:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 5.198338] sd 3:0:0:0: [sdd] 586072368 512-byte hardware sectors (300069 MB) [ 5.199218] sd 3:0:0:0: [sdd] Write Protect is off [ 5.200211] sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00 [ 5.200225] sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.201238] sd 3:0:0:0: [sdd] 586072368 512-byte hardware sectors (300069 MB) [ 5.202217] sd 3:0:0:0: [sdd] Write Protect is off [ 5.203210] sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00 [ 5.203224] sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.204210] sdd: sdd1 [ 5.210279] sd 3:0:0:0: [sdd] Attached SCSI disk [ 5.211333] scsi 4:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 5.212335] sd 4:0:0:0: [sde] 586072368 512-byte hardware sectors (300069 MB) [ 5.213216] sd 4:0:0:0: [sde] Write Protect is off [ 5.214209] sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00 [ 5.214223] sd 4:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.215236] sd 4:0:0:0: [sde] 586072368 512-byte hardware sectors (300069 MB) [ 5.216215] sd 4:0:0:0: [sde] Write Protect is off [ 5.217208] sd 4:0:0:0: [sde] Mode Sense: 00 3a 00 00 [ 5.217222] sd 4:0:0:0: [sde] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.218208] sde: sde1 [ 5.226329] sd 4:0:0:0: [sde] Attached SCSI disk [ 5.227335] scsi 5:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 5.228332] sd 5:0:0:0: [sdf] 586072368 512-byte hardware sectors (300069 MB) [ 5.229214] sd 5:0:0:0: [sdf] Write Protect is off [ 5.230206] sd 5:0:0:0: [sdf] Mode Sense: 00 3a 00 00 [ 5.230221] sd 5:0:0:0: [sdf] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.231234] sd 5:0:0:0: [sdf] 586072368 512-byte hardware sectors (300069 MB) [ 5.232213] sd 5:0:0:0: [sdf] Write Protect is off [ 5.233205] sd 5:0:0:0: [sdf] Mode Sense: 00 3a 00 00 [ 5.233220] sd 5:0:0:0: [sdf] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 5.234205] sdf: sdf1 [ 5.240317] sd 5:0:0:0: [sdf] Attached SCSI disk [ 5.241403] sata_sil24 0000:03:00.0: version 1.1 [ 5.241433] ACPI: PCI Interrupt 0000:03:00.0[A] -> GSI 18 (level, low) -> IRQ 18 [ 5.242246] PCI: Setting latency timer of device 0000:03:00.0 to 64 [ 5.243248] scsi6 : sata_sil24 [ 5.245287] scsi7 : sata_sil24 [ 5.247256] ata7: SATA max UDMA/100 host m128@0xe0304000 port 0xe0300000 irq 18 [ 5.248205] ata8: SATA max UDMA/100 host m128@0xe0304000 port 0xe0302000 irq 18 [ 7.228923] ata7: SATA link up 3.0 Gbps (SStatus 123 SControl 0) [ 7.400910] ata7.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 7.401876] ata7.00: 586072368 sectors, multi 16: LBA48 NCQ (depth 31/32) [ 7.407950] ata7.00: configured for UDMA/100 [ 9.394593] ata8: SATA link up 3.0 Gbps (SStatus 123 SControl 0) [ 9.561003] ata8.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 9.561548] ata8.00: 586072368 sectors, multi 16: LBA48 NCQ (depth 31/32) [ 9.567892] ata8.00: configured for UDMA/100 [ 9.568598] scsi 6:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 9.569683] sd 6:0:0:0: [sdg] 586072368 512-byte hardware sectors (300069 MB) [ 9.570561] sd 6:0:0:0: [sdg] Write Protect is off [ 9.571546] sd 6:0:0:0: [sdg] Mode Sense: 00 3a 00 00 [ 9.572553] sd 6:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 9.573575] sd 6:0:0:0: [sdg] 586072368 512-byte hardware sectors (300069 MB) [ 9.574553] sd 6:0:0:0: [sdg] Write Protect is off [ 9.575545] sd 6:0:0:0: [sdg] Mode Sense: 00 3a 00 00 [ 9.575560] sd 6:0:0:0: [sdg] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 9.576546] sdg: sdg1 [ 9.609654] sd 6:0:0:0: [sdg] Attached SCSI disk [ 9.610670] scsi 7:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 9.611677] sd 7:0:0:0: [sdh] 586072368 512-byte hardware sectors (300069 MB) [ 9.612547] sd 7:0:0:0: [sdh] Write Protect is off [ 9.613540] sd 7:0:0:0: [sdh] Mode Sense: 00 3a 00 00 [ 9.613554] sd 7:0:0:0: [sdh] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 9.614566] sd 7:0:0:0: [sdh] 586072368 512-byte hardware sectors (300069 MB) [ 9.615546] sd 7:0:0:0: [sdh] Write Protect is off [ 9.616539] sd 7:0:0:0: [sdh] Mode Sense: 00 3a 00 00 [ 9.616553] sd 7:0:0:0: [sdh] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 9.617539] sdh: sdh1 [ 9.620650] sd 7:0:0:0: [sdh] Attached SCSI disk [ 9.621631] ACPI: PCI Interrupt 0000:04:00.0[A] -> GSI 19 (level, low) -> IRQ 19 [ 9.622573] PCI: Setting latency timer of device 0000:04:00.0 to 64 [ 9.622685] scsi8 : sata_sil24 [ 9.623643] scsi9 : sata_sil24 [ 9.624621] ata9: SATA max UDMA/100 host m128@0xe0204000 port 0xe0200000 irq 19 [ 9.625539] ata10: SATA max UDMA/100 host m128@0xe0204000 port 0xe0202000 irq 19 [ 11.684245] ata9: SATA link up 3.0 Gbps (SStatus 123 SControl 0) [ 11.780237] ata9.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 11.781210] ata9.00: 586072368 sectors, multi 16: LBA48 NCQ (depth 31/32) [ 11.789115] ata9.00: configured for UDMA/100 [ 13.852915] ata10: SATA link up 3.0 Gbps (SStatus 123 SControl 0) [ 13.937011] ata10.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 13.938882] ata10.00: 586072368 sectors, multi 16: LBA48 NCQ (depth 31/32) [ 13.945218] ata10.00: configured for UDMA/100 [ 13.945947] scsi 8:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 13.947020] sd 8:0:0:0: [sdi] 586072368 512-byte hardware sectors (300069 MB) [ 13.947889] sd 8:0:0:0: [sdi] Write Protect is off [ 13.948881] sd 8:0:0:0: [sdi] Mode Sense: 00 3a 00 00 [ 13.948895] sd 8:0:0:0: [sdi] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 13.949909] sd 8:0:0:0: [sdi] 586072368 512-byte hardware sectors (300069 MB) [ 13.950887] sd 8:0:0:0: [sdi] Write Protect is off [ 13.951880] sd 8:0:0:0: [sdi] Mode Sense: 00 3a 00 00 [ 13.951894] sd 8:0:0:0: [sdi] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 13.952880] sdi: sdi1 [ 13.988990] sd 8:0:0:0: [sdi] Attached SCSI disk [ 13.990005] scsi 9:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 13.991004] sd 9:0:0:0: [sdj] 586072368 512-byte hardware sectors (300069 MB) [ 13.991881] sd 9:0:0:0: [sdj] Write Protect is off [ 13.992874] sd 9:0:0:0: [sdj] Mode Sense: 00 3a 00 00 [ 13.992889] sd 9:0:0:0: [sdj] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 13.993901] sd 9:0:0:0: [sdj] 586072368 512-byte hardware sectors (300069 MB) [ 13.994881] sd 9:0:0:0: [sdj] Write Protect is off [ 13.995873] sd 9:0:0:0: [sdj] Mode Sense: 00 3a 00 00 [ 13.995887] sd 9:0:0:0: [sdj] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 13.996873] sdj: sdj1 [ 14.003988] sd 9:0:0:0: [sdj] Attached SCSI disk [ 14.004964] ACPI: PCI Interrupt 0000:05:00.0[A] -> GSI 16 (level, low) -> IRQ 16 [ 14.006907] PCI: Setting latency timer of device 0000:05:00.0 to 64 [ 14.007021] scsi10 : sata_sil24 [ 14.007976] scsi11 : sata_sil24 [ 14.008943] ata11: SATA max UDMA/100 host m128@0xe0104000 port 0xe0100000 irq 16 [ 14.009873] ata12: SATA max UDMA/100 host m128@0xe0104000 port 0xe0102000 irq 16 [ 16.144568] ata11: SATA link up 3.0 Gbps (SStatus 123 SControl 0) [ 16.161178] ata11.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 16.161544] ata11.00: 586072368 sectors, multi 16: LBA48 NCQ (depth 31/32) [ 16.167968] ata11.00: configured for UDMA/100 [ 18.309238] ata12: SATA link up 3.0 Gbps (SStatus 123 SControl 0) [ 18.319689] ata12.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max UDMA/133 [ 18.320216] ata12.00: 586072368 sectors, multi 16: LBA48 NCQ (depth 31/32) [ 18.326309] ata12.00: configured for UDMA/100 [ 18.327263] scsi 10:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 18.328352] sd 10:0:0:0: [sdk] 586072368 512-byte hardware sectors (300069 MB) [ 18.329222] sd 10:0:0:0: [sdk] Write Protect is off [ 18.330215] sd 10:0:0:0: [sdk] Mode Sense: 00 3a 00 00 [ 18.330229] sd 10:0:0:0: [sdk] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 18.331252] sd 10:0:0:0: [sdk] 586072368 512-byte hardware sectors (300069 MB) [ 18.332221] sd 10:0:0:0: [sdk] Write Protect is off [ 18.333214] sd 10:0:0:0: [sdk] Mode Sense: 00 3a 00 00 [ 18.333228] sd 10:0:0:0: [sdk] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 18.334214] sdk: sdk1 [ 18.368324] sd 10:0:0:0: [sdk] Attached SCSI disk [ 18.369335] scsi 11:0:0:0: Direct-Access ATA WDC WD3000GLFS-0 03.0 PQ: 0 ANSI: 5 [ 18.370336] sd 11:0:0:0: [sdl] 586072368 512-byte hardware sectors (300069 MB) [ 18.371216] sd 11:0:0:0: [sdl] Write Protect is off [ 18.372208] sd 11:0:0:0: [sdl] Mode Sense: 00 3a 00 00 [ 18.372223] sd 11:0:0:0: [sdl] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 18.373235] sd 11:0:0:0: [sdl] 586072368 512-byte hardware sectors (300069 MB) [ 18.374215] sd 11:0:0:0: [sdl] Write Protect is off [ 18.375207] sd 11:0:0:0: [sdl] Mode Sense: 00 3a 00 00 [ 18.375222] sd 11:0:0:0: [sdl] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 18.376207] sdl: sdl1 [ 18.380321] sd 11:0:0:0: [sdl] Attached SCSI disk [ 18.381333] ACPI: PCI Interrupt 0000:02:00.0[A] -> GSI 17 (level, low) -> IRQ 17 [ 18.382224] PCI: Setting latency timer of device 0000:02:00.0 to 64 [ 18.382298] scsi12 : pata_marvell [ 18.383309] scsi13 : pata_marvell [ 18.384281] ata13: PATA max UDMA/100 cmd 0x5018 ctl 0x5024 bmdma 0x5000 irq 17 [ 18.385206] ata14: DUMMY [ 18.466560] BAR5:00:00 01:7F 02:22 03:CA 04:00 05:00 06:00 07:00 08:00 09:00 0A:00 0B:00 0C:01 0D:00 0E:00 0F:00 [ 18.772535] ata13.00: ATAPI: _NEC DVD_RW ND-3520A, 1.04, max UDMA/33 [ 18.930500] ata13.00: configured for UDMA/33 [ 18.861800] scsi 12:0:0:0: CD-ROM _NEC DVD_RW ND-3520A 1.04 PQ: 0 ANSI: 5 [ 18.865373] sr0: scsi3-mmc drive: 48x/48x writer cd/rw xa/form2 cdda tray [ 18.866133] Uniform CD-ROM driver Revision: 3.20 [ 18.867235] sr 12:0:0:0: Attached scsi CD-ROM sr0 [ 18.867611] ACPI: PCI Interrupt 0000:06:03.0[A] -> GSI 19 (level, low) -> IRQ 19 [ 18.918810] ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[19] MMIO=[e0084000-e00847ff] Max Packet=[2048] IR/IT contexts=[4/8] [ 18.919278] ACPI: PCI Interrupt 0000:00:1a.7[C] -> GSI 18 (level, low) -> IRQ 18 [ 18.920130] PCI: Setting latency timer of device 0000:00:1a.7 to 64 [ 18.920143] ehci_hcd 0000:00:1a.7: EHCI Host Controller [ 18.921206] ehci_hcd 0000:00:1a.7: new USB bus registered, assigned bus number 1 [ 18.926036] ehci_hcd 0000:00:1a.7: debug port 1 [ 18.926127] PCI: cache line size of 32 is not supported by device 0000:00:1a.7 [ 18.926131] ehci_hcd 0000:00:1a.7: irq 18, io mem 0xe0625c00 [ 18.937125] ehci_hcd 0000:00:1a.7: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 [ 18.938335] usb usb1: configuration #1 chosen from 1 choice [ 18.939201] hub 1-0:1.0: USB hub found [ 18.940135] hub 1-0:1.0: 4 ports detected [ 19.042249] ACPI: PCI Interrupt 0000:00:1d.7[A] -> GSI 23 (level, low) -> IRQ 23 [ 19.043110] PCI: Setting latency timer of device 0000:00:1d.7 to 64 [ 19.043113] ehci_hcd 0000:00:1d.7: EHCI Host Controller [ 19.044174] ehci_hcd 0000:00:1d.7: new USB bus registered, assigned bus number 2 [ 19.049012] ehci_hcd 0000:00:1d.7: debug port 1 [ 19.049108] PCI: cache line size of 32 is not supported by device 0000:00:1d.7 [ 19.049114] ehci_hcd 0000:00:1d.7: irq 23, io mem 0xe0625800 [ 19.060107] ehci_hcd 0000:00:1d.7: USB 2.0 started, EHCI 1.00, driver 10 Dec 2004 [ 19.062156] usb usb2: configuration #1 chosen from 1 choice [ 19.063169] hub 2-0:1.0: USB hub found [ 19.064106] hub 2-0:1.0: 6 ports detected [ 19.166238] USB Universal Host Controller Interface driver v3.0 [ 19.168113] ACPI: PCI Interrupt 0000:00:1a.0[A] -> GSI 16 (level, low) -> IRQ 16 [ 19.169090] PCI: Setting latency timer of device 0000:00:1a.0 to 64 [ 19.169092] uhci_hcd 0000:00:1a.0: UHCI Host Controller [ 19.170155] uhci_hcd 0000:00:1a.0: new USB bus registered, assigned bus number 3 [ 19.171104] uhci_hcd 0000:00:1a.0: irq 16, io base 0x000060c0 [ 19.172265] usb usb3: configuration #1 chosen from 1 choice [ 19.173151] hub 3-0:1.0: USB hub found [ 19.174089] hub 3-0:1.0: 2 ports detected [ 19.276199] ACPI: PCI Interrupt 0000:00:1a.1[B] -> GSI 21 (level, low) -> IRQ 21 [ 19.277073] PCI: Setting latency timer of device 0000:00:1a.1 to 64 [ 19.277076] uhci_hcd 0000:00:1a.1: UHCI Host Controller [ 19.278138] uhci_hcd 0000:00:1a.1: new USB bus registered, assigned bus number 4 [ 19.279091] uhci_hcd 0000:00:1a.1: irq 21, io base 0x000060a0 [ 19.280226] usb usb4: configuration #1 chosen from 1 choice [ 19.281135] hub 4-0:1.0: USB hub found [ 19.282073] hub 4-0:1.0: 2 ports detected [ 19.464056] hub 2-0:1.0: unable to enumerate USB device on port 1 [ 19.384175] ACPI: PCI Interrupt 0000:00:1d.0[A] -> GSI 23 (level, low) -> IRQ 23 [ 19.385057] PCI: Setting latency timer of device 0000:00:1d.0 to 64 [ 19.385059] uhci_hcd 0000:00:1d.0: UHCI Host Controller [ 19.386124] uhci_hcd 0000:00:1d.0: new USB bus registered, assigned bus number 5 [ 19.387070] uhci_hcd 0000:00:1d.0: irq 23, io base 0x00006080 [ 19.388214] usb usb5: configuration #1 chosen from 1 choice [ 19.389120] hub 5-0:1.0: USB hub found [ 19.390056] hub 5-0:1.0: 2 ports detected [ 19.672020] hub 2-0:1.0: unable to enumerate USB device on port 4 [ 19.492163] ACPI: PCI Interrupt 0000:00:1d.1[B] -> GSI 19 (level, low) -> IRQ 19 [ 19.493040] PCI: Setting latency timer of device 0000:00:1d.1 to 64 [ 19.493043] uhci_hcd 0000:00:1d.1: UHCI Host Controller [ 19.494105] uhci_hcd 0000:00:1d.1: new USB bus registered, assigned bus number 6 [ 19.495056] uhci_hcd 0000:00:1d.1: irq 19, io base 0x00006060 [ 19.497094] usb usb6: configuration #1 chosen from 1 choice [ 19.498103] hub 6-0:1.0: USB hub found [ 19.499040] hub 6-0:1.0: 2 ports detected [ 19.601147] ACPI: PCI Interrupt 0000:00:1d.2[C] -> GSI 18 (level, low) -> IRQ 18 [ 19.602024] PCI: Setting latency timer of device 0000:00:1d.2 to 64 [ 19.602026] uhci_hcd 0000:00:1d.2: UHCI Host Controller [ 19.603090] uhci_hcd 0000:00:1d.2: new USB bus registered, assigned bus number 7 [ 19.605028] uhci_hcd 0000:00:1d.2: irq 18, io base 0x00006040 [ 19.606177] usb usb7: configuration #1 chosen from 1 choice [ 19.607085] hub 7-0:1.0: USB hub found [ 19.608023] hub 7-0:1.0: 2 ports detected [ 19.893981] usb 5-1: new low speed USB device using uhci_hcd and address 2 [ 19.710157] Initializing USB Mass Storage driver... [ 19.827405] usb 5-1: configuration #1 chosen from 1 choice [ 20.023123] ieee1394: Host added: ID:BUS[0-00:1023] GUID[0090270001c5be9f] [ 20.036960] usb 6-2: new full speed USB device using uhci_hcd and address 2 [ 20.196959] usb 6-2: configuration #1 chosen from 1 choice [ 20.203891] hub 6-2:1.0: USB hub found [ 20.204409] hub 6-2:1.0: 3 ports detected [ 20.488800] usb 6-2.1: new full speed USB device using uhci_hcd and address 3 [ 20.614902] usb 6-2.1: configuration #1 chosen from 1 choice [ 20.801753] usb 6-2.2: new low speed USB device using uhci_hcd and address 4 [ 20.921856] usb 6-2.2: configuration #1 chosen from 1 choice [ 20.928781] usbcore: registered new interface driver usb-storage [ 20.928826] USB Mass Storage support registered. [ 20.930025] PNP: No PS/2 controller found. Probing ports directly. [ 20.933984] serio: i8042 KBD port at 0x60,0x64 irq 1 [ 20.934820] serio: i8042 AUX port at 0x60,0x64 irq 12 [ 20.935892] mice: PS/2 mouse device common for all mice [ 21.267717] input: PC Speaker as /devices/platform/pcspkr/input/input2 [ 21.347193] coretemp coretemp.0: Using relative temperature scale! [ 21.347866] coretemp coretemp.1: Using relative temperature scale! [ 21.348895] coretemp coretemp.2: Using relative temperature scale! [ 21.349863] coretemp coretemp.3: Using relative temperature scale! [ 21.351816] md: raid0 personality registered for level 0 [ 21.352755] md: raid1 personality registered for level 1 [ 21.370766] raid6: int64x1 2277 MB/s [ 21.388751] raid6: int64x2 3000 MB/s [ 21.406758] raid6: int64x4 2789 MB/s [ 21.424753] raid6: int64x8 2089 MB/s [ 21.442750] raid6: sse2x1 3730 MB/s [ 21.460752] raid6: sse2x2 4285 MB/s [ 21.478742] raid6: sse2x4 6664 MB/s [ 21.479735] raid6: using algorithm sse2x4 (6664 MB/s) [ 21.480736] md: raid6 personality registered for level 6 [ 21.481735] md: raid5 personality registered for level 5 [ 21.482735] md: raid4 personality registered for level 4 [ 21.483797] usbcore: registered new interface driver hiddev [ 21.880059] hiddev96: USB HID v1.00 Device [ UPS] on usb-0000:00:1d.0-1 [ 21.883920] input: Dell Dell USB Keyboard Hub as /devices/pci0000:00/0000:00:1d.1/usb6/6-2/6-2.1/6-2.1:1.0/input/input3 [ 21.888678] input: USB HID v1.10 Keyboard [Dell Dell USB Keyboard Hub] on usb-0000:00:1d.1-2.1 [ 21.895665] input: Dell Dell USB Keyboard Hub as /devices/pci0000:00/0000:00:1d.1/usb6/6-2/6-2.1/6-2.1:1.1/input/input4 [ 21.899676] input: USB HID v1.10 Device [Dell Dell USB Keyboard Hub] on usb-0000:00:1d.1-2.1 [ 21.913811] input: USB Optical Mouse as /devices/pci0000:00/0000:00:1d.1/usb6/6-2/6-2.2/6-2.2:1.0/input/input5 [ 21.918715] input: USB HID v1.11 Mouse [USB Optical Mouse] on usb-0000:00:1d.1-2.2 [ 21.919727] usbcore: registered new interface driver usbhid [ 21.920680] drivers/hid/usbhid/hid-core.c: v2.6:USB HID core driver [ 21.921741] Advanced Linux Sound Architecture Driver Version 1.0.16rc2 (Thu Jan 31 16:40:16 2008 UTC). [ 21.923773] ACPI: PCI Interrupt 0000:00:1b.0[A] -> GSI 22 (level, low) -> IRQ 22 [ 21.924681] PCI: Setting latency timer of device 0000:00:1b.0 to 64 [ 21.962235] ALSA device list: [ 21.962662] #0: HDA Intel at 0xe0620000 irq 22 [ 21.963692] u32 classifier [ 21.964661] Actions configured [ 21.965716] nf_conntrack version 0.5.0 (16384 buckets, 65536 max) [ 21.967776] ip_tables: (C) 2000-2006 Netfilter Core Team [ 21.968682] TCP cubic registered [ 21.969680] NET: Registered protocol family 1 [ 21.970670] NET: Registered protocol family 17 [ 21.971846] RPC: Registered udp transport module. [ 21.972661] RPC: Registered tcp transport module. [ 21.974046] md: Autodetecting RAID arrays. [ 22.130876] md: Scanned 16 and added 16 devices. [ 22.131636] md: autorun ... [ 22.132636] md: considering sdl1 ... [ 22.133639] md: adding sdl1 ... [ 22.134638] md: adding sdk1 ... [ 22.135638] md: adding sdj1 ... [ 22.137637] md: adding sdi1 ... [ 22.138637] md: adding sdh1 ... [ 22.139637] md: adding sdg1 ... [ 22.140637] md: adding sdf1 ... [ 22.141637] md: adding sde1 ... [ 22.142637] md: adding sdd1 ... [ 22.143636] md: adding sdc1 ... [ 22.144636] md: sdb3 has different UUID to sdl1 [ 22.145635] md: sdb2 has different UUID to sdl1 [ 22.146635] md: sdb1 has different UUID to sdl1 [ 22.147635] md: sda3 has different UUID to sdl1 [ 22.148634] md: sda2 has different UUID to sdl1 [ 22.149634] md: sda1 has different UUID to sdl1 [ 22.151643] md: created md3 [ 22.152633] md: bind [ 22.153639] md: bind [ 22.154640] md: bind [ 22.155638] md: bind [ 22.156639] md: bind [ 22.157638] md: bind [ 22.158638] md: bind [ 22.159637] md: bind [ 22.160638] md: bind [ 22.161638] md: bind [ 22.162637] md: running: [ 22.163652] md: kicking non-fresh sdd1 from array! [ 22.164633] md: unbind [ 22.165633] md: export_rdev(sdd1) [ 22.166637] raid5: device sdl1 operational as raid disk 9 [ 22.167631] raid5: device sdk1 operational as raid disk 8 [ 22.168631] raid5: device sdj1 operational as raid disk 7 [ 22.169630] raid5: device sdi1 operational as raid disk 6 [ 22.170630] raid5: device sdh1 operational as raid disk 5 [ 22.171630] raid5: device sdg1 operational as raid disk 4 [ 22.172630] raid5: device sdf1 operational as raid disk 3 [ 22.173630] raid5: device sde1 operational as raid disk 2 [ 22.174630] raid5: device sdc1 operational as raid disk 0 [ 22.176994] raid5: allocated 10574kB for md3 [ 22.177629] raid5: raid level 5 set md3 active with 9 out of 10 devices, algorithm 2 [ 22.178629] RAID5 conf printout: [ 22.179629] --- rd:10 wd:9 [ 22.180651] disk 0, o:1, dev:sdc1 [ 22.181629] disk 2, o:1, dev:sde1 [ 22.182629] disk 3, o:1, dev:sdf1 [ 22.183628] disk 4, o:1, dev:sdg1 [ 22.184628] disk 5, o:1, dev:sdh1 [ 22.185628] disk 6, o:1, dev:sdi1 [ 22.186628] disk 7, o:1, dev:sdj1 [ 22.187628] disk 8, o:1, dev:sdk1 [ 22.187629] disk 9, o:1, dev:sdl1 [ 22.190980] md: considering sdb3 ... [ 22.191631] md: adding sdb3 ... [ 22.192628] md: sdb2 has different UUID to sdb3 [ 22.193628] md: sdb1 has different UUID to sdb3 [ 22.194629] md: adding sda3 ... [ 22.195628] md: sda2 has different UUID to sdb3 [ 22.196627] md: sda1 has different UUID to sdb3 [ 22.197712] md: created md2 [ 22.198626] md: bind [ 22.199632] md: bind [ 22.200631] md: running: [ 22.201702] raid1: raid set md2 active with 2 out of 2 mirrors [ 22.202691] md: considering sdb2 ... [ 22.203628] md: adding sdb2 ... [ 22.204626] md: sdb1 has different UUID to sdb2 [ 22.205627] md: adding sda2 ... [ 22.206626] md: sda1 has different UUID to sdb2 [ 22.207703] md: created md1 [ 22.208625] md: bind [ 22.209630] md: bind [ 22.210629] md: running: [ 22.212700] raid1: raid set md1 active with 2 out of 2 mirrors [ 22.213690] md: considering sdb1 ... [ 22.214626] md: adding sdb1 ... [ 22.215626] md: adding sda1 ... [ 22.216624] md: created md0 [ 22.217623] md: bind [ 22.218630] md: bind [ 22.219629] md: running: [ 22.220700] raid1: raid set md0 active with 2 out of 2 mirrors [ 22.221690] md: ... autorun DONE. [ 22.259336] UDF-fs: No VRS found [ 22.259957] Filesystem "md2": Disabling barriers, not supported by the underlying device [ 22.260618] XFS: correcting sb_features alignment problem [ 22.272582] XFS mounting filesystem md2 [ 22.377567] Ending clean XFS mount for filesystem: md2 [ 22.377598] VFS: Mounted root (xfs filesystem) readonly. [ 22.377609] Freeing unused kernel memory: 256k freed [ 24.720255] Adding 16787768k swap on /dev/md0. Priority:-1 extents:1 across:16787768k [ 24.824654] Filesystem "md2": Disabling barriers, not supported by the underlying device [ 26.944903] kjournald starting. Commit interval 5 seconds [ 26.518955] EXT3 FS on md1, internal journal [ 26.518959] EXT3-fs: mounted filesystem with ordered data mode. [ 26.519307] Filesystem "md3": Disabling barriers, not supported by the underlying device [ 26.519447] XFS mounting filesystem md3 [ 26.683692] Ending clean XFS mount for filesystem: md3 [ 28.560034] e1000: eth1: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX [ 28.734046] e1000: eth2: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX [ 30.053502] eth0: Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX [ 33.513766] warning: `named' uses 32-bit capabilities (legacy support in use) [ 185.127945] md: bind [ 185.150226] RAID5 conf printout: [ 185.150230] --- rd:10 wd:9 [ 185.150232] disk 0, o:1, dev:sdc1 [ 185.150235] disk 1, o:1, dev:sdd1 [ 185.150238] disk 2, o:1, dev:sde1 [ 185.150241] disk 3, o:1, dev:sdf1 [ 185.150244] disk 4, o:1, dev:sdg1 [ 185.150247] disk 5, o:1, dev:sdh1 [ 185.150250] disk 6, o:1, dev:sdi1 [ 185.150253] disk 7, o:1, dev:sdj1 [ 185.150256] disk 8, o:1, dev:sdk1 [ 185.150258] disk 9, o:1, dev:sdl1 [ 185.053336] md: recovery of RAID array md3 [ 185.053361] md: minimum _guaranteed_ speed: 1000 KB/sec/disk. [ 185.053362] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for recovery. [ 185.053371] md: using 128k window, over a total of 293032960 blocks. [ 5832.879634] md: md3: recovery done. [ 5833.870866] RAID5 conf printout: [ 5833.870875] --- rd:10 wd:10 [ 5833.870878] disk 0, o:1, dev:sdc1 [ 5833.870882] disk 1, o:1, dev:sdd1 [ 5833.870885] disk 2, o:1, dev:sde1 [ 5833.870888] disk 3, o:1, dev:sdf1 [ 5833.870891] disk 4, o:1, dev:sdg1 [ 5833.870893] disk 5, o:1, dev:sdh1 [ 5833.870896] disk 6, o:1, dev:sdi1 [ 5833.870909] disk 7, o:1, dev:sdj1 [ 5833.870911] disk 8, o:1, dev:sdk1 [ 5833.870913] disk 9, o:1, dev:sdl1 [55164.325258] md: data-check of RAID array md0 [55164.325266] md: minimum _guaranteed_ speed: 1000 KB/sec/disk. [55164.325268] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check. [55164.325271] md: using 128k window, over a total of 16787776 blocks. [55165.960235] md: delaying data-check of md1 until md0 has finished (they share one or more physical units) [55166.383909] md: delaying data-check of md2 until md0 has finished (they share one or more physical units) [55166.964687] md: delaying data-check of md1 until md2 has finished (they share one or more physical units) [55167.386914] md: data-check of RAID array md3 [55167.386919] md: minimum _guaranteed_ speed: 1000 KB/sec/disk. [55167.386921] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check. [55167.386928] md: using 128k window, over a total of 293032960 blocks. [55315.529779] md: md0: data-check done. [55315.445302] md: delaying data-check of md1 until md2 has finished (they share one or more physical units) [55315.445319] md: data-check of RAID array md2 [55315.445321] md: minimum _guaranteed_ speed: 1000 KB/sec/disk. [55315.445322] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check. [55315.445327] md: using 128k window, over a total of 276109056 blocks. [55315.556313] RAID1 conf printout: [55315.556321] --- wd:2 rd:2 [55315.556322] disk 0, wo:0, o:1, dev:sda1 [55315.556324] disk 1, wo:0, o:1, dev:sdb1 [58682.444937] md: md2: data-check done. [58682.365721] md: data-check of RAID array md1 [58682.365729] md: minimum _guaranteed_ speed: 1000 KB/sec/disk. [58682.365730] md: using maximum available idle IO bandwidth (but not more than 200000 KB/sec) for data-check. [58682.365734] md: using 128k window, over a total of 136448 blocks. [58682.485403] RAID1 conf printout: [58682.485408] --- wd:2 rd:2 [58682.485420] disk 0, wo:0, o:1, dev:sda3 [58682.485422] disk 1, wo:0, o:1, dev:sdb3 [58683.793698] md: md1: data-check done. [58683.831793] RAID1 conf printout: [58683.831798] --- wd:2 rd:2 [58683.831800] disk 0, wo:0, o:1, dev:sda2 [58683.831801] disk 1, wo:0, o:1, dev:sdb2 [61891.936511] md: md3: data-check done. [61893.152803] RAID5 conf printout: [61893.152812] --- rd:10 wd:10 [61893.152815] disk 0, o:1, dev:sdc1 [61893.152817] disk 1, o:1, dev:sdd1 [61893.152819] disk 2, o:1, dev:sde1 [61893.152821] disk 3, o:1, dev:sdf1 [61893.152822] disk 4, o:1, dev:sdg1 [61893.152824] disk 5, o:1, dev:sdh1 [61893.152826] disk 6, o:1, dev:sdi1 [61893.152827] disk 7, o:1, dev:sdj1 [61893.152829] disk 8, o:1, dev:sdk1 [61893.152831] disk 9, o:1, dev:sdl1 [86349.168562] kvm: emulating exchange as write [87546.433705] apic write: bad size=1 fee00030 [87546.433814] Ignoring de-assert INIT to vcpu 0 [89725.513763] handle_exception: unexpected, vectoring info 0x80000306 intr info 0x80000b0d [89725.514930] pending exception: not handled yet [89725.517367] pending exception: not handled yet [107360.796671] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x2 frozen [107360.796680] ata4.00: cmd b0/d8:00:00:4f:c2/00:00:00:00:00/00 tag 0 [107360.796681] res 40/00:ff:00:00:00/00:00:00:00:00/00 Emask 0x4 (timeout) [107360.796685] ata4.00: status: { DRDY } [107361.099615] ata4: soft resetting link [107361.252599] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300) [107361.273562] ata4.00: configured for UDMA/133 [107361.273604] ata4: EH complete [107361.018520] sd 3:0:0:0: [sdd] 586072368 512-byte hardware sectors (300069 MB) [107361.018683] sd 3:0:0:0: [sdd] Write Protect is off [107361.018687] sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00 [107361.040887] sd 3:0:0:0: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA From owner-xfs@oss.sgi.com Sat Jul 5 13:10:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 13:10:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65KAbYa001482 for ; Sat, 5 Jul 2008 13:10:37 -0700 X-ASG-Debug-ID: 1215288701-2e7a032c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D480D18810F0 for ; Sat, 5 Jul 2008 13:11:41 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id MuoX3IJL39rLaxkK for ; Sat, 05 Jul 2008 13:11:41 -0700 (PDT) Received: from localhost (DSL01.83.171.151.103.ip-pool.NEFkom.net [83.171.151.103]) by mail.lichtvoll.de (Postfix) with ESMTP id EF3045AE2C for ; Sat, 5 Jul 2008 22:11:40 +0200 (CEST) To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: grub fails boot after update Subject: Re: grub fails boot after update From: Martin Steigerwald Date: Sat, 5 Jul 2008 22:11:34 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807052211.34884.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1215288701 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2813 1.0000 -0.4296 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.43 X-Barracuda-Spam-Status: No, SCORE=-0.43 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55238 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16739 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs Hi! Am Donnerstag 03 Juli 2008 schrieb Jason White: > On Wed, Jul 02, 2008 at 10:54:38PM -0500, Eric Sandeen wrote: > > This really is grub that is busted, but I'd still just suggest using > > ext3 to (mostly) work around the breakage for the foreseeable future. > > > > The other option is to teach grub to always do its io via the > > filesystem not the block device while the fs is mounted (IIRC there > > are various & sundry non-intuitive commands which actually nudge grub > > towards or away from this desired behavior... --with-stage2=/path is > > one I think, skipping the "verification" phase (i.e. trying to read > > the block dev while mounted) is another) > > Does grub 2 (still in development when last I checked) improve on this > situation? > > I managed to get Grub 1 installed on machines with XFS root file > systems by running the install from within the grub "shell" environment > rather than using grub-install. Maybe this skips the checks that > attempt to read the block device directly. I also recall that > grub-install failed. I use GRUB 1 on XFS ever since. But I also used the GRUB shell directly to write it. grub-install doesn't work reliable. I even use the functionality to save the last booted menu entry into /boot/grub/default without a problem. I agree, reading or writing a mounted filesystem directly is not a good idea. Ciao, -- Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 From owner-xfs@oss.sgi.com Sat Jul 5 13:10:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 13:10:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65KAGBS001413 for ; Sat, 5 Jul 2008 13:10:16 -0700 X-ASG-Debug-ID: 1215288678-2e7c033b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.lichtvoll.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 93EAC18810E4 for ; Sat, 5 Jul 2008 13:11:18 -0700 (PDT) Received: from mail.lichtvoll.de (mondschein.lichtvoll.de [194.150.191.11]) by cuda.sgi.com with ESMTP id sQ5aH93GyrxcCxwL for ; Sat, 05 Jul 2008 13:11:18 -0700 (PDT) Received: from localhost (DSL01.83.171.151.103.ip-pool.NEFkom.net [83.171.151.103]) by mail.lichtvoll.de (Postfix) with ESMTP id 75A9B5AE2C for ; Sat, 5 Jul 2008 22:11:17 +0200 (CEST) From: Martin Steigerwald To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: grub fails boot after update Subject: Re: grub fails boot after update Date: Sat, 5 Jul 2008 22:11:10 +0200 User-Agent: KMail/1.9.9 References: <486C4D7E.8060608@sandeen.net> <20080703044755.GA13630@jdc.jasonjgw.net> (sfid-20080703_143045_158241_F738FCFB) In-Reply-To: <20080703044755.GA13630@jdc.jasonjgw.net> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1458418.nLvPYxNhxp"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200807052211.10899.Martin@lichtvoll.de> X-Barracuda-Connect: mondschein.lichtvoll.de[194.150.191.11] X-Barracuda-Start-Time: 1215288679 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0248 1.0000 -1.8599 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.86 X-Barracuda-Spam-Status: No, SCORE=-1.86 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55238 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16738 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Martin@lichtvoll.de Precedence: bulk X-list: xfs --nextPart1458418.nLvPYxNhxp Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi! Am Donnerstag 03 Juli 2008 schrieb Jason White: > On Wed, Jul 02, 2008 at 10:54:38PM -0500, Eric Sandeen wrote: > > This really is grub that is busted, but I'd still just suggest using > > ext3 to (mostly) work around the breakage for the foreseeable future. > > > > The other option is to teach grub to always do its io via the > > filesystem not the block device while the fs is mounted (IIRC there > > are various & sundry non-intuitive commands which actually nudge grub > > towards or away from this desired behavior... --with-stage2=3D/path is > > one I think, skipping the "verification" phase (i.e. trying to read > > the block dev while mounted) is another) > > Does grub 2 (still in development when last I checked) improve on this > situation? > > I managed to get Grub 1 installed on machines with XFS root file > systems by running the install from within the grub "shell" environment > rather than using grub-install. Maybe this skips the checks that > attempt to read the block device directly. I also recall that > grub-install failed. I use GRUB 1 on XFS ever since. But I also used the GRUB shell directly to= =20 write it. grub-install doesn't work reliable. I even use the functionality to save the last booted menu entry=20 into /boot/grub/default without a problem. I agree, reading or writing a mounted filesystem directly is not a good=20 idea. Ciao, --=20 Martin 'Helios' Steigerwald - http://www.Lichtvoll.de GPG: 03B0 0D6C 0040 0710 4AFA B82F 991B EAAC A599 84C7 --nextPart1458418.nLvPYxNhxp Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkhv1V4ACgkQmRvqrKWZhMdDqwCePOKU7SJNz/BZzeyK4RFzmCil MJMAn2geMcOGw3UWCJKl/gE39nsaLfK+ =ckdq -----END PGP SIGNATURE----- --nextPart1458418.nLvPYxNhxp-- From owner-xfs@oss.sgi.com Sat Jul 5 16:21:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 16:21:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65NLJ8O018830 for ; Sat, 5 Jul 2008 16:21:19 -0700 X-ASG-Debug-ID: 1215300142-5ae4033e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pd2mo1so-dmz.prod.shaw.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8CF1312DD0E5 for ; Sat, 5 Jul 2008 16:22:22 -0700 (PDT) Received: from pd2mo1so-dmz.prod.shaw.ca (idcmail-mo1so.shaw.ca [24.71.223.10]) by cuda.sgi.com with ESMTP id 3XqyaK7ST6Sj1tuT for ; Sat, 05 Jul 2008 16:22:22 -0700 (PDT) Received: from unknown (HELO pd2ml1so-ssvc.prod.shaw.ca) ([10.0.141.139]) by pd2mo1so-svcs.prod.shaw.ca with ESMTP; 05 Jul 2008 17:22:22 -0600 X-Cloudmark-SP-Filtered: true X-Cloudmark-SP-Result: v=1.0 c=0 a=06YJs3ZYCObwu2VayQ8A:9 a=_igs-5A00fB-RLDi04kdxpAoJYoA:4 a=YMwqvzZXbQMA:10 a=EWWKLeJB2BwA:10 Received: from s0106000c41bb86e1.ss.shawcable.net (HELO [192.168.1.113]) ([70.64.130.4]) by pd2ml1so-dmz.prod.shaw.ca with ESMTP; 05 Jul 2008 17:22:21 -0600 Message-ID: <48700228.7060904@shaw.ca> Date: Sat, 05 Jul 2008 17:22:16 -0600 From: Robert Hancock User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Justin Piszcz CC: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) References: <486FBFAB.5050303@shaw.ca> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: idcmail-mo1so.shaw.ca[24.71.223.10] X-Barracuda-Start-Time: 1215300143 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55241 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16740 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hancockr@shaw.ca Precedence: bulk X-list: xfs Justin Piszcz wrote: >> Can you post your dmesg from bootup with the controller/drive detection? > > Below: > > [ 0.889917] ahci 0000:00:1f.2: version 3.0 > [ 0.889931] ACPI: PCI Interrupt 0000:00:1f.2[A] -> GSI 19 (level, > low) -> IRQ 19 > [ 1.890735] ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 6 ports 3 Gbps > 0x3f impl SATA mode > [ 1.890845] ahci 0000:00:1f.2: flags: 64bit ncq sntf led clo pio slum > part [ 1.890940] PCI: Setting latency timer of device 0000:00:1f.2 to 64 > [ 1.891185] scsi0 : ahci > [ 1.891310] scsi1 : ahci > [ 1.891419] scsi2 : ahci > [ 1.891527] scsi3 : ahci > [ 1.891806] scsi4 : ahci > [ 1.892805] scsi5 : ahci > [ 1.893844] ata1: SATA max UDMA/133 abar m2048@0xe0625000 port > 0xe0625100 irq 378 > [ 1.894714] ata2: SATA max UDMA/133 abar m2048@0xe0625000 port > 0xe0625180 irq 378 > [ 1.895713] ata3: SATA max UDMA/133 abar m2048@0xe0625000 port > 0xe0625200 irq 378 > [ 1.896713] ata4: SATA max UDMA/133 abar m2048@0xe0625000 port > 0xe0625280 irq 378 > [ 1.897723] ata5: SATA max UDMA/133 abar m2048@0xe0625000 port > 0xe0625300 irq 378 > [ 1.898713] ata6: SATA max UDMA/133 abar m2048@0xe0625000 port > 0xe0625380 irq 378 > [ 2.356649] ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 2.673654] ata1.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max > UDMA/133 > [ 2.674595] ata1.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) > [ 2.679961] ata1.00: configured for UDMA/133 > [ 2.836575] ata2: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 3.155395] ata2.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max > UDMA/133 > [ 3.155521] ata2.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) > [ 3.161112] ata2.00: configured for UDMA/133 > [ 3.322501] ata3: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 3.633983] ata3.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max > UDMA/133 > [ 3.634449] ata3.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) > [ 3.640394] ata3.00: configured for UDMA/133 > [ 3.806428] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 4.112403] ata4.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max > UDMA/133 > [ 4.113376] ata4.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) > [ 4.119137] ata4.00: configured for UDMA/133 > [ 4.397339] ata5: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 4.591563] ata5.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max > UDMA/133 > [ 4.592303] ata5.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) > [ 4.598246] ata5.00: configured for UDMA/133 > [ 4.881265] ata6: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [ 5.069692] ata6.00: ATA-8: WDC WD3000GLFS-01F8U0, 03.03V01, max > UDMA/133 > [ 5.070230] ata6.00: 586072368 sectors, multi 0: LBA48 NCQ (depth 31/32) > [ 5.076402] ata6.00: configured for UDMA/133 So you've got 6 drives in the machine. Intel chipsets normally seem pretty robust with AHCI. > [107360.796671] ata4.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action > 0x2 frozen > [107360.796680] ata4.00: cmd b0/d8:00:00:4f:c2/00:00:00:00:00/00 tag 0 > [107360.796681] res 40/00:ff:00:00:00/00:00:00:00:00/00 Emask > 0x4 (timeout) > [107360.796685] ata4.00: status: { DRDY } > [107361.099615] ata4: soft resetting link > [107361.252599] ata4: SATA link up 3.0 Gbps (SStatus 123 SControl 300) > [107361.273562] ata4.00: configured for UDMA/133 > [107361.273604] ata4: EH complete > [107361.018520] sd 3:0:0:0: [sdd] 586072368 512-byte hardware sectors > (300069 MB) > [107361.018683] sd 3:0:0:0: [sdd] Write Protect is off > [107361.018687] sd 3:0:0:0: [sdd] Mode Sense: 00 3a 00 00 > [107361.040887] sd 3:0:0:0: [sdd] Write cache: enabled, read cache: > enabled, doesn't support DPO or FUA Are you certain that your machine has enough power to run all those drives properly? We've seen in a number of cases that power fluctuations or noise can cause these kinds of errors. From owner-xfs@oss.sgi.com Sat Jul 5 16:23:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 16:23:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m65NNnxT019229 for ; Sat, 5 Jul 2008 16:23:49 -0700 X-ASG-Debug-ID: 1215300292-5af3037c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8D23CDA2A47 for ; Sat, 5 Jul 2008 16:24:52 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id Z8rKcLFEXweaZrX0 for ; Sat, 05 Jul 2008 16:24:52 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 8435B5A568; Sat, 5 Jul 2008 19:24:52 -0400 (EDT) Date: Sat, 5 Jul 2008 19:24:52 -0400 (EDT) From: Justin Piszcz To: Robert Hancock cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: <48700228.7060904@shaw.ca> Message-ID: References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215300293 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55241 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16741 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sat, 5 Jul 2008, Robert Hancock wrote: > Justin Piszcz wrote: >>> Can you post your dmesg from bootup with the controller/drive detection? > > So you've got 6 drives in the machine. Intel chipsets normally seem pretty > robust with AHCI. > > Are you certain that your machine has enough power to run all those drives > properly? We've seen in a number of cases that power fluctuations or noise > can cause these kinds of errors. I have a 650watt PSU (nice antec one) and the power draw of the box is ~148watts w/ veliciraptors, ~250 when fully load all 4 cores + all 12 disks writing. I have turned off the irqbalance daemon and I am going to see if the problem re-occurs. Justin. From owner-xfs@oss.sgi.com Sat Jul 5 21:18:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 05 Jul 2008 21:18:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m664Ikwg011867 for ; Sat, 5 Jul 2008 21:18:47 -0700 X-ASG-Debug-ID: 1215317988-10cb03150000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 25CDC1BB218D for ; Sat, 5 Jul 2008 21:19:48 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ELDckLtAwivUrBDP for ; Sat, 05 Jul 2008 21:19:48 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAM/kb0h5LBzp/2dsb2JhbACsMA X-IronPort-AV: E=Sophos;i="4.30,309,1212330600"; d="scan'208";a="142781062" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 06 Jul 2008 13:49:46 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KFLiz-00044T-PY; Sun, 06 Jul 2008 14:19:45 +1000 Date: Sun, 6 Jul 2008 14:19:45 +1000 From: Dave Chinner To: Sagar Borikar Cc: Eric Sandeen , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash Message-ID: <20080706041945.GH29319@disturbed> Mail-Followup-To: Sagar Borikar , Eric Sandeen , Nathan Scott , xfs@oss.sgi.com References: <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215317990 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0210 1.0000 -1.8848 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.88 X-Barracuda-Spam-Status: No, SCORE=-1.88 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55264 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16742 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 04, 2008 at 10:51:47AM -0700, Sagar Borikar wrote: > > Copy is of the same file to 30 different directories and it is basically > overwrite. Not an overwrite - cp truncates the destination file first: # cp t.t fred # strace cp -f t.t fred ..... stat("fred", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0 stat("t.t", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0 stat("fred", {st_mode=S_IFREG|0644, st_size=5, ...}) = 0 open("t.t", O_RDONLY) = 3 fstat(3, {st_mode=S_IFREG|0644, st_size=5, ...}) = 0 open("fred", O_WRONLY|O_TRUNC) = 4 ^^^^^^^^^^^^^^^^ fstat(4, {st_mode=S_IFREG|0644, st_size=0, ...}) = 0 read(3, "fred\n", 4096) = 5 write(4, "fred\n", 5) = 5 close(4) = 0 close(3) = 0 ..... That being said, I can't reproduce it on a 2.6.24 (debian) kernel, either. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Jul 6 03:30:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 03:31:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66AUdRx012717 for ; Sun, 6 Jul 2008 03:30:40 -0700 X-ASG-Debug-ID: 1215340302-737502150000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 250AD29963 for ; Sun, 6 Jul 2008 03:31:42 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id 1RY0vbYlNKuWGKDJ for ; Sun, 06 Jul 2008 03:31:42 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id C81A75A564; Sun, 6 Jul 2008 06:31:41 -0400 (EDT) Date: Sun, 6 Jul 2008 06:31:41 -0400 (EDT) From: Justin Piszcz To: Robert Hancock cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: Message-ID: References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215340303 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55286 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16743 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sat, 5 Jul 2008, Justin Piszcz wrote: > > > On Sat, 5 Jul 2008, Robert Hancock wrote: > >> Justin Piszcz wrote: >>>> Can you post your dmesg from bootup with the controller/drive detection? >> >> So you've got 6 drives in the machine. Intel chipsets normally seem pretty >> robust with AHCI. >> >> Are you certain that your machine has enough power to run all those drives >> properly? We've seen in a number of cases that power fluctuations or noise >> can cause these kinds of errors. > > I have a 650watt PSU (nice antec one) and the power draw of the box is > ~148watts w/ veliciraptors, ~250 when fully load all 4 cores + all 12 disks > writing. I have turned off the irqbalance daemon and I am going to see if > the problem re-occurs. > > Justin. > With IRQ balance turned off, it did not make any difference. This time I also left NCQ on (bad idea): And infact this time (w/NCQ enabled), it was so bad it dropped a disk from my RAID: (and later it dropped another disk when it was rebuilding (again, w/NCQ on), words of wisdom? do NOT use NCQ w/raptor disks)) md3 : active raid5 sdl1[9] sdk1[8] sdj1[7] sdi1[6] sdh1[5] sdg1[4] sdf1[10](F) sde1[2] sdd1[1] sdc1[0] 2637296640 blocks level 5, 1024k chunk, algorithm 2 [10/9] [UUU_UUUUUU] p34:~# fdisk -l /dev/sdf p34:~# [ 27.080281] EXT3 FS on md1, internal journal [ 27.080285] EXT3-fs: mounted filesystem with ordered data mode. [ 27.080631] Filesystem "md3": Disabling barriers, not supported by the underlying device [ 27.080762] XFS mounting filesystem md3 [ 27.231444] Ending clean XFS mount for filesystem: md3 [ 30.003809] e1000: eth1: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX [ 30.174956] e1000: eth2: e1000_watchdog: NIC Link is Up 100 Mbps Full Duplex, Flow Control: RX [ 31.619294] eth0: Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX [ 35.112182] warning: `named' uses 32-bit capabilities (legacy support in use) [ 1842.570355] ata12.00: exception Emask 0x2 SAct 0x7 SErr 0x0 action 0x2 frozen [ 1842.570361] ata12.00: irq_stat 0x00060002, protocol mismatch [ 1842.570367] ata12.00: cmd 60/e0:00:3f:c8:1c/03:00:15:00:00/40 tag 0 ncq 507904 in [ 1842.570368] res 50/00:01:00:00:00/00:00:00:00:00/00 Emask 0x2 (HSM violation) [ 1842.570371] ata12.00: status: { DRDY } [ 1842.570376] ata12.00: cmd 60/e0:08:1f:cc:1c/03:00:15:00:00/40 tag 1 ncq 507904 in [ 1842.570377] res 50/00:01:00:00:00/00:00:00:00:00/00 Emask 0x2 (HSM violation) [ 1842.570380] ata12.00: status: { DRDY } [ 1842.570384] ata12.00: cmd 60/40:10:ff:cf:1c/00:00:15:00:00/40 tag 2 ncq 32768 in [ 1842.570385] res 50/00:01:00:00:00/00:00:00:00:00/00 Emask 0x2 (HSM violation) [ 1842.570387] ata12.00: status: { DRDY } [ 1842.570396] ata12: hard resetting link [ 1844.690631] ata12: softreset failed (SRST command error) [ 1844.690638] ata12: reset failed (errno=-5), retrying in 8 secs [ 1852.568418] ata12: hard resetting link [ 1854.700112] ata12: SATA link up 3.0 Gbps (SStatus 123 SControl 0) [ 1854.710188] ata12.00: configured for UDMA/100 [ 1854.710207] ata12: EH complete [ 1855.138782] sd 11:0:0:0: [sdl] 586072368 512-byte hardware sectors (300069 MB) [ 1855.138799] sd 11:0:0:0: [sdl] Write Protect is off [ 1855.138804] sd 11:0:0:0: [sdl] Mode Sense: 00 3a 00 00 [ 1855.138842] sd 11:0:0:0: [sdl] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [ 1931.593377] ata6.00: exception Emask 0x2 SAct 0x7fff SErr 0x3000400 action 0x2 frozen [ 1931.593386] ata6: SError: { Proto TrStaTrns UnrecFIS } [ 1931.593392] ata6.00: cmd 60/e0:00:3f:08:c8/03:00:20:00:00/40 tag 0 ncq 507904 in [ 1931.593393] res 40/00:28:ff:0f:e0/00:00:15:00:00/40 Emask 0x6 (timeout) [ 1931.593396] ata6.00: status: { DRDY } [ 1931.593400] ata6.00: cmd 60/e0:08:1f:0c:c8/03:00:20:00:00/40 tag 1 ncq 507904 in [ 1931.593402] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593404] ata6.00: status: { DRDY } [ 1931.593408] ata6.00: cmd 60/40:10:ff:0f:c8/00:00:20:00:00/40 tag 2 ncq 32768 in [ 1931.593409] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593412] ata6.00: status: { DRDY } [ 1931.593416] ata6.00: cmd 60/f8:18:3f:18:c8/00:00:20:00:00/40 tag 3 ncq 126976 in [ 1931.593417] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593420] ata6.00: status: { DRDY } [ 1931.593424] ata6.00: cmd 60/e0:20:37:19:c8/03:00:20:00:00/40 tag 4 ncq 507904 in [ 1931.593425] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593427] ata6.00: status: { DRDY } [ 1931.593431] ata6.00: cmd 60/28:28:17:1d:c8/03:00:20:00:00/40 tag 5 ncq 413696 in [ 1931.593433] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593437] ata6.00: status: { DRDY } [ 1931.593442] ata6.00: cmd 60/e0:30:3f:20:c8/03:00:20:00:00/40 tag 6 ncq 507904 in [ 1931.593443] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593447] ata6.00: status: { DRDY } [ 1931.593452] ata6.00: cmd 60/e0:38:1f:24:c8/03:00:20:00:00/40 tag 7 ncq 507904 in [ 1931.593453] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593457] ata6.00: status: { DRDY } [ 1931.593463] ata6.00: cmd 60/28:40:ff:27:c8/03:00:20:00:00/40 tag 8 ncq 413696 in [ 1931.593464] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593468] ata6.00: status: { DRDY } [ 1931.593473] ata6.00: cmd 60/f8:48:27:2b:c8/00:00:20:00:00/40 tag 9 ncq 126976 in [ 1931.593474] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593478] ata6.00: status: { DRDY } [ 1931.593483] ata6.00: cmd 60/e0:50:1f:2c:c8/03:00:20:00:00/40 tag 10 ncq 507904 in [ 1931.593485] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593489] ata6.00: status: { DRDY } [ 1931.593494] ata6.00: cmd 60/28:58:ff:2f:c8/03:00:20:00:00/40 tag 11 ncq 413696 in [ 1931.593495] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593499] ata6.00: status: { DRDY } [ 1931.593504] ata6.00: cmd 60/e0:60:27:33:c8/03:00:20:00:00/40 tag 12 ncq 507904 in [ 1931.593505] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593509] ata6.00: status: { DRDY } [ 1931.593514] ata6.00: cmd 60/f8:68:07:37:c8/00:00:20:00:00/40 tag 13 ncq 126976 in [ 1931.593516] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593520] ata6.00: status: { DRDY } [ 1931.593525] ata6.00: cmd 60/40:70:ff:37:c8/00:00:20:00:00/40 tag 14 ncq 32768 in [ 1931.593526] res 40/00:00:00:00:00/00:00:00:00:00/00 Emask 0x6 (timeout) [ 1931.593530] ata6.00: status: { DRDY } [ 1931.896320] ata6: soft resetting link [ 1937.097529] ata6: port is slow to respond, please be patient (Status 0xc0) [ 1941.941795] ata6: softreset failed (device not ready) [ 1941.941802] ata6: hard resetting link [ 1947.445957] ata6: port is slow to respond, please be patient (Status 0x80) [ 1951.984266] ata6: COMRESET failed (errno=-16) [ 1951.984272] ata6: hard resetting link [ 1957.488431] ata6: port is slow to respond, please be patient (Status 0x80) [ 1987.012943] ata6: COMRESET failed (errno=-16) [ 1987.012952] ata6: limiting SATA link speed to 1.5 Gbps [ 1987.012955] ata6: hard resetting link [ 1992.058175] ata6: COMRESET failed (errno=-16) [ 1992.058182] ata6: reset failed, giving up [ 1992.058187] ata6.00: disabled [ 1992.058240] ata6: EH complete [ 1992.058285] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058292] end_request: I/O error, dev sdf, sector 549992447 [ 1992.058303] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058305] end_request: I/O error, dev sdf, sector 549992199 [ 1992.058311] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058313] end_request: I/O error, dev sdf, sector 549991207 [ 1992.058319] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058321] end_request: I/O error, dev sdf, sector 549990399 [ 1992.058327] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058329] end_request: I/O error, dev sdf, sector 549989407 [ 1992.058333] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058335] end_request: I/O error, dev sdf, sector 549989159 [ 1992.058340] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058342] end_request: I/O error, dev sdf, sector 549988351 [ 1992.058348] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058350] end_request: I/O error, dev sdf, sector 549987359 [ 1992.058356] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058358] end_request: I/O error, dev sdf, sector 549986367 [ 1992.058364] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058366] end_request: I/O error, dev sdf, sector 549985559 [ 1992.058372] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058374] end_request: I/O error, dev sdf, sector 549984567 [ 1992.058379] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058383] end_request: I/O error, dev sdf, sector 549984319 [ 1992.058387] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058391] end_request: I/O error, dev sdf, sector 549982207 [ 1992.058397] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058402] end_request: I/O error, dev sdf, sector 549981215 [ 1992.058408] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058412] end_request: I/O error, dev sdf, sector 549980223 [ 1992.058421] sd 5:0:0:0: [sdf] Result: hostbyte=DID_BAD_TARGET driverbyte=DRIVER_OK,SUGGEST_OK [ 1992.058425] end_request: I/O error, dev sdf, sector 586067135 [ 1992.058430] end_request: I/O error, dev sdf, sector 586067135 [ 1992.058434] md: super_written gets error=-5, uptodate=0 [ 1992.058437] raid5: Disk failure on sdf1, disabling device. Operation continuing on 9 devices [ 1991.645896] RAID5 conf printout: [ 1991.645903] --- rd:10 wd:9 [ 1991.645906] disk 0, o:1, dev:sdc1 [ 1991.645908] disk 1, o:1, dev:sdd1 [ 1991.645910] disk 2, o:1, dev:sde1 [ 1991.645912] disk 3, o:0, dev:sdf1 [ 1991.645914] disk 4, o:1, dev:sdg1 [ 1991.645916] disk 5, o:1, dev:sdh1 [ 1991.645918] disk 6, o:1, dev:sdi1 [ 1991.645920] disk 7, o:1, dev:sdj1 [ 1991.645922] disk 8, o:1, dev:sdk1 [ 1991.645923] disk 9, o:1, dev:sdl1 [ 1991.678270] RAID5 conf printout: [ 1991.678275] --- rd:10 wd:9 [ 1991.678278] disk 0, o:1, dev:sdc1 [ 1991.678280] disk 1, o:1, dev:sdd1 [ 1991.678282] disk 2, o:1, dev:sde1 [ 1991.678284] disk 4, o:1, dev:sdg1 [ 1991.678286] disk 5, o:1, dev:sdh1 [ 1991.678288] disk 6, o:1, dev:sdi1 [ 1991.678290] disk 7, o:1, dev:sdj1 [ 1991.678292] disk 8, o:1, dev:sdk1 [ 1991.678293] disk 9, o:1, dev:sdl1 [ 2053.744827] program smartctl is using a deprecated SCSI ioctl, please convert it to SG_IO Even after rebooting, the port was still 'hung' / having problems, I power cycled the host and it came up just fine, ran SMART tests too, no issues! # smartctl -a /dev/sdf smartctl version 5.38 [x86_64-unknown-linux-gnu] Copyright (C) 2002-8 Bruce Allen Home page is http://smartmontools.sourceforge.net/ === START OF INFORMATION SECTION === Device Model: WDC WD3000GLFS-01F8U0 Serial Number: ************** Firmware Version: 03.03V01 User Capacity: 300,069,052,416 bytes Device is: Not in smartctl database [for details use: -P showall] ATA Version is: 8 ATA Standard is: Exact ATA specification draft version not indicated Local Time is: Sun Jul 6 04:58:37 2008 EDT SMART support is: Available - device has SMART capability. SMART support is: Enabled .. etc No Errors Logged SMART Self-test log structure revision number 1 Num Test_Description Status Remaining LifeTime(hours) LBA_of_first_error # 1 Short offline Completed without error 00% 705 - # 2 Extended offline Completed without error 00% 702 - # 3 Short offline Completed without error 00% 677 - # 4 Short offline Completed without error 00% 630 - # 5 Short offline Completed without error 00% 271 - I will try booting with the various options disabling APIC/ACPI/nolapic to see if it is possible to not get these errors/problems under heavy I/O: $ cat runtest.sh #!/bin/bash for i in `seq 0 20` do cd $i tar xf ../linux-2.6.25.10.tar & cd .. done -- In short, utilizing Raptors (especially veliciraptors)+NCQ on the ICH8 w/AHCI & other cards in a RAID 5 configuration is a death trap (a good way to lose your data), it appears unsafe to use NCQ w/raptors in a RAID 5 configuration. I've defaulted back to disabling it like I always do and my RAID5 is rebuilding now. After the rebuild is completed I will perform more testing. Justin. From owner-xfs@oss.sgi.com Sun Jul 6 03:43:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 03:43:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66AhR8E013778 for ; Sun, 6 Jul 2008 03:43:27 -0700 X-ASG-Debug-ID: 1215341071-78c601d60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp-out002.kontent.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 39CD51882073 for ; Sun, 6 Jul 2008 03:44:31 -0700 (PDT) Received: from smtp-out002.kontent.com (smtp-out002.kontent.com [81.88.40.216]) by cuda.sgi.com with ESMTP id SBVX9VOjGAw0wrj1 for ; Sun, 06 Jul 2008 03:44:31 -0700 (PDT) Received: from lstyd.lan (p5B162542.dip0.t-ipconnect.de [91.22.37.66]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-out.kontent.com (Postfix) with ESMTP id E53735986361; Sun, 6 Jul 2008 12:44:29 +0200 (CEST) Received: from [10.0.0.2] (para.lan [10.0.0.2]) by lstyd.lan (Postfix) with ESMTP id F357B207A4BA; Sun, 6 Jul 2008 12:44:26 +0200 (CEST) Message-ID: <4870A20C.7080802@theendofthetunnel.de> Date: Sun, 06 Jul 2008 12:44:28 +0200 From: Hannes Dorbath User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Alan Piszcz Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: smtp-out002.kontent.com[81.88.40.216] X-Barracuda-Start-Time: 1215341072 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55286 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16744 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: light@theendofthetunnel.de Precedence: bulk X-list: xfs Justin Piszcz wrote: > In short, utilizing Raptors (especially veliciraptors)+NCQ on the ICH8 > w/AHCI & other cards in a RAID 5 configuration is a death trap (a good > way to lose your data), it appears unsafe to use NCQ w/raptors in a RAID 5 > configuration. I've defaulted back to disabling it like I always do > and my RAID5 is rebuilding now. To my knowledge NCQ and Raptors is completely broken. Besides that, I have really bad experiences with the reliability of those drives. -- Best regards, Hannes Dorbath From owner-xfs@oss.sgi.com Sun Jul 6 05:11:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 05:12:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66CBvu9026375 for ; Sun, 6 Jul 2008 05:11:58 -0700 X-ASG-Debug-ID: 1215346380-78c203680000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3900F1882023 for ; Sun, 6 Jul 2008 05:13:00 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id PIx9q5kjpHAwonIm for ; Sun, 06 Jul 2008 05:13:00 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 718D219A76; Sun, 6 Jul 2008 08:13:00 -0400 (EDT) Date: Sun, 6 Jul 2008 08:13:00 -0400 (EDT) From: Justin Piszcz To: Robert Hancock cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: Message-ID: References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215346381 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55292 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16745 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sun, 6 Jul 2008, Justin Piszcz wrote: > On Sat, 5 Jul 2008, Justin Piszcz wrote: >> On Sat, 5 Jul 2008, Robert Hancock wrote: > > In short, utilizing Raptors (especially veliciraptors)+NCQ on the ICH8 w/AHCI > & other cards in a RAID 5 configuration is a death trap (a good way to lose > your data), it appears unsafe to use NCQ w/raptors in a RAID 5 > configuration. I've defaulted back to disabling it like I always do > and my RAID5 is rebuilding now. > > After the rebuild is completed I will perform more testing. Running many parallel, tar, untar and copies of big fileskernel tarball and the kernel source tree) $ ps auxww | grep -c cp 437 $ ps auxww | grep -c tar 71 More than ~50k context switches.. procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- r b swpd free buff cache si so bi bo in cs us sy id wa 9 8 160 48092 160 6640044 0 0 524 21776 2264 50571 0 27 30 43 0 9 160 46572 160 6642572 0 0 220 22956 2032 45197 0 40 11 49 0 47 160 51424 160 6642800 0 0 0 22900 1799 39694 0 57 5 38 0 6 160 48916 160 6646272 0 0 112 23932 1763 41746 0 49 13 38 0 7 160 49316 160 6646192 0 0 0 25712 1513 37190 0 20 30 50 0 7 160 49240 160 6646264 0 0 0 28352 1853 38319 0 27 18 55 0 1 160 46652 160 6649688 0 0 548 22800 1933 34609 0 22 69 8 0 0 160 47032 160 6651108 0 0 2268 23652 1998 40729 0 22 56 22 1 0 160 47192 160 6651580 0 0 340 21220 1718 34293 1 17 60 23 This is with the "noapic" boot option and NCQ disabled. If there are no further errors I will reboot once more and re-run these tests without the "noapic" boot option and NCQ+irqbalance disabled as before I left NCQ enabled when irqbalance was disabled. Trying to find a pattern here but not having much luck. When all is said and done with over > 500 processes doing I/O with NCQ disabled and IRQ balance disabled w/noapic, I could not reproduce the problem. The problem here is look at the IRQ routing, nearly every device is on IRQ 11: $ cat /proc/interrupts CPU0 CPU1 CPU2 CPU3 0: 100 0 0 0 XT-PIC-XT timer 1: 2 0 0 0 XT-PIC-XT i8042 2: 0 0 0 0 XT-PIC-XT cascade 8: 1 0 0 0 XT-PIC-XT rtc 9: 60454 0 0 0 XT-PIC-XT acpi, HDA Intel, eth2 10: 129911 0 0 0 XT-PIC-XT pata_marvell, uhci_hcd:usb4, eth1 11: 10278157 0 0 0 XT-PIC-XT sata_sil24, sata_sil24, sata_sil24, ohci1394, ehci_hcd:usb1, ehci_hcd:usb2, uhci_hcd:usb3, uhci_hcd:usb5, uhci_hcd:usb6, uhci_hcd:usb7, i915@pci:0000:00:02.0 12: 4 0 0 0 XT-PIC-XT i8042 377: 3027113 0 0 0 PCI-MSI-edge eth0 378: 9168537 0 0 0 PCI-MSI-edge ahci NMI: 0 0 0 0 Non-maskable interrupts LOC: 9832917 9837364 9833540 9842241 Local timer interrupts RES: 2313942 5729262 5207216 5776735 Rescheduling interrupts CAL: 24888 884 25272 25155 function call interrupts TLB: 7990 21120 23055 43247 TLB shootdowns TRM: 0 0 0 0 Thermal event interrupts THR: 0 0 0 0 Threshold APIC interrupts SPU: 0 0 0 0 Spurious interrupts ERR: 0 Justin. From owner-xfs@oss.sgi.com Sun Jul 6 05:41:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 05:42:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_44 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66Cfu9p029389 for ; Sun, 6 Jul 2008 05:41:56 -0700 X-ASG-Debug-ID: 1215348180-1831031e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D6CE32BDB93 for ; Sun, 6 Jul 2008 05:43:00 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id jkZzqKyEZvABOT2m for ; Sun, 06 Jul 2008 05:43:00 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id BB67E32862; Sun, 6 Jul 2008 08:42:59 -0400 (EDT) Date: Sun, 6 Jul 2008 08:42:59 -0400 (EDT) From: Justin Piszcz To: Robert Hancock cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: Message-ID: References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215348180 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55293 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16746 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sun, 6 Jul 2008, Justin Piszcz wrote: > On Sun, 6 Jul 2008, Justin Piszcz wrote: >> On Sat, 5 Jul 2008, Justin Piszcz wrote: >>> On Sat, 5 Jul 2008, Robert Hancock wrote: >> After the rebuild is completed I will perform more testing. The following setup is in-place: Kernel: 2.6.25.10 Boot options: none NCQ: disabled on all disks irqbalance: disabled/not running Removal of all old test data: $ for i in [0-9]*; do rm -rf $i & done .. [468] 5158 [469] 5159 [470] 5160 [471] 5161 [472] 5162 $ -- no problems yet -- run untar test+copy test: $ mkdir `seq 0 20` $ ./runtest.sh for i in `seq 0 20` do cd $i tar xf ../linux-2.6.25.10.tar & cd .. done for b in `seq 21 40` do cp linux-2.6.25.10.tar $b & done -- waiting for problems -- If no problems at the end of this test, will start up IRQ balance (how I normally ran my system) and re-test to see it is relegated to the irqbalance daemon running. ----------------------------- Success .. $ du -sh `seq 0 40` 311M 0 311M 1 311M 2 311M 3 311M 4 311M 5 311M 6 311M 7 311M 8 311M 9 311M 10 311M 11 311M 12 311M 13 311M 14 311M 15 311M 16 311M 17 311M 18 311M 19 311M 20 272M 21 272M 22 272M 23 272M 24 272M 25 272M 26 272M 27 272M 28 272M 29 272M 30 272M 31 272M 32 272M 33 272M 34 272M 35 272M 36 272M 37 272M 38 272M 39 272M 40 ----------------------------- .. no problems .. .. proceeded with test mentioned above .. Second round: The following setup is in-place: Kernel: 2.6.25.10 Boot options: none NCQ: disabled on all disks irqbalance: enabled -- Remove old cruft: $ for i in `seq 0 40` > do > rm -rf $i & > done Create new directories, re-run test: $ mkdir `seq 0 20` $ ./runtest.sh .. no problems either .. -- I do not have a method to reproduce the problem at will unfortunately. Justin. From owner-xfs@oss.sgi.com Sun Jul 6 10:23:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 10:23:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_31, J_CHICKENPOX_45 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66HN1pG024060 for ; Sun, 6 Jul 2008 10:23:04 -0700 X-ASG-Debug-ID: 1215365043-430000160000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta03.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 597D22BE5C8 for ; Sun, 6 Jul 2008 10:24:03 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (bby1mta03.pmc-sierra.com [216.241.235.118]) by cuda.sgi.com with ESMTP id 4mdiisWqlEp9fTU7 for ; Sun, 06 Jul 2008 10:24:03 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 90D4D1070079; Sun, 6 Jul 2008 10:26:43 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta03.pmc-sierra.bc.ca (Postfix) with SMTP id E429E107007D; Sun, 6 Jul 2008 10:26:40 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Jul 2008 10:24:36 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Xfs Access to block zero exception and system crash Subject: RE: Xfs Access to block zero exception and system crash Date: Sun, 6 Jul 2008 10:24:32 -0700 Message-ID: <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <486FA095.1050106@sandeen.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xfs Access to block zero exception and system crash Thread-Index: Acjeu+vnjBaNVLt7QAG//TmvR5I8jwAy4MaA References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> From: "Sagar Borikar" To: "Eric Sandeen" Cc: "Dave Chinner" , "Nathan Scott" , X-OriginalArrivalTime: 06 Jul 2008 17:24:36.0559 (UTC) FILETIME=[29D9EDF0:01C8DF8D] X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.7.6.170557 X-PMC-SpamCheck: Gauge=IIIIIII, Probability=7%, Report='BODY_SIZE_10000_PLUS 0, __BOUNCE_CHALLENGE_SUBJ 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __HAS_MSGID 0, __IMS_MSGID 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __SANE_MSGID 0' X-Barracuda-Connect: bby1mta03.pmc-sierra.com[216.241.235.118] X-Barracuda-Start-Time: 1215365044 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55313 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m66HN4pG024064 X-archive-position: 16747 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Sagar_Borikar@pmc-sierra.com Precedence: bulk X-list: xfs Sagar Borikar wrote: > Copy is of the same file to 30 different directories and it is basically > overwrite. > > Here is the setup: > > It's a JBOD with Volume size 20 GB. The directories are empty and this > is basically continuous copy of the file on all thirty directories. But > surprisingly none of the copy succeeds. All the copy processes are in > Uninterruptible sleep state and xfs_repair log I have already attached > With the prep. As mentioned it is with 2.6.24 Fedora kernel. It would probably be best to try a 2.6.26 kernel from rawhide to be sure you're closest to the bleeding edge. Sure Eric but I reran the test and I got similar errors with 2.6.24 kernel on x86. I am still confused with the results that I see on 2.6.24 kernel on x86 machine. I see that the used size shown by ls is way too huge than the actual size. Here is the log of the system [root@lab00 ~/test_partition]# ls -lSah total 202M -rw-r--r-- 1 root root 202M Jul 4 14:06 original ---> this I sthe file Which I copy. drwxr-x--- 65 root root 12K Jul 6 21:57 .. -rwxr-xr-x 1 root root 189 Jul 4 16:31 runall -rwxr-xr-x 1 root root 50 Jul 4 16:32 copy drwxr-xr-x 2 root root 45 Jul 6 22:07 . -------> Total size is roughly 202MB. [root@lab00 ~/test_partition]# df -lh . Filesystem Size Used Avail Use% Mounted on /mnt/xfstest 9.6G 7.7G 2.0G 80% /root/test_partition Size reported by df is 7.7G which is complete anomaly here. This is 10GB loopback partition and it mentions that only 2 GB is available. [root@lab00 ~/test_partition]# cat /etc/mtab /dev/mapper/VolGroup00-LogVol00 / ext3 rw 0 0 proc /proc proc rw 0 0 sysfs /sys sysfs rw 0 0 devpts /dev/pts devpts rw,gid=5,mode=620 0 0 /dev/sda1 /boot ext3 rw 0 0 tmpfs /dev/shm tmpfs rw 0 0 automount(pid3151) /net autofs rw,fd=4,pgrp=3151,minproto=2,maxproto=4 0 0 /mnt/xfstest /root/test_partition xfs rw,loop=/dev/loop0 0 0 ---> XFS partition. Here is the fragmentation result [root@lab00 ~/test_partition]# xfs_db -c frag -r /mnt/xfstest actual 7781, ideal 32, fragmentation factor 99.59% Here is the kernel version: [root@lab00 ~/test_partition]# uname -a Linux lab00 2.6.24 #1 SMP Fri Jul 4 12:20:56 IST 2008 i686 i686 i386 GNU/Linux I tested on 2.6.24.7-92.fc8 on x86_64, and I did this, specifically, in the root of a 30G xfs fs: # for I in `seq 1 30`; do mkdir dir$I; done # vi copyit.sh (your script) # chmod +x copyit.sh # dd if=/dev/zero of=300mbfile bs=1M count=300 # for I in `seq 1 30`; do ./copyit.sh 300mbfile dir$I & done I got no errors or corruption after several iterations. Surprising. I see it every time. I do it on 20 GB and 10GB partition on loopback device. When looked for the bad inode, Might also be worth checking dmesg for any errors when you run. dmesg log doesn't give any information. Here is XFS related info: XFS mounting filesystem loop0 Ending clean XFS mount for filesystem: loop0 Which is basically for mounting XFS cleanly. But there is no exception in XFS. Filesystem has become completely sluggish and response time is increased to 3-4 minutes for every command. Not a single copy is complete and all the copy processes are sleeping continuously. Xfs_repair starts reporting severe bugs: - agno = 1 entry "testfile" in shortform directory 16777472 references free inode 16777473 would have junked entry "testfile" in directory inode 16777472 - agno = 0 entry "testfile_3" at block 0 offset 664 in directory inode 128 references free inode 138 would clear inode number in entry at offset 664... entry "testfile_4" at block 0 offset 712 in directory inode 128 references free inode 140 would clear inode number in entry at offset 712... entry "testfile_5" at block 0 offset 760 in directory inode 128 references free inode 142 would clear inode number in entry at offset 760... entry "testfile_6" at block 0 offset 808 in directory inode 128 references free inode 143 would clear inode number in entry at offset 808... entry "testfile_7" at block 0 offset 856 in directory inode 128 references free inode 144 would clear inode number in entry at offset 856... entry "testfile_8" at block 0 offset 904 in directory inode 128 references free inode 146 would clear inode number in entry at offset 904... entry "testfile_9" at block 0 offset 952 in directory inode 128 references free inode 148 would clear inode number in entry at offset 952... entry "testfile_10" at block 0 offset 976 in directory inode 128 references free inode 149 would clear inode number in entry at offset 976... entry "testfile_12" at block 0 offset 1048 in directory inode 128 references free inode 150 would clear inode number in entry at offset 1048... entry "testfile_11" at block 0 offset 1072 in directory inode 128 references free inode 151 would clear inode number in entry at offset 1072... entry "testfile_13" at block 0 offset 1144 in directory inode 128 references free inode 154 data fork in ino 16777473 claims dup extent, off - 5266, start - 2164956, cnt 192 bad data fork in inode 16777473 would have cleared inode 16777473 entry "testfile" in shortform directory 16777474 references free inode 16777475 would have junked entry "testfile" in directory inode 16777474 would clear inode number in entry at offset 1144... entry "testfile_14" at block 0 offset 1168 in directory inode 128 references free inode 155 would clear inode number in entry at offset 1168... entry "testfile_15" at block 0 offset 1240 in directory inode 128 references free inode 156 would clear inode number in entry at offset 1240... entry "testfile_16" at block 0 offset 1264 in directory inode 128 references free inode 157 would clear inode number in entry at offset 1264... entry "testfile_17" at block 0 offset 1336 in directory inode 128 references free inode 160 would clear inode number in entry at offset 1336... entry "testfile_18" at block 0 offset 1360 in directory inode 128 references free inode 161 would clear inode number in entry at offset 1360... entry "testfile_19" at block 0 offset 1432 in directory inode 128 references free inode 162 would clear inode number in entry at offset 1432... entry "testfile_20" at block 0 offset 1456 in directory inode 128 references free inode 163 would clear inode number in entry at offset 1456... entry "testfile_2" at block 0 offset 3032 in directory inode 128 references free inode 137 would clear inode number in entry at offset 3032... data fork in ino 16777475 claims dup extent, off - 8178, start - 3200553, cnt 104 bad data fork in inode 16777475 would have cleared inode 16777475 entry "testfile" in shortform directory 16777476 references free inode 16777477 would have junked entry "testfile" in directory inode 16777476 data fork in ino 16777477 claims dup extent, off - 9402, start - 3221565, cnt 56 bad data fork in inode 16777477 would have cleared inode 16777477 entry "testfile" in shortform directory 16777478 references free inode 16777479 would have junked entry "testfile" in directory inode 16777478 data fork in ino 16777479 claims dup extent, off - 9586, start - 170361, cnt 96 bad data fork in inode 16777479 would have cleared inode 16777479 entry "testfile" in shortform directory 16777480 references free inode 16777481 would have junked entry "testfile" in directory inode 16777480 data fork in ino 16777481 claims dup extent, off - 8338, start - 3203018, cnt 128 bad data fork in inode 16777481 would have cleared inode 16777481 - agno = 2 entry "testfile" in shortform directory 33595712 references free inode 33595713 would have junked entry "testfile" in directory inode 33595712 bad data fork in inode 33595713 would have cleared inode 33595713 entry "testfile" in shortform directory 33595714 references free inode 33595715 would have junked entry "testfile" in directory inode 33595714 imap claims in-use inode 33595715 is free, correcting imap entry "testfile" in shortform directory 33595716 references free inode 33595717 would have junked entry "testfile" in directory inode 33595716 data fork in ino 33595717 claims dup extent, off - 0, start - 3281880, cnt 6180 bad data fork in inode 33595717 would have cleared inode 33595717 entry "testfile" in shortform directory 33595718 references free inode 33595719 would have junked entry "testfile" in directory inode 33595718 bad data fork in inode 33595719 would have cleared inode 33595719 entry "testfile" in shortform directory 33595720 references free inode 33595721 would have junked entry "testfile" in directory inode 33595720 bad data fork in inode 33595721 would have cleared inode 33595721 - agno = 3 entry "testfile" in shortform directory 50331904 references free inode 50331905 would have junked entry "testfile" in directory inode 50331904 bad data fork in inode 50331905 would have cleared inode 50331905 entry "testfile" in shortform directory 50331906 references free inode 50331907 would have junked entry "testfile" in directory inode 50331906 data fork in ino 50331907 claims dup extent, off - 609, start - 3151886, cnt 311 bad data fork in inode 50331907 would have cleared inode 50331907 entry "testfile" in shortform directory 50331908 references free inode 50331909 would have junked entry "testfile" in directory inode 50331908 imap claims in-use inode 50331909 is free, correcting imap entry "testfile" in shortform directory 50331910 references free inode 50331911 would have junked entry "testfile" in directory inode 50331910 bad data fork in inode 50331911 would have cleared inode 50331911 entry "testfile" in shortform directory 50331912 references free inode 50331913 would have junked entry "testfile" in directory inode 50331912 data fork in ino 50331913 claims dup extent, off - 6358, start - 3224389, cnt 469 bad data fork in inode 50331913 would have cleared inode 50331913 data fork in regular inode 133 claims used block 1075592 would have cleared inode 133 data fork in regular inode 136 claims used block 1075930 would have cleared inode 136 data fork in regular inode 137 claims used block 2162044 would have cleared inode 137 data fork in regular inode 138 claims used block 1075938 would have cleared inode 138 entry "testfile" in shortform directory 139 references free inode 141 would have junked entry "testfile" in directory inode 139 data fork in ino 140 claims dup extent, off - 12298, start - 202587, cnt 30 bad data fork in inode 140 would have cleared inode 140 data fork in ino 141 claims dup extent, off - 8562, start - 160071, cnt 384 bad data fork in inode 141 would have cleared inode 141 data fork in ino 142 claims dup extent, off - 1458, start - 80521, cnt 32 bad data fork in inode 142 would have cleared inode 142 data fork in ino 143 claims dup extent, off - 13770, start - 235117, cnt 96 bad data fork in inode 143 would have cleared inode 143 bad magic # 0 in inode 144 (data fork) bmbt block 3262925 bad data fork in inode 144 would have cleared inode 144 entry "testfile" in shortform directory 145 references free inode 147 would have junked entry "testfile" in directory inode 145 data fork in ino 146 claims dup extent, off - 8082, start - 138272, cnt 32 bad data fork in inode 146 would have cleared inode 146 data fork in regular inode 147 claims used block 1075759 would have cleared inode 147 data fork in regular inode 148 claims used block 3231076 would have cleared inode 148 data fork in ino 149 claims dup extent, off - 9426, start - 168635, cnt 8 bad data fork in inode 149 would have cleared inode 149 data fork in ino 150 claims dup extent, off - 3607, start - 105990, cnt 59 bad data fork in inode 150 would have cleared inode 150 data fork in regular inode 151 claims used block 1076476 would have cleared inode 151 entry "testfile" in shortform directory 152 references free inode 153 would have junked entry "testfile" in directory inode 152 bad magic # 0 in inode 153 (data fork) bmbt block 3271407 bad data fork in inode 153 would have cleared inode 153 data fork in regular inode 154 claims used block 1076388 would have cleared inode 154 data fork in regular inode 155 claims used block 1076068 would have cleared inode 155 data fork in regular inode 156 claims used block 3224002 would have cleared inode 156 data fork in ino 157 claims dup extent, off - 9554, start - 170265, cnt 96 bad data fork in inode 157 would have cleared inode 157 entry "testfile" in shortform directory 158 references free inode 159 would have junked entry "testfile" in directory inode 158 data fork in regular inode 159 claims used block 1076564 would have cleared inode 159 data fork in ino 160 claims dup extent, off - 9394, start - 168489, cnt 8 bad data fork in inode 160 would have cleared inode 160 data fork in ino 161 claims dup extent, off - 14662, start - 253175, cnt 32 bad data fork in inode 161 would have cleared inode 161 data fork in regular inode 162 claims used block 2209542 would have cleared inode 162 bad magic # 0 in inode 163 (data fork) bmbt block 3270098 bad data fork in inode 163 would have cleared inode 163 No modify flag set, skipping phase 5 Phase 6 - check inode connectivity... - traversing filesystem ... - agno = 0 entry "testfile_3" in directory inode 128 points to free inode 138, would junk entry entry "testfile_4" in directory inode 128 points to free inode 140, would junk entry entry "testfile_5" in directory inode 128 points to free inode 142, would junk entry entry "testfile_6" in directory inode 128 points to free inode 143, would junk entry entry "testfile_7" in directory inode 128 points to free inode 144, would junk entry entry "testfile_8" in directory inode 128 points to free inode 146, would junk entry entry "testfile_9" in directory inode 128 points to free inode 148, would junk entry entry "testfile_10" in directory inode 128 points to free inode 149, would junk entry entry "testfile_12" in directory inode 128 points to free inode 150, would junk entry entry "testfile_11" in directory inode 128 points to free inode 151, would junk entry entry "testfile_13" in directory inode 128 points to free inode 154, would junk entry entry "testfile_14" in directory inode 128 points to free inode 155, would junk entry entry "testfile_15" in directory inode 128 points to free inode 156, would junk entry entry "testfile_16" in directory inode 128 points to free inode 157, would junk entry entry "testfile_17" in directory inode 128 points to free inode 160, would junk entry entry "testfile_18" in directory inode 128 points to free inode 161, would junk entry entry "testfile_19" in directory inode 128 points to free inode 162, would junk entry entry "testfile_20" in directory inode 128 points to free inode 163, would junk entry entry "testfile_1" in directory inode 128 points to free inode 136, would junk entry entry "testfile_2" in directory inode 128 points to free inode 137, would junk entry bad hash table for directory inode 128 (no data entry): would rebuild entry "testfile" in shortform directory inode 132 points to free inode 133would junk entry entry "testfile" in shortform directory inode 139 points to free inode 141would junk entry entry "testfile" in shortform directory inode 145 points to free inode 147would junk entry entry "testfile" in shortform directory inode 152 points to free inode 153would junk entry entry "testfile" in shortform directory inode 158 points to free inode 159would junk entry - agno = 1 entry "testfile" in shortform directory inode 16777472 points to free inode 16777473would junk entry entry "testfile" in shortform directory inode 16777474 points to free inode 16777475would junk entry entry "testfile" in shortform directory inode 16777476 points to free inode 16777477would junk entry entry "testfile" in shortform directory inode 16777478 points to free inode 16777479would junk entry entry "testfile" in shortform directory inode 16777480 points to free inode 16777481would junk entry - agno = 2 entry "testfile" in shortform directory inode 33595712 points to free inode 33595713would junk entry entry "testfile" in shortform directory inode 33595716 points to free inode 33595717would junk entry entry "testfile" in shortform directory inode 33595718 points to free inode 33595719would junk entry entry "testfile" in shortform directory inode 33595720 points to free inode 33595721would junk entry - agno = 3 entry "testfile" in shortform directory inode 50331904 points to free inode 50331905would junk entry entry "testfile" in shortform directory inode 50331906 points to free inode 50331907would junk entry entry "testfile" in shortform directory inode 50331910 points to free inode 50331911would junk entry entry "testfile" in shortform directory inode 50331912 points to free inode 50331913would junk entry - traversal finished ... - moving disconnected inodes to lost+found ... Phase 7 - verify link counts... No modify flag set, skipping filesystem flush and exiting. XFS_REPAIR Summary Sun Jul 6 22:43:36 2008 Phase Start End Duration Phase 1: 07/06 22:39:18 07/06 22:39:33 15 seconds Phase 2: 07/06 22:39:33 07/06 22:41:47 2 minutes, 14 seconds Phase 3: 07/06 22:41:47 07/06 22:43:15 1 minute, 28 seconds Phase 4: 07/06 22:43:15 07/06 22:43:36 21 seconds Phase 5: Skipped Phase 6: 07/06 22:43:36 07/06 22:43:36 Phase 7: 07/06 22:43:36 07/06 22:43:36 Total run time: 4 minutes, 18 seconds When checked for bad inode in xfs_db, then the parent inode was shown as -1 I presume it should point to right parent directory inode. 1: byte offset 2560065792, length 256 buffer block 5000128 (fsbno 1048592), 8 bbs inode 16777473, dir inode -1, type inode I don't know what I am doing wrong here. Sagar From owner-xfs@oss.sgi.com Sun Jul 6 12:06:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 12:06:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66J6cvs000435 for ; Sun, 6 Jul 2008 12:06:38 -0700 X-ASG-Debug-ID: 1215371262-50c4016a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AC0891882A88 for ; Sun, 6 Jul 2008 12:07:42 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id m6ykREfWzWX7UD6S for ; Sun, 06 Jul 2008 12:07:42 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 15F18AC626B; Sun, 6 Jul 2008 14:07:41 -0500 (CDT) Message-ID: <487117FC.9090109@sandeen.net> Date: Sun, 06 Jul 2008 14:07:40 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215371262 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55319 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16748 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > Sagar Borikar wrote: >> Copy is of the same file to 30 different directories and it is > basically >> overwrite. >> >> Here is the setup: >> >> It's a JBOD with Volume size 20 GB. The directories are empty and this >> is basically continuous copy of the file on all thirty directories. > But >> surprisingly none of the copy succeeds. All the copy processes are in >> Uninterruptible sleep state and xfs_repair log I have already attached > >> With the prep. As mentioned it is with 2.6.24 Fedora kernel. > > It would probably be best to try a 2.6.26 kernel from rawhide to be sure > you're closest to the bleeding edge. > > Sure Eric but I reran the test and I got similar errors with > 2.6.24 kernel on x86. I am still confused with the results that I see on > 2.6.24 kernel on x86 machine. I see that the used size shown by ls is > way too huge than the actual size. Here is the log of the system > > [root@lab00 ~/test_partition]# ls -lSah > total 202M > -rw-r--r-- 1 root root 202M Jul 4 14:06 original ---> this I sthe file > Which I copy. > drwxr-x--- 65 root root 12K Jul 6 21:57 .. > -rwxr-xr-x 1 root root 189 Jul 4 16:31 runall > -rwxr-xr-x 1 root root 50 Jul 4 16:32 copy > drwxr-xr-x 2 root root 45 Jul 6 22:07 . It'd be great if you provided these actual scripts so we don't have to guess at what you're doing or work backwards from the repair output :) > dmesg log doesn't give any information. Here is XFS related > info: > > XFS mounting filesystem loop0 > Ending clean XFS mount for filesystem: loop0 > Which is basically for mounting XFS cleanly. But there is no exception > in XFS. and nothing else of interest either? > Filesystem has become completely sluggish and response time is increased > to > 3-4 minutes for every command. Not a single copy is complete and all > the copy processes are sleeping continuously. And how did you recover from this; did you power-cycle the box? -Eric From owner-xfs@oss.sgi.com Sun Jul 6 12:49:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 12:50:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66JnwnY009553 for ; Sun, 6 Jul 2008 12:49:59 -0700 X-ASG-Debug-ID: 1215373861-731101600000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3A966C35A83 for ; Sun, 6 Jul 2008 12:51:01 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id g7Ey8MJKqQTu2SWb for ; Sun, 06 Jul 2008 12:51:01 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 197555A56D; Sun, 6 Jul 2008 15:51:01 -0400 (EDT) Date: Sun, 6 Jul 2008 15:51:01 -0400 (EDT) From: Justin Piszcz To: Robert Hancock cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: Message-ID: References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215373863 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55321 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16749 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Sun, 6 Jul 2008, Justin Piszcz wrote: > On Sun, 6 Jul 2008, Justin Piszcz wrote: >> On Sun, 6 Jul 2008, Justin Piszcz wrote: >>> On Sat, 5 Jul 2008, Justin Piszcz wrote: >>>> On Sat, 5 Jul 2008, Robert Hancock wrote: >>> After the rebuild is completed I will perform more testing. As more or less of a last-ditch effort, I replaced all 12 SATA cables. Will see if/when the problem happens again. Justin. From owner-xfs@oss.sgi.com Sun Jul 6 16:52:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 16:52:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m66NqEGl000777 for ; Sun, 6 Jul 2008 16:52:15 -0700 X-ASG-Debug-ID: 1215388398-574400230000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp.sauce.co.nz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 841C011DBF4F for ; Sun, 6 Jul 2008 16:53:18 -0700 (PDT) Received: from smtp.sauce.co.nz (smtp.sauce.co.nz [210.48.49.72]) by cuda.sgi.com with ESMTP id lZEoFBWDFqPJUVZG for ; Sun, 06 Jul 2008 16:53:18 -0700 (PDT) Received: (qmail 17559 invoked from network); 6 Jul 2008 23:53:17 -0000 Received: from unknown (HELO ?192.168.4.111?) (192.168.4.111) by smtp.sauce.co.nz with (DHE-RSA-AES256-SHA encrypted) SMTP; 6 Jul 2008 23:53:17 -0000 Message-ID: <48715CEF.8010008@sauce.co.nz> Date: Mon, 07 Jul 2008 12:01:51 +1200 From: Richard Scobie User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS Recovery Subject: XFS Recovery Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: smtp.sauce.co.nz[210.48.49.72] X-Barracuda-Start-Time: 1215388399 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4676 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55338 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16750 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richard@sauce.co.nz Precedence: bulk X-list: xfs If the following log entry appears after mounting an XFS fs, is it safe to assume that whatever issue initiated the recovery has been repaired, or is further checking/repair required? XFS mounting filesystem md5 Starting XFS recovery on filesystem: md5 (logdev: /dev/md0) Ending XFS recovery on filesystem: md5 (logdev: /dev/md0) Regards, Richard From owner-xfs@oss.sgi.com Sun Jul 6 17:06:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 17:06:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6706kLj002298 for ; Sun, 6 Jul 2008 17:06:46 -0700 X-ASG-Debug-ID: 1215389269-252d03830000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3873B2BEF58 for ; Sun, 6 Jul 2008 17:07:49 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id mAfCr5HXUf2BAMQG for ; Sun, 06 Jul 2008 17:07:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAE/6cEh5LBzp/2dsb2JhbACtMg X-IronPort-AV: E=Sophos;i="4.30,312,1212330600"; d="scan'208";a="143213053" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 07 Jul 2008 09:37:47 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KFeGf-0001Ow-RG; Mon, 07 Jul 2008 10:07:45 +1000 Date: Mon, 7 Jul 2008 10:07:45 +1000 From: Dave Chinner To: Richard Scobie Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS Recovery Subject: Re: XFS Recovery Message-ID: <20080707000745.GI29319@disturbed> Mail-Followup-To: Richard Scobie , xfs@oss.sgi.com References: <48715CEF.8010008@sauce.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48715CEF.8010008@sauce.co.nz> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215389271 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4745 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55339 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16751 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 07, 2008 at 12:01:51PM +1200, Richard Scobie wrote: > If the following log entry appears after mounting an XFS fs, is it safe > to assume that whatever issue initiated the recovery has been repaired, > or is further checking/repair required? No. > XFS mounting filesystem md5 > Starting XFS recovery on filesystem: md5 (logdev: /dev/md0) > Ending XFS recovery on filesystem: md5 (logdev: /dev/md0) That's normal output when mounting an XFS filesystem - if you see more than this then there might be problems... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Jul 6 18:13:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 18:13:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m671DHaY007140 for ; Sun, 6 Jul 2008 18:13:18 -0700 X-ASG-Debug-ID: 1215393261-5745035b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp.sauce.co.nz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 22A4611DC4BB for ; Sun, 6 Jul 2008 18:14:21 -0700 (PDT) Received: from smtp.sauce.co.nz (smtp.sauce.co.nz [210.48.49.72]) by cuda.sgi.com with ESMTP id V5z1fv5VKvJt0dVK for ; Sun, 06 Jul 2008 18:14:21 -0700 (PDT) Received: (qmail 18355 invoked from network); 7 Jul 2008 01:14:19 -0000 Received: from unknown (HELO ?192.168.4.111?) (192.168.4.111) by smtp.sauce.co.nz with (DHE-RSA-AES256-SHA encrypted) SMTP; 7 Jul 2008 01:14:19 -0000 Message-ID: <48716FEE.7070806@sauce.co.nz> Date: Mon, 07 Jul 2008 13:22:54 +1200 From: Richard Scobie User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.2) Gecko/20040805 Netscape/7.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Dave Chinner CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS Recovery Subject: Re: XFS Recovery References: <48715CEF.8010008@sauce.co.nz> <20080707000745.GI29319@disturbed> In-Reply-To: <20080707000745.GI29319@disturbed> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: smtp.sauce.co.nz[210.48.49.72] X-Barracuda-Start-Time: 1215393262 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0323 1.0000 -1.8119 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.81 X-Barracuda-Spam-Status: No, SCORE=-1.81 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55344 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16752 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richard@sauce.co.nz Precedence: bulk X-list: xfs Dave Chinner wrote: >>XFS mounting filesystem md5 >>Starting XFS recovery on filesystem: md5 (logdev: /dev/md0) >>Ending XFS recovery on filesystem: md5 (logdev: /dev/md0) > > > That's normal output when mounting an XFS filesystem - if > you see more than this then there might be problems... Thanks Dave, I was more used to seeing: XFS mounting filesystem md5 Ending clean XFS mount for filesystem: md5 Maybe the message has changed with later kernels. In any case, it sounds like I have no issues. Regards, Richard From owner-xfs@oss.sgi.com Sun Jul 6 18:29:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 18:29:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m671TGIs008843 for ; Sun, 6 Jul 2008 18:29:18 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA13666; Mon, 7 Jul 2008 11:30:15 +1000 Message-ID: <487171A7.4070602@sgi.com> Date: Mon, 07 Jul 2008 11:30:15 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Richard Scobie , xfs@oss.sgi.com Subject: Re: XFS Recovery References: <48715CEF.8010008@sauce.co.nz> <20080707000745.GI29319@disturbed> In-Reply-To: <20080707000745.GI29319@disturbed> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16753 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Mon, Jul 07, 2008 at 12:01:51PM +1200, Richard Scobie wrote: >> If the following log entry appears after mounting an XFS fs, is it safe >> to assume that whatever issue initiated the recovery has been repaired, >> or is further checking/repair required? > > No. > >> XFS mounting filesystem md5 >> Starting XFS recovery on filesystem: md5 (logdev: /dev/md0) >> Ending XFS recovery on filesystem: md5 (logdev: /dev/md0) > > That's normal output when mounting an XFS filesystem - if > you see more than this then there might be problems... > Hmmm....I don't know if I would describe that as "normal" unless I am misunderstanding Dave here. There has been some recovery happening indicating that there wasn't a clean unmount (it didn't find an unmount record in the log). But recovery should have replayed the outstanding metadata to a time point in the near past and so no repair should be necessary (we have qa tests which do the test anyway and check that there are no complaints). --Tim From owner-xfs@oss.sgi.com Sun Jul 6 18:55:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 18:55:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m671tE6a012756 for ; Sun, 6 Jul 2008 18:55:14 -0700 X-ASG-Debug-ID: 1215395778-6a8100e90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from web34505.mail.mud.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 0080E1883A2F for ; Sun, 6 Jul 2008 18:56:18 -0700 (PDT) Received: from web34505.mail.mud.yahoo.com (web34505.mail.mud.yahoo.com [66.163.178.171]) by cuda.sgi.com with SMTP id vxZYGierty2RqhUc for ; Sun, 06 Jul 2008 18:56:18 -0700 (PDT) Received: (qmail 7481 invoked by uid 60001); 7 Jul 2008 01:56:17 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Message-ID; b=N1qE0OV6szutRoWT2jCgUzoG59lboCrpsSZ15GkdbL0623K/mLCV3Iph5S91icNZYYpYnezLg7bp/EHpBT1YjNUE/njGvQ97bDJmfwepLllvMEHOU2/mzU1ktFMP1uyZlMRdWMpu8176iUC4y/cYGudTe08SFb/8tS2paloTKmI=; Received: from [96.14.131.125] by web34505.mail.mud.yahoo.com via HTTP; Sun, 06 Jul 2008 18:56:17 PDT X-Mailer: YahooMailWebService/0.7.199 Date: Sun, 6 Jul 2008 18:56:17 -0700 (PDT) From: Mark Reply-To: MusicMan529@yahoo.com X-ASG-Orig-Subj: Re: XFS Recovery Subject: Re: XFS Recovery To: xfs@oss.sgi.com In-Reply-To: <487171A7.4070602@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Message-ID: <719163.7411.qm@web34505.mail.mud.yahoo.com> X-Barracuda-Connect: web34505.mail.mud.yahoo.com[66.163.178.171] X-Barracuda-Start-Time: 1215395779 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4676 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55346 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16754 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: musicman529@yahoo.com Precedence: bulk X-list: xfs --- On Sun, 7/6/08, Timothy Shimmin wrote: > >> XFS mounting filesystem md5 > >> Starting XFS recovery on filesystem: md5 (logdev: > /dev/md0) > >> Ending XFS recovery on filesystem: md5 (logdev: > /dev/md0) > > > > That's normal output when mounting an XFS > filesystem - if > > you see more than this then there might be problems... > > > Hmmm....I don't know if I would describe that as > "normal" > unless I am misunderstanding Dave here. > There has been some recovery happening indicating that > there > wasn't a clean unmount (it didn't find an unmount > record in the log). > But recovery should have replayed the > outstanding metadata to a time point in the near past > and so no repair should be necessary (we have qa tests > which do the > test anyway and check that there are no complaints). Maybe not "normal," but at least "acceptable"? If it's a regular occurrence, it might be worth looking into. If it was a one-off, with no further complaints, I'd ignore it. -- Mark "What better place to find oneself than on the streets of one's home village?" --Capt. Jean-Luc Picard, "Family" From owner-xfs@oss.sgi.com Sun Jul 6 19:05:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 19:05:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6725cIB014573 for ; Sun, 6 Jul 2008 19:05:38 -0700 X-ASG-Debug-ID: 1215396401-5ed1005a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 791F32BF661 for ; Sun, 6 Jul 2008 19:06:42 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 3TD2qvSXwizt8vSB for ; Sun, 06 Jul 2008 19:06:42 -0700 (PDT) Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 07 Jul 2008 11:35:51 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KFg64-0005hP-J5; Mon, 07 Jul 2008 12:04:56 +1000 Date: Mon, 7 Jul 2008 12:04:56 +1000 From: Dave Chinner To: Timothy Shimmin Cc: Richard Scobie , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS Recovery Subject: Re: XFS Recovery Message-ID: <20080707020456.GJ29319@disturbed> Mail-Followup-To: Timothy Shimmin , Richard Scobie , xfs@oss.sgi.com References: <48715CEF.8010008@sauce.co.nz> <20080707000745.GI29319@disturbed> <487171A7.4070602@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <487171A7.4070602@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215396403 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3753 1.0000 -0.0690 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.07 X-Barracuda-Spam-Status: No, SCORE=-0.07 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55346 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16755 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 07, 2008 at 11:30:15AM +1000, Timothy Shimmin wrote: > Dave Chinner wrote: > > On Mon, Jul 07, 2008 at 12:01:51PM +1200, Richard Scobie wrote: > >> If the following log entry appears after mounting an XFS fs, is it safe > >> to assume that whatever issue initiated the recovery has been repaired, > >> or is further checking/repair required? > > > > No. > > > >> XFS mounting filesystem md5 > >> Starting XFS recovery on filesystem: md5 (logdev: /dev/md0) > >> Ending XFS recovery on filesystem: md5 (logdev: /dev/md0) > > > > That's normal output when mounting an XFS filesystem - if > > you see more than this then there might be problems... > > > Hmmm....I don't know if I would describe that as "normal" > unless I am misunderstanding Dave here. Normal as in "everything is OK - there's no need to worry". Recovery at mount time happens quite frequently for a variety of reasons - it's not a sign that there's something wrong as such.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sun Jul 6 20:01:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:01:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m673153Q022247 for ; Sun, 6 Jul 2008 20:01:06 -0700 X-ASG-Debug-ID: 1215399729-30b303190000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta03.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 031CD11DD0A5 for ; Sun, 6 Jul 2008 20:02:09 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (bby1mta03.pmc-sierra.com [216.241.235.118]) by cuda.sgi.com with ESMTP id nOZv9jkLuVXAvpZa for ; Sun, 06 Jul 2008 20:02:09 -0700 (PDT) Received: from bby1mta03.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id DEC3A1070088; Sun, 6 Jul 2008 20:04:52 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta03.pmc-sierra.bc.ca (Postfix) with SMTP id 7AE401070071; Sun, 6 Jul 2008 20:04:50 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Jul 2008 20:02:45 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Sun, 6 Jul 2008 20:02:44 -0700 Message-ID: <4871872B.9060107@pmc-sierra.com> Date: Mon, 07 Jul 2008 08:32:03 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> In-Reply-To: <487117FC.9090109@sandeen.net> Content-Type: multipart/mixed; boundary="------------080806010108010907030600" X-OriginalArrivalTime: 07 Jul 2008 03:02:45.0222 (UTC) FILETIME=[EDE7D860:01C8DFDD] X-PMX-Version: 5.4.2.338381, Antispam-Engine: 2.6.0.325393, Antispam-Data: 2008.7.7.24612 X-PMC-SpamCheck: Gauge=IIIIIII, Probability=7%, Report='BODY_SIZE_3000_3999 0, BODY_SIZE_5000_LESS 0, __BAT_BOUNDARY 0, __BOUNCE_CHALLENGE_SUBJ 0, __CT 0, __CTYPE_HAS_BOUNDARY 0, __CTYPE_MULTIPART 0, __HAS_MSGID 0, __KNOWN_PHONE_RU_MOSCOW_CELL 0, __MIME_TEXT_ONLY 0, __MIME_VERSION 0, __RUS_OBFU_PHONE 0, __SANE_MSGID 0, __STOCK_PHRASE_7 0, __USER_AGENT 0' X-Barracuda-Connect: bby1mta03.pmc-sierra.com[216.241.235.118] X-Barracuda-Start-Time: 1215399730 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2127 1.0000 -0.7614 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.76 X-Barracuda-Spam-Status: No, SCORE=-0.76 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55350 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16756 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs This is a multi-part message in MIME format. --------------080806010108010907030600 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Eric Sandeen wrote: > Sagar Borikar wrote: > >> Sagar Borikar wrote: >> >>> Copy is of the same file to 30 different directories and it is >>> >> basically >> >>> overwrite. >>> >>> Here is the setup: >>> >>> It's a JBOD with Volume size 20 GB. The directories are empty and this >>> is basically continuous copy of the file on all thirty directories. >>> >> But >> >>> surprisingly none of the copy succeeds. All the copy processes are in >>> Uninterruptible sleep state and xfs_repair log I have already attached >>> >>> With the prep. As mentioned it is with 2.6.24 Fedora kernel. >>> >> It would probably be best to try a 2.6.26 kernel from rawhide to be sure >> you're closest to the bleeding edge. >> >> Sure Eric but I reran the test and I got similar errors with >> 2.6.24 kernel on x86. I am still confused with the results that I see on >> 2.6.24 kernel on x86 machine. I see that the used size shown by ls is >> way too huge than the actual size. Here is the log of the system >> >> [root@lab00 ~/test_partition]# ls -lSah >> total 202M >> -rw-r--r-- 1 root root 202M Jul 4 14:06 original ---> this I sthe file >> Which I copy. >> drwxr-x--- 65 root root 12K Jul 6 21:57 .. >> -rwxr-xr-x 1 root root 189 Jul 4 16:31 runall >> -rwxr-xr-x 1 root root 50 Jul 4 16:32 copy >> drwxr-xr-x 2 root root 45 Jul 6 22:07 . >> > > It'd be great if you provided these actual scripts so we don't have to > guess at what you're doing or work backwards from the repair output :) > Attaching the scripts with this mail. > >> dmesg log doesn't give any information. Here is XFS related >> info: >> >> XFS mounting filesystem loop0 >> Ending clean XFS mount for filesystem: loop0 >> Which is basically for mounting XFS cleanly. But there is no exception >> in XFS. >> > > and nothing else of interest either? > Not really. That's why it was surprising. Even after setting the error_level to 11 > >> Filesystem has become completely sluggish and response time is increased >> to >> 3-4 minutes for every command. Not a single copy is complete and all >> the copy processes are sleeping continuously. >> > > And how did you recover from this; did you power-cycle the box? > There was no failure. Only the processes were stalled. System was operative. > -Eric > --------------080806010108010907030600 Content-Type: text/plain; name="copy" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="copy" #! /bin/sh while [ 1 ] do cp -f $1 $2 done --------------080806010108010907030600 Content-Type: text/plain; name="runall" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="runall" #! /bin/sh for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do mkdir -p testdir_$i ./copy testfile testdir_$i & rm -Rf testdir_$1/testfile ./copy testfile testfile_$i & done --------------080806010108010907030600-- From owner-xfs@oss.sgi.com Sun Jul 6 20:03:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:03:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6733l2A022678 for ; Sun, 6 Jul 2008 20:03:47 -0700 X-ASG-Debug-ID: 1215399891-05f102760000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B04E71883F1D for ; Sun, 6 Jul 2008 20:04:51 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id SbhyuS47PCUNvXKL for ; Sun, 06 Jul 2008 20:04:51 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id D9CD7AC626B; Sun, 6 Jul 2008 22:04:50 -0500 (CDT) Message-ID: <487187D2.8080105@sandeen.net> Date: Sun, 06 Jul 2008 22:04:50 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> In-Reply-To: <4871872B.9060107@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215399891 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55350 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16757 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > There was no failure. Only the processes were stalled. System was > operative. I'm curious, if the processes were stalled, how did you unmount the filesystem to run repair on it? -Eric From owner-xfs@oss.sgi.com Sun Jul 6 20:06:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:06:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m67367GD023116 for ; Sun, 6 Jul 2008 20:06:07 -0700 X-ASG-Debug-ID: 1215400031-6a81033d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 546EA1883F98 for ; Sun, 6 Jul 2008 20:07:11 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id kARH4hED4YMVnG6O for ; Sun, 06 Jul 2008 20:07:11 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 079B18E00A2; Sun, 6 Jul 2008 20:09:56 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id E68EC8E007F; Sun, 6 Jul 2008 20:09:55 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Jul 2008 20:07:49 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Sun, 6 Jul 2008 20:07:48 -0700 Message-ID: <4871885B.6090208@pmc-sierra.com> Date: Mon, 07 Jul 2008 08:37:07 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> In-Reply-To: <487187D2.8080105@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Jul 2008 03:07:49.0001 (UTC) FILETIME=[A2F8D790:01C8DFDE] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215400031 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0894 1.0000 -1.4565 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.46 X-Barracuda-Spam-Status: No, SCORE=-1.46 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55350 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16758 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Sagar Borikar wrote: > > > >> There was no failure. Only the processes were stalled. System was >> operative. >> > > > I'm curious, if the processes were stalled, how did you unmount the > filesystem to run repair on it? > > -Eric > I ran with -n option. xfs_repair -fvn /root/test_partition Sagar From owner-xfs@oss.sgi.com Sun Jul 6 20:10:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:10:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m673Alnb023662 for ; Sun, 6 Jul 2008 20:10:47 -0700 X-ASG-Debug-ID: 1215400312-5ba503590000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BF1702BFA4D for ; Sun, 6 Jul 2008 20:11:52 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id GIlhASmqd3PyCso6 for ; Sun, 06 Jul 2008 20:11:52 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id B4FA0AC626B; Sun, 6 Jul 2008 22:11:51 -0500 (CDT) Message-ID: <48718977.1090005@sandeen.net> Date: Sun, 06 Jul 2008 22:11:51 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> In-Reply-To: <4871885B.6090208@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215400312 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0022 1.0000 -2.0063 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55350 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16759 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > > Eric Sandeen wrote: >> Sagar Borikar wrote: >> >> >> >>> There was no failure. Only the processes were stalled. System was >>> operative. >>> >> >> I'm curious, if the processes were stalled, how did you unmount the >> filesystem to run repair on it? >> >> -Eric >> > I ran with -n option. > > xfs_repair -fvn /root/test_partition oh.... So, you basically ran repair on a live, mounted filesystem; it's expected that it would not be consistent at this point. So, the errors you are seeing on this x86 are likely not related to those you see on mips. (the D state process might be interesting and worth looking into, but probably not related to the problem you're trying to solve.) -Eric From owner-xfs@oss.sgi.com Sun Jul 6 20:16:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:16:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m673G9Ol024457 for ; Sun, 6 Jul 2008 20:16:10 -0700 X-ASG-Debug-ID: 1215400633-762e02090000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 58B672BF940 for ; Sun, 6 Jul 2008 20:17:14 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id lR62va5hIcMAtFJE for ; Sun, 06 Jul 2008 20:17:14 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id AEFC18E007F; Sun, 6 Jul 2008 20:19:58 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id 94FC78E006F; Sun, 6 Jul 2008 20:19:58 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Jul 2008 20:17:52 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Sun, 6 Jul 2008 20:17:51 -0700 Message-ID: <48718AB6.80709@pmc-sierra.com> Date: Mon, 07 Jul 2008 08:47:10 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> <48718977.1090005@sandeen.net> In-Reply-To: <48718977.1090005@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Jul 2008 03:17:51.0888 (UTC) FILETIME=[0A521900:01C8DFE0] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215400634 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3640 1.0000 -0.1049 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.10 X-Barracuda-Spam-Status: No, SCORE=-0.10 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55352 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16760 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Sagar Borikar wrote: > >> Eric Sandeen wrote: >> >>> Sagar Borikar wrote: >>> >>> >>> >>> >>>> There was no failure. Only the processes were stalled. System was >>>> operative. >>>> >>>> >>> I'm curious, if the processes were stalled, how did you unmount the >>> filesystem to run repair on it? >>> >>> -Eric >>> >>> >> I ran with -n option. >> >> xfs_repair -fvn /root/test_partition >> > > oh.... > > So, you basically ran repair on a live, mounted filesystem; it's > expected that it would not be consistent at this point. > > So, the errors you are seeing on this x86 are likely not related to > those you see on mips. (the D state process might be interesting and > worth looking into, but probably not related to the problem you're > trying to solve.) > > -Eric > Ok. But then I was surprised as why the copy is not successful. Here is the ps output root 29200 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_16 root 29201 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_16 root 29202 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_14 root 29203 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_2 root 29204 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_9 root 29205 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_5 root 29206 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_3 root 29207 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_15 root 29208 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testdir_2 root 29209 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_12 root 29210 0.0 0.1 2088 644 ? D 01:41 0:00 cp -f testfile testfile_10 root 29211 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_4 root 29212 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_13 root 29213 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_20 root 29214 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testdir_20 root 29215 0.0 0.1 2088 656 ? D 01:41 0:00 cp -f testfile testdir_18 root 29216 0.0 0.1 2088 644 ? D 01:41 0:00 cp -f testfile testfile_13 root 29217 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testdir_1 root 29218 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_8 root 29219 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_11 root 29220 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_6 root 29221 0.0 0.1 2088 644 ? D 01:41 0:00 cp -f testfile testfile_6 root 29222 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_10 root 29223 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_14 root 29224 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_19 root 29225 0.0 0.1 2088 644 ? D 01:41 0:00 cp -f testfile testfile_12 root 29226 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_5 root 29227 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testdir_11 root 29228 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_8 root 29229 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_4 root 29230 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_17 root 29231 0.0 0.1 2088 644 ? D 01:41 0:00 cp -f testfile testfile_18 root 29232 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testdir_15 root 29233 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_7 root 29234 0.0 0.1 2088 644 ? D 01:41 0:00 cp -f testfile testfile_3 root 29235 0.0 0.1 2088 644 ? D 01:41 0:00 cp -f testfile testfile_1 root 29236 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_17 root 29237 0.0 0.1 2088 652 ? D 01:41 0:00 cp -f testfile testdir_7 root 29238 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testdir_19 root 29239 0.0 0.1 2088 648 ? D 01:41 0:00 cp -f testfile testfile_9 All the the copies are pending and file size in those directories is constant. It is not increasing. And as the processes are in D state, the file system is marked as busy and I can't unmount it. Thanks Sagar From owner-xfs@oss.sgi.com Sun Jul 6 20:21:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:21:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m673LL2c029637 for ; Sun, 6 Jul 2008 20:21:21 -0700 X-ASG-Debug-ID: 1215400945-2e3b00c80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 46EC62BFBA8 for ; Sun, 6 Jul 2008 20:22:25 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id WcOTXXLGD2ASU2ck for ; Sun, 06 Jul 2008 20:22:25 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 3C148AC626B; Sun, 6 Jul 2008 22:22:25 -0500 (CDT) Message-ID: <48718BF0.2040700@sandeen.net> Date: Sun, 06 Jul 2008 22:22:24 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> <48718977.1090005@sandeen.net> <48718AB6.80709@pmc-sierra.com> In-Reply-To: <48718AB6.80709@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215400946 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0201 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55352 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16761 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > All the the copies are pending and file size in those directories is > constant. It is not > increasing. > And as the processes are in D state, the file system is marked as busy > and I can't unmount > it. Understood. It looks like you've deadlocked somewhere. But, this is not the problem you are really trying to solve, right? You just were trying to recreate the mips problem on x86? If you want, do a sysrq-t to get traces of all those cp's to see where they're stuck, but this probably isn't getting you much closer to solving the original problem. (BTW: is this the exact same testcase that led to the block 0 access on mips which started this thread?) -Eric From owner-xfs@oss.sgi.com Sun Jul 6 20:41:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:41:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m673fBuA031071 for ; Sun, 6 Jul 2008 20:41:11 -0700 X-ASG-Debug-ID: 1215402135-66da02150000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AAB0A11DD133 for ; Sun, 6 Jul 2008 20:42:15 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id CxYPKGyvQnK50kqt for ; Sun, 06 Jul 2008 20:42:15 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 7429B8E007E; Sun, 6 Jul 2008 20:45:00 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id 5A9538E0078; Sun, 6 Jul 2008 20:45:00 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Jul 2008 20:42:53 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Sun, 6 Jul 2008 20:42:53 -0700 Message-ID: <48719093.3060907@pmc-sierra.com> Date: Mon, 07 Jul 2008 09:12:11 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> <48718977.1090005@sandeen.net> <48718AB6.80709@pmc-sierra.com> <48718BF0.2040700@sandeen.net> In-Reply-To: <48718BF0.2040700@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Jul 2008 03:42:53.0301 (UTC) FILETIME=[893B8A50:01C8DFE3] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215402135 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0017 1.0000 -2.0098 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55354 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16762 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Sagar Borikar wrote: > > >> All the the copies are pending and file size in those directories is >> constant. It is not >> increasing. >> And as the processes are in D state, the file system is marked as busy >> and I can't unmount >> it. >> > > Understood. It looks like you've deadlocked somewhere. But, this is > not the problem you are really trying to solve, right? You just were > trying to recreate the mips problem on x86? > That's right. The intention behind testing on 2.6.24 was to check whether we can imitate failure on x86 which is considered to be more robust. If we replicate the failure then there could be some issue in XFS and if the test passes then we can back port this kernel on MIPS ( Which any way I am doing with your patches ). But I faced similar deadlock on MIPS with exceptions which I posted earlier. > If you want, do a sysrq-t to get traces of all those cp's to see where > they're stuck, but this probably isn't getting you much closer to > solving the original problem. > > I'll keep you posted with it. > (BTW: is this the exact same testcase that led to the block 0 access on > mips which started this thread?) > > -Eric > Ok. So initially our multi client iozone stress test used to fail. But as it took 2-3 days to replicate the issue, I tried the test, standalone on MIPS and observed similar failures which I used to get in multi client test. The test is exactly same what I do in mutli client iozoen over network. Hence I came to conclusion that if we fix system to pass my test case then we can try iozone test with that fix. And now on x86 with 2.6.24, I am finding similar deadlock but the system is responsive and there are no lockups or exceptions. Do you observe similar failures on x86 at your setup? Also do you think the issues which I am seeing on x86 and MIPS are coming from the same sources? Thanks Sagar From owner-xfs@oss.sgi.com Sun Jul 6 20:46:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:46:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m673kCt7031638 for ; Sun, 6 Jul 2008 20:46:12 -0700 X-ASG-Debug-ID: 1215402436-01d7003d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A8D6C188380B for ; Sun, 6 Jul 2008 20:47:16 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 0BdF4mMcyb0Bmaua for ; Sun, 06 Jul 2008 20:47:16 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id E4C90AC626B; Sun, 6 Jul 2008 22:47:14 -0500 (CDT) Message-ID: <487191C2.6090803@sandeen.net> Date: Sun, 06 Jul 2008 22:47:14 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> <48718977.1090005@sandeen.net> <48718AB6.80709@pmc-sierra.com> <48718BF0.2040700@sandeen.net> <48719093.3060907@pmc-sierra.com> In-Reply-To: <48719093.3060907@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215402436 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0204 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55353 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16763 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > Ok. So initially our multi client iozone stress test used to fail. Are these multiple nfs clients? > But > as it took 2-3 days > to replicate the issue, I tried the test, standalone on MIPS and the iozone test again? > observed similar failures which > I used to get in multi client test. The test is exactly same what I do > in mutli client > iozoen over network. Hence I came to conclusion that if we fix system to > pass my test case > then we can try iozone test with that fix. And now on x86 with 2.6.24, > I am finding similar deadlock but > the system is responsive and there are no lockups or exceptions. Do you > observe similar failures on x86 > at your setup? So far I've not seen the deadlocks. > Also do you think the issues which I am seeing on x86 and > MIPS are coming from the > same sources? hard to say at this point, I think. -Eric > Thanks > Sagar > From owner-xfs@oss.sgi.com Sun Jul 6 20:57:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 20:57:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m673vrhx032597 for ; Sun, 6 Jul 2008 20:57:53 -0700 X-ASG-Debug-ID: 1215403137-01d300d40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E1FDC18840CB for ; Sun, 6 Jul 2008 20:58:57 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id s9slWUz4MS1Oh4mG for ; Sun, 06 Jul 2008 20:58:57 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 4164C8E009A; Sun, 6 Jul 2008 21:01:42 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id 272058E0092; Sun, 6 Jul 2008 21:01:42 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Jul 2008 20:59:35 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Sun, 6 Jul 2008 20:59:34 -0700 Message-ID: <4871947D.2090701@pmc-sierra.com> Date: Mon, 07 Jul 2008 09:28:53 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Dave Chinner , Nathan Scott , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <20080702051337.GX29319@disturbed> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> <48718977.1090005@sandeen.net> <48718AB6.80709@pmc-sierra.com> <48718BF0.2040700@sandeen.net> <48719093.3060907@pmc-sierra.com> <487191C2.6090803@sandeen .net> In-Reply-To: <487191C2.6090803@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Jul 2008 03:59:35.0200 (UTC) FILETIME=[DE693200:01C8DFE5] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215403137 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4715 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55355 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16764 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Sagar Borikar wrote: > > > >> Ok. So initially our multi client iozone stress test used to fail. >> > > Are these multiple nfs clients? > Actually mix of them. 15 CIFS clients, 4 NFS clients ( 19 iozone clients ) , 2 FTP clients, 4 HTTP transfers. ( Total 25 transactions simultaneously ) > >> But >> as it took 2-3 days >> to replicate the issue, I tried the test, standalone on MIPS and >> > > the iozone test again? > iozone test is continuously giving the access to block zero exception and xfs shutdown errors with transaction cancel exceptions plus alloc btree corruption exception which I reported earlier. And my test gives transaction cancel exception and block zero exception with processes under test in deadlock state on MIPS but on x86 there are no exceptions but only incomplete copies due to uninterruptible sleep state and deadlock. > >> observed similar failures which >> I used to get in multi client test. The test is exactly same what I do >> in mutli client >> iozoen over network. Hence I came to conclusion that if we fix system to >> pass my test case >> then we can try iozone test with that fix. And now on x86 with 2.6.24, >> I am finding similar deadlock but >> the system is responsive and there are no lockups or exceptions. Do you >> observe similar failures on x86 >> at your setup? >> > > So far I've not seen the deadlocks. > Could you kindly try with my test? I presume you should see failure soon. I tried this on 2 different x86 systems 2 times ( after rebooting the system ) and I saw it every time. > >> Also do you think the issues which I am seeing on x86 and >> MIPS are coming from the >> same sources? >> > > hard to say at this point, I think. > > -Eric > > >> Thanks >> Sagar >> >> > > From owner-xfs@oss.sgi.com Sun Jul 6 22:18:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 22:19:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m675IsOt004979 for ; Sun, 6 Jul 2008 22:18:54 -0700 X-ASG-Debug-ID: 1215407997-10de00d40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A0D182BFC61 for ; Sun, 6 Jul 2008 22:19:58 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id CTKRnfJhEA9qXN6N for ; Sun, 06 Jul 2008 22:19:58 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id A2E71A84DBF; Mon, 7 Jul 2008 00:19:57 -0500 (CDT) Message-ID: <4871A77D.7050803@sandeen.net> Date: Mon, 07 Jul 2008 00:19:57 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sagar Borikar CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <486B13AD.2010500@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> <48718977.1090005@sandeen.net> <48718AB6.80709@pmc-sierra.com> <48718BF0.2040700@sandeen.net> <48719093.3060907@pmc-sierra.com> <487191C2.6090803@sandeen .net> <4871947D.2090701@pmc-sierr a.com> In-Reply-To: <4871947D.2090701@pmc-sierra.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215407998 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0171 1.0000 -1.9097 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.91 X-Barracuda-Spam-Status: No, SCORE=-1.91 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55360 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16765 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sagar Borikar wrote: > Could you kindly try with my test? I presume you should see failure > soon. I tried this on > 2 different x86 systems 2 times ( after rebooting the system ) and I saw > it every time. Sure. Is there a reason you're doing this on a loopback file? That probably stresses the vm a bit more, and might get even trickier if the loopback file is sparse... But anyway, on an x86_64 machine with 2G of memory and a non-sparse 10G loopback file on 2.6.24.7-92.fc8, your test runs w/o problems for me, though the system does get sluggish. I let it run a bit then ran repair and it found no problems, I'll run it overnight to see if anything else turns up. -Eric From owner-xfs@oss.sgi.com Sun Jul 6 22:57:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 06 Jul 2008 22:57:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m675vWvw007372 for ; Sun, 6 Jul 2008 22:57:32 -0700 X-ASG-Debug-ID: 1215410316-37f4002f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta01.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 875942BFF3F for ; Sun, 6 Jul 2008 22:58:36 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (bby1mta01.pmc-sierra.com [216.241.235.116]) by cuda.sgi.com with ESMTP id 6HKEE6GcrHr6KaLH for ; Sun, 06 Jul 2008 22:58:36 -0700 (PDT) Received: from bby1mta01.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 8B5CF18900C2; Sun, 6 Jul 2008 23:01:52 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta01.pmc-sierra.bc.ca (Postfix) with SMTP id 7F420189009E; Sun, 6 Jul 2008 23:01:52 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Sun, 6 Jul 2008 22:59:14 -0700 Received: from [209.68.166.73] ([209.68.166.73]) by BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.2825); Sun, 6 Jul 2008 22:59:14 -0700 Message-ID: <4871B085.10902@pmc-sierra.com> Date: Mon, 07 Jul 2008 11:28:29 +0530 From: Sagar Borikar Organization: PMC Sierra Inc User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Xfs Access to block zero exception and system crash Subject: Re: Xfs Access to block zero exception and system crash References: <486B01A6.4030104@pmc-sierra.com> <1214979191.6025.22.camel@verge.scott.net.au> <20080702065652.GS14251@build-svl-1.agami.com> <486B6062.6040201@pmc-sierra.com> <486C4F89.9030009@sandeen.net> <486C6053.7010503@pmc-sierra.com> <486CE9EA.90502@sandeen.net> <486DF8F0.5010700@pmc-sierra.com> <20080704122726.GG29319@disturbed> <340C71CD25A7EB49BFA81AE8C839266702997641@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486E5F4D.1010009@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702997658@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <486FA095.1050106@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A084A6@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> <487117FC.9090109@sandeen.net> <4871872B.9060107@pmc-sierra.com> <487187D2.8080105@sandeen.net> <4871885B.6090208@pmc-sierra.com> <48718977.1090005@sandeen.net> <48718AB6.80709@pmc-sierra.com> <48718BF0.2040700@sandeen.net> <48719093.3060907@pmc-sierra.com> <487191C2.6090803@sandeen .net> <4871947D.2090701@pmc-sierr a.com> <4871A77D.7050803@sandeen. net> In-Reply-To: <4871A77D.7050803@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 07 Jul 2008 05:59:14.0342 (UTC) FILETIME=[95835460:01C8DFF6] X-Barracuda-Connect: bby1mta01.pmc-sierra.com[216.241.235.116] X-Barracuda-Start-Time: 1215410316 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1652 1.0000 -1.0159 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.02 X-Barracuda-Spam-Status: No, SCORE=-1.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55362 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16766 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sagar_borikar@pmc-sierra.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Sagar Borikar wrote: > > > >> Could you kindly try with my test? I presume you should see failure >> soon. I tried this on >> 2 different x86 systems 2 times ( after rebooting the system ) and I saw >> it every time. >> > > > Sure. Is there a reason you're doing this on a loopback file? That > probably stresses the vm a bit more, and might get even trickier if the > loopback file is sparse... > Initially I thought to do that since I didn't want to have a strict allocation limit but allowing allocations to grow as needed until the backing filesystem runs out of free space due to type of the test case I had. But then I dropped the plan and created a non-sparse loopback device. There was no specific reason to create loopback but as it was simplest option to do it. > But anyway, on an x86_64 machine with 2G of memory and a non-sparse 10G > loopback file on 2.6.24.7-92.fc8, your test runs w/o problems for me, > though the system does get sluggish. I let it run a bit then ran repair > and it found no problems, I'll run it overnight to see if anything else > turns up. > That will be great. Thanks indeed. Sagar > -Eric > From owner-xfs@oss.sgi.com Mon Jul 7 01:02:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 01:03:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6782rqG022479 for ; Mon, 7 Jul 2008 01:02:55 -0700 X-ASG-Debug-ID: 1215417837-23d502e00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mailgate02.web.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9FE7911DE847 for ; Mon, 7 Jul 2008 01:03:58 -0700 (PDT) Received: from mailgate02.web.de (mailgate02.web.de [217.72.192.252]) by cuda.sgi.com with ESMTP id vsgGyXW5HYa0GJus for ; Mon, 07 Jul 2008 01:03:58 -0700 (PDT) Received: by lxjbe.webde.local (Postfix, from userid 1000) id 7CCE341261; Mon, 7 Jul 2008 10:04:09 +0200 (CEST) (R201) Date: Mon, 7 Jul 2008 10:04:09 +0200 From: Jens Beyer To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS perfomance degradation on growing filesystem size Subject: Re: XFS perfomance degradation on growing filesystem size Message-ID: <20080707080409.GA18390@webde.de> References: <20080704064126.GA14847@webde.de> <20080704075941.GP16257@build-svl-1.agami.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080704075941.GP16257@build-svl-1.agami.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: mailgate02.web.de[217.72.192.252] X-Barracuda-Start-Time: 1215417838 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0449 1.0000 -1.7321 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.73 X-Barracuda-Spam-Status: No, SCORE=-1.73 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55370 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16767 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jens.beyer@1und1.de Precedence: bulk X-list: xfs On Fri, Jul 04, 2008 at 12:59:41AM -0700, Dave Chinner wrote: > On Fri, Jul 04, 2008 at 08:41:26AM +0200, Jens Beyer wrote: > > > > I have encountered a strange performance problem during some > > hardware evaluation tests: > > > > I am running a benchmark to measure especially random read/write > > I/O on an raid device and found that (under some circumstances) > > the performance of Random Read I/O is inverse proportional to the > > size of the tested XFS filesystem. > > > > In numbers this means that on a 100GB partition I get a throughput > > of ~25 MB/s and on the same hardware at 1TB FS size only 18 MB/s > > (and at 2+ TB like 14 MB/s) (absolute values depend on options, > > kernel version and are for random read i/o at 8k test block size). > > Of course - as the filesystem size grows, so does the amount of > each disk in use so the average seek distance increases and hence > read I/Os take longer. > But then - why does the rate of ext3 does not decrease and stays at the higher value? Thanks, Jens From owner-xfs@oss.sgi.com Mon Jul 7 02:44:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 02:44:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m679ihvx029797 for ; Mon, 7 Jul 2008 02:44:44 -0700 X-ASG-Debug-ID: 1215423947-6bbb02450000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.acc.umu.se (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D479B2C0A4B for ; Mon, 7 Jul 2008 02:45:48 -0700 (PDT) Received: from mail.acc.umu.se (mail.acc.umu.se [130.239.18.156]) by cuda.sgi.com with ESMTP id mVPIVcpnGjegrNPD for ; Mon, 07 Jul 2008 02:45:48 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by amavisd-new (Postfix) with ESMTP id 95603F59; Mon, 7 Jul 2008 11:45:46 +0200 (MEST) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at acc.umu.se Received: from shaka.acc.umu.se (shaka.acc.umu.se [130.239.18.148]) by mail.acc.umu.se (Postfix) with ESMTP id 4C836F58; Mon, 7 Jul 2008 11:45:45 +0200 (MEST) Received: by shaka.acc.umu.se (Postfix, from userid 23056) id 2126B35C; Mon, 7 Jul 2008 11:45:45 +0200 (MEST) Received: from localhost (localhost [127.0.0.1]) by shaka.acc.umu.se (Postfix) with ESMTP id 121F435B; Mon, 7 Jul 2008 11:45:45 +0200 (MEST) Date: Mon, 7 Jul 2008 11:45:44 +0200 (MEST) From: Mattias Wadenstein To: Justin Piszcz cc: Robert Hancock , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: Message-ID: References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: mail.acc.umu.se[130.239.18.156] X-Barracuda-Start-Time: 1215423948 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55376 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean X-archive-position: 16768 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: maswan@acc.umu.se Precedence: bulk X-list: xfs On Sat, 5 Jul 2008, Justin Piszcz wrote: > > > On Sat, 5 Jul 2008, Robert Hancock wrote: > >> Justin Piszcz wrote: >>>> Can you post your dmesg from bootup with the controller/drive detection? >> >> So you've got 6 drives in the machine. Intel chipsets normally seem pretty >> robust with AHCI. >> >> Are you certain that your machine has enough power to run all those drives >> properly? We've seen in a number of cases that power fluctuations or noise >> can cause these kinds of errors. > > I have a 650watt PSU (nice antec one) and the power draw of the box is > ~148watts w/ veliciraptors, ~250 when fully load all 4 cores + all 12 disks > writing. I have turned off the irqbalance daemon and I am going to see if > the problem re-occurs. Looking at the sum wattage number is really misleading for this. You need to dig out the specs for how many amps it can provide on the different voltages (5 and 12 volts). In particular, many modern PSUs have several separate 12V rails, where one (or more, some have the 12V supply split into 3 or 4 parts!) is used for CPU and GFX card power and usually only one is available for disks. You can also have plenty of 12V left but run out of 5V, or the other way around. I've spent quite some time trying to find a PSU that would handle 18 disks without costing too much. The splitting of the 12V power into separate rails and a general lack of 5V compared to what the disks need according to their specs just made it difficult, and I ended up bonding two PSUs together (linking the ground together with some custom cabling) to get a stable machine again. /Mattias Wadenstein From owner-xfs@oss.sgi.com Mon Jul 7 02:56:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 02:56:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m679uJVs030929 for ; Mon, 7 Jul 2008 02:56:19 -0700 X-ASG-Debug-ID: 1215424643-260a01d30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1650411E18B2 for ; Mon, 7 Jul 2008 02:57:23 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id 0K4iLmBazVSY5BZW for ; Mon, 07 Jul 2008 02:57:23 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 559225A56F; Mon, 7 Jul 2008 05:57:23 -0400 (EDT) Date: Mon, 7 Jul 2008 05:57:23 -0400 (EDT) From: Justin Piszcz To: Mattias Wadenstein cc: Robert Hancock , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, linux-ide@vger.kernel.org, xfs@oss.sgi.com, Alan Piszcz X-ASG-Orig-Subj: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) Subject: Re: Lots of con-current I/O = resets SATA link? (2.6.25.10) In-Reply-To: Message-ID: References: <486FBFAB.5050303@shaw.ca> <48700228.7060904@shaw.ca> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215424644 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55378 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16769 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Mon, 7 Jul 2008, Mattias Wadenstein wrote: > On Sat, 5 Jul 2008, Justin Piszcz wrote: > >> >> >> On Sat, 5 Jul 2008, Robert Hancock wrote: >> >>> Justin Piszcz wrote: >>>>> Can you post your dmesg from bootup with the controller/drive detection? >>> >>> So you've got 6 drives in the machine. Intel chipsets normally seem pretty >>> robust with AHCI. >>> >>> Are you certain that your machine has enough power to run all those drives >>> properly? We've seen in a number of cases that power fluctuations or noise >>> can cause these kinds of errors. >> >> I have a 650watt PSU (nice antec one) and the power draw of the box is >> ~148watts w/ veliciraptors, ~250 when fully load all 4 cores + all 12 disks >> writing. I have turned off the irqbalance daemon and I am going to see if >> the problem re-occurs. > > Looking at the sum wattage number is really misleading for this. You need to > dig out the specs for how many amps it can provide on the different voltages > (5 and 12 volts). In particular, many modern PSUs have several separate 12V > rails, where one (or more, some have the 12V supply split into 3 or 4 parts!) > is used for CPU and GFX card power and usually only one is available for > disks. > > You can also have plenty of 12V left but run out of 5V, or the other way > around. I've spent quite some time trying to find a PSU that would handle 18 > disks without costing too much. The splitting of the 12V power into separate > rails and a general lack of 5V compared to what the disks need according to > their specs just made it difficult, and I ended up bonding two PSUs together > (linking the ground together with some custom cabling) to get a stable > machine again. > > /Mattias Wadenstein > Good info here indeed but for my case it does not apply. I used to have Raptor150s (12 of them on the same host) the ONLY thing that changed was the drives themselves. And it used to use 150-250 watts (the 3.5" suck up a lot more power) the power cables are also exactly the same as they were on the Raptor 150s and I never had any issues. I have two hosts, pretty much idential, I use the Antec TruePower Trio 650 in each of them. http://www.antec.com/us/productDetails.php?ProdID=23650 Justin. From owner-xfs@oss.sgi.com Mon Jul 7 04:28:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 04:28:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m67BSjbC009809 for ; Mon, 7 Jul 2008 04:28:47 -0700 Received: from tim-shimmins-mac-mini.local (melb-sw-corp-251-5.corp.sgi.com [134.15.251.5]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA23814; Mon, 7 Jul 2008 21:29:38 +1000 Message-ID: <4871FE21.9020609@sgi.com> Date: Mon, 07 Jul 2008 21:29:37 +1000 From: Tim Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 1/3] split out xfs value-add from xfs_setattr References: <20080627154553.GA31476@lst.de> In-Reply-To: <20080627154553.GA31476@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16770 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christoph, I've gone thru this and it looks good to me. However, there is enough stuff which was extracted and duplicated from different places in xfs_setattr to easily miss something (IMHO) and so we would need to test this carefully I reckon. I'll have a look at the other 2 patches tomorrow. Below are my notes: * remove related code to quota, xflags, etc from xfs_setattr * duplicate support code from xfs_setattr * I need to compare old xfs_setattr() with xfs_ioctl_setattr() to check that the code is still doing the same thing for the relevant cases... * The "can't change extent size test" is duplicated as we split up the predicate of EXTSIZE and XFLAGS into two Okay * xfs_trans_log_inode doesn't need to be called in 2 spots now it can be done after the di_extsize and the set_diflags spot and no need for just after the projid one. Okay * And we just call xfs_ichgtime directly instead of noting a timeflag Okay * commit_flags are zero as are non-zero for AT_SIZE changes which we don't deal with here Okay * This code is different: + if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE)) { + XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL, + NULL, DM_RIGHT_NULL, NULL, NULL, 0, 0, + (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); + } + + vn_revalidate(XFS_ITOV(ip)); /* update flags */ Q: What happened to the ATTR_DMI flag testing? A: We never set ATTR_DMI in the flags by the ioctls. Okay cool. Q: Why have you introduced the vn_revalidate? A: Because you took it out of the callers to xfs_ioctl_setattr. Okay * So XFS_AT_ALL and XFS_AT_STAT are not used currently Okay --Tim Christoph Hellwig wrote: > xfs_setattr currently doesn't just handle the attributes set through > ->setattr but also addition XFS-specific attributes: project id, inode > flags and extent size hint. Having these in a single function makes it > more complicated and forces to have us a bhv_vattr intermediate > structure eating up stackspace. > > This patch adds a new xfs_ioctl_setattr helper for the XFS ioctls that > set these attributes and remove the code to set them through > xfs_setattr. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-06-15 16:41:09.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-06-15 16:42:18.000000000 +0200 > @@ -47,6 +47,8 @@ > #include "xfs_dfrag.h" > #include "xfs_fsops.h" > #include "xfs_vnodeops.h" > +#include "xfs_quota.h" > +#include "xfs_inode_item.h" > > #include > #include > @@ -875,6 +877,297 @@ xfs_ioc_fsgetxattr( > return 0; > } > > +STATIC void > +xfs_set_diflags( > + struct xfs_inode *ip, > + unsigned int xflags) > +{ > + unsigned int di_flags; > + > + /* can't set PREALLOC this way, just preserve it */ > + di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC); > + if (xflags & XFS_XFLAG_IMMUTABLE) > + di_flags |= XFS_DIFLAG_IMMUTABLE; > + if (xflags & XFS_XFLAG_APPEND) > + di_flags |= XFS_DIFLAG_APPEND; > + if (xflags & XFS_XFLAG_SYNC) > + di_flags |= XFS_DIFLAG_SYNC; > + if (xflags & XFS_XFLAG_NOATIME) > + di_flags |= XFS_DIFLAG_NOATIME; > + if (xflags & XFS_XFLAG_NODUMP) > + di_flags |= XFS_DIFLAG_NODUMP; > + if (xflags & XFS_XFLAG_PROJINHERIT) > + di_flags |= XFS_DIFLAG_PROJINHERIT; > + if (xflags & XFS_XFLAG_NODEFRAG) > + di_flags |= XFS_DIFLAG_NODEFRAG; > + if (xflags & XFS_XFLAG_FILESTREAM) > + di_flags |= XFS_DIFLAG_FILESTREAM; > + if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { > + if (xflags & XFS_XFLAG_RTINHERIT) > + di_flags |= XFS_DIFLAG_RTINHERIT; > + if (xflags & XFS_XFLAG_NOSYMLINKS) > + di_flags |= XFS_DIFLAG_NOSYMLINKS; > + if (xflags & XFS_XFLAG_EXTSZINHERIT) > + di_flags |= XFS_DIFLAG_EXTSZINHERIT; > + } else if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) { > + if (xflags & XFS_XFLAG_REALTIME) > + di_flags |= XFS_DIFLAG_REALTIME; > + if (xflags & XFS_XFLAG_EXTSIZE) > + di_flags |= XFS_DIFLAG_EXTSIZE; > + } > + > + ip->i_d.di_flags = di_flags; > +} > + > + > +#define FSX_PROJID 1 > +#define FSX_EXTSIZE 2 > +#define FSX_XFLAGS 4 > +#define FSX_NONBLOCK 8 > + > +STATIC int > +xfs_ioctl_setattr( > + xfs_inode_t *ip, > + struct fsxattr *fa, > + int mask) > +{ > + struct xfs_mount *mp = ip->i_mount; > + struct xfs_trans *tp; > + unsigned int lock_flags = 0; > + struct xfs_dquot *udqp = NULL, *gdqp = NULL; > + struct xfs_dquot *olddquot = NULL; > + int code; > + > + xfs_itrace_entry(ip); > + > + if (mp->m_flags & XFS_MOUNT_RDONLY) > + return XFS_ERROR(EROFS); > + if (XFS_FORCED_SHUTDOWN(mp)) > + return XFS_ERROR(EIO); > + > + /* > + * If disk quotas is on, we make sure that the dquots do exist on disk, > + * before we start any other transactions. Trying to do this later > + * is messy. We don't care to take a readlock to look at the ids > + * in inode here, because we can't hold it across the trans_reserve. > + * If the IDs do change before we take the ilock, we're covered > + * because the i_*dquot fields will get updated anyway. > + */ > + if (XFS_IS_QUOTA_ON(mp) && (mask & FSX_PROJID)) { > + code = XFS_QM_DQVOPALLOC(mp, ip, ip->i_d.di_uid, > + ip->i_d.di_gid, fa->fsx_projid, > + XFS_QMOPT_PQUOTA, &udqp, &gdqp); > + if (code) > + return code; > + } > + > + /* > + * For the other attributes, we acquire the inode lock and > + * first do an error checking pass. > + */ > + tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); > + code = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0); > + if (code) > + goto error_return; > + > + lock_flags = XFS_ILOCK_EXCL; > + xfs_ilock(ip, lock_flags); > + > + /* > + * CAP_FOWNER overrides the following restrictions: > + * > + * The user ID of the calling process must be equal > + * to the file owner ID, except in cases where the > + * CAP_FSETID capability is applicable. > + */ > + if (current->fsuid != ip->i_d.di_uid && !capable(CAP_FOWNER)) { > + code = XFS_ERROR(EPERM); > + goto error_return; > + } > + > + /* > + * Do a quota reservation only if projid is actually going to change. > + */ > + if (mask & FSX_PROJID) { > + if (XFS_IS_PQUOTA_ON(mp) && > + ip->i_d.di_projid != fa->fsx_projid) { > + ASSERT(tp); > + code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp, > + capable(CAP_FOWNER) ? > + XFS_QMOPT_FORCE_RES : 0); > + if (code) /* out of quota */ > + goto error_return; > + } > + } > + > + if (mask & FSX_EXTSIZE) { > + /* > + * Can't change extent size if any extents are allocated. > + */ > + if (ip->i_d.di_nextents && > + ((ip->i_d.di_extsize << mp->m_sb.sb_blocklog) != > + fa->fsx_extsize)) { > + code = XFS_ERROR(EINVAL); /* EFBIG? */ > + goto error_return; > + } > + > + /* > + * Extent size must be a multiple of the appropriate block > + * size, if set at all. > + */ > + if (fa->fsx_extsize != 0) { > + xfs_extlen_t size; > + > + if (XFS_IS_REALTIME_INODE(ip) || > + ((mask & FSX_XFLAGS) && > + (fa->fsx_xflags & XFS_XFLAG_REALTIME))) { > + size = mp->m_sb.sb_rextsize << > + mp->m_sb.sb_blocklog; > + } else { > + size = mp->m_sb.sb_blocksize; > + } > + > + if (fa->fsx_extsize % size) { > + code = XFS_ERROR(EINVAL); > + goto error_return; > + } > + } > + } > + > + > + if (mask & FSX_XFLAGS) { > + /* > + * Can't change realtime flag if any extents are allocated. > + */ > + if ((ip->i_d.di_nextents || ip->i_delayed_blks) && > + (XFS_IS_REALTIME_INODE(ip)) != > + (fa->fsx_xflags & XFS_XFLAG_REALTIME)) { > + code = XFS_ERROR(EINVAL); /* EFBIG? */ > + goto error_return; > + } > + > + /* > + * If realtime flag is set then must have realtime data. > + */ > + if ((fa->fsx_xflags & XFS_XFLAG_REALTIME)) { > + if ((mp->m_sb.sb_rblocks == 0) || > + (mp->m_sb.sb_rextsize == 0) || > + (ip->i_d.di_extsize % mp->m_sb.sb_rextsize)) { > + code = XFS_ERROR(EINVAL); > + goto error_return; > + } > + } > + > + /* > + * Can't modify an immutable/append-only file unless > + * we have appropriate permission. > + */ > + if ((ip->i_d.di_flags & > + (XFS_DIFLAG_IMMUTABLE|XFS_DIFLAG_APPEND) || > + (fa->fsx_xflags & > + (XFS_XFLAG_IMMUTABLE | XFS_XFLAG_APPEND))) && > + !capable(CAP_LINUX_IMMUTABLE)) { > + code = XFS_ERROR(EPERM); > + goto error_return; > + } > + } > + > + xfs_trans_ijoin(tp, ip, lock_flags); > + xfs_trans_ihold(tp, ip); > + > + /* > + * Change file ownership. Must be the owner or privileged. > + * If the system was configured with the "restricted_chown" > + * option, the owner is not permitted to give away the file, > + * and can change the group id only to a group of which he > + * or she is a member. > + */ > + if (mask & FSX_PROJID) { > + /* > + * CAP_FSETID overrides the following restrictions: > + * > + * The set-user-ID and set-group-ID bits of a file will be > + * cleared upon successful return from chown() > + */ > + if ((ip->i_d.di_mode & (S_ISUID|S_ISGID)) && > + !capable(CAP_FSETID)) > + ip->i_d.di_mode &= ~(S_ISUID|S_ISGID); > + > + /* > + * Change the ownerships and register quota modifications > + * in the transaction. > + */ > + if (ip->i_d.di_projid != fa->fsx_projid) { > + if (XFS_IS_PQUOTA_ON(mp)) { > + olddquot = XFS_QM_DQVOPCHOWN(mp, tp, ip, > + &ip->i_gdquot, gdqp); > + } > + ip->i_d.di_projid = fa->fsx_projid; > + > + /* > + * We may have to rev the inode as well as > + * the superblock version number since projids didn't > + * exist before DINODE_VERSION_2 and SB_VERSION_NLINK. > + */ > + if (ip->i_d.di_version == XFS_DINODE_VERSION_1) > + xfs_bump_ino_vers2(tp, ip); > + } > + > + } > + > + if (mask & FSX_EXTSIZE) > + ip->i_d.di_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog; > + if (mask & FSX_XFLAGS) > + xfs_set_diflags(ip, fa->fsx_xflags); > + > + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > + xfs_ichgtime(ip, XFS_ICHGTIME_CHG); > + > + XFS_STATS_INC(xs_ig_attrchg); > + > + /* > + * If this is a synchronous mount, make sure that the > + * transaction goes to disk before returning to the user. > + * This is slightly sub-optimal in that truncates require > + * two sync transactions instead of one for wsync filesystems. > + * One for the truncate and one for the timestamps since we > + * don't want to change the timestamps unless we're sure the > + * truncate worked. Truncates are less than 1% of the laddis > + * mix so this probably isn't worth the trouble to optimize. > + */ > + if (mp->m_flags & XFS_MOUNT_WSYNC) > + xfs_trans_set_sync(tp); > + code = xfs_trans_commit(tp, 0); > + xfs_iunlock(ip, lock_flags); > + > + /* > + * Release any dquot(s) the inode had kept before chown. > + */ > + XFS_QM_DQRELE(mp, olddquot); > + XFS_QM_DQRELE(mp, udqp); > + XFS_QM_DQRELE(mp, gdqp); > + > + if (code) > + return code; > + > + if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE)) { > + XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL, > + NULL, DM_RIGHT_NULL, NULL, NULL, 0, 0, > + (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); > + } > + > + vn_revalidate(XFS_ITOV(ip)); /* update flags */ > + return 0; > + > + error_return: > + XFS_QM_DQRELE(mp, udqp); > + XFS_QM_DQRELE(mp, gdqp); > + xfs_trans_cancel(tp, 0); > + if (lock_flags) > + xfs_iunlock(ip, lock_flags); > + return code; > +} > + > STATIC int > xfs_ioc_fssetxattr( > xfs_inode_t *ip, > @@ -882,31 +1175,16 @@ xfs_ioc_fssetxattr( > void __user *arg) > { > struct fsxattr fa; > - struct bhv_vattr *vattr; > - int error; > - int attr_flags; > + unsigned int mask; > > if (copy_from_user(&fa, arg, sizeof(fa))) > return -EFAULT; > > - vattr = kmalloc(sizeof(*vattr), GFP_KERNEL); > - if (unlikely(!vattr)) > - return -ENOMEM; > - > - attr_flags = 0; > + mask = FSX_XFLAGS | FSX_EXTSIZE | FSX_PROJID; > if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) > - attr_flags |= ATTR_NONBLOCK; > + mask |= FSX_NONBLOCK; > > - vattr->va_mask = XFS_AT_XFLAGS | XFS_AT_EXTSIZE | XFS_AT_PROJID; > - vattr->va_xflags = fa.fsx_xflags; > - vattr->va_extsize = fa.fsx_extsize; > - vattr->va_projid = fa.fsx_projid; > - > - error = -xfs_setattr(ip, vattr, attr_flags, NULL); > - if (!error) > - vn_revalidate(XFS_ITOV(ip)); /* update flags */ > - kfree(vattr); > - return 0; > + return -xfs_ioctl_setattr(ip, &fa, mask); > } > > STATIC int > @@ -928,10 +1206,9 @@ xfs_ioc_setxflags( > struct file *filp, > void __user *arg) > { > - struct bhv_vattr *vattr; > + struct fsxattr fa; > unsigned int flags; > - int attr_flags; > - int error; > + unsigned int mask; > > if (copy_from_user(&flags, arg, sizeof(flags))) > return -EFAULT; > @@ -941,22 +1218,12 @@ xfs_ioc_setxflags( > FS_SYNC_FL)) > return -EOPNOTSUPP; > > - vattr = kmalloc(sizeof(*vattr), GFP_KERNEL); > - if (unlikely(!vattr)) > - return -ENOMEM; > - > - attr_flags = 0; > + mask = FSX_XFLAGS; > if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) > - attr_flags |= ATTR_NONBLOCK; > + mask |= FSX_NONBLOCK; > + fa.fsx_xflags = xfs_merge_ioc_xflags(flags, xfs_ip2xflags(ip)); > > - vattr->va_mask = XFS_AT_XFLAGS; > - vattr->va_xflags = xfs_merge_ioc_xflags(flags, xfs_ip2xflags(ip)); > - > - error = -xfs_setattr(ip, vattr, attr_flags, NULL); > - if (likely(!error)) > - vn_revalidate(XFS_ITOV(ip)); /* update flags */ > - kfree(vattr); > - return error; > + return -xfs_ioctl_setattr(ip, &fa, mask); > } > > STATIC int > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-06-15 17:32:14.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-06-15 17:35:44.000000000 +0200 > @@ -117,26 +117,11 @@ typedef struct bhv_vattr { > #define XFS_AT_ACL 0x00080000 > #define XFS_AT_CAP 0x00100000 > #define XFS_AT_INF 0x00200000 > -#define XFS_AT_XFLAGS 0x00400000 > -#define XFS_AT_EXTSIZE 0x00800000 > #define XFS_AT_NEXTENTS 0x01000000 > #define XFS_AT_ANEXTENTS 0x02000000 > -#define XFS_AT_PROJID 0x04000000 > #define XFS_AT_SIZE_NOPERM 0x08000000 > #define XFS_AT_GENCOUNT 0x10000000 > > -#define XFS_AT_ALL (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\ > - XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\ > - XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\ > - XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|XFS_AT_MAC|\ > - XFS_AT_ACL|XFS_AT_CAP|XFS_AT_INF|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|\ > - XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_PROJID|XFS_AT_GENCOUNT) > - > -#define XFS_AT_STAT (XFS_AT_TYPE|XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID|\ > - XFS_AT_FSID|XFS_AT_NODEID|XFS_AT_NLINK|XFS_AT_SIZE|\ > - XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME|XFS_AT_RDEV|\ > - XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_PROJID) > - > #define XFS_AT_TIMES (XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME) > > #define XFS_AT_UPDTIMES (XFS_AT_UPDATIME|XFS_AT_UPDMTIME|XFS_AT_UPDCTIME) > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-06-15 17:32:42.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-06-15 17:39:09.000000000 +0200 > @@ -94,7 +94,6 @@ xfs_setattr( > uid_t uid=0, iuid=0; > gid_t gid=0, igid=0; > int timeflags = 0; > - xfs_prid_t projid=0, iprojid=0; > struct xfs_dquot *udqp, *gdqp, *olddquot1, *olddquot2; > int file_owner; > int need_iolock = 1; > @@ -139,8 +138,7 @@ xfs_setattr( > * If the IDs do change before we take the ilock, we're covered > * because the i_*dquot fields will get updated anyway. > */ > - if (XFS_IS_QUOTA_ON(mp) && > - (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID))) { > + if (XFS_IS_QUOTA_ON(mp) && (mask & (XFS_AT_UID|XFS_AT_GID))) { > uint qflags = 0; > > if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) { > @@ -155,12 +153,7 @@ xfs_setattr( > } else { > gid = ip->i_d.di_gid; > } > - if ((mask & XFS_AT_PROJID) && XFS_IS_PQUOTA_ON(mp)) { > - projid = vap->va_projid; > - qflags |= XFS_QMOPT_PQUOTA; > - } else { > - projid = ip->i_d.di_projid; > - } > + > /* > * We take a reference when we initialize udqp and gdqp, > * so it is important that we never blindly double trip on > @@ -168,8 +161,8 @@ xfs_setattr( > */ > ASSERT(udqp == NULL); > ASSERT(gdqp == NULL); > - code = XFS_QM_DQVOPALLOC(mp, ip, uid, gid, projid, qflags, > - &udqp, &gdqp); > + code = XFS_QM_DQVOPALLOC(mp, ip, uid, gid, ip->i_d.di_projid, > + qflags, &udqp, &gdqp); > if (code) > return code; > } > @@ -219,9 +212,7 @@ xfs_setattr( > * Only the owner or users with CAP_FOWNER > * capability may do these things. > */ > - if (mask & > - (XFS_AT_MODE|XFS_AT_XFLAGS|XFS_AT_EXTSIZE|XFS_AT_UID| > - XFS_AT_GID|XFS_AT_PROJID)) { > + if (mask & (XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID)) { > /* > * CAP_FOWNER overrides the following restrictions: > * > @@ -270,7 +261,7 @@ xfs_setattr( > * and can change the group id only to a group of which he > * or she is a member. > */ > - if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID)) { > + if (mask & (XFS_AT_UID|XFS_AT_GID)) { > /* > * These IDs could have changed since we last looked at them. > * But, we're assured that if the ownership did change > @@ -278,12 +269,9 @@ xfs_setattr( > * would have changed also. > */ > iuid = ip->i_d.di_uid; > - iprojid = ip->i_d.di_projid; > igid = ip->i_d.di_gid; > gid = (mask & XFS_AT_GID) ? vap->va_gid : igid; > uid = (mask & XFS_AT_UID) ? vap->va_uid : iuid; > - projid = (mask & XFS_AT_PROJID) ? (xfs_prid_t)vap->va_projid : > - iprojid; > > /* > * CAP_CHOWN overrides the following restrictions: > @@ -303,11 +291,10 @@ xfs_setattr( > goto error_return; > } > /* > - * Do a quota reservation only if uid/projid/gid is actually > + * Do a quota reservation only if uid/gid is actually > * going to change. > */ > if ((XFS_IS_UQUOTA_ON(mp) && iuid != uid) || > - (XFS_IS_PQUOTA_ON(mp) && iprojid != projid) || > (XFS_IS_GQUOTA_ON(mp) && igid != gid)) { > ASSERT(tp); > code = XFS_QM_DQVOPCHOWNRESV(mp, tp, ip, udqp, gdqp, > @@ -361,78 +348,6 @@ xfs_setattr( > } > > /* > - * Change extent size or realtime flag. > - */ > - if (mask & (XFS_AT_EXTSIZE|XFS_AT_XFLAGS)) { > - /* > - * Can't change extent size if any extents are allocated. > - */ > - if (ip->i_d.di_nextents && (mask & XFS_AT_EXTSIZE) && > - ((ip->i_d.di_extsize << mp->m_sb.sb_blocklog) != > - vap->va_extsize) ) { > - code = XFS_ERROR(EINVAL); /* EFBIG? */ > - goto error_return; > - } > - > - /* > - * Can't change realtime flag if any extents are allocated. > - */ > - if ((ip->i_d.di_nextents || ip->i_delayed_blks) && > - (mask & XFS_AT_XFLAGS) && > - (XFS_IS_REALTIME_INODE(ip)) != > - (vap->va_xflags & XFS_XFLAG_REALTIME)) { > - code = XFS_ERROR(EINVAL); /* EFBIG? */ > - goto error_return; > - } > - /* > - * Extent size must be a multiple of the appropriate block > - * size, if set at all. > - */ > - if ((mask & XFS_AT_EXTSIZE) && vap->va_extsize != 0) { > - xfs_extlen_t size; > - > - if (XFS_IS_REALTIME_INODE(ip) || > - ((mask & XFS_AT_XFLAGS) && > - (vap->va_xflags & XFS_XFLAG_REALTIME))) { > - size = mp->m_sb.sb_rextsize << > - mp->m_sb.sb_blocklog; > - } else { > - size = mp->m_sb.sb_blocksize; > - } > - if (vap->va_extsize % size) { > - code = XFS_ERROR(EINVAL); > - goto error_return; > - } > - } > - /* > - * If realtime flag is set then must have realtime data. > - */ > - if ((mask & XFS_AT_XFLAGS) && > - (vap->va_xflags & XFS_XFLAG_REALTIME)) { > - if ((mp->m_sb.sb_rblocks == 0) || > - (mp->m_sb.sb_rextsize == 0) || > - (ip->i_d.di_extsize % mp->m_sb.sb_rextsize)) { > - code = XFS_ERROR(EINVAL); > - goto error_return; > - } > - } > - > - /* > - * Can't modify an immutable/append-only file unless > - * we have appropriate permission. > - */ > - if ((mask & XFS_AT_XFLAGS) && > - (ip->i_d.di_flags & > - (XFS_DIFLAG_IMMUTABLE|XFS_DIFLAG_APPEND) || > - (vap->va_xflags & > - (XFS_XFLAG_IMMUTABLE | XFS_XFLAG_APPEND))) && > - !capable(CAP_LINUX_IMMUTABLE)) { > - code = XFS_ERROR(EPERM); > - goto error_return; > - } > - } > - > - /* > * Now we can make the changes. Before we join the inode > * to the transaction, if XFS_AT_SIZE is set then take care of > * the part of the truncation that must be done without the > @@ -568,7 +483,7 @@ xfs_setattr( > * and can change the group id only to a group of which he > * or she is a member. > */ > - if (mask & (XFS_AT_UID|XFS_AT_GID|XFS_AT_PROJID)) { > + if (mask & (XFS_AT_UID|XFS_AT_GID)) { > /* > * CAP_FSETID overrides the following restrictions: > * > @@ -603,23 +518,6 @@ xfs_setattr( > } > ip->i_d.di_gid = gid; > } > - if (iprojid != projid) { > - if (XFS_IS_PQUOTA_ON(mp)) { > - ASSERT(!XFS_IS_GQUOTA_ON(mp)); > - ASSERT(mask & XFS_AT_PROJID); > - ASSERT(gdqp); > - olddquot2 = XFS_QM_DQVOPCHOWN(mp, tp, ip, > - &ip->i_gdquot, gdqp); > - } > - ip->i_d.di_projid = projid; > - /* > - * We may have to rev the inode as well as > - * the superblock version number since projids didn't > - * exist before DINODE_VERSION_2 and SB_VERSION_NLINK. > - */ > - if (ip->i_d.di_version == XFS_DINODE_VERSION_1) > - xfs_bump_ino_vers2(tp, ip); > - } > > xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); > timeflags |= XFS_ICHGTIME_CHG; > @@ -647,57 +545,6 @@ xfs_setattr( > } > > /* > - * Change XFS-added attributes. > - */ > - if (mask & (XFS_AT_EXTSIZE|XFS_AT_XFLAGS)) { > - if (mask & XFS_AT_EXTSIZE) { > - /* > - * Converting bytes to fs blocks. > - */ > - ip->i_d.di_extsize = vap->va_extsize >> > - mp->m_sb.sb_blocklog; > - } > - if (mask & XFS_AT_XFLAGS) { > - uint di_flags; > - > - /* can't set PREALLOC this way, just preserve it */ > - di_flags = (ip->i_d.di_flags & XFS_DIFLAG_PREALLOC); > - if (vap->va_xflags & XFS_XFLAG_IMMUTABLE) > - di_flags |= XFS_DIFLAG_IMMUTABLE; > - if (vap->va_xflags & XFS_XFLAG_APPEND) > - di_flags |= XFS_DIFLAG_APPEND; > - if (vap->va_xflags & XFS_XFLAG_SYNC) > - di_flags |= XFS_DIFLAG_SYNC; > - if (vap->va_xflags & XFS_XFLAG_NOATIME) > - di_flags |= XFS_DIFLAG_NOATIME; > - if (vap->va_xflags & XFS_XFLAG_NODUMP) > - di_flags |= XFS_DIFLAG_NODUMP; > - if (vap->va_xflags & XFS_XFLAG_PROJINHERIT) > - di_flags |= XFS_DIFLAG_PROJINHERIT; > - if (vap->va_xflags & XFS_XFLAG_NODEFRAG) > - di_flags |= XFS_DIFLAG_NODEFRAG; > - if (vap->va_xflags & XFS_XFLAG_FILESTREAM) > - di_flags |= XFS_DIFLAG_FILESTREAM; > - if ((ip->i_d.di_mode & S_IFMT) == S_IFDIR) { > - if (vap->va_xflags & XFS_XFLAG_RTINHERIT) > - di_flags |= XFS_DIFLAG_RTINHERIT; > - if (vap->va_xflags & XFS_XFLAG_NOSYMLINKS) > - di_flags |= XFS_DIFLAG_NOSYMLINKS; > - if (vap->va_xflags & XFS_XFLAG_EXTSZINHERIT) > - di_flags |= XFS_DIFLAG_EXTSZINHERIT; > - } else if ((ip->i_d.di_mode & S_IFMT) == S_IFREG) { > - if (vap->va_xflags & XFS_XFLAG_REALTIME) > - di_flags |= XFS_DIFLAG_REALTIME; > - if (vap->va_xflags & XFS_XFLAG_EXTSIZE) > - di_flags |= XFS_DIFLAG_EXTSIZE; > - } > - ip->i_d.di_flags = di_flags; > - } > - xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > - timeflags |= XFS_ICHGTIME_CHG; > - } > - > - /* > * Change file inode change time only if XFS_AT_CTIME set > * AND we have been called by a DMI function. > */ > From owner-xfs@oss.sgi.com Mon Jul 7 11:30:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 11:31:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_27 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m67IUtIY013065 for ; Mon, 7 Jul 2008 11:30:55 -0700 X-ASG-Debug-ID: 1215455519-70a603190000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 068782C3489 for ; Mon, 7 Jul 2008 11:31:59 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id Gt7spVsUoU5KWIuD for ; Mon, 07 Jul 2008 11:31:59 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 8B33B5A568; Mon, 7 Jul 2008 14:31:58 -0400 (EDT) Date: Mon, 7 Jul 2008 14:31:57 -0400 (EDT) From: Justin Piszcz To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Subject: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Message-ID: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215455520 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55412 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16771 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs Each PCI-e x1 card has 1 veliciraptor on it now. Got an x4 card wit 4 sata ports: Not quite the > 1 gbyte/sec I was hoping for in regards to the reads but pretty close! (For my RAID5) Previously my write was limited to 400-420MiB/s now I see an additional 120-125 MiB/s increase! jpiszcz@p34:/x/f$ dd if=/dev/zero of=bigfile bs=1M count=10240 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 20.7054 s, 519 MB/s jpiszcz@p34:/x/f$ sync jpiszcz@p34:/x/f$ dd if=/dev/zero of=bigfile.1 bs=1M count=10240 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 20.4973 s, 524 MB/s jpiszcz@p34:/x/f$ sync jpiszcz@p34:/x/f$ dd if=bigfile of=/dev/null bs=1M count=10240 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 11.3529 s, 946 MB/s jpiszcz@p34:/x/f$ sync jpiszcz@p34:/x/f$ dd if=bigfile.1 of=/dev/null bs=1M count=10240 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 11.2635 s, 953 MB/s jpiszcz@p34:/x/f$ -- For all disks: Something I noticed is the x1 PCI-e cards are doing around 68MiB/s each for 3 of them where the x4 has no issue pumping out 100MiB/s+ without a problem, however keep in mind the bus is probably already taxed from the 6 sata drives on the southbridge. vmstat output: procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu---- 1 VR 0 1 160 45220 341772 6480468 0 0 122112 0 584 2082 1 7 73 20 0 1 160 46592 455436 6362088 0 0 113664 0 495 1968 0 4 74 21 2 VR 1 1 160 45540 3027724 3720340 0 0 243216 0 1006 4030 0 9 74 17 0 2 160 44988 3262220 3480648 0 0 234480 0 1008 4134 0 8 73 19 3 VR 1 2 160 44816 6600068 50476 0 0 330248 16 1342 4126 0 12 70 18 0 3 160 45440 6599812 50264 0 0 316032 8 1296 3878 0 12 72 17 4 VR 0 4 160 44504 6602488 47644 0 0 495232 0 1992 6081 0 20 57 23 1 3 160 45500 6602796 45980 0 0 483968 0 1915 6207 0 20 54 26 5 VR 1 5 160 43932 6602972 45304 0 0 606080 0 2375 6622 0 25 56 19 1 4 160 45412 6601852 45160 0 0 618756 0 2431 6791 0 25 53 21 6 VR 0 6 160 45000 6602348 44512 0 0 683904 8 2746 7880 0 31 42 27 0 6 160 45248 6602028 44460 0 0 705792 0 2754 7564 0 31 45 24 7 VR 2 6 160 46744 6599020 44688 0 0 748204 17 3042 9084 0 34 40 26 3 6 160 46592 6598824 44372 0 0 747520 8 2975 9047 1 33 31 36 8 VR 2 7 160 46512 6598612 44580 0 0 761184 16 3089 9937 0 36 40 24 2 7 160 44528 6600392 44360 0 0 759720 8 2993 9522 0 36 36 28 9 VR 2 8 160 47152 6596824 44572 0 0 767016 0 3075 9730 1 37 39 24 2 7 160 46576 6597728 44688 0 0 771200 0 3032 9568 0 37 40 23 10 VR 0 10 160 45048 6598240 44428 0 0 889072 8 3599 11561 0 47 20 33 2 10 160 45232 6598116 44772 0 0 890112 0 3495 11547 0 46 23 31 11 VR 4 8 160 45536 6594716 44600 0 0 996352 0 3947 12134 1 62 13 25 2 9 160 45348 6594912 44096 0 0 1009152 0 3949 11949 0 63 10 28 12 VR 6 8 160 45092 6583136 47016 0 0 1063200 0 4187 12394 1 71 9 21 3 11 160 47080 6578492 47588 0 0 1058412 0 4224 12547 1 72 8 20 Just about 1 gigabyte per second total aggregate read for all drives on a 965 chipset! Justin. From owner-xfs@oss.sgi.com Mon Jul 7 11:36:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 11:36:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m67IaSCq013719 for ; Mon, 7 Jul 2008 11:36:28 -0700 X-ASG-Debug-ID: 1215455852-1b3300000000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 56D77DB15FA for ; Mon, 7 Jul 2008 11:37:32 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id hDX17cvsb0T2wRsX for ; Mon, 07 Jul 2008 11:37:32 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 45FBC5A56A; Mon, 7 Jul 2008 14:37:32 -0400 (EDT) Date: Mon, 7 Jul 2008 14:37:31 -0400 (EDT) From: Justin Piszcz To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Subject: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215455853 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55412 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16772 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Mon, 7 Jul 2008, Justin Piszcz wrote: > Each PCI-e x1 card has 1 veliciraptor on it now. > Got an x4 card wit 4 sata ports: > > Not quite the > 1 gbyte/sec I was hoping for in regards to the reads > but pretty close! Going to remove one of the drives from the x1 card and put it on the x4 card instead, then I will use all 4 SATA ports on the x4 and hopefully get better bw. If you look at 7,8,9 there is little improvement: (PCI-e x1) 7 VR 2 6 160 46744 6599020 44688 0 0 748204 17 3042 9084 0 34 40 26 3 6 160 46592 6598824 44372 0 0 747520 8 2975 9047 1 33 31 36 8 VR 2 7 160 46512 6598612 44580 0 0 761184 16 3089 9937 0 36 40 24 2 7 160 44528 6600392 44360 0 0 759720 8 2993 9522 0 36 36 28 9 VR 2 8 160 47152 6596824 44572 0 0 767016 0 3075 9730 1 37 39 24 2 7 160 46576 6597728 44688 0 0 771200 0 3032 9568 0 37 40 23 But once I hit the drives on the x4 card, vroom vroom! 10 VR 0 10 160 45048 6598240 44428 0 0 889072 8 3599 11561 0 47 20 33 2 10 160 45232 6598116 44772 0 0 890112 0 3495 11547 0 46 23 31 11 VR 4 8 160 45536 6594716 44600 0 0 996352 0 3947 12134 1 62 13 25 2 9 160 45348 6594912 44096 0 0 1009152 0 3949 11949 0 63 10 28 12 VR 6 8 160 45092 6583136 47016 0 0 1063200 0 4187 12394 1 71 9 21 3 11 160 47080 6578492 47588 0 0 1058412 0 4224 12547 1 72 8 20 Justin. From owner-xfs@oss.sgi.com Mon Jul 7 11:45:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 11:45:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m67IjPRh014564 for ; Mon, 7 Jul 2008 11:45:25 -0700 X-ASG-Debug-ID: 1215456389-68fc00a70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 78DCE188738B for ; Mon, 7 Jul 2008 11:46:29 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id zKX8fPDbbdWbNjbe for ; Mon, 07 Jul 2008 11:46:29 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 44E0E5A562; Mon, 7 Jul 2008 14:46:29 -0400 (EDT) Date: Mon, 7 Jul 2008 14:46:28 -0400 (EDT) From: Justin Piszcz To: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com cc: Alan Piszcz X-ASG-Orig-Subj: Re: 12 Veliciraptors again w/x4 card (1.1gbytes/sec aggregate read)! Subject: Re: 12 Veliciraptors again w/x4 card (1.1gbytes/sec aggregate read)! In-Reply-To: Message-ID: References: User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215456390 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55412 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16773 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Mon, 7 Jul 2008, Justin Piszcz wrote: > > > On Mon, 7 Jul 2008, Justin Piszcz wrote: > >> Each PCI-e x1 card has 1 veliciraptor on it now. >> Got an x4 card wit 4 sata ports: >> >> Not quite the > 1 gbyte/sec I was hoping for in regards to the reads >> but pretty close! > > Going to remove one of the drives from the x1 card and put it on the x4 > card instead, then I will use all 4 SATA ports on the x4 and hopefully get > better bw. > Four drives on the x4 card, MAX bandwidth for every disk. p34:~# dd if=/dev/sdi of=/dev/null bs=1M & [1] 4720 p34:~# dd if=/dev/sdj of=/dev/null bs=1M & [2] 4721 p34:~# dd if=/dev/sdk of=/dev/null bs=1M & [3] 4722 p34:~# dd if=/dev/sdl of=/dev/null bs=1M & [4] 4723 p34:~# 120MiB/s per each one! Re-running dd test with all 12 disks: 1.1 gigabytes per second read! r b swpd free buff cache si so bi bo in cs us sy id wa 1 0 120 59104 6632220 52228 0 0 0 40 168 517 0 0 100 0 0 0 120 59104 6632220 52228 0 0 0 0 20 291 0 0 100 0 3 10 120 43516 6635576 51924 0 0 1051776 62 4221 12301 1 70 11 19 6 9 160 44420 6634720 51788 0 0 1117284 0 4435 12308 1 75 5 19 6 9 160 47436 6631100 51676 0 0 1110300 0 4449 11438 1 76 3 20 2 10 160 46740 6632048 51948 0 0 1137920 0 4447 12251 1 75 8 17 9 7 160 45248 6632056 52004 0 8 1127940 45 4559 13259 1 74 9 17 3 9 160 44152 6634780 49960 0 0 1132032 12 4471 12962 0 75 8 16 4 9 160 44160 6634960 49380 0 0 1129216 8 4430 12545 0 76 7 16 After: About the same for write: $ dd if=/dev/zero of=bigfile.1 bs=1M count=10240 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 20.4056 s, 526 MB/s 'nuff said for read :) $ dd if=bigfile.1 of=/dev/null bs=1M count=10240 10240+0 records in 10240+0 records out 10737418240 bytes (11 GB) copied, 10.2841 s, 1.0 GB/s Justin. From owner-xfs@oss.sgi.com Mon Jul 7 15:05:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 15:05:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m67M5lvV032661 for ; Mon, 7 Jul 2008 15:05:49 -0700 X-ASG-Debug-ID: 1215468411-726602890000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 86403DB9CCD for ; Mon, 7 Jul 2008 15:06:51 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id DegRA0AybAJWSdea for ; Mon, 07 Jul 2008 15:06:51 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEALAvckh5LBzp/2dsb2JhbACxLA X-IronPort-AV: E=Sophos;i="4.30,318,1212330600"; d="scan'208";a="143919718" Received: from ppp121-44-28-233.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.28.233]) by ipmail01.adl6.internode.on.net with ESMTP; 08 Jul 2008 07:36:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KFyr9-0006nX-W2; Tue, 08 Jul 2008 08:06:47 +1000 Date: Tue, 8 Jul 2008 08:06:47 +1000 From: Dave Chinner To: Jens Beyer Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: XFS perfomance degradation on growing filesystem size Subject: Re: XFS perfomance degradation on growing filesystem size Message-ID: <20080707220647.GN29319@disturbed> Mail-Followup-To: Jens Beyer , xfs@oss.sgi.com References: <20080704064126.GA14847@webde.de> <20080704075941.GP16257@build-svl-1.agami.com> <20080707080409.GA18390@webde.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080707080409.GA18390@webde.de> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215468412 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4731 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55424 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16774 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 07, 2008 at 10:04:09AM +0200, Jens Beyer wrote: > On Fri, Jul 04, 2008 at 12:59:41AM -0700, Dave Chinner wrote: > > On Fri, Jul 04, 2008 at 08:41:26AM +0200, Jens Beyer wrote: > > > > > > I have encountered a strange performance problem during some > > > hardware evaluation tests: > > > > > > I am running a benchmark to measure especially random read/write > > > I/O on an raid device and found that (under some circumstances) > > > the performance of Random Read I/O is inverse proportional to the > > > size of the tested XFS filesystem. > > > > > > In numbers this means that on a 100GB partition I get a throughput > > > of ~25 MB/s and on the same hardware at 1TB FS size only 18 MB/s > > > (and at 2+ TB like 14 MB/s) (absolute values depend on options, > > > kernel version and are for random read i/o at 8k test block size). > > > > Of course - as the filesystem size grows, so does the amount of > > each disk in use so the average seek distance increases and hence > > read I/Os take longer. > > But then - why does the rate of ext3 does not decrease and stays at the > higher value? Because XFS spreads the data and metadata across the entire filesystem, not just a small portion. It's one of the reasons XFS can make decent use of lots of disks effectively. Grab seekwatcher traces from your workload for the different filesystems and you'll see what I mean.... Cheers,, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 7 16:11:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 16:11:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m67NBtBP004521 for ; Mon, 7 Jul 2008 16:11:55 -0700 X-ASG-Debug-ID: 1215472379-2b2f03da0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mail.ukfsn.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0FAF3DBA688 for ; Mon, 7 Jul 2008 16:12:59 -0700 (PDT) Received: from mail.ukfsn.org (mx1.ukfsn.org [77.75.108.10]) by cuda.sgi.com with ESMTP id hTz2Fs7pqYjB8SHY for ; Mon, 07 Jul 2008 16:12:59 -0700 (PDT) Received: from localhost (smtp-filter.ukfsn.org [192.168.54.205]) by mail.ukfsn.org (Postfix) with ESMTP id 98611DECED; Tue, 8 Jul 2008 00:22:42 +0100 (BST) Received: from mail.ukfsn.org ([192.168.54.25]) by localhost (smtp-filter.ukfsn.org [192.168.54.205]) (amavisd-new, port 10024) with ESMTP id EQtN1aZ+JHbj; Mon, 7 Jul 2008 23:05:59 +0100 (BST) Received: from elm.dgreaves.com (78-32-229-233.no-dns-yet.enta.net [78.32.229.233]) by mail.ukfsn.org (Postfix) with ESMTP id 609B0DECE6; Tue, 8 Jul 2008 00:22:41 +0100 (BST) Received: from ash.dgreaves.com ([10.0.0.90]) by elm.dgreaves.com with esmtp (Exim 4.62) (envelope-from ) id 1KFzt6-0007ji-VB; Tue, 08 Jul 2008 00:12:53 +0100 Message-ID: <4872A2F4.2010604@dgreaves.com> Date: Tue, 08 Jul 2008 00:12:52 +0100 From: David Greaves User-Agent: Mozilla-Thunderbird 2.0.0.14 (X11/20080509) MIME-Version: 1.0 To: Justin Piszcz CC: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Subject: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! References: In-Reply-To: X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: mx1.ukfsn.org[77.75.108.10] X-Barracuda-Start-Time: 1215472380 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55429 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16775 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@dgreaves.com Precedence: bulk X-list: xfs Justin Piszcz wrote: > Each PCI-e x1 card has 1 veliciraptor on it now. > Got an x4 card wit 4 sata ports: Useful - which card? David From owner-xfs@oss.sgi.com Mon Jul 7 19:54:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 19:54:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m682sSbr019949 for ; Mon, 7 Jul 2008 19:54:28 -0700 X-ASG-Debug-ID: 1215485732-7e8100910000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2C6832C6677 for ; Mon, 7 Jul 2008 19:55:32 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id bjH1qFW1L9za1c7O for ; Mon, 07 Jul 2008 19:55:32 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id BDDC9AC3593 for ; Mon, 7 Jul 2008 21:55:31 -0500 (CDT) Message-ID: <4872D725.5070306@sandeen.net> Date: Mon, 07 Jul 2008 21:55:33 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs mailing list X-ASG-Orig-Subj: Re: [PATCH] convert xfs to use ERR_CAST Subject: Re: [PATCH] convert xfs to use ERR_CAST References: <480FA737.5030001@sandeen.net> In-Reply-To: <480FA737.5030001@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215485733 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55444 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16776 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Eric Sandeen wrote: > Looks like somehow xfs got missed in the conversion that > took place in e231c2ee64eb1c5cd3c63c31da9dac7d888dcf7f, > "Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p) " > > Signed-off-by: Eric Sandeen > --- ping. This one's really, really, really easy :) -Eric > ndex: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_export.c > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_export.c > @@ -167,7 +167,7 @@ xfs_fs_fh_to_dentry(struct super_block * > if (!inode) > return NULL; > if (IS_ERR(inode)) > - return ERR_PTR(PTR_ERR(inode)); > + return ERR_CAST(inode); > result = d_alloc_anon(inode); > if (!result) { > iput(inode); > @@ -198,7 +198,7 @@ xfs_fs_fh_to_parent(struct super_block * > if (!inode) > return NULL; > if (IS_ERR(inode)) > - return ERR_PTR(PTR_ERR(inode)); > + return ERR_CAST(inode); > result = d_alloc_anon(inode); > if (!result) { > iput(inode); > > > From owner-xfs@oss.sgi.com Mon Jul 7 20:04:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 20:04:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, SUBJ_FRIEND autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m68348n5020644 for ; Mon, 7 Jul 2008 20:04:08 -0700 X-ASG-Debug-ID: 1215486313-55e500f80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6039918890B1 for ; Mon, 7 Jul 2008 20:05:13 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id YOMHEwJ0FnZO54v2 for ; Mon, 07 Jul 2008 20:05:13 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id D9462AC3593 for ; Mon, 7 Jul 2008 22:05:12 -0500 (CDT) Message-ID: <4872D96A.7070703@sandeen.net> Date: Mon, 07 Jul 2008 22:05:14 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] remove INT_GET and friends Subject: Re: [PATCH] remove INT_GET and friends References: <47FF794C.4020801@sandeen.net> In-Reply-To: <47FF794C.4020801@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215486313 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55444 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16777 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Eric Sandeen wrote: > Thanks to hch's endian work, INT_GET etc are no longer used, > and may as well be removed. INT_SET is still used in > the acl code, though. > > Signed-off-by: Eric Sandeen > --- > > xfs_arch.h | 68 --------------------------------- > 1 files changed, 68 deletions(-) > Ping? these are just unused macros. -Eric > > Index: linux-2.6-xfs/fs/xfs/xfs_arch.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_arch.h > +++ linux-2.6-xfs/fs/xfs/xfs_arch.h > @@ -92,16 +92,6 @@ > ((__u8*)(pointer))[1] = (((value) ) & 0xff); \ > } > > -/* define generic INT_ macros */ > - > -#define INT_GET(reference,arch) \ > - (((arch) == ARCH_NOCONVERT) \ > - ? \ > - (reference) \ > - : \ > - INT_SWAP((reference),(reference)) \ > - ) > - > /* does not return a value */ > #define INT_SET(reference,arch,valueref) \ > (__builtin_constant_p(valueref) ? \ > @@ -112,64 +102,6 @@ > ) \ > ) > > -/* does not return a value */ > -#define INT_MOD_EXPR(reference,arch,code) \ > - (((arch) == ARCH_NOCONVERT) \ > - ? \ > - (void)((reference) code) \ > - : \ > - (void)( \ > - (reference) = INT_GET((reference),arch) , \ > - ((reference) code), \ > - INT_SET(reference, arch, reference) \ > - ) \ > - ) > - > -/* does not return a value */ > -#define INT_MOD(reference,arch,delta) \ > - (void)( \ > - INT_MOD_EXPR(reference,arch,+=(delta)) \ > - ) > - > -/* > - * INT_COPY - copy a value between two locations with the > - * _same architecture_ but _potentially different sizes_ > - * > - * if the types of the two parameters are equal or they are > - * in native architecture, a simple copy is done > - * > - * otherwise, architecture conversions are done > - * > - */ > - > -/* does not return a value */ > -#define INT_COPY(dst,src,arch) \ > - ( \ > - ((sizeof(dst) == sizeof(src)) || ((arch) == ARCH_NOCONVERT)) \ > - ? \ > - (void)((dst) = (src)) \ > - : \ > - INT_SET(dst, arch, INT_GET(src, arch)) \ > - ) > - > -/* > - * INT_XLATE - copy a value in either direction between two locations > - * with different architectures > - * > - * dir < 0 - copy from memory to buffer (native to arch) > - * dir > 0 - copy from buffer to memory (arch to native) > - */ > - > -/* does not return a value */ > -#define INT_XLATE(buf,mem,dir,arch) {\ > - ASSERT(dir); \ > - if (dir>0) { \ > - (mem)=INT_GET(buf, arch); \ > - } else { \ > - INT_SET(buf, arch, mem); \ > - } \ > -} > - > static inline void be16_add(__be16 *a, __s16 b) > { > *a = cpu_to_be16(be16_to_cpu(*a) + b); > > > From owner-xfs@oss.sgi.com Mon Jul 7 20:07:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 20:07:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6837uDv021065 for ; Mon, 7 Jul 2008 20:07:56 -0700 X-ASG-Debug-ID: 1215486541-56a803370000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A80CB2C6840 for ; Mon, 7 Jul 2008 20:09:01 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id yRCKbSk9acAwyN4D for ; Mon, 07 Jul 2008 20:09:01 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id B9534AC3593; Mon, 7 Jul 2008 22:09:00 -0500 (CDT) Message-ID: <4872DA4E.3040405@sandeen.net> Date: Mon, 07 Jul 2008 22:09:02 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: nscott@aconex.com, xfs-oss X-ASG-Orig-Subj: Re: [PATCH, RFC] - remove mountpoint UUID code Subject: Re: [PATCH, RFC] - remove mountpoint UUID code References: <47D20F78.7000103@sandeen.net> <1205196252.15982.69.camel@edge.scott.net.au> <47D5DE13.8030902@sandeen.net> <34665.192.168.3.1.1205266196.squirrel@mail.aconex.com> <20080312072259.GA26148@infradead.org> In-Reply-To: <20080312072259.GA26148@infradead.org> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215486541 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=COMMA_SUBJECT X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55444 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 COMMA_SUBJECT Subject is like 'Re: FDSDS, this is a subject' X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16778 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Wed, Mar 12, 2008 at 07:09:56AM +1100, nscott@aconex.com wrote: >> I don't have any immediate plans. I can imagine it could be used to >> stitch parts of the namespace together in a filesystem that supports >> multiple devices (in a chunkfs kinda way) ... or maybe more simply >> just an in-filesystem auto-mounter. *shrug*. But its there, the tools >> support it (once again, I didn't see a userspace patch - hohum), so I >> would vote for leaving it in its current form so some enterprising, >> constructive young coder can try to make something useful from it >> at some point. :) > > That kind of automounter really doesn't belong into the low-level > filesystem. If we really wanted it it would go into the VFS, storing > the uuid or other identifier for the mountpoint in an xattr. This is > really just dead junk that should go away. Can I get a yea or nay on this from sgi, then? Thanks, -Eric From owner-xfs@oss.sgi.com Mon Jul 7 20:27:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 20:27:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m683RqHx026698 for ; Mon, 7 Jul 2008 20:27:52 -0700 X-ASG-Debug-ID: 1215487735-092901310000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D817A2C6098 for ; Mon, 7 Jul 2008 20:28:55 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 2xb8or1kFH8UUaBx for ; Mon, 07 Jul 2008 20:28:55 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 528B1AC3593 for ; Mon, 7 Jul 2008 22:28:55 -0500 (CDT) Message-ID: <4872DEF8.6060704@sandeen.net> Date: Mon, 07 Jul 2008 22:28:56 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: [PATCH] remove shouting-indirection macros from xfs_trans.h Subject: [PATCH] remove shouting-indirection macros from xfs_trans.h Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215487736 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55445 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16779 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs compile-tested, fairly easy to inspect with: quilt diff --diff="diff -iu" Signed-off-by: Eric Sandeen --- xfs_bmap.c | 6 ++--- xfs_trans.c | 12 +++++----- xfs_trans.h | 11 --------- xfs_trans_buf.c | 12 +++++----- xfs_trans_item.c | 66 +++++++++++++++++++++++++++---------------------------- xfsidbg.c | 6 ++--- 6 files changed, 51 insertions(+), 62 deletions(-) Index: linux/fs/xfs/xfs_bmap.c =================================================================== RCS file: /cvs/xfs-linux/xfs_bmap.c,v retrieving revision 1.394 diff -u -r1.394 xfs_bmap.c --- linux/fs/xfs/xfs_bmap.c 20 Jun 2008 16:19:53 -0000 1.394 +++ linux/fs/xfs/xfs_bmap.c 8 Jul 2008 03:24:32 -0000 @@ -6096,7 +6096,7 @@ tp = cur->bc_tp; licp = &tp->t_items; while (!bp && licp != NULL) { - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { licp = licp->lic_next; continue; } @@ -6106,11 +6106,11 @@ xfs_buf_log_item_t *bip; xfs_buf_t *lbp; - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); lip = lidp->lid_item; if (lip->li_type != XFS_LI_BUF) continue; Index: linux/fs/xfs/xfs_trans.c =================================================================== RCS file: /cvs/xfs-linux/xfs_trans.c,v retrieving revision 1.185 diff -u -r1.185 xfs_trans.c --- linux/fs/xfs/xfs_trans.c 9 May 2008 04:27:47 -0000 1.185 +++ linux/fs/xfs/xfs_trans.c 8 Jul 2008 03:24:32 -0000 @@ -253,7 +253,7 @@ tp->t_mountp = mp; tp->t_items_free = XFS_LIC_NUM_SLOTS; tp->t_busy_free = XFS_LBC_NUM_SLOTS; - XFS_LIC_INIT(&(tp->t_items)); + xfs_lic_init(&(tp->t_items)); XFS_LBC_INIT(&(tp->t_busy)); return tp; } @@ -282,7 +282,7 @@ ntp->t_mountp = tp->t_mountp; ntp->t_items_free = XFS_LIC_NUM_SLOTS; ntp->t_busy_free = XFS_LBC_NUM_SLOTS; - XFS_LIC_INIT(&(ntp->t_items)); + xfs_lic_init(&(ntp->t_items)); XFS_LBC_INIT(&(ntp->t_busy)); ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); @@ -1169,7 +1169,7 @@ while (licp != NULL) { lidp = licp->lic_descs; for (i = 0; i < licp->lic_unused; i++, lidp++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } @@ -1253,7 +1253,7 @@ * Special case the chunk embedded in the transaction. */ licp = &(tp->t_items); - if (!(XFS_LIC_ARE_ALL_FREE(licp))) { + if (!(xfs_lic_are_all_free(licp))) { xfs_trans_chunk_committed(licp, tp->t_lsn, abortflag); } @@ -1262,7 +1262,7 @@ */ licp = licp->lic_next; while (licp != NULL) { - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); xfs_trans_chunk_committed(licp, tp->t_lsn, abortflag); next_licp = licp->lic_next; kmem_free(licp); @@ -1325,7 +1325,7 @@ lidp = licp->lic_descs; for (i = 0; i < licp->lic_unused; i++, lidp++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } Index: linux/fs/xfs/xfs_trans.h =================================================================== RCS file: /cvs/xfs-linux/xfs_trans.h,v retrieving revision 1.149 diff -u -r1.149 xfs_trans.h --- linux/fs/xfs/xfs_trans.h 11 Mar 2008 15:02:32 -0000 1.149 +++ linux/fs/xfs/xfs_trans.h 8 Jul 2008 03:24:33 -0000 @@ -210,62 +210,52 @@ * lic_unused to the right value (0 matches all free). The * lic_descs.lid_index values are set up as each desc is allocated. */ -#define XFS_LIC_INIT(cp) xfs_lic_init(cp) static inline void xfs_lic_init(xfs_log_item_chunk_t *cp) { cp->lic_free = XFS_LIC_FREEMASK; } -#define XFS_LIC_INIT_SLOT(cp,slot) xfs_lic_init_slot(cp, slot) static inline void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot) { cp->lic_descs[slot].lid_index = (unsigned char)(slot); } -#define XFS_LIC_VACANCY(cp) xfs_lic_vacancy(cp) static inline int xfs_lic_vacancy(xfs_log_item_chunk_t *cp) { return cp->lic_free & XFS_LIC_FREEMASK; } -#define XFS_LIC_ALL_FREE(cp) xfs_lic_all_free(cp) static inline void xfs_lic_all_free(xfs_log_item_chunk_t *cp) { cp->lic_free = XFS_LIC_FREEMASK; } -#define XFS_LIC_ARE_ALL_FREE(cp) xfs_lic_are_all_free(cp) static inline int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp) { return ((cp->lic_free & XFS_LIC_FREEMASK) == XFS_LIC_FREEMASK); } -#define XFS_LIC_ISFREE(cp,slot) xfs_lic_isfree(cp,slot) static inline int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot) { return (cp->lic_free & (1 << slot)); } -#define XFS_LIC_CLAIM(cp,slot) xfs_lic_claim(cp,slot) static inline void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot) { cp->lic_free &= ~(1 << slot); } -#define XFS_LIC_RELSE(cp,slot) xfs_lic_relse(cp,slot) static inline void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot) { cp->lic_free |= 1 << slot; } -#define XFS_LIC_SLOT(cp,slot) xfs_lic_slot(cp,slot) static inline xfs_log_item_desc_t * xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot) { return &(cp->lic_descs[slot]); } -#define XFS_LIC_DESC_TO_SLOT(dp) xfs_lic_desc_to_slot(dp) static inline int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp) { return (uint)dp->lid_index; @@ -278,7 +268,6 @@ * All of this yields the address of the chunk, which is * cast to a chunk pointer. */ -#define XFS_LIC_DESC_TO_CHUNK(dp) xfs_lic_desc_to_chunk(dp) static inline xfs_log_item_chunk_t * xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) { Index: linux/fs/xfs/xfs_trans_buf.c =================================================================== RCS file: /cvs/xfs-linux/xfs_trans_buf.c,v retrieving revision 1.130 diff -u -r1.130 xfs_trans_buf.c --- linux/fs/xfs/xfs_trans_buf.c 10 Apr 2008 04:25:55 -0000 1.130 +++ linux/fs/xfs/xfs_trans_buf.c 8 Jul 2008 03:24:33 -0000 @@ -1021,16 +1021,16 @@ bp = NULL; len = BBTOB(len); licp = &tp->t_items; - if (!XFS_LIC_ARE_ALL_FREE(licp)) { + if (!xfs_lic_are_all_free(licp)) { for (i = 0; i < licp->lic_unused; i++) { /* * Skip unoccupied slots. */ - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); blip = (xfs_buf_log_item_t *)lidp->lid_item; if (blip->bli_item.li_type != XFS_LI_BUF) { continue; @@ -1074,7 +1074,7 @@ bp = NULL; len = BBTOB(len); for (licp = &tp->t_items; licp != NULL; licp = licp->lic_next) { - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { ASSERT(licp == &tp->t_items); ASSERT(licp->lic_next == NULL); return NULL; @@ -1083,11 +1083,11 @@ /* * Skip unoccupied slots. */ - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); blip = (xfs_buf_log_item_t *)lidp->lid_item; if (blip->bli_item.li_type != XFS_LI_BUF) { continue; Index: linux/fs/xfs/xfs_trans_item.c =================================================================== RCS file: /cvs/xfs-linux/xfs_trans_item.c,v retrieving revision 1.47 diff -u -r1.47 xfs_trans_item.c --- linux/fs/xfs/xfs_trans_item.c 9 May 2008 04:27:47 -0000 1.47 +++ linux/fs/xfs/xfs_trans_item.c 8 Jul 2008 03:24:33 -0000 @@ -53,11 +53,11 @@ * Initialize the chunk, and then * claim the first slot in the newly allocated chunk. */ - XFS_LIC_INIT(licp); - XFS_LIC_CLAIM(licp, 0); + xfs_lic_init(licp); + xfs_lic_claim(licp, 0); licp->lic_unused = 1; - XFS_LIC_INIT_SLOT(licp, 0); - lidp = XFS_LIC_SLOT(licp, 0); + xfs_lic_init_slot(licp, 0); + lidp = xfs_lic_slot(licp, 0); /* * Link in the new chunk and update the free count. @@ -88,14 +88,14 @@ */ licp = &tp->t_items; while (licp != NULL) { - if (XFS_LIC_VACANCY(licp)) { + if (xfs_lic_vacancy(licp)) { if (licp->lic_unused <= XFS_LIC_MAX_SLOT) { i = licp->lic_unused; - ASSERT(XFS_LIC_ISFREE(licp, i)); + ASSERT(xfs_lic_isfree(licp, i)); break; } for (i = 0; i <= XFS_LIC_MAX_SLOT; i++) { - if (XFS_LIC_ISFREE(licp, i)) + if (xfs_lic_isfree(licp, i)) break; } ASSERT(i <= XFS_LIC_MAX_SLOT); @@ -108,12 +108,12 @@ * If we find a free descriptor, claim it, * initialize it, and return it. */ - XFS_LIC_CLAIM(licp, i); + xfs_lic_claim(licp, i); if (licp->lic_unused <= i) { licp->lic_unused = i + 1; - XFS_LIC_INIT_SLOT(licp, i); + xfs_lic_init_slot(licp, i); } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); tp->t_items_free--; lidp->lid_item = lip; lidp->lid_flags = 0; @@ -136,9 +136,9 @@ xfs_log_item_chunk_t *licp; xfs_log_item_chunk_t **licpp; - slot = XFS_LIC_DESC_TO_SLOT(lidp); - licp = XFS_LIC_DESC_TO_CHUNK(lidp); - XFS_LIC_RELSE(licp, slot); + slot = xfs_lic_desc_to_slot(lidp); + licp = xfs_lic_desc_to_chunk(lidp); + xfs_lic_relse(licp, slot); lidp->lid_item->li_desc = NULL; tp->t_items_free++; @@ -154,7 +154,7 @@ * Also decrement the transaction structure's count of free items * by the number in a chunk since we are freeing an empty chunk. */ - if (XFS_LIC_ARE_ALL_FREE(licp) && (licp != &(tp->t_items))) { + if (xfs_lic_are_all_free(licp) && (licp != &(tp->t_items))) { licpp = &(tp->t_items.lic_next); while (*licpp != licp) { ASSERT(*licpp != NULL); @@ -207,20 +207,20 @@ /* * If it's not in the first chunk, skip to the second. */ - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { licp = licp->lic_next; } /* * Return the first non-free descriptor in the chunk. */ - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); for (i = 0; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - return XFS_LIC_SLOT(licp, i); + return xfs_lic_slot(licp, i); } cmn_err(CE_WARN, "xfs_trans_first_item() -- no first item"); return NULL; @@ -242,18 +242,18 @@ xfs_log_item_chunk_t *licp; int i; - licp = XFS_LIC_DESC_TO_CHUNK(lidp); + licp = xfs_lic_desc_to_chunk(lidp); /* * First search the rest of the chunk. The for loop keeps us * from referencing things beyond the end of the chunk. */ - for (i = (int)XFS_LIC_DESC_TO_SLOT(lidp) + 1; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + for (i = (int)xfs_lic_desc_to_slot(lidp) + 1; i < licp->lic_unused; i++) { + if (xfs_lic_isfree(licp, i)) { continue; } - return XFS_LIC_SLOT(licp, i); + return xfs_lic_slot(licp, i); } /* @@ -266,13 +266,13 @@ } licp = licp->lic_next; - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); for (i = 0; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - return XFS_LIC_SLOT(licp, i); + return xfs_lic_slot(licp, i); } ASSERT(0); /* NOTREACHED */ @@ -300,9 +300,9 @@ /* * Special case the embedded chunk so we don't free it below. */ - if (!XFS_LIC_ARE_ALL_FREE(licp)) { + if (!xfs_lic_are_all_free(licp)) { (void) xfs_trans_unlock_chunk(licp, 1, abort, NULLCOMMITLSN); - XFS_LIC_ALL_FREE(licp); + xfs_lic_all_free(licp); licp->lic_unused = 0; } licp = licp->lic_next; @@ -311,7 +311,7 @@ * Unlock each item in each chunk and free the chunks. */ while (licp != NULL) { - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); (void) xfs_trans_unlock_chunk(licp, 1, abort, NULLCOMMITLSN); next_licp = licp->lic_next; kmem_free(licp); @@ -347,7 +347,7 @@ /* * Special case the embedded chunk so we don't free. */ - if (!XFS_LIC_ARE_ALL_FREE(licp)) { + if (!xfs_lic_are_all_free(licp)) { freed = xfs_trans_unlock_chunk(licp, 0, 0, commit_lsn); } licpp = &(tp->t_items.lic_next); @@ -358,10 +358,10 @@ * and free empty chunks. */ while (licp != NULL) { - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); freed += xfs_trans_unlock_chunk(licp, 0, 0, commit_lsn); next_licp = licp->lic_next; - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { *licpp = next_licp; kmem_free(licp); freed -= XFS_LIC_NUM_SLOTS; @@ -402,7 +402,7 @@ freed = 0; lidp = licp->lic_descs; for (i = 0; i < licp->lic_unused; i++, lidp++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } lip = lidp->lid_item; @@ -421,7 +421,7 @@ */ if (!(freeing_chunk) && (!(lidp->lid_flags & XFS_LID_DIRTY) || abort)) { - XFS_LIC_RELSE(licp, i); + xfs_lic_relse(licp, i); freed++; } } Index: linux/fs/xfs/xfsidbg.c =================================================================== RCS file: /cvs/xfs-linux/xfsidbg.c,v retrieving revision 1.353 diff -u -r1.353 xfsidbg.c --- linux/fs/xfs/xfsidbg.c 25 Jun 2008 16:26:57 -0000 1.353 +++ linux/fs/xfs/linux/fs/xfs/xfsidbg.c 8 Jul 2008 03:24:35 -0000 @@ -6951,17 +6951,17 @@ licp = &tp->t_items; chunk = 0; while (licp != NULL) { - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { licp = licp->lic_next; chunk++; continue; } for (i = 0; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); kdb_printf("\n"); kdb_printf("chunk %d index %d item 0x%p size %d\n", chunk, i, lidp->lid_item, lidp->lid_size); From owner-xfs@oss.sgi.com Mon Jul 7 21:40:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 21:40:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m684eoLr028855 for ; Mon, 7 Jul 2008 21:40:50 -0700 X-ASG-Debug-ID: 1215492112-165002d50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D8598DBB563 for ; Mon, 7 Jul 2008 21:41:53 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 9ytjZ0les93QX9Ot for ; Mon, 07 Jul 2008 21:41:53 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 418B2AC3593 for ; Mon, 7 Jul 2008 23:41:52 -0500 (CDT) Message-ID: <4872F011.70902@sandeen.net> Date: Mon, 07 Jul 2008 23:41:53 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: [PATCH (fixed)] remove shouting-indirection macros from xfs_trans.h Subject: [PATCH (fixed)] remove shouting-indirection macros from xfs_trans.h References: <4872DEF8.6060704@sandeen.net> In-Reply-To: <4872DEF8.6060704@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215492114 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55450 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16780 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs (sorry, stuffed up the patch format just a bit) compile-tested, fairly easy to inspect with: quilt diff --diff="diff -iu" etc. Signed-off-by: Eric Sandeen --- xfs_bmap.c | 6 ++--- xfs_trans.c | 12 +++++----- xfs_trans.h | 11 --------- xfs_trans_buf.c | 12 +++++----- xfs_trans_item.c | 66 +++++++++++++++++++++++++++---------------------------- xfsidbg.c | 6 ++--- 6 files changed, 51 insertions(+), 62 deletions(-) Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c @@ -6096,7 +6096,7 @@ xfs_bmap_get_bp( tp = cur->bc_tp; licp = &tp->t_items; while (!bp && licp != NULL) { - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { licp = licp->lic_next; continue; } @@ -6106,11 +6106,11 @@ xfs_bmap_get_bp( xfs_buf_log_item_t *bip; xfs_buf_t *lbp; - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); lip = lidp->lid_item; if (lip->li_type != XFS_LI_BUF) continue; Index: linux-2.6-xfs/fs/xfs/xfs_trans.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_trans.c +++ linux-2.6-xfs/fs/xfs/xfs_trans.c @@ -253,7 +253,7 @@ _xfs_trans_alloc( tp->t_mountp = mp; tp->t_items_free = XFS_LIC_NUM_SLOTS; tp->t_busy_free = XFS_LBC_NUM_SLOTS; - XFS_LIC_INIT(&(tp->t_items)); + xfs_lic_init(&(tp->t_items)); XFS_LBC_INIT(&(tp->t_busy)); return tp; } @@ -282,7 +282,7 @@ xfs_trans_dup( ntp->t_mountp = tp->t_mountp; ntp->t_items_free = XFS_LIC_NUM_SLOTS; ntp->t_busy_free = XFS_LBC_NUM_SLOTS; - XFS_LIC_INIT(&(ntp->t_items)); + xfs_lic_init(&(ntp->t_items)); XFS_LBC_INIT(&(ntp->t_busy)); ASSERT(tp->t_flags & XFS_TRANS_PERM_LOG_RES); @@ -1169,7 +1169,7 @@ xfs_trans_cancel( while (licp != NULL) { lidp = licp->lic_descs; for (i = 0; i < licp->lic_unused; i++, lidp++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } @@ -1253,7 +1253,7 @@ xfs_trans_committed( * Special case the chunk embedded in the transaction. */ licp = &(tp->t_items); - if (!(XFS_LIC_ARE_ALL_FREE(licp))) { + if (!(xfs_lic_are_all_free(licp))) { xfs_trans_chunk_committed(licp, tp->t_lsn, abortflag); } @@ -1262,7 +1262,7 @@ xfs_trans_committed( */ licp = licp->lic_next; while (licp != NULL) { - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); xfs_trans_chunk_committed(licp, tp->t_lsn, abortflag); next_licp = licp->lic_next; kmem_free(licp); @@ -1325,7 +1325,7 @@ xfs_trans_chunk_committed( lidp = licp->lic_descs; for (i = 0; i < licp->lic_unused; i++, lidp++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } Index: linux-2.6-xfs/fs/xfs/xfs_trans.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_trans.h +++ linux-2.6-xfs/fs/xfs/xfs_trans.h @@ -210,62 +210,52 @@ typedef struct xfs_log_item_chunk { * lic_unused to the right value (0 matches all free). The * lic_descs.lid_index values are set up as each desc is allocated. */ -#define XFS_LIC_INIT(cp) xfs_lic_init(cp) static inline void xfs_lic_init(xfs_log_item_chunk_t *cp) { cp->lic_free = XFS_LIC_FREEMASK; } -#define XFS_LIC_INIT_SLOT(cp,slot) xfs_lic_init_slot(cp, slot) static inline void xfs_lic_init_slot(xfs_log_item_chunk_t *cp, int slot) { cp->lic_descs[slot].lid_index = (unsigned char)(slot); } -#define XFS_LIC_VACANCY(cp) xfs_lic_vacancy(cp) static inline int xfs_lic_vacancy(xfs_log_item_chunk_t *cp) { return cp->lic_free & XFS_LIC_FREEMASK; } -#define XFS_LIC_ALL_FREE(cp) xfs_lic_all_free(cp) static inline void xfs_lic_all_free(xfs_log_item_chunk_t *cp) { cp->lic_free = XFS_LIC_FREEMASK; } -#define XFS_LIC_ARE_ALL_FREE(cp) xfs_lic_are_all_free(cp) static inline int xfs_lic_are_all_free(xfs_log_item_chunk_t *cp) { return ((cp->lic_free & XFS_LIC_FREEMASK) == XFS_LIC_FREEMASK); } -#define XFS_LIC_ISFREE(cp,slot) xfs_lic_isfree(cp,slot) static inline int xfs_lic_isfree(xfs_log_item_chunk_t *cp, int slot) { return (cp->lic_free & (1 << slot)); } -#define XFS_LIC_CLAIM(cp,slot) xfs_lic_claim(cp,slot) static inline void xfs_lic_claim(xfs_log_item_chunk_t *cp, int slot) { cp->lic_free &= ~(1 << slot); } -#define XFS_LIC_RELSE(cp,slot) xfs_lic_relse(cp,slot) static inline void xfs_lic_relse(xfs_log_item_chunk_t *cp, int slot) { cp->lic_free |= 1 << slot; } -#define XFS_LIC_SLOT(cp,slot) xfs_lic_slot(cp,slot) static inline xfs_log_item_desc_t * xfs_lic_slot(xfs_log_item_chunk_t *cp, int slot) { return &(cp->lic_descs[slot]); } -#define XFS_LIC_DESC_TO_SLOT(dp) xfs_lic_desc_to_slot(dp) static inline int xfs_lic_desc_to_slot(xfs_log_item_desc_t *dp) { return (uint)dp->lid_index; @@ -278,7 +268,6 @@ static inline int xfs_lic_desc_to_slot(x * All of this yields the address of the chunk, which is * cast to a chunk pointer. */ -#define XFS_LIC_DESC_TO_CHUNK(dp) xfs_lic_desc_to_chunk(dp) static inline xfs_log_item_chunk_t * xfs_lic_desc_to_chunk(xfs_log_item_desc_t *dp) { Index: linux-2.6-xfs/fs/xfs/xfs_trans_buf.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_trans_buf.c +++ linux-2.6-xfs/fs/xfs/xfs_trans_buf.c @@ -1021,16 +1021,16 @@ xfs_trans_buf_item_match( bp = NULL; len = BBTOB(len); licp = &tp->t_items; - if (!XFS_LIC_ARE_ALL_FREE(licp)) { + if (!xfs_lic_are_all_free(licp)) { for (i = 0; i < licp->lic_unused; i++) { /* * Skip unoccupied slots. */ - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); blip = (xfs_buf_log_item_t *)lidp->lid_item; if (blip->bli_item.li_type != XFS_LI_BUF) { continue; @@ -1074,7 +1074,7 @@ xfs_trans_buf_item_match_all( bp = NULL; len = BBTOB(len); for (licp = &tp->t_items; licp != NULL; licp = licp->lic_next) { - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { ASSERT(licp == &tp->t_items); ASSERT(licp->lic_next == NULL); return NULL; @@ -1083,11 +1083,11 @@ xfs_trans_buf_item_match_all( /* * Skip unoccupied slots. */ - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); blip = (xfs_buf_log_item_t *)lidp->lid_item; if (blip->bli_item.li_type != XFS_LI_BUF) { continue; Index: linux-2.6-xfs/fs/xfs/xfs_trans_item.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_trans_item.c +++ linux-2.6-xfs/fs/xfs/xfs_trans_item.c @@ -53,11 +53,11 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_ * Initialize the chunk, and then * claim the first slot in the newly allocated chunk. */ - XFS_LIC_INIT(licp); - XFS_LIC_CLAIM(licp, 0); + xfs_lic_init(licp); + xfs_lic_claim(licp, 0); licp->lic_unused = 1; - XFS_LIC_INIT_SLOT(licp, 0); - lidp = XFS_LIC_SLOT(licp, 0); + xfs_lic_init_slot(licp, 0); + lidp = xfs_lic_slot(licp, 0); /* * Link in the new chunk and update the free count. @@ -88,14 +88,14 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_ */ licp = &tp->t_items; while (licp != NULL) { - if (XFS_LIC_VACANCY(licp)) { + if (xfs_lic_vacancy(licp)) { if (licp->lic_unused <= XFS_LIC_MAX_SLOT) { i = licp->lic_unused; - ASSERT(XFS_LIC_ISFREE(licp, i)); + ASSERT(xfs_lic_isfree(licp, i)); break; } for (i = 0; i <= XFS_LIC_MAX_SLOT; i++) { - if (XFS_LIC_ISFREE(licp, i)) + if (xfs_lic_isfree(licp, i)) break; } ASSERT(i <= XFS_LIC_MAX_SLOT); @@ -108,12 +108,12 @@ xfs_trans_add_item(xfs_trans_t *tp, xfs_ * If we find a free descriptor, claim it, * initialize it, and return it. */ - XFS_LIC_CLAIM(licp, i); + xfs_lic_claim(licp, i); if (licp->lic_unused <= i) { licp->lic_unused = i + 1; - XFS_LIC_INIT_SLOT(licp, i); + xfs_lic_init_slot(licp, i); } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); tp->t_items_free--; lidp->lid_item = lip; lidp->lid_flags = 0; @@ -136,9 +136,9 @@ xfs_trans_free_item(xfs_trans_t *tp, xfs xfs_log_item_chunk_t *licp; xfs_log_item_chunk_t **licpp; - slot = XFS_LIC_DESC_TO_SLOT(lidp); - licp = XFS_LIC_DESC_TO_CHUNK(lidp); - XFS_LIC_RELSE(licp, slot); + slot = xfs_lic_desc_to_slot(lidp); + licp = xfs_lic_desc_to_chunk(lidp); + xfs_lic_relse(licp, slot); lidp->lid_item->li_desc = NULL; tp->t_items_free++; @@ -154,7 +154,7 @@ xfs_trans_free_item(xfs_trans_t *tp, xfs * Also decrement the transaction structure's count of free items * by the number in a chunk since we are freeing an empty chunk. */ - if (XFS_LIC_ARE_ALL_FREE(licp) && (licp != &(tp->t_items))) { + if (xfs_lic_are_all_free(licp) && (licp != &(tp->t_items))) { licpp = &(tp->t_items.lic_next); while (*licpp != licp) { ASSERT(*licpp != NULL); @@ -207,20 +207,20 @@ xfs_trans_first_item(xfs_trans_t *tp) /* * If it's not in the first chunk, skip to the second. */ - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { licp = licp->lic_next; } /* * Return the first non-free descriptor in the chunk. */ - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); for (i = 0; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - return XFS_LIC_SLOT(licp, i); + return xfs_lic_slot(licp, i); } cmn_err(CE_WARN, "xfs_trans_first_item() -- no first item"); return NULL; @@ -242,18 +242,18 @@ xfs_trans_next_item(xfs_trans_t *tp, xfs xfs_log_item_chunk_t *licp; int i; - licp = XFS_LIC_DESC_TO_CHUNK(lidp); + licp = xfs_lic_desc_to_chunk(lidp); /* * First search the rest of the chunk. The for loop keeps us * from referencing things beyond the end of the chunk. */ - for (i = (int)XFS_LIC_DESC_TO_SLOT(lidp) + 1; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + for (i = (int)xfs_lic_desc_to_slot(lidp) + 1; i < licp->lic_unused; i++) { + if (xfs_lic_isfree(licp, i)) { continue; } - return XFS_LIC_SLOT(licp, i); + return xfs_lic_slot(licp, i); } /* @@ -266,13 +266,13 @@ xfs_trans_next_item(xfs_trans_t *tp, xfs } licp = licp->lic_next; - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); for (i = 0; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - return XFS_LIC_SLOT(licp, i); + return xfs_lic_slot(licp, i); } ASSERT(0); /* NOTREACHED */ @@ -300,9 +300,9 @@ xfs_trans_free_items( /* * Special case the embedded chunk so we don't free it below. */ - if (!XFS_LIC_ARE_ALL_FREE(licp)) { + if (!xfs_lic_are_all_free(licp)) { (void) xfs_trans_unlock_chunk(licp, 1, abort, NULLCOMMITLSN); - XFS_LIC_ALL_FREE(licp); + xfs_lic_all_free(licp); licp->lic_unused = 0; } licp = licp->lic_next; @@ -311,7 +311,7 @@ xfs_trans_free_items( * Unlock each item in each chunk and free the chunks. */ while (licp != NULL) { - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); (void) xfs_trans_unlock_chunk(licp, 1, abort, NULLCOMMITLSN); next_licp = licp->lic_next; kmem_free(licp); @@ -347,7 +347,7 @@ xfs_trans_unlock_items(xfs_trans_t *tp, /* * Special case the embedded chunk so we don't free. */ - if (!XFS_LIC_ARE_ALL_FREE(licp)) { + if (!xfs_lic_are_all_free(licp)) { freed = xfs_trans_unlock_chunk(licp, 0, 0, commit_lsn); } licpp = &(tp->t_items.lic_next); @@ -358,10 +358,10 @@ xfs_trans_unlock_items(xfs_trans_t *tp, * and free empty chunks. */ while (licp != NULL) { - ASSERT(!XFS_LIC_ARE_ALL_FREE(licp)); + ASSERT(!xfs_lic_are_all_free(licp)); freed += xfs_trans_unlock_chunk(licp, 0, 0, commit_lsn); next_licp = licp->lic_next; - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { *licpp = next_licp; kmem_free(licp); freed -= XFS_LIC_NUM_SLOTS; @@ -402,7 +402,7 @@ xfs_trans_unlock_chunk( freed = 0; lidp = licp->lic_descs; for (i = 0; i < licp->lic_unused; i++, lidp++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } lip = lidp->lid_item; @@ -421,7 +421,7 @@ xfs_trans_unlock_chunk( */ if (!(freeing_chunk) && (!(lidp->lid_flags & XFS_LID_DIRTY) || abort)) { - XFS_LIC_RELSE(licp, i); + xfs_lic_relse(licp, i); freed++; } } Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c +++ linux-2.6-xfs/fs/xfs/xfsidbg.c @@ -6951,17 +6951,17 @@ xfsidbg_xtp(xfs_trans_t *tp) licp = &tp->t_items; chunk = 0; while (licp != NULL) { - if (XFS_LIC_ARE_ALL_FREE(licp)) { + if (xfs_lic_are_all_free(licp)) { licp = licp->lic_next; chunk++; continue; } for (i = 0; i < licp->lic_unused; i++) { - if (XFS_LIC_ISFREE(licp, i)) { + if (xfs_lic_isfree(licp, i)) { continue; } - lidp = XFS_LIC_SLOT(licp, i); + lidp = xfs_lic_slot(licp, i); kdb_printf("\n"); kdb_printf("chunk %d index %d item 0x%p size %d\n", chunk, i, lidp->lid_item, lidp->lid_size); From owner-xfs@oss.sgi.com Mon Jul 7 22:02:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 07 Jul 2008 22:02:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6851vnr029780 for ; Mon, 7 Jul 2008 22:02:01 -0700 X-ASG-Debug-ID: 1215493380-3b6402ff0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 963E32C6A39 for ; Mon, 7 Jul 2008 22:03:01 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id V7TKKGdoH1on58ym for ; Mon, 07 Jul 2008 22:03:01 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id C0B4C8E00B4; Mon, 7 Jul 2008 22:05:47 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id A8DF88E008E; Mon, 7 Jul 2008 22:05:47 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Mon, 7 Jul 2008 22:03:39 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Xfs Access to block zero exception and system crash Subject: RE: Xfs Access to block zero exception and system crash Date: Mon, 7 Jul 2008 22:03:38 -0700 Message-ID: <340C71CD25A7EB49BFA81AE8C839266701323C3C@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <4872E33E.3090107@sandeen.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xfs Access to block zero exception and system crash Thread-Index: AcjgrWReJLSDlJRQSj6EZpV6D5oEvQACBGJg References: <4872E0BC.6070400@pmc-sierra.com> <4872E33E.3090107@sandeen.net> From: "Sagar Borikar" To: "Eric Sandeen" Cc: "Raj Palani" , X-OriginalArrivalTime: 08 Jul 2008 05:03:39.0458 (UTC) FILETIME=[FC2E2A20:01C8E0B7] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215493381 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0014 1.0000 -2.0119 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55451 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m68521nr029782 X-archive-position: 16781 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Sagar_Borikar@pmc-sierra.com Precedence: bulk X-list: xfs Sure Eric, I'll keep you posted with the results w/o loop back file. When you say that the deadlock could be due to vm, is it due to lack of memory? I checked meminfo and I found that sufficient buffers and committed_as were persent when xfs is stalled. Thanks Sagar Sagar Borikar wrote: > That's right Eric but I am still surprised that why should we get a > dead lock in this scenario as it is a plain copy of file in multiple > directories. Our customer is reporting similar kind of lockup in our > platform. ok, I guess I had missed that, sorry. > I do understand that we are chasing the access to block zero exception > and XFS forced shutdown which I mentioned earlier. But we also see > quite a few smbd processes which are writing data to XFS are in > uninterruptible sleep state and the system locks up too. Ok; then the next step is probably to do sysrq-t and see where things are stuck. It might be better to see if you can reproduce w/o the loopback file, too, since that's just another layer to go through that might be changing things. > So I thought > the test which I am running could be pointing to similar issue which > we are observing on our platform. But does this indicate that the > problem lies with x86 XFS too ? or maybe the vm ... > Also I presume in enterprise market such kind of simultaneous write > situation may happen. Has anybody reported similar issues to you? As > you observed it over x86 and 2.6.24 kernel, could you say what would > be root cause of this? Haven't really seen it before that I recall, and at this point can't say for sure what it might be. -Eric > Sorry for lots of questions at same time :) But I am happy that > you were able to see the deadlock in x86 on your setup with 2.6.24 > > Thanks > Sagar > > > Eric Sandeen wrote: >> Sagar Borikar wrote: >> >>> Hi Eric, >>> >>> Did you see any issues in your test? >>> >> I got a deadlock but that's it; I don't think that's the bug you want >> to chase... >> >> >> -Eric >> >> >>> Thanks >>> Sagar >>> >>> >>> Sagar Borikar wrote: >>> >>>> Eric Sandeen wrote: >>>> >>>>> Sagar Borikar wrote: >>>>> >>>>> >>>>> >>>>> >>>>>> Could you kindly try with my test? I presume you should see >>>>>> failure soon. I tried this on >>>>>> 2 different x86 systems 2 times ( after rebooting the system ) >>>>>> and I saw it every time. >>>>>> >>>>>> >>>>> Sure. Is there a reason you're doing this on a loopback file? >>>>> That probably stresses the vm a bit more, and might get even >>>>> trickier if the loopback file is sparse... >>>>> >>>>> >>>> Initially I thought to do that since I didn't want to have a strict >>>> allocation limit but allowing allocations to grow as needed until >>>> the backing filesystem runs out of free space due to type of the >>>> test case I had. But then I dropped the plan and created a >>>> non-sparse loopback device. There was no specific reason to create >>>> loopback but as it was simplest option to do it. >>>> >>>>> But anyway, on an x86_64 machine with 2G of memory and a >>>>> non-sparse 10G loopback file on 2.6.24.7-92.fc8, your test runs >>>>> w/o problems for me, though the system does get sluggish. I let >>>>> it run a bit then ran repair and it found no problems, I'll run it >>>>> overnight to see if anything else turns up. >>>>> >>>>> >>>> That will be great. Thanks indeed. >>>> Sagar >>>> >>>> >>>>> -Eric >>>>> >>>>> >> > From owner-xfs@oss.sgi.com Tue Jul 8 01:01:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 01:02:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE, SUBJ_FRIEND autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6881htK009670 for ; Tue, 8 Jul 2008 01:01:45 -0700 X-ASG-Debug-ID: 1215504167-3abf03c00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C3BFD1889C32 for ; Tue, 8 Jul 2008 01:02:47 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id J2CqmH622pIkqeUh for ; Tue, 08 Jul 2008 01:02:47 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KG89v-0000pA-CN; Tue, 08 Jul 2008 08:02:47 +0000 Date: Tue, 8 Jul 2008 04:02:47 -0400 From: Christoph Hellwig To: Eric Sandeen Cc: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] remove INT_GET and friends Subject: Re: [PATCH] remove INT_GET and friends Message-ID: <20080708080247.GA13762@infradead.org> References: <47FF794C.4020801@sandeen.net> <4872D96A.7070703@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4872D96A.7070703@sandeen.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1215504167 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55460 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16782 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 07, 2008 at 10:05:14PM -0500, Eric Sandeen wrote: > Eric Sandeen wrote: > > Thanks to hch's endian work, INT_GET etc are no longer used, > > and may as well be removed. INT_SET is still used in > > the acl code, though. > > > > Signed-off-by: Eric Sandeen > > --- > > > > xfs_arch.h | 68 --------------------------------- > > 1 files changed, 68 deletions(-) > > > > Ping? these are just unused macros. You might want to wait until the generic ACL code goes in, because then we can kill the remaining macros, too. Or just put this in now, I don't really care :) From owner-xfs@oss.sgi.com Tue Jul 8 01:28:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 01:28:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m688SrYO011287 for ; Tue, 8 Jul 2008 01:28:54 -0700 X-ASG-Debug-ID: 1215505797-6b3702860000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BF7B61889D47 for ; Tue, 8 Jul 2008 01:29:58 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id E5DIoXB3uj18B5Po for ; Tue, 08 Jul 2008 01:29:58 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id AB97E5A567; Tue, 8 Jul 2008 04:29:57 -0400 (EDT) Date: Tue, 8 Jul 2008 04:29:57 -0400 (EDT) From: Justin Piszcz To: David Greaves cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Subject: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! In-Reply-To: <4872A2F4.2010604@dgreaves.com> Message-ID: References: <4872A2F4.2010604@dgreaves.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215505798 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55462 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16783 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Tue, 8 Jul 2008, David Greaves wrote: > Justin Piszcz wrote: >> Each PCI-e x1 card has 1 veliciraptor on it now. >> Got an x4 card wit 4 sata ports: > > Useful - which card? > > David > > StarTech 4 Port PCI Express x4 SATA II Card Model PEXSATA24E Justin. From owner-xfs@oss.sgi.com Tue Jul 8 01:38:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 01:38:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m688cU1k012142 for ; Tue, 8 Jul 2008 01:38:30 -0700 X-ASG-Debug-ID: 1215506374-699702250000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AE5542C7411 for ; Tue, 8 Jul 2008 01:39:35 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id yLPPKBtiWZMIg74P for ; Tue, 08 Jul 2008 01:39:35 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id 8E495126FF; Tue, 8 Jul 2008 04:39:34 -0400 (EDT) Date: Tue, 8 Jul 2008 04:39:34 -0400 (EDT) From: Justin Piszcz To: David Greaves cc: linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Subject: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! In-Reply-To: Message-ID: References: <4872A2F4.2010604@dgreaves.com> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1215506375 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55460 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16784 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs On Tue, 8 Jul 2008, Justin Piszcz wrote: > > > On Tue, 8 Jul 2008, David Greaves wrote: > >> Justin Piszcz wrote: >>> Each PCI-e x1 card has 1 veliciraptor on it now. >>> Got an x4 card wit 4 sata ports: >> >> Useful - which card? >> >> David >> >> > > StarTech 4 Port PCI Express x4 SATA II Card Model PEXSATA24E > > Justin. > > > Chipset: Marvell 88SX7042 SATA Connectivity: Use four internal ports at the same time or two internal and two external ports Which is fully supported in the latest kernels (didn't try an old kernel): linux-2.6.25.10/drivers/ata/sata_mv.c /* Marvell 7042 support */ { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 }, From owner-xfs@oss.sgi.com Tue Jul 8 06:37:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 06:37:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00, DATE_IN_PAST_24_48 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m68DbMDl003746 for ; Tue, 8 Jul 2008 06:37:22 -0700 X-ASG-Debug-ID: 1215524290-2b4803b50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from spitz.ucw.cz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 001A02C8987 for ; Tue, 8 Jul 2008 06:38:16 -0700 (PDT) Received: from spitz.ucw.cz (gprs189-60.eurotel.cz [160.218.189.60]) by cuda.sgi.com with ESMTP id vyHGEJIEo7eq4HgI for ; Tue, 08 Jul 2008 06:38:16 -0700 (PDT) Received: by spitz.ucw.cz (Postfix, from userid 0) id 5D55F2787C; Mon, 7 Jul 2008 11:07:31 +0000 (UTC) Date: Mon, 7 Jul 2008 13:07:31 +0200 From: Pavel Machek To: Christoph Hellwig Cc: Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080707110730.GG5643@ucw.cz> References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080701081026.GB16691@infradead.org> User-Agent: Mutt/1.5.9i X-Barracuda-Connect: gprs189-60.eurotel.cz[160.218.189.60] X-Barracuda-Start-Time: 1215524305 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=DATE_IN_PAST_24_48 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55481 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.81 DATE_IN_PAST_24_48 Date: is 24 to 48 hours before Received: date X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16785 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pavel@suse.cz Precedence: bulk X-list: xfs Hi! > I still disagree with this whole patch. There is not reason to let > the freeze request timeout - an auto-unfreezing will only confuse the > hell out of the caller. The only reason where the current XFS freeze > call can hang and this would be theoretically useful is when the What happens when someone dirties so much data that vm swaps out whatever process that frozen the filesystem? I though that was why the timeout was there... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html From owner-xfs@oss.sgi.com Tue Jul 8 16:09:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 16:09:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m68N9Sv7010767 for ; Tue, 8 Jul 2008 16:09:29 -0700 X-ASG-Debug-ID: 1215558630-06dd03920000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 376772CBA3B for ; Tue, 8 Jul 2008 16:10:31 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id RlLskAlZCcxGzkOz for ; Tue, 08 Jul 2008 16:10:31 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAePc0h5LFxA/2dsb2JhbACyEg X-IronPort-AV: E=Sophos;i="4.30,326,1212330600"; d="scan'208";a="144725750" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 09 Jul 2008 08:40:28 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGMKJ-00074K-2m; Wed, 09 Jul 2008 09:10:27 +1000 Date: Wed, 9 Jul 2008 09:10:27 +1000 From: Dave Chinner To: Pavel Machek Cc: Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080708231026.GP11558@disturbed> Mail-Followup-To: Pavel Machek , Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080707110730.GG5643@ucw.cz> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215558633 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55519 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16786 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 07, 2008 at 01:07:31PM +0200, Pavel Machek wrote: > Hi! > > > I still disagree with this whole patch. There is not reason to let > > the freeze request timeout - an auto-unfreezing will only confuse the > > hell out of the caller. The only reason where the current XFS freeze > > call can hang and this would be theoretically useful is when the > > What happens when someone dirties so much data that vm swaps out > whatever process that frozen the filesystem? a) you can't dirty a frozen filesystem - by definition a frozen filesystem is a *clean filesystem* and *cannot be dirtied*. b) Swap doesn't write through the filesystem c) you can still read from a frozen filesystem to page your executableѕ in. d) if dirtying another unfrozen filesystem swaps out your application so it can't run, then there's a major VM bug. Regardless, until the app completes it is relying on the filesystem being frozen, so it better remain frozen.... > I though that was why the timeout was there... Not that I know of. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 8 16:18:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 16:18:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m68NIZEu011773 for ; Tue, 8 Jul 2008 16:18:36 -0700 X-ASG-Debug-ID: 1215559176-11e102b30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gprs189-60.eurotel.cz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2F8A518939C0 for ; Tue, 8 Jul 2008 16:19:37 -0700 (PDT) Received: from gprs189-60.eurotel.cz (gprs189-60.eurotel.cz [160.218.189.60]) by cuda.sgi.com with ESMTP id vrB7FnmjaDKjPjwK for ; Tue, 08 Jul 2008 16:19:37 -0700 (PDT) Received: by gprs189-60.eurotel.cz (Postfix, from userid 1000) id 83CDE506; Wed, 9 Jul 2008 01:20:31 +0200 (CEST) Date: Wed, 9 Jul 2008 01:20:31 +0200 From: Pavel Machek To: Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080708232031.GE18195@elf.ucw.cz> References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080708231026.GP11558@disturbed> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: gprs189-60.eurotel.cz[160.218.189.60] X-Barracuda-Start-Time: 1215559179 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55521 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16787 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pavel@suse.cz Precedence: bulk X-list: xfs On Wed 2008-07-09 09:10:27, Dave Chinner wrote: > On Mon, Jul 07, 2008 at 01:07:31PM +0200, Pavel Machek wrote: > > Hi! > > > > > I still disagree with this whole patch. There is not reason to let > > > the freeze request timeout - an auto-unfreezing will only confuse the > > > hell out of the caller. The only reason where the current XFS freeze > > > call can hang and this would be theoretically useful is when the > > > > What happens when someone dirties so much data that vm swaps out > > whatever process that frozen the filesystem? > > a) you can't dirty a frozen filesystem - by definition a frozen > filesystem is a *clean filesystem* and *cannot be dirtied*. Can you stop me? mmap("/some/huge_file", MAP_SHARED); then write to memory mapping? > b) Swap doesn't write through the filesystem > c) you can still read from a frozen filesystem to page your > executable?? in. atime modification should mean dirty data, right? And dirty data mean memory pressure, right? > d) if dirtying another unfrozen filesystem swaps out your ~~~~~~~ > application so it can't run, then there's a major VM bug. > Regardless, until the app completes it is relying on the > filesystem being frozen, so it better remain frozen.... Agreed. With emphasis on "another". > > I though that was why the timeout was there... > > Not that I know of. Ok, lets see how you deal with mmap. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html From owner-xfs@oss.sgi.com Tue Jul 8 17:51:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 17:52:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m690prDL022137 for ; Tue, 8 Jul 2008 17:51:54 -0700 X-ASG-Debug-ID: 1215564777-328702750000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id ED6D92CBF71 for ; Tue, 8 Jul 2008 17:52:58 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id RS5k1zKf9f0E2Mmu for ; Tue, 08 Jul 2008 17:52:58 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEABioc0h5LFxA/2dsb2JhbACxKQ X-IronPort-AV: E=Sophos;i="4.30,327,1212330600"; d="scan'208";a="144800286" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 09 Jul 2008 10:22:56 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGNvS-0000qa-IC; Wed, 09 Jul 2008 10:52:54 +1000 Date: Wed, 9 Jul 2008 10:52:54 +1000 From: Dave Chinner To: Pavel Machek Cc: Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709005254.GQ11558@disturbed> Mail-Followup-To: Pavel Machek , Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080708232031.GE18195@elf.ucw.cz> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215564778 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55525 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16788 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 01:20:31AM +0200, Pavel Machek wrote: > On Wed 2008-07-09 09:10:27, Dave Chinner wrote: > > On Mon, Jul 07, 2008 at 01:07:31PM +0200, Pavel Machek wrote: > > > Hi! > > > > > > > I still disagree with this whole patch. There is not reason to let > > > > the freeze request timeout - an auto-unfreezing will only confuse the > > > > hell out of the caller. The only reason where the current XFS freeze > > > > call can hang and this would be theoretically useful is when the > > > > > > What happens when someone dirties so much data that vm swaps out > > > whatever process that frozen the filesystem? > > > > a) you can't dirty a frozen filesystem - by definition a frozen > > filesystem is a *clean filesystem* and *cannot be dirtied*. > > Can you stop me? > > mmap("/some/huge_file", MAP_SHARED); > > then write to memory mapping? Sure - we can put a hook in ->page_mkwrite() to prevent it. We don't right now because nobody in the real world really cares if one half of a concurrent user data change is in the old snapshot or the new one...... > > b) Swap doesn't write through the filesystem > > c) you can still read from a frozen filesystem to page your > > executable?? in. > > atime modification should mean dirty data, right? Metadata, not data. If that's really a problem (and it never has been for XFS because we always allow in memory changes to atime) then touch_atime could be easily changed to avoid this... > And dirty data mean > memory pressure, right? If you walk enough inodes while the filesystem is frozen, it theoretically could happen. Typically a filesystem is only for a few seconds at a time so in the real world this has never, ever been a problem. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 8 18:10:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 18:11:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m691Awkn023535 for ; Tue, 8 Jul 2008 18:10:58 -0700 X-ASG-Debug-ID: 1215565922-75b600630000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from thunker.thunk.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 49F4F1894633 for ; Tue, 8 Jul 2008 18:12:02 -0700 (PDT) Received: from thunker.thunk.org (www.church-of-our-saviour.org [69.25.196.31]) by cuda.sgi.com with ESMTP id H9MydiP32djqWzZM for ; Tue, 08 Jul 2008 18:12:02 -0700 (PDT) Received: from root (helo=closure.thunk.org) by thunker.thunk.org with local-esmtp (Exim 4.50 #1 (Debian)) id 1KGOBQ-00066K-8m; Tue, 08 Jul 2008 21:09:24 -0400 Received: from tytso by closure.thunk.org with local (Exim 4.69) (envelope-from ) id 1KGOBO-0004AW-Ld; Tue, 08 Jul 2008 21:09:22 -0400 Date: Tue, 8 Jul 2008 21:09:22 -0400 From: Theodore Tso To: Pavel Machek , Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709010922.GE9957@mit.edu> Mail-Followup-To: Theodore Tso , Pavel Machek , Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080709005254.GQ11558@disturbed> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@mit.edu X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false X-Barracuda-Connect: www.church-of-our-saviour.org[69.25.196.31] X-Barracuda-Start-Time: 1215565923 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55525 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16789 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tytso@mit.edu Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 10:52:54AM +1000, Dave Chinner wrote: > If you walk enough inodes while the filesystem is frozen, it > theoretically could happen. Typically a filesystem is only for a > few seconds at a time so in the real world this has never, ever been > a problem. I had argued for the timeout (and so it's mostly my fault that Takashi-San included it as a feature) mainly because I was (and still amm) deeply paranoid about the competence of the application programers who might use this feature. I could see them screwing up leaving it locked forever --- perhaps when their program core dumps or when the user types ^C and they forgot to install a signal handler, leaving the filesystem frozen forever. In the meantime, user applications that try to create files on that filesystem, or write to files already opened when the filesystem are frozen will accumulate dirty pages in the page cache, until the system finally falls over. Think about some of the evil perpetrated by hal and the userspace suspend-resume scripts (and how much complexity with random XML fragments getting parsed by various dbus plugins), and tell me with a straight face that you would trust these modern-day desktop application writers with this interface. Because they *will* find some interesting way to (ab)use it..... Also, I didn't think the extra code complexity to implements timeouts was *that* bad --- it seemed fairly small for the functionality. Best regards, - Ted From owner-xfs@oss.sgi.com Tue Jul 8 22:49:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 22:50:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m695now5013508 for ; Tue, 8 Jul 2008 22:49:52 -0700 X-ASG-Debug-ID: 1215582655-563901580000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from cynthia.pants.nu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C3B2869A21E for ; Tue, 8 Jul 2008 22:50:55 -0700 (PDT) Received: from cynthia.pants.nu ([76.245.85.235]) by cuda.sgi.com with ESMTP id mgWNdIqug0HxaF4v for ; Tue, 08 Jul 2008 22:50:55 -0700 (PDT) Received: from flar by cynthia.pants.nu with local (Exim 4.50) id 1KGRBb-0007Cc-RG; Tue, 08 Jul 2008 21:21:47 -0700 Date: Tue, 8 Jul 2008 21:21:47 -0700 From: Brad Boyer To: Theodore Tso , Pavel Machek , Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709042147.GB20695@cynthia.pants.nu> References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080709010922.GE9957@mit.edu> User-Agent: Mutt/1.5.9i X-Barracuda-Connect: UNKNOWN[76.245.85.235] X-Barracuda-Start-Time: 1215582655 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.92 X-Barracuda-Spam-Status: No, SCORE=-1.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RDNS_NONE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55542 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16790 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: flar@allandria.com Precedence: bulk X-list: xfs On Tue, Jul 08, 2008 at 09:09:22PM -0400, Theodore Tso wrote: > I had argued for the timeout (and so it's mostly my fault that > Takashi-San included it as a feature) mainly because I was (and still > amm) deeply paranoid about the competence of the application > programers who might use this feature. I could see them screwing up > leaving it locked forever --- perhaps when their program core dumps or > when the user types ^C and they forgot to install a signal handler, > leaving the filesystem frozen forever. > > In the meantime, user applications that try to create files on that > filesystem, or write to files already opened when the filesystem are > frozen will accumulate dirty pages in the page cache, until the system > finally falls over. > > Think about some of the evil perpetrated by hal and the userspace > suspend-resume scripts (and how much complexity with random XML > fragments getting parsed by various dbus plugins), and tell me with a > straight face that you would trust these modern-day desktop > application writers with this interface. Because they *will* find > some interesting way to (ab)use it..... > > Also, I didn't think the extra code complexity to implements timeouts > was *that* bad --- it seemed fairly small for the functionality. Just as an extra point of reference, VxFS supports a freeze/thaw by ioctl very similar to this including a timeout in seconds. This means someone else thought it was a useful feature. http://sfdoccentral.symantec.com/sf/5.0/linux/manpages/vxfs/vxfsio_7.html Brad Boyer flar@allandria.com From owner-xfs@oss.sgi.com Tue Jul 8 23:12:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 23:12:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m696ClCO015387 for ; Tue, 8 Jul 2008 23:12:50 -0700 X-ASG-Debug-ID: 1215584031-3d4d00040000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pomaz-ex.szeredi.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3D3BD1895704 for ; Tue, 8 Jul 2008 23:13:52 -0700 (PDT) Received: from pomaz-ex.szeredi.hu (fxip-0047f.externet.hu [88.209.222.127]) by cuda.sgi.com with ESMTP id jKmeAoP2O8F4UDTV for ; Tue, 08 Jul 2008 23:13:52 -0700 (PDT) Received: from miko by pomaz-ex.szeredi.hu with local (Exim 4.63) (envelope-from ) id 1KGSvZ-0006dB-53; Wed, 09 Jul 2008 08:13:21 +0200 To: tytso@mit.edu CC: pavel@suse.cz, hch@infradead.org, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com In-reply-to: <20080709010922.GE9957@mit.edu> (message from Theodore Tso on Tue, 8 Jul 2008 21:09:22 -0400) X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> Message-Id: From: Miklos Szeredi Date: Wed, 09 Jul 2008 08:13:21 +0200 X-Barracuda-Connect: fxip-0047f.externet.hu[88.209.222.127] X-Barracuda-Start-Time: 1215584033 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55543 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16791 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs On Tue, 8 Jul 2008, Theodore Tso wrote: > On Wed, Jul 09, 2008 at 10:52:54AM +1000, Dave Chinner wrote: > > If you walk enough inodes while the filesystem is frozen, it > > theoretically could happen. Typically a filesystem is only for a > > few seconds at a time so in the real world this has never, ever been > > a problem. > > I had argued for the timeout (and so it's mostly my fault that > Takashi-San included it as a feature) mainly because I was (and still > amm) deeply paranoid about the competence of the application > programers who might use this feature. I could see them screwing up > leaving it locked forever --- perhaps when their program core dumps or > when the user types ^C and they forgot to install a signal handler, > leaving the filesystem frozen forever. A much better way to deal with that would be to limit the freeze to the lifetime of the process somehow. E.g. the freeze ioctl sets a bit in struct file (I'm sure we have some available) and release on the file checks this bit and thaws the filesystem. This would mean that freeze and thaw will have to be done on the same file descriptor, but this isn't unreasonable to expect, is it? Miklos From owner-xfs@oss.sgi.com Tue Jul 8 23:15:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 23:15:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m696FYbP016152 for ; Tue, 8 Jul 2008 23:15:35 -0700 X-ASG-Debug-ID: 1215584199-3de0001f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DA0AD1895742 for ; Tue, 8 Jul 2008 23:16:39 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id hSF2YTKC78u1HGEY for ; Tue, 08 Jul 2008 23:16:39 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KGSyT-0003x4-Hf; Wed, 09 Jul 2008 06:16:21 +0000 Date: Wed, 9 Jul 2008 02:16:21 -0400 From: Christoph Hellwig To: Miklos Szeredi Cc: tytso@mit.edu, pavel@suse.cz, hch@infradead.org, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709061621.GA5260@infradead.org> References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1215584199 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55543 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16792 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 08:13:21AM +0200, Miklos Szeredi wrote: > This would mean that freeze and thaw will have to be done on the same > file descriptor, but this isn't unreasonable to expect, is it? It is certainly not the current use case, where you run one command to freeze the filesystem and another one to unfreeze it. From owner-xfs@oss.sgi.com Tue Jul 8 23:22:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 23:22:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m696M93M016873 for ; Tue, 8 Jul 2008 23:22:09 -0700 X-ASG-Debug-ID: 1215584593-3de1008d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pomaz-ex.szeredi.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 61E3D18954FF for ; Tue, 8 Jul 2008 23:23:14 -0700 (PDT) Received: from pomaz-ex.szeredi.hu (fxip-0047f.externet.hu [88.209.222.127]) by cuda.sgi.com with ESMTP id NHdLvy7xCqQrv2hV for ; Tue, 08 Jul 2008 23:23:14 -0700 (PDT) Received: from miko by pomaz-ex.szeredi.hu with local (Exim 4.63) (envelope-from ) id 1KGT4q-0006fD-Jb; Wed, 09 Jul 2008 08:22:56 +0200 To: hch@infradead.org CC: miklos@szeredi.hu, tytso@mit.edu, pavel@suse.cz, hch@infradead.org, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com In-reply-to: <20080709061621.GA5260@infradead.org> (message from Christoph Hellwig on Wed, 9 Jul 2008 02:16:21 -0400) X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> Message-Id: From: Miklos Szeredi Date: Wed, 09 Jul 2008 08:22:56 +0200 X-Barracuda-Connect: fxip-0047f.externet.hu[88.209.222.127] X-Barracuda-Start-Time: 1215584594 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16793 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs On Wed, 9 Jul 2008, Christoph Hellwig wrote: > On Wed, Jul 09, 2008 at 08:13:21AM +0200, Miklos Szeredi wrote: > > This would mean that freeze and thaw will have to be done on the same > > file descriptor, but this isn't unreasonable to expect, is it? > > It is certainly not the current use case, where you run one command > to freeze the filesystem and another one to unfreeze it. So instead of freeze_fs mountpoint backup-command unfreeze_fs mountpoint the user would have do to run_freezed mountpoint backup-command I find the second one nicer, regardless of any reliability issues. Miklos From owner-xfs@oss.sgi.com Tue Jul 8 23:41:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 23:41:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m696fCgg018235 for ; Tue, 8 Jul 2008 23:41:12 -0700 X-ASG-Debug-ID: 1215585736-3de001910000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from casper.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B418D18955AB for ; Tue, 8 Jul 2008 23:42:16 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id Z9CVRXgRLVRWfmvP for ; Tue, 08 Jul 2008 23:42:16 -0700 (PDT) Received: from c-71-193-193-226.hsd1.or.comcast.net ([71.193.193.226] helo=localhost.localdomain) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1KGTMu-0004hQ-SQ; Wed, 09 Jul 2008 06:41:39 +0000 Date: Tue, 8 Jul 2008 23:41:20 -0700 From: Arjan van de Ven To: Miklos Szeredi Cc: hch@infradead.org, miklos@szeredi.hu, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080708234120.5072111f@infradead.org> In-Reply-To: References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> Organization: Intel X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1215585736 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16794 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: xfs On Wed, 09 Jul 2008 08:22:56 +0200 Miklos Szeredi wrote: > On Wed, 9 Jul 2008, Christoph Hellwig wrote: > > On Wed, Jul 09, 2008 at 08:13:21AM +0200, Miklos Szeredi wrote: > > > This would mean that freeze and thaw will have to be done on the > > > same file descriptor, but this isn't unreasonable to expect, is > > > it? > > > > It is certainly not the current use case, where you run one command > > to freeze the filesystem and another one to unfreeze it. > > So instead of > > freeze_fs mountpoint > backup-command > unfreeze_fs mountpoint > > the user would have do to > > run_freezed mountpoint backup-command > > I find the second one nicer, regardless of any reliability issues. nah he needs to do make_snapshot ; backup-command ; unref_snapshot. freezing isn't the right solution for the backup problem ;) -- If you want to reach me at my work email, use arjan@linux.intel.com For development, discussion and tips for power savings, visit http://www.lesswatts.org From owner-xfs@oss.sgi.com Tue Jul 8 23:48:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 23:48:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m696m4Qi018870 for ; Tue, 8 Jul 2008 23:48:05 -0700 X-ASG-Debug-ID: 1215586149-1b8e004b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pomaz-ex.szeredi.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6A4CD114C40C for ; Tue, 8 Jul 2008 23:49:09 -0700 (PDT) Received: from pomaz-ex.szeredi.hu (fxip-0047f.externet.hu [88.209.222.127]) by cuda.sgi.com with ESMTP id P9z6l9n5ACyhL8hd for ; Tue, 08 Jul 2008 23:49:09 -0700 (PDT) Received: from miko by pomaz-ex.szeredi.hu with local (Exim 4.63) (envelope-from ) id 1KGTTm-0006ke-Jh; Wed, 09 Jul 2008 08:48:42 +0200 To: arjan@infradead.org CC: miklos@szeredi.hu, hch@infradead.org, miklos@szeredi.hu, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com In-reply-to: <20080708234120.5072111f@infradead.org> (message from Arjan van de Ven on Tue, 8 Jul 2008 23:41:20 -0700) X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> Message-Id: From: Miklos Szeredi Date: Wed, 09 Jul 2008 08:48:42 +0200 X-Barracuda-Connect: fxip-0047f.externet.hu[88.209.222.127] X-Barracuda-Start-Time: 1215586150 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16795 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs On Tue, 8 Jul 2008, Arjan van de Ven wrote: > nah he needs to do > > make_snapshot ; backup-command ; unref_snapshot. > > freezing isn't the right solution for the backup problem ;) Confused, what's freezing _is_ for then? Patch description says: Currently, ext3 in mainline Linux doesn't have the freeze feature which suspends write requests. So, we cannot take a backup which keeps the filesystem's consistency with the storage device's features (snapshot and replication) while it is mounted. In many case, a commercial filesystem (e.g. VxFS) has the freeze feature and it would be used to get the consistent backup. If Linux's standard filesytem ext3 has the freeze feature, we can do it without a commercial filesystem. Miklos From owner-xfs@oss.sgi.com Tue Jul 8 23:55:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 23:55:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m696tTXe019474 for ; Tue, 8 Jul 2008 23:55:29 -0700 X-ASG-Debug-ID: 1215586593-7a9602610000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from casper.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9D39911E4F0A for ; Tue, 8 Jul 2008 23:56:34 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id 28QTYqtNYaaF45Eu for ; Tue, 08 Jul 2008 23:56:34 -0700 (PDT) Received: from c-71-193-193-226.hsd1.or.comcast.net ([71.193.193.226] helo=localhost.localdomain) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1KGTaU-0004rB-V5; Wed, 09 Jul 2008 06:55:42 +0000 Date: Tue, 8 Jul 2008 23:55:02 -0700 From: Arjan van de Ven To: Miklos Szeredi Cc: miklos@szeredi.hu, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080708235502.1c52a586@infradead.org> In-Reply-To: References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> Organization: Intel X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1215586594 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55545 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16796 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: xfs On Wed, 09 Jul 2008 08:48:42 +0200 Miklos Szeredi wrote: > On Tue, 8 Jul 2008, Arjan van de Ven wrote: > > nah he needs to do > > > > make_snapshot ; backup-command ; unref_snapshot. > > > > freezing isn't the right solution for the backup problem ;) > > Confused, what's freezing _is_ for then? Patch description says: > > Currently, ext3 in mainline Linux doesn't have the freeze feature > which suspends write requests. So, we cannot take a backup which > keeps the filesystem's consistency with the storage device's features > (snapshot and replication) while it is mounted. I tihnk the idea there is freeze . do the snapshot op . unfreeze . make backup of snapshot one can argue about the need of doing the first 3 steps via a userland loop; it sure sounds like one needs to be really careful to not do any writes to the fs from the app that does snapshots (and that includes doing any syscalls in the kernel that allocate memory.. just because that already could cause unrelated data to be written from inside the app. Not fun.) -- If you want to reach me at my work email, use arjan@linux.intel.com For development, discussion and tips for power savings, visit http://www.lesswatts.org From owner-xfs@oss.sgi.com Tue Jul 8 23:58:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 08 Jul 2008 23:58:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m696wsJS020013 for ; Tue, 8 Jul 2008 23:58:54 -0700 X-ASG-Debug-ID: 1215586798-798a010f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C016F2CCC83 for ; Tue, 8 Jul 2008 23:59:58 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ss6UxDx18WfqtSiz for ; Tue, 08 Jul 2008 23:59:58 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHz8c0h5LFxA/2dsb2JhbACweg X-IronPort-AV: E=Sophos;i="4.30,330,1212330600"; d="scan'208";a="145060804" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 09 Jul 2008 16:29:52 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGTeY-0000Ci-El; Wed, 09 Jul 2008 16:59:50 +1000 Date: Wed, 9 Jul 2008 16:59:50 +1000 From: Dave Chinner To: Arjan van de Ven Cc: Miklos Szeredi , hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709065950.GR11558@disturbed> Mail-Followup-To: Arjan van de Ven , Miklos Szeredi , hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080708234120.5072111f@infradead.org> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215586799 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55546 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16797 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 08, 2008 at 11:41:20PM -0700, Arjan van de Ven wrote: > On Wed, 09 Jul 2008 08:22:56 +0200 > Miklos Szeredi wrote: > > > On Wed, Jul 09, 2008 at 08:13:21AM +0200, Miklos Szeredi wrote: > > > > This would mean that freeze and thaw will have to be done on the > > > > same file descriptor, but this isn't unreasonable to expect, is > > > > it? > > > > > > It is certainly not the current use case, where you run one command > > > to freeze the filesystem and another one to unfreeze it. > > > > So instead of > > > > freeze_fs mountpoint > > backup-command > > unfreeze_fs mountpoint > > > > the user would have do to > > > > run_freezed mountpoint backup-command > > > > I find the second one nicer, regardless of any reliability issues. > > nah he needs to do > > make_snapshot ; backup-command ; unref_snapshot. > > freezing isn't the right solution for the backup problem ;) You're forgetting that to take a snapshot you generally need to freeze the filesystem. ;) i.e: freeze; make_snapshot; unfreeze backup-command unref_snapshot Yes, dm_snapshot does the freeze/snapshot/unfreeze for you, but the point is there is a freeze in the example you gave. The argument against Miklos' version is that there may be multiple commands to execute while the fs is frozen. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 9 00:07:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 00:07:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6977Me7023293 for ; Wed, 9 Jul 2008 00:07:22 -0700 X-ASG-Debug-ID: 1215587306-797f017b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pomaz-ex.szeredi.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A32402CCDE6 for ; Wed, 9 Jul 2008 00:08:26 -0700 (PDT) Received: from pomaz-ex.szeredi.hu (fxip-0047f.externet.hu [88.209.222.127]) by cuda.sgi.com with ESMTP id MacgYVg355Tsnhbj for ; Wed, 09 Jul 2008 00:08:26 -0700 (PDT) Received: from miko by pomaz-ex.szeredi.hu with local (Exim 4.63) (envelope-from ) id 1KGTmZ-0006oz-Qi; Wed, 09 Jul 2008 09:08:07 +0200 To: arjan@infradead.org CC: miklos@szeredi.hu, miklos@szeredi.hu, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com In-reply-to: <20080708235502.1c52a586@infradead.org> (message from Arjan van de Ven on Tue, 8 Jul 2008 23:55:02 -0700) X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> Message-Id: From: Miklos Szeredi Date: Wed, 09 Jul 2008 09:08:07 +0200 X-Barracuda-Connect: fxip-0047f.externet.hu[88.209.222.127] X-Barracuda-Start-Time: 1215587307 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55546 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16798 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs On Tue, 8 Jul 2008, Arjan van de Ven wrote: > I tihnk the idea there is > > freeze . do the snapshot op . unfreeze . make backup of snapshot Ah, so then my proposal would become run_frozen mountpoint do-snapshot do-backup release-snapshot and if they are afraid of deadlocks they can just implement the timeout in userspace: run_frozen -t timeout mountpoint do-snapshot 'run_frozen' can be a trivial 30 line app, that can be guaranteed not to deadlock. > one can argue about the need of doing the first 3 steps via a userland > loop; it sure sounds like one needs to be really careful to not do any > writes to the fs from the app that does snapshots (and that includes > doing any syscalls in the kernel that allocate memory.. just because > that already could cause unrelated data to be written from inside the > app. Not fun.) Userland always has to be careful when messing with raw devices. That alone is not a reason to put the snapshotting facility in kernel IMO. Miklos From owner-xfs@oss.sgi.com Wed Jul 9 00:12:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 00:12:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m697Cki6024019 for ; Wed, 9 Jul 2008 00:12:47 -0700 X-ASG-Debug-ID: 1215587630-3de003420000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7FB7A1895C07 for ; Wed, 9 Jul 2008 00:13:50 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id xlNqlC7GTwPId4lW for ; Wed, 09 Jul 2008 00:13:50 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMr/c0h5LFxA/2dsb2JhbACweQ X-IronPort-AV: E=Sophos;i="4.30,330,1212330600"; d="scan'208";a="145069926" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 09 Jul 2008 16:43:48 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGTs2-0000VO-FF; Wed, 09 Jul 2008 17:13:46 +1000 Date: Wed, 9 Jul 2008 17:13:46 +1000 From: Dave Chinner To: Arjan van de Ven Cc: Miklos Szeredi , hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709071346.GS11558@disturbed> Mail-Followup-To: Arjan van de Ven , Miklos Szeredi , hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080708235502.1c52a586@infradead.org> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215587631 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55546 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16799 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 08, 2008 at 11:55:02PM -0700, Arjan van de Ven wrote: > On Wed, 09 Jul 2008 08:48:42 +0200 > Miklos Szeredi wrote: > > > On Tue, 8 Jul 2008, Arjan van de Ven wrote: > > > nah he needs to do > > > > > > make_snapshot ; backup-command ; unref_snapshot. > > > > > > freezing isn't the right solution for the backup problem ;) > > > > Confused, what's freezing _is_ for then? Patch description says: > > > > Currently, ext3 in mainline Linux doesn't have the freeze feature > > which suspends write requests. So, we cannot take a backup which > > keeps the filesystem's consistency with the storage device's features > > (snapshot and replication) while it is mounted. > > I tihnk the idea there is > > freeze . do the snapshot op . unfreeze . make backup of snapshot > > one can argue about the need of doing the first 3 steps via a userland > loop; it sure sounds like one needs to be really careful to not do any > writes to the fs from the app that does snapshots (and that includes > doing any syscalls in the kernel that allocate memory.. just because > that already could cause unrelated data to be written from inside the > app. Not fun.) Bloody hell! Doesn't *anyone* understand that a frozen filesystem is *clean*? That the process of freezing it ensures all dirty data and metadata is written out before the freeze completes? And that once frozen, it can't be dirtied until unfrozen? That's 3 (or is it 4 - maybe 5 now that I think about it) different ppl in 24 hours that have made this same broken argument about being unable to write back dirty data on a frozen filesystem...... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 9 00:13:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 00:13:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m697D3aZ024158 for ; Wed, 9 Jul 2008 00:13:04 -0700 X-ASG-Debug-ID: 1215587647-4dd102b50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pomaz-ex.szeredi.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7F2461895C27 for ; Wed, 9 Jul 2008 00:14:08 -0700 (PDT) Received: from pomaz-ex.szeredi.hu (fxip-0047f.externet.hu [88.209.222.127]) by cuda.sgi.com with ESMTP id IGlmGKjfwvKGAsNE for ; Wed, 09 Jul 2008 00:14:08 -0700 (PDT) Received: from miko by pomaz-ex.szeredi.hu with local (Exim 4.63) (envelope-from ) id 1KGTrq-0006qj-1u; Wed, 09 Jul 2008 09:13:34 +0200 To: david@fromorbit.com CC: arjan@infradead.org, miklos@szeredi.hu, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com In-reply-to: <20080709065950.GR11558@disturbed> (message from Dave Chinner on Wed, 9 Jul 2008 16:59:50 +1000) X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080709065950.GR11558@disturbed> Message-Id: From: Miklos Szeredi Date: Wed, 09 Jul 2008 09:13:34 +0200 X-Barracuda-Connect: fxip-0047f.externet.hu[88.209.222.127] X-Barracuda-Start-Time: 1215587648 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55546 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16800 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs On Wed, 9 Jul 2008, Dave Chinner wrote: > The argument against Miklos' version is that there may be multiple > commands to execute while the fs is frozen. Which is what a shell is for ;) Miklos From owner-xfs@oss.sgi.com Wed Jul 9 00:32:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 00:33:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21, J_CHICKENPOX_46 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m697Wxo4031601 for ; Wed, 9 Jul 2008 00:32:59 -0700 X-ASG-Debug-ID: 1215588843-4aa700110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 72237DD1B6D for ; Wed, 9 Jul 2008 00:34:03 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id H9xWhGySNu0A3cSw for ; Wed, 09 Jul 2008 00:34:03 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAUHdEh5LFxA/2dsb2JhbACwcg X-IronPort-AV: E=Sophos;i="4.30,330,1212330600"; d="scan'208";a="145083240" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 09 Jul 2008 17:04:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGUBa-0000xD-UB; Wed, 09 Jul 2008 17:33:58 +1000 Date: Wed, 9 Jul 2008 17:33:58 +1000 From: Dave Chinner To: Miklos Szeredi Cc: arjan@infradead.org, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709073358.GT11558@disturbed> Mail-Followup-To: Miklos Szeredi , arjan@infradead.org, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080709065950.GR11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215588844 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55547 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16801 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 09:13:34AM +0200, Miklos Szeredi wrote: > On Wed, 9 Jul 2008, Dave Chinner wrote: > > The argument against Miklos' version is that there may be multiple > > commands to execute while the fs is frozen. > > Which is what a shell is for ;) Yeah, weĺl, with your method I ca't tell a user to: # xfs_freeze -f /mntpt # xfs_db -r -c 'sb 0' -c 'p rootino' /dev/foo 128 # xfs_db -r -c 'ino 128' -c 'p core.format' /dev/foo core.format = 2 (extents) # xfs_db ..... ..... # xfs_freeze -u /mntpt i.e. using the freeze to force all metadata to disk and prevent it from changing while doing interactive debugging of some problem. Yes, a one-shot freeze/unfreeze mechanism works for some use cases. The point is that it does not work for them all..... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 9 01:10:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 01:10:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21, J_CHICKENPOX_46 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m698AI67001386 for ; Wed, 9 Jul 2008 01:10:18 -0700 X-ASG-Debug-ID: 1215591083-60f4009b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from pomaz-ex.szeredi.hu (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0139ADD1D0A for ; Wed, 9 Jul 2008 01:11:23 -0700 (PDT) Received: from pomaz-ex.szeredi.hu (fxip-0047f.externet.hu [88.209.222.127]) by cuda.sgi.com with ESMTP id 5nczH8YF61fTiAPW for ; Wed, 09 Jul 2008 01:11:23 -0700 (PDT) Received: from miko by pomaz-ex.szeredi.hu with local (Exim 4.63) (envelope-from ) id 1KGUlR-0006zH-FT; Wed, 09 Jul 2008 10:11:01 +0200 To: david@fromorbit.com CC: miklos@szeredi.hu, arjan@infradead.org, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com In-reply-to: <20080709073358.GT11558@disturbed> (message from Dave Chinner on Wed, 9 Jul 2008 17:33:58 +1000) X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080709065950.GR11558@disturbed> <20080709073358.GT11558@disturbed> MIME-version: 1.0 Content-type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-Id: From: Miklos Szeredi Date: Wed, 09 Jul 2008 10:11:01 +0200 X-Barracuda-Connect: fxip-0047f.externet.hu[88.209.222.127] X-Barracuda-Start-Time: 1215591084 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55551 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16802 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: miklos@szeredi.hu Precedence: bulk X-list: xfs On Wed, 9 Jul 2008, Dave Chinner wrote: > On Wed, Jul 09, 2008 at 09:13:34AM +0200, Miklos Szeredi wrote: > > On Wed, 9 Jul 2008, Dave Chinner wrote: > > > The argument against Miklos' version is that there may be multiple > > > commands to execute while the fs is frozen. > > > > Which is what a shell is for ;) > > Yeah, weĺl, with your method I ca't tell a user to: > > # xfs_freeze -f /mntpt > # xfs_db -r -c 'sb 0' -c 'p rootino' /dev/foo > 128 > # xfs_db -r -c 'ino 128' -c 'p core.format' /dev/foo > core.format = 2 (extents) > # xfs_db ..... > ..... > # xfs_freeze -u /mntpt > > i.e. using the freeze to force all metadata to disk and > prevent it from changing while doing interactive debugging > of some problem. # run_freeze /mntpt /bin/bash # ... # ^D It's the same, no? Miklos From owner-xfs@oss.sgi.com Wed Jul 9 01:57:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 01:57:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_38, J_CHICKENPOX_62,J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m698vQEb004104 for ; Wed, 9 Jul 2008 01:57:28 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA16183; Wed, 9 Jul 2008 18:58:22 +1000 Message-ID: <48747DAD.7060501@sgi.com> Date: Wed, 09 Jul 2008 18:58:21 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 2/3] simplify xfs_setattr References: <20080627154557.GB31476@lst.de> <20080705172021.GA7177@lst.de> In-Reply-To: <20080705172021.GA7177@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16803 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Looks reasonable to me :) (odd notes below) --Tim Christoph Hellwig wrote: > On Fri, Jun 27, 2008 at 05:45:57PM +0200, Christoph Hellwig wrote: >> Now that xfs_setattr is only used for attributes set from ->setattr it >> can be switched to take struct iattr directly and thus simplify the >> implementation greatly. Also rename the ATTR_ flags to XFS_ATTR_ to >> not conflict with the ATTR_ flags used by the VFS. > > As per discussion with Tim here's a version that doesn't require the > generic ACL patch applied before: > > o stop using bhv_vattr_t and move over to struct iattr. where va_mask -> ia_valid > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-04 14:59:13.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-04 14:59:21.000000000 +0200 > @@ -2460,7 +2460,8 @@ xfs_dm_punch_hole( > #endif > > error = xfs_change_file_space(ip, XFS_IOC_UNRESVSP, &bf, > - (xfs_off_t)off, sys_cred, ATTR_DMI|ATTR_NOLOCK); > + (xfs_off_t)off, sys_cred, > + XFS_ATTR_DMI|XFS_ATTR_NOLOCK); > > /* > * if punching to end of file, kill any blocks past EOF that > @@ -2663,7 +2664,7 @@ xfs_dm_set_fileattr( > dm_fileattr_t __user *statp) > { > dm_fileattr_t stat; > - bhv_vattr_t vat; > + struct iattr iattr; > int error; > > /* Returns negative errors to DMAPI */ > @@ -2674,52 +2675,52 @@ xfs_dm_set_fileattr( > if (copy_from_user( &stat, statp, sizeof(stat))) > return(-EFAULT); > > - vat.va_mask = 0; > + iattr.ia_valid = 0; > > if (mask & DM_AT_MODE) { > - vat.va_mask |= XFS_AT_MODE; > - vat.va_mode = stat.fa_mode; > + iattr.ia_valid |= ATTR_MODE; > + iattr.ia_mode = stat.fa_mode; > } > if (mask & DM_AT_UID) { > - vat.va_mask |= XFS_AT_UID; > - vat.va_uid = stat.fa_uid; > + iattr.ia_valid |= ATTR_UID; > + iattr.ia_uid = stat.fa_uid; > } > if (mask & DM_AT_GID) { > - vat.va_mask |= XFS_AT_GID; > - vat.va_gid = stat.fa_gid; > + iattr.ia_valid |= ATTR_GID; > + iattr.ia_gid = stat.fa_gid; > } > if (mask & DM_AT_ATIME) { > - vat.va_mask |= XFS_AT_ATIME; > - vat.va_atime.tv_sec = stat.fa_atime; > - vat.va_atime.tv_nsec = 0; > + iattr.ia_valid |= ATTR_ATIME; > + iattr.ia_atime.tv_sec = stat.fa_atime; > + iattr.ia_atime.tv_nsec = 0; > inode->i_atime.tv_sec = stat.fa_atime; > } > if (mask & DM_AT_MTIME) { > - vat.va_mask |= XFS_AT_MTIME; > - vat.va_mtime.tv_sec = stat.fa_mtime; > - vat.va_mtime.tv_nsec = 0; > + iattr.ia_valid |= ATTR_MTIME; > + iattr.ia_mtime.tv_sec = stat.fa_mtime; > + iattr.ia_mtime.tv_nsec = 0; > } > if (mask & DM_AT_CTIME) { > - vat.va_mask |= XFS_AT_CTIME; > - vat.va_ctime.tv_sec = stat.fa_ctime; > - vat.va_ctime.tv_nsec = 0; > + iattr.ia_valid |= ATTR_CTIME; > + iattr.ia_ctime.tv_sec = stat.fa_ctime; > + iattr.ia_ctime.tv_nsec = 0; > } > > - /* DM_AT_DTIME only takes effect if DM_AT_CTIME is not specified. We > - overload ctime to also act as dtime, i.e. DM_CONFIG_DTIME_OVERLOAD. > - */ > - > + /* > + * DM_AT_DTIME only takes effect if DM_AT_CTIME is not specified. We > + * overload ctime to also act as dtime, i.e. DM_CONFIG_DTIME_OVERLOAD. > + */ > if ((mask & DM_AT_DTIME) && !(mask & DM_AT_CTIME)) { > - vat.va_mask |= XFS_AT_CTIME; > - vat.va_ctime.tv_sec = stat.fa_dtime; > - vat.va_ctime.tv_nsec = 0; > + iattr.ia_valid |= ATTR_CTIME; > + iattr.ia_ctime.tv_sec = stat.fa_dtime; > + iattr.ia_ctime.tv_nsec = 0; > } > if (mask & DM_AT_SIZE) { > - vat.va_mask |= XFS_AT_SIZE; > - vat.va_size = stat.fa_size; > + iattr.ia_valid |= ATTR_SIZE; > + iattr.ia_size = stat.fa_size; > } > > - error = xfs_setattr(XFS_I(inode), &vat, ATTR_DMI, NULL); > + error = xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); > if (!error) > vn_revalidate(vn_from_inode(inode)); /* update Linux inode flags */ > return(-error); /* Return negative error to DMAPI */ Looks good. > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-04 14:59:11.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-04 15:03:53.000000000 +0200 > @@ -656,54 +656,20 @@ xfs_vn_getattr( > STATIC int > xfs_vn_setattr( > struct dentry *dentry, > - struct iattr *attr) > + struct iattr *iattr) > { > struct inode *inode = dentry->d_inode; > - unsigned int ia_valid = attr->ia_valid; > - bhv_vattr_t vattr = { 0 }; > - int flags = 0; > int error; > > - if (ia_valid & ATTR_UID) { > - vattr.va_mask |= XFS_AT_UID; > - vattr.va_uid = attr->ia_uid; > - } > - if (ia_valid & ATTR_GID) { > - vattr.va_mask |= XFS_AT_GID; > - vattr.va_gid = attr->ia_gid; > - } > - if (ia_valid & ATTR_SIZE) { > - vattr.va_mask |= XFS_AT_SIZE; > - vattr.va_size = attr->ia_size; > - } > - if (ia_valid & ATTR_ATIME) { > - vattr.va_mask |= XFS_AT_ATIME; > - vattr.va_atime = attr->ia_atime; > - inode->i_atime = attr->ia_atime; > - } > - if (ia_valid & ATTR_MTIME) { > - vattr.va_mask |= XFS_AT_MTIME; > - vattr.va_mtime = attr->ia_mtime; > - } > - if (ia_valid & ATTR_CTIME) { > - vattr.va_mask |= XFS_AT_CTIME; > - vattr.va_ctime = attr->ia_ctime; > - } > - if (ia_valid & ATTR_MODE) { > - vattr.va_mask |= XFS_AT_MODE; > - vattr.va_mode = attr->ia_mode; > + if (iattr->ia_valid & ATTR_ATIME) > + inode->i_atime = iattr->ia_atime; > + > + if (iattr->ia_valid & ATTR_MODE) { > if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) > inode->i_mode &= ~S_ISGID; > } > So just need to keep the changes to the inode, don't need to set vattr as we are just passing thru iattr into xfs_setattr now. Fine. > - if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) > - flags |= ATTR_UTIME; > -#ifdef ATTR_NO_BLOCK > - if ((ia_valid & ATTR_NO_BLOCK)) > - flags |= ATTR_NONBLOCK; > -#endif > - So this code looks different. We are now dropping the flags. Why is that? Presumably because we were mapping ia_valid's: ATTR_MTIME_SET or ATTR_ATIME_SET --> ATTR_UTIME ATTR_NO_BLOCK -> ATTR_NONBLOCK But now we pass ATTR_?TIME_SET and ATTR_NO_BLOCK straight thru. So previously we didn't map them onto va_mask bits but as separate flags instead. > - error = xfs_setattr(XFS_I(inode), &vattr, flags, NULL); > + error = xfs_setattr(XFS_I(inode), iattr, 0, NULL); So no flags here now. > if (likely(!error)) > vn_revalidate(vn_from_inode(inode)); > return -error; > @@ -747,18 +713,18 @@ xfs_vn_fallocate( > > xfs_ilock(ip, XFS_IOLOCK_EXCL); > error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf, > - 0, NULL, ATTR_NOLOCK); > + 0, NULL, XFS_ATTR_NOLOCK); > if (!error && !(mode & FALLOC_FL_KEEP_SIZE) && > offset + len > i_size_read(inode)) > new_size = offset + len; > > /* Change file size if needed */ > if (new_size) { > - bhv_vattr_t va; > + struct iattr iattr; > > - va.va_mask = XFS_AT_SIZE; > - va.va_size = new_size; > - error = xfs_setattr(ip, &va, ATTR_NOLOCK, NULL); > + iattr.ia_valid = ATTR_SIZE; > + iattr.ia_size = new_size; > + error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK, NULL); > } > Fine. > xfs_iunlock(ip, XFS_IOLOCK_EXCL); > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-04 14:59:14.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-04 14:59:21.000000000 +0200 > @@ -19,7 +19,6 @@ > #define __XFS_VNODE_H__ > > struct file; > -struct bhv_vattr; > struct xfs_iomap; > struct attrlist_cursor_kern; > > @@ -66,69 +65,6 @@ static inline struct inode *vn_to_inode( > Prevent VM access to the pages until > the operation completes. */ > > -/* > - * Vnode attributes. va_mask indicates those attributes the caller > - * wants to set or extract. > - */ > -typedef struct bhv_vattr { > - int va_mask; /* bit-mask of attributes present */ > - mode_t va_mode; /* file access mode and type */ > - xfs_nlink_t va_nlink; /* number of references to file */ > - uid_t va_uid; /* owner user id */ > - gid_t va_gid; /* owner group id */ > - xfs_ino_t va_nodeid; /* file id */ > - xfs_off_t va_size; /* file size in bytes */ > - u_long va_blocksize; /* blocksize preferred for i/o */ > - struct timespec va_atime; /* time of last access */ > - struct timespec va_mtime; /* time of last modification */ > - struct timespec va_ctime; /* time file changed */ > - u_int va_gen; /* generation number of file */ > - xfs_dev_t va_rdev; /* device the special file represents */ > - __int64_t va_nblocks; /* number of blocks allocated */ > - u_long va_xflags; /* random extended file flags */ > - u_long va_extsize; /* file extent size */ > - u_long va_nextents; /* number of extents in file */ > - u_long va_anextents; /* number of attr extents in file */ > - prid_t va_projid; /* project id */ > -} bhv_vattr_t; > - > -/* > - * setattr or getattr attributes > - */ > -#define XFS_AT_TYPE 0x00000001 > -#define XFS_AT_MODE 0x00000002 > -#define XFS_AT_UID 0x00000004 > -#define XFS_AT_GID 0x00000008 > -#define XFS_AT_FSID 0x00000010 > -#define XFS_AT_NODEID 0x00000020 > -#define XFS_AT_NLINK 0x00000040 > -#define XFS_AT_SIZE 0x00000080 > -#define XFS_AT_ATIME 0x00000100 > -#define XFS_AT_MTIME 0x00000200 > -#define XFS_AT_CTIME 0x00000400 > -#define XFS_AT_RDEV 0x00000800 > -#define XFS_AT_BLKSIZE 0x00001000 > -#define XFS_AT_NBLOCKS 0x00002000 > -#define XFS_AT_VCODE 0x00004000 > -#define XFS_AT_MAC 0x00008000 > -#define XFS_AT_UPDATIME 0x00010000 > -#define XFS_AT_UPDMTIME 0x00020000 > -#define XFS_AT_UPDCTIME 0x00040000 > -#define XFS_AT_ACL 0x00080000 > -#define XFS_AT_CAP 0x00100000 > -#define XFS_AT_INF 0x00200000 > -#define XFS_AT_NEXTENTS 0x01000000 > -#define XFS_AT_ANEXTENTS 0x02000000 > -#define XFS_AT_SIZE_NOPERM 0x08000000 > -#define XFS_AT_GENCOUNT 0x10000000 > - > -#define XFS_AT_TIMES (XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME) > - > -#define XFS_AT_UPDTIMES (XFS_AT_UPDATIME|XFS_AT_UPDMTIME|XFS_AT_UPDCTIME) > - > -#define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\ > - XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ > - XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) > Cool. Get rid of a whole bunch of stuff. > extern void vn_init(void); > extern int vn_revalidate(bhv_vnode_t *); > @@ -204,15 +140,6 @@ static inline void vn_atime_to_time_t(bh > #define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \ > PAGECACHE_TAG_DIRTY) > > -/* > - * Flags to vop_setattr/getattr. > - */ > -#define ATTR_UTIME 0x01 /* non-default utime(2) request */ > -#define ATTR_DMI 0x08 /* invocation from a DMI function */ > -#define ATTR_LAZY 0x80 /* set/get attributes lazily */ > -#define ATTR_NONBLOCK 0x100 /* return EAGAIN if operation would block */ > -#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */ > -#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */ > So where do these go now? Looking ahead: xfs_vnodeops.h: DMI,NONBLOCK,NOLOCK And UTIME, LAZY and NOSIZETOK are gone. LAZY doesn't seem to be used anywhere. NOSIZETOK is presumably for cxfs. UTIME is done by ATTR_MTIME_SET or ATTR_ATIME_SET now (passed straight thru). > /* > * Tracking vnode activity. > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-04 14:59:14.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-04 14:59:21.000000000 +0200 > @@ -75,19 +75,16 @@ xfs_open( > return 0; > } > > -/* > - * xfs_setattr > - */ > int > xfs_setattr( > - xfs_inode_t *ip, > - bhv_vattr_t *vap, > + struct xfs_inode *ip, > + struct iattr *iattr, > int flags, > cred_t *credp) > { > xfs_mount_t *mp = ip->i_mount; > + int mask = iattr->ia_valid; > xfs_trans_t *tp; > - int mask; > int code; > uint lock_flags; > uint commit_flags=0; > @@ -103,30 +100,9 @@ xfs_setattr( > if (mp->m_flags & XFS_MOUNT_RDONLY) > return XFS_ERROR(EROFS); > > - /* > - * Cannot set certain attributes. > - */ > - mask = vap->va_mask; > - if (mask & XFS_AT_NOSET) { > - return XFS_ERROR(EINVAL); > - } > - So we get rid of the test for XFS_AT_NOSET. where: #define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\ XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) I can't see anywhere we set any of these. Presumably out of the xattr calls. Some left over from IRIX I guess. > if (XFS_FORCED_SHUTDOWN(mp)) > return XFS_ERROR(EIO); > > - /* > - * Timestamps do not need to be logged and hence do not > - * need to be done within a transaction. > - */ > - if (mask & XFS_AT_UPDTIMES) { > - ASSERT((mask & ~XFS_AT_UPDTIMES) == 0); > - timeflags = ((mask & XFS_AT_UPDATIME) ? XFS_ICHGTIME_ACC : 0) | > - ((mask & XFS_AT_UPDCTIME) ? XFS_ICHGTIME_CHG : 0) | > - ((mask & XFS_AT_UPDMTIME) ? XFS_ICHGTIME_MOD : 0); > - xfs_ichgtime(ip, timeflags); > - return 0; > - } > - #define XFS_AT_UPDATIME 0x00010000 #define XFS_AT_UPDMTIME 0x00020000 #define XFS_AT_UPDCTIME 0x00040000 3 more not supported by vfs ATTR_* macros. I can't see where we set any of these. So no loss there I guess. Presumably they were just for IRIX. > olddquot1 = olddquot2 = NULL; > udqp = gdqp = NULL; > > @@ -138,17 +114,17 @@ xfs_setattr( > * If the IDs do change before we take the ilock, we're covered > * because the i_*dquot fields will get updated anyway. > */ > - if (XFS_IS_QUOTA_ON(mp) && (mask & (XFS_AT_UID|XFS_AT_GID))) { > + if (XFS_IS_QUOTA_ON(mp) && (mask & (ATTR_UID|ATTR_GID))) { > uint qflags = 0; > > - if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) { > - uid = vap->va_uid; > + if ((mask & ATTR_UID) && XFS_IS_UQUOTA_ON(mp)) { > + uid = iattr->ia_uid; > qflags |= XFS_QMOPT_UQUOTA; > } else { > uid = ip->i_d.di_uid; > } > - if ((mask & XFS_AT_GID) && XFS_IS_GQUOTA_ON(mp)) { > - gid = vap->va_gid; > + if ((mask & ATTR_GID) && XFS_IS_GQUOTA_ON(mp)) { > + gid = iattr->ia_gid; > qflags |= XFS_QMOPT_GQUOTA; > } else { > gid = ip->i_d.di_gid; > @@ -173,10 +149,10 @@ xfs_setattr( > */ > tp = NULL; > lock_flags = XFS_ILOCK_EXCL; > - if (flags & ATTR_NOLOCK) > + if (flags & XFS_ATTR_NOLOCK) > need_iolock = 0; > - if (!(mask & XFS_AT_SIZE)) { > - if ((mask != (XFS_AT_CTIME|XFS_AT_ATIME|XFS_AT_MTIME)) || > + if (!(mask & ATTR_SIZE)) { > + if ((mask != (ATTR_CTIME|ATTR_ATIME|ATTR_MTIME)) || > (mp->m_flags & XFS_MOUNT_WSYNC)) { > tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); > commit_flags = 0; > @@ -189,10 +165,10 @@ xfs_setattr( > } > } else { > if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) && > - !(flags & ATTR_DMI)) { > + !(flags & XFS_ATTR_DMI)) { > int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; > code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, ip, > - vap->va_size, 0, dmflags, NULL); > + iattr->ia_size, 0, dmflags, NULL); > if (code) { > lock_flags = 0; > goto error_return; > @@ -212,7 +188,7 @@ xfs_setattr( > * Only the owner or users with CAP_FOWNER > * capability may do these things. > */ > - if (mask & (XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID)) { > + if (mask & (ATTR_MODE|ATTR_UID|ATTR_GID)) { > /* > * CAP_FOWNER overrides the following restrictions: > * > @@ -236,21 +212,21 @@ xfs_setattr( > * IDs of the calling process shall match the group owner of > * the file when setting the set-group-ID bit on that file > */ > - if (mask & XFS_AT_MODE) { > + if (mask & ATTR_MODE) { > mode_t m = 0; > > - if ((vap->va_mode & S_ISUID) && !file_owner) > + if ((iattr->ia_mode & S_ISUID) && !file_owner) > m |= S_ISUID; > - if ((vap->va_mode & S_ISGID) && > + if ((iattr->ia_mode & S_ISGID) && > !in_group_p((gid_t)ip->i_d.di_gid)) > m |= S_ISGID; > #if 0 > /* Linux allows this, Irix doesn't. */ > - if ((vap->va_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode)) > + if ((iattr->ia_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode)) > m |= S_ISVTX; > #endif > if (m && !capable(CAP_FSETID)) > - vap->va_mode &= ~m; > + iattr->ia_mode &= ~m; > } > } > > @@ -261,7 +237,7 @@ xfs_setattr( > * and can change the group id only to a group of which he > * or she is a member. > */ > - if (mask & (XFS_AT_UID|XFS_AT_GID)) { > + if (mask & (ATTR_UID|ATTR_GID)) { > /* > * These IDs could have changed since we last looked at them. > * But, we're assured that if the ownership did change > @@ -270,8 +246,8 @@ xfs_setattr( > */ > iuid = ip->i_d.di_uid; > igid = ip->i_d.di_gid; > - gid = (mask & XFS_AT_GID) ? vap->va_gid : igid; > - uid = (mask & XFS_AT_UID) ? vap->va_uid : iuid; > + gid = (mask & ATTR_GID) ? iattr->ia_gid : igid; > + uid = (mask & ATTR_UID) ? iattr->ia_uid : iuid; > > /* > * CAP_CHOWN overrides the following restrictions: > @@ -308,13 +284,13 @@ xfs_setattr( > /* > * Truncate file. Must have write permission and not be a directory. > */ > - if (mask & XFS_AT_SIZE) { > + if (mask & ATTR_SIZE) { > /* Short circuit the truncate case for zero length files */ > - if ((vap->va_size == 0) && > - (ip->i_size == 0) && (ip->i_d.di_nextents == 0)) { > + if (iattr->ia_size == 0 && > + ip->i_size == 0 && ip->i_d.di_nextents == 0) { > xfs_iunlock(ip, XFS_ILOCK_EXCL); > lock_flags &= ~XFS_ILOCK_EXCL; > - if (mask & XFS_AT_CTIME) > + if (mask & ATTR_CTIME) > xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); > code = 0; > goto error_return; > @@ -337,9 +313,9 @@ xfs_setattr( > /* > * Change file access or modified times. > */ > - if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) { > + if (mask & (ATTR_ATIME|ATTR_MTIME)) { > if (!file_owner) { > - if ((flags & ATTR_UTIME) && > + if ((mask & (ATTR_MTIME_SET|ATTR_ATIME_SET)) && > !capable(CAP_FOWNER)) { > code = XFS_ERROR(EPERM); > goto error_return; > @@ -349,23 +325,22 @@ xfs_setattr( > > /* > * Now we can make the changes. Before we join the inode > - * to the transaction, if XFS_AT_SIZE is set then take care of > + * to the transaction, if ATTR_SIZE is set then take care of > * the part of the truncation that must be done without the > * inode lock. This needs to be done before joining the inode > * to the transaction, because the inode cannot be unlocked > * once it is a part of the transaction. > */ > - if (mask & XFS_AT_SIZE) { > + if (mask & ATTR_SIZE) { > code = 0; > - if ((vap->va_size > ip->i_size) && > - (flags & ATTR_NOSIZETOK) == 0) { > + if (iattr->ia_size > ip->i_size) { Yeah, so we no longer support ATTR_NOSIZETOK (presumably for cxfs). > /* > * Do the first part of growing a file: zero any data > * in the last block that is beyond the old EOF. We > * need to do this before the inode is joined to the > * transaction to modify the i_size. > */ > - code = xfs_zero_eof(ip, vap->va_size, ip->i_size); > + code = xfs_zero_eof(ip, iattr->ia_size, ip->i_size); > } > xfs_iunlock(ip, XFS_ILOCK_EXCL); > > @@ -382,10 +357,10 @@ xfs_setattr( > * not within the range we care about here. > */ > if (!code && > - (ip->i_size != ip->i_d.di_size) && > - (vap->va_size > ip->i_d.di_size)) { > + ip->i_size != ip->i_d.di_size && > + iattr->ia_size > ip->i_d.di_size) { > code = xfs_flush_pages(ip, > - ip->i_d.di_size, vap->va_size, > + ip->i_d.di_size, iattr->ia_size, > XFS_B_ASYNC, FI_NONE); > } > > @@ -393,7 +368,7 @@ xfs_setattr( > vn_iowait(ip); > > if (!code) > - code = xfs_itruncate_data(ip, vap->va_size); > + code = xfs_itruncate_data(ip, iattr->ia_size); > if (code) { > ASSERT(tp == NULL); > lock_flags &= ~XFS_ILOCK_EXCL; > @@ -422,31 +397,30 @@ xfs_setattr( > /* > * Truncate file. Must have write permission and not be a directory. > */ > - if (mask & XFS_AT_SIZE) { > + if (mask & ATTR_SIZE) { > /* > * Only change the c/mtime if we are changing the size > * or we are explicitly asked to change it. This handles > * the semantic difference between truncate() and ftruncate() > * as implemented in the VFS. > */ > - if (vap->va_size != ip->i_size || (mask & XFS_AT_CTIME)) > + if (iattr->ia_size != ip->i_size || (mask & ATTR_CTIME)) > timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; > > - if (vap->va_size > ip->i_size) { > - ip->i_d.di_size = vap->va_size; > - ip->i_size = vap->va_size; > - if (!(flags & ATTR_DMI)) > + if (iattr->ia_size > ip->i_size) { > + ip->i_d.di_size = iattr->ia_size; > + ip->i_size = iattr->ia_size; > + if (!(flags & XFS_ATTR_DMI)) > xfs_ichgtime(ip, XFS_ICHGTIME_CHG); > xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > - } else if ((vap->va_size <= ip->i_size) || > - ((vap->va_size == 0) && ip->i_d.di_nextents)) { > + } else if (iattr->ia_size <= ip->i_size || > + (iattr->ia_size == 0 && ip->i_d.di_nextents)) { > /* > * signal a sync transaction unless > * we're truncating an already unlinked > * file on a wsync filesystem > */ > - code = xfs_itruncate_finish(&tp, ip, > - (xfs_fsize_t)vap->va_size, > + code = xfs_itruncate_finish(&tp, ip, iattr->ia_size, > XFS_DATA_FORK, > ((ip->i_d.di_nlink != 0 || > !(mp->m_flags & XFS_MOUNT_WSYNC)) > @@ -468,9 +442,9 @@ xfs_setattr( > /* > * Change file access modes. > */ > - if (mask & XFS_AT_MODE) { > + if (mask & ATTR_MODE) { > ip->i_d.di_mode &= S_IFMT; > - ip->i_d.di_mode |= vap->va_mode & ~S_IFMT; > + ip->i_d.di_mode |= iattr->ia_mode & ~S_IFMT; > > xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); > timeflags |= XFS_ICHGTIME_CHG; > @@ -483,7 +457,7 @@ xfs_setattr( > * and can change the group id only to a group of which he > * or she is a member. > */ > - if (mask & (XFS_AT_UID|XFS_AT_GID)) { > + if (mask & (ATTR_UID|ATTR_GID)) { > /* > * CAP_FSETID overrides the following restrictions: > * > @@ -501,7 +475,7 @@ xfs_setattr( > */ > if (iuid != uid) { > if (XFS_IS_UQUOTA_ON(mp)) { > - ASSERT(mask & XFS_AT_UID); > + ASSERT(mask & ATTR_UID); > ASSERT(udqp); > olddquot1 = XFS_QM_DQVOPCHOWN(mp, tp, ip, > &ip->i_udquot, udqp); > @@ -511,7 +485,7 @@ xfs_setattr( > if (igid != gid) { > if (XFS_IS_GQUOTA_ON(mp)) { > ASSERT(!XFS_IS_PQUOTA_ON(mp)); > - ASSERT(mask & XFS_AT_GID); > + ASSERT(mask & ATTR_GID); > ASSERT(gdqp); > olddquot2 = XFS_QM_DQVOPCHOWN(mp, tp, ip, > &ip->i_gdquot, gdqp); > @@ -527,31 +501,31 @@ xfs_setattr( > /* > * Change file access or modified times. > */ > - if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) { > - if (mask & XFS_AT_ATIME) { > - ip->i_d.di_atime.t_sec = vap->va_atime.tv_sec; > - ip->i_d.di_atime.t_nsec = vap->va_atime.tv_nsec; > + if (mask & (ATTR_ATIME|ATTR_MTIME)) { > + if (mask & ATTR_ATIME) { > + ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; > + ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; > ip->i_update_core = 1; > timeflags &= ~XFS_ICHGTIME_ACC; > } > - if (mask & XFS_AT_MTIME) { > - ip->i_d.di_mtime.t_sec = vap->va_mtime.tv_sec; > - ip->i_d.di_mtime.t_nsec = vap->va_mtime.tv_nsec; > + if (mask & ATTR_MTIME) { > + ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; > + ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; > timeflags &= ~XFS_ICHGTIME_MOD; > timeflags |= XFS_ICHGTIME_CHG; > } > - if (tp && (flags & ATTR_UTIME)) > + if (tp && (mask & (ATTR_MTIME_SET|ATTR_ATIME_SET))) > xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); > } > > /* > - * Change file inode change time only if XFS_AT_CTIME set > + * Change file inode change time only if ATTR_CTIME set > * AND we have been called by a DMI function. > */ > > - if ( (flags & ATTR_DMI) && (mask & XFS_AT_CTIME) ) { > - ip->i_d.di_ctime.t_sec = vap->va_ctime.tv_sec; > - ip->i_d.di_ctime.t_nsec = vap->va_ctime.tv_nsec; > + if ((flags & XFS_ATTR_DMI) && (mask & ATTR_CTIME)) { > + ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; > + ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; > ip->i_update_core = 1; > timeflags &= ~XFS_ICHGTIME_CHG; > } > @@ -560,7 +534,7 @@ xfs_setattr( > * Send out timestamp changes that need to be set to the > * current time. Not done when called by a DMI function. > */ > - if (timeflags && !(flags & ATTR_DMI)) > + if (timeflags && !(flags & XFS_ATTR_DMI)) > xfs_ichgtime(ip, timeflags); > > XFS_STATS_INC(xs_ig_attrchg); > @@ -598,7 +572,7 @@ xfs_setattr( > } > > if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && > - !(flags & ATTR_DMI)) { > + !(flags & XFS_ATTR_DMI)) { > (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL, > NULL, DM_RIGHT_NULL, NULL, NULL, > 0, 0, AT_DELAY_FLAG(flags)); > @@ -3033,7 +3007,7 @@ xfs_alloc_file_space( > > /* Generate a DMAPI event if needed. */ > if (alloc_type != 0 && offset < ip->i_size && > - (attr_flags&ATTR_DMI) == 0 && > + (attr_flags & XFS_ATTR_DMI) == 0 && > DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { > xfs_off_t end_dmi_offset; > > @@ -3147,7 +3121,7 @@ retry: > allocatesize_fsb -= allocated_fsb; > } > dmapi_enospc_check: > - if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 && > + if (error == ENOSPC && (attr_flags & XFS_ATTR_DMI) == 0 && > DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) { > error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, > ip, DM_RIGHT_NULL, > @@ -3294,7 +3268,7 @@ xfs_free_file_space( > end_dmi_offset = offset + len; > endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset); > > - if (offset < ip->i_size && (attr_flags & ATTR_DMI) == 0 && > + if (offset < ip->i_size && (attr_flags & XFS_ATTR_DMI) == 0 && > DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { > if (end_dmi_offset > ip->i_size) > end_dmi_offset = ip->i_size; > @@ -3305,7 +3279,7 @@ xfs_free_file_space( > return error; > } > > - if (attr_flags & ATTR_NOLOCK) > + if (attr_flags & XFS_ATTR_NOLOCK) > need_iolock = 0; > if (need_iolock) { > xfs_ilock(ip, XFS_IOLOCK_EXCL); > @@ -3482,7 +3456,7 @@ xfs_change_file_space( > xfs_off_t startoffset; > xfs_off_t llen; > xfs_trans_t *tp; > - bhv_vattr_t va; > + struct iattr iattr; > > xfs_itrace_entry(ip); > > @@ -3556,10 +3530,10 @@ xfs_change_file_space( > break; > } > > - va.va_mask = XFS_AT_SIZE; > - va.va_size = startoffset; > + iattr.ia_valid = ATTR_SIZE; > + iattr.ia_size = startoffset; > > - error = xfs_setattr(ip, &va, attr_flags, credp); > + error = xfs_setattr(ip, &iattr, attr_flags, credp); > > if (error) > return error; > @@ -3589,7 +3563,7 @@ xfs_change_file_space( > xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); > xfs_trans_ihold(tp, ip); > > - if ((attr_flags & ATTR_DMI) == 0) { > + if ((attr_flags & XFS_ATTR_DMI) == 0) { > ip->i_d.di_mode &= ~S_ISUID; > > /* > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2008-07-04 14:58:36.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2008-07-04 14:59:21.000000000 +0200 > @@ -2,9 +2,9 @@ > #define _XFS_VNODEOPS_H 1 > > struct attrlist_cursor_kern; > -struct bhv_vattr; > struct cred; > struct file; > +struct iattr; > struct inode; > struct iovec; > struct kiocb; > @@ -15,8 +15,12 @@ struct xfs_iomap; > > > int xfs_open(struct xfs_inode *ip); > -int xfs_setattr(struct xfs_inode *ip, struct bhv_vattr *vap, int flags, > +int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags, > struct cred *credp); > +#define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */ > +#define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */ > +#define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */ > + So we don't bring thru: ATTR_UTIME, ATTR_LAZY, ATTR_NOSIZETOK > int xfs_readlink(struct xfs_inode *ip, char *link); > int xfs_fsync(struct xfs_inode *ip); > int xfs_release(struct xfs_inode *ip); > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-04 14:59:14.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-04 14:59:21.000000000 +0200 > @@ -685,9 +685,9 @@ xfs_ioc_space( > return -XFS_ERROR(EFAULT); > > if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) > - attr_flags |= ATTR_NONBLOCK; > + attr_flags |= XFS_ATTR_NONBLOCK; > if (ioflags & IO_INVIS) > - attr_flags |= ATTR_DMI; > + attr_flags |= XFS_ATTR_DMI; > > error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, > NULL, attr_flags); > Index: linux-2.6-xfs/fs/xfs/xfs_dmapi.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_dmapi.h 2008-07-04 14:58:36.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_dmapi.h 2008-07-04 14:59:21.000000000 +0200 > @@ -166,6 +166,6 @@ typedef enum { > > #define FILP_DELAY_FLAG(filp) ((filp->f_flags&(O_NDELAY|O_NONBLOCK)) ? \ > DM_FLAGS_NDELAY : 0) > -#define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) > +#define AT_DELAY_FLAG(f) ((f & XFS_ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) > > #endif /* __XFS_DMAPI_H__ */ > Index: linux-2.6-xfs/fs/xfs/xfs_acl.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-04 15:01:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-04 15:02:47.000000000 +0200 > @@ -720,7 +720,7 @@ xfs_acl_setmode( > xfs_acl_t *acl, > int *basicperms) > { > - bhv_vattr_t va; > + struct iattr iattr; > xfs_acl_entry_t *ap; > xfs_acl_entry_t *gap = NULL; > int i, nomask = 1; > @@ -734,25 +734,25 @@ xfs_acl_setmode( > * Copy the u::, g::, o::, and m:: bits from the ACL into the > * mode. The m:: bits take precedence over the g:: bits. > */ > - va.va_mask = XFS_AT_MODE; > - va.va_mode = xfs_vtoi(vp)->i_d.di_mode; > - va.va_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); > + iattr.ia_mask = XFS_AT_MODE; > + iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; > + iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); > ap = acl->acl_entry; > for (i = 0; i < acl->acl_cnt; ++i) { > switch (ap->ae_tag) { > case ACL_USER_OBJ: > - va.va_mode |= ap->ae_perm << 6; > + iattr.ia_mode |= ap->ae_perm << 6; > break; > case ACL_GROUP_OBJ: > gap = ap; > break; > case ACL_MASK: /* more than just standard modes */ > nomask = 0; > - va.va_mode |= ap->ae_perm << 3; > + iattr.ia_mode |= ap->ae_perm << 3; > *basicperms = 0; > break; > case ACL_OTHER: > - va.va_mode |= ap->ae_perm; > + iattr.ia_mode |= ap->ae_perm; > break; > default: /* more than just standard modes */ > *basicperms = 0; > @@ -763,9 +763,9 @@ xfs_acl_setmode( > > /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */ > if (gap && nomask) > - va.va_mode |= gap->ae_perm << 3; > + iattr.ia_mode |= gap->ae_perm << 3; > > - return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred); > + return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred); > } > > /* > From owner-xfs@oss.sgi.com Wed Jul 9 04:09:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 04:09:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69B91eo021861 for ; Wed, 9 Jul 2008 04:09:01 -0700 X-ASG-Debug-ID: 1215601804-6ac003af0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from thunker.thunk.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3BD602CDD30 for ; Wed, 9 Jul 2008 04:10:04 -0700 (PDT) Received: from thunker.thunk.org (www.church-of-our-saviour.org [69.25.196.31]) by cuda.sgi.com with ESMTP id CpSTwGGgqfjsrihu for ; Wed, 09 Jul 2008 04:10:04 -0700 (PDT) Received: from root (helo=closure.thunk.org) by thunker.thunk.org with local-esmtp (Exim 4.50 #1 (Debian)) id 1KGXXh-0007Y4-6j; Wed, 09 Jul 2008 07:09:01 -0400 Received: from tytso by closure.thunk.org with local (Exim 4.69) (envelope-from ) id 1KGXXg-0003LO-71; Wed, 09 Jul 2008 07:09:00 -0400 Date: Wed, 9 Jul 2008 07:09:00 -0400 From: Theodore Tso To: Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709110900.GI9957@mit.edu> Mail-Followup-To: Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080709071346.GS11558@disturbed> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@mit.edu X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false X-Barracuda-Connect: www.church-of-our-saviour.org[69.25.196.31] X-Barracuda-Start-Time: 1215601806 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55561 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16804 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tytso@mit.edu Precedence: bulk X-list: xfs > > Bloody hell! Doesn't *anyone* understand that a frozen filesystem is > *clean*? That the process of freezing it ensures all dirty data and > metadata is written out before the freeze completes? And that once > frozen, it can't be dirtied until unfrozen? What do you mean by "it can't be diritied until unfrozen". What happens if I have a kernel compilation happening on a filesystem which I am trying to freeze? Does (a) the freeze fail (because the checks equivalent to what happens when you remount a filesystem read-only happen)? (b) The process gets a kill -9 when it tries to write a file on the frozen filesystem? (c) The process gets a kill -STOP when it tries to write to a file on the frozen filesystem? (d) The process won't fail, but just continue to run, filling the page cache with dirty pages that can't be written out because the filesystem is frozen? If the answer is (b) or (c), and if you don't have a timeout, and the backup process which has frozen the filesystem tries to write to the filesystem, hilarity will ensue.... > That's 3 (or is it 4 - maybe 5 now that I think about it) different > ppl in 24 hours that have made this same broken argument about > being unable to write back dirty data on a frozen filesystem...... It's not a question of writing back dirty data, it's the fact that you *can't*, leading to the page cache filling up wirth dirty data, leading eventually to the OOM killer running --- and since the last time I tried suggesting that if the process holding the file descriptor freezing the filesystem, that idea got shot down (I see it's been suggested again), if that happens, there is going to be no other recovery path other than the Big Red Button. - Ted From owner-xfs@oss.sgi.com Wed Jul 9 04:14:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 04:14:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21, J_CHICKENPOX_46,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69BEUEJ022660 for ; Wed, 9 Jul 2008 04:14:31 -0700 X-ASG-Debug-ID: 1215602134-618d036f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4F0D3189CA5D for ; Wed, 9 Jul 2008 04:15:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 031Y17RuvIApZfE5 for ; Wed, 09 Jul 2008 04:15:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAAA4dEh5LFxA/2dsb2JhbACwCg X-IronPort-AV: E=Sophos;i="4.30,331,1212330600"; d="scan'208";a="145208332" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 09 Jul 2008 20:45:32 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGXdu-0005jw-G0; Wed, 09 Jul 2008 21:15:26 +1000 Date: Wed, 9 Jul 2008 21:15:26 +1000 From: Dave Chinner To: Miklos Szeredi Cc: arjan@infradead.org, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709111526.GU11558@disturbed> Mail-Followup-To: Miklos Szeredi , arjan@infradead.org, hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080709065950.GR11558@disturbed> <20080709073358.GT11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215602136 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55561 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16805 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 10:11:01AM +0200, Miklos Szeredi wrote: > On Wed, 9 Jul 2008, Dave Chinner wrote: > > On Wed, Jul 09, 2008 at 09:13:34AM +0200, Miklos Szeredi wrote: > > > On Wed, 9 Jul 2008, Dave Chinner wrote: > > > > The argument against Miklos' version is that there may be multiple > > > > commands to execute while the fs is frozen. > > > > > > Which is what a shell is for ;) > > > > Yeah, weĺl, with your method I ca't tell a user to: > > > > # xfs_freeze -f /mntpt > > # xfs_db -r -c 'sb 0' -c 'p rootino' /dev/foo > > 128 > > # xfs_db -r -c 'ino 128' -c 'p core.format' /dev/foo > > core.format = 2 (extents) > > # xfs_db ..... > > ..... > > # xfs_freeze -u /mntpt > > > > i.e. using the freeze to force all metadata to disk and > > prevent it from changing while doing interactive debugging > > of some problem. > > # run_freeze /mntpt /bin/bash > # ... > # ^D > > It's the same, no? For that case, yeah. But it's a horrible hack - if that's the best we can come up with for this freeze/unfreeze then we've already lost. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 9 04:48:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 04:49:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69BmvXR000817 for ; Wed, 9 Jul 2008 04:48:58 -0700 X-ASG-Debug-ID: 1215604201-31c602a90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3C7592CDC81 for ; Wed, 9 Jul 2008 04:50:02 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id IZiavC6JSiK1pWVM for ; Wed, 09 Jul 2008 04:50:02 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMdCdEh5LFxA/2dsb2JhbACwCw X-IronPort-AV: E=Sophos;i="4.30,331,1212330600"; d="scan'208";a="145222754" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 09 Jul 2008 21:20:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGYBK-0006W4-SQ; Wed, 09 Jul 2008 21:49:58 +1000 Date: Wed, 9 Jul 2008 21:49:58 +1000 From: Dave Chinner To: Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709114958.GV11558@disturbed> Mail-Followup-To: Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080709110900.GI9957@mit.edu> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215604203 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55566 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16806 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 07:09:00AM -0400, Theodore Tso wrote: > > > > Bloody hell! Doesn't *anyone* understand that a frozen filesystem is > > *clean*? That the process of freezing it ensures all dirty data and > > metadata is written out before the freeze completes? And that once > > frozen, it can't be dirtied until unfrozen? > > What do you mean by "it can't be diritied until unfrozen". What > happens if I have a kernel compilation happening on a filesystem which > I am trying to freeze? Does > (a) the freeze fail (because the checks equivalent to what happens > when you remount a filesystem read-only happen)? > > (b) The process gets a kill -9 when it tries to write a file on the > frozen filesystem? > > (c) The process gets a kill -STOP when it tries to write > to a file on the frozen filesystem? > > (d) The process won't fail, but just continue to run, filling the page > cache with dirty pages that can't be written out because the > filesystem is frozen? (e) none of the above. The kernel compilation will appear to pause until the filesystem is unfrozen. No other visible effect should occur. It will get blocked in a write or filesystem transaction because the fs is frozen. Look at vfs_check_frozen() - any call to that will block if the filesystem is frozen or being frozen. The generic hook is in __generic_file_aio_write_nolock() and various other filesystems have calls in their specific write paths (fuse, ntfs, ocfs2, xfs, xip) to do this. For all other modifications, filesystem specific methods of blocking transactions are used. XFS uses vfs_check_frozen() in xfs_trans_alloc(), ext3 (and probably ocfs2) do it via their ->write_super_lockfs method calling journal_lock_updates(), ext4 via jbd2_lock_updates() and so on.... When the filesystem is unfrozen the journal is unlocked and anything sleeping on the vfs_check_frozen() waitqueue is woken..... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 9 05:23:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 05:23:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69CNb9T003374 for ; Wed, 9 Jul 2008 05:23:38 -0700 X-ASG-Debug-ID: 1215606281-404d02b10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from thunker.thunk.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 35E75189D13C for ; Wed, 9 Jul 2008 05:24:42 -0700 (PDT) Received: from thunker.thunk.org (www.church-of-our-saviour.org [69.25.196.31]) by cuda.sgi.com with ESMTP id sVn7BuULP3bwOIVC for ; Wed, 09 Jul 2008 05:24:42 -0700 (PDT) Received: from root (helo=closure.thunk.org) by thunker.thunk.org with local-esmtp (Exim 4.50 #1 (Debian)) id 1KGYiS-0007lp-SL; Wed, 09 Jul 2008 08:24:12 -0400 Received: from tytso by closure.thunk.org with local (Exim 4.69) (envelope-from ) id 1KGYiH-0007hJ-NM; Wed, 09 Jul 2008 08:24:01 -0400 Date: Wed, 9 Jul 2008 08:24:01 -0400 From: Theodore Tso To: Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709122401.GK9957@mit.edu> Mail-Followup-To: Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com References: <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080709114958.GV11558@disturbed> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-SA-Exim-Connect-IP: X-SA-Exim-Mail-From: tytso@mit.edu X-SA-Exim-Scanned: No (on thunker.thunk.org); SAEximRunCond expanded to false X-Barracuda-Connect: www.church-of-our-saviour.org[69.25.196.31] X-Barracuda-Start-Time: 1215606283 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55568 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16807 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tytso@mit.edu Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 09:49:58PM +1000, Dave Chinner wrote: > (e) none of the above. The kernel compilation will appear to pause > until the filesystem is unfrozen. No other visible effect should > occur. It will get blocked in a write or filesystem transaction > because the fs is frozen. So if the process which froze the filesystem accidentally tries writing to a log file (or database file containing the backup information, or whatever) that happens to be on the filesystem that is frozen, that process will get blocked and you end up in a deadlock; did I get that right? - Ted From owner-xfs@oss.sgi.com Wed Jul 9 05:59:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 05:59:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,MIME_8BIT_HEADER, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69CxO0C009561 for ; Wed, 9 Jul 2008 05:59:25 -0700 X-ASG-Debug-ID: 1215608428-446c00cf0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from orchid.cbk.poznan.pl (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0F8BD1BB390A for ; Wed, 9 Jul 2008 06:00:28 -0700 (PDT) Received: from orchid.cbk.poznan.pl (orchid.cbk.poznan.pl [150.254.183.30]) by cuda.sgi.com with ESMTP id j7pQjhL1hNYdw3KZ for ; Wed, 09 Jul 2008 06:00:28 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by orchid.cbk.poznan.pl (Postfix) with ESMTP id B139EE4996B; Wed, 9 Jul 2008 15:00:26 +0200 (CEST) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: by amavisd-new at cbk.poznan.pl Received: from orchid.cbk.poznan.pl ([127.0.0.1]) by localhost (orchid.cbk.poznan.pl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id ul2fXHigh4Sa; Wed, 9 Jul 2008 15:00:24 +0200 (CEST) Received: from venus.local.navi.pl (ip-83-238-212-180.netia.com.pl [83.238.212.180]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by orchid.cbk.poznan.pl (Postfix) with ESMTP id 5103AE498ED; Wed, 9 Jul 2008 15:00:24 +0200 (CEST) X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature From: Olaf =?iso-8859-2?Q?Fr=B1czyk?= To: Theodore Tso Cc: Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com In-Reply-To: <20080709122401.GK9957@mit.edu> References: <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <20080709122401.GK9957@mit.edu> Content-Type: text/plain; charset=UTF-8 Date: Wed, 09 Jul 2008 14:59:20 +0200 Message-Id: <1215608360.20914.14.camel@venus.local.navi.pl> Mime-Version: 1.0 X-Mailer: Evolution 2.0.2 (2.0.2-3) Content-Transfer-Encoding: 8bit X-Barracuda-Connect: orchid.cbk.poznan.pl[150.254.183.30] X-Barracuda-Start-Time: 1215608430 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55570 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Status: Clean X-archive-position: 16808 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: olaf@cbk.poznan.pl Precedence: bulk X-list: xfs On Wed, 2008-07-09 at 08:24 -0400, Theodore Tso wrote: > On Wed, Jul 09, 2008 at 09:49:58PM +1000, Dave Chinner wrote: > > (e) none of the above. The kernel compilation will appear to pause > > until the filesystem is unfrozen. No other visible effect should > > occur. It will get blocked in a write or filesystem transaction > > because the fs is frozen. > > So if the process which froze the filesystem accidentally tries > writing to a log file (or database file containing the backup > information, or whatever) that happens to be on the filesystem that is > frozen, that process will get blocked and you end up in a deadlock; > did I get that right? Where do you see the deadlock? The process doesn't have a lock on filesystem or something. You can always unfreeze from another process. Regards, Olaf -- Olaf Frączyk From owner-xfs@oss.sgi.com Wed Jul 9 06:53:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 06:53:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69DrPbG014188 for ; Wed, 9 Jul 2008 06:53:27 -0700 X-ASG-Debug-ID: 1215611668-7d38027c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from casper.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C0E30123B8F7 for ; Wed, 9 Jul 2008 06:54:28 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id SrwCghbCY2qy79ko for ; Wed, 09 Jul 2008 06:54:28 -0700 (PDT) Received: from c-71-193-193-226.hsd1.or.comcast.net ([71.193.193.226] helo=localhost.localdomain) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1KGa6v-0001NP-BE; Wed, 09 Jul 2008 13:53:33 +0000 Date: Wed, 9 Jul 2008 06:53:36 -0700 From: Arjan van de Ven To: Dave Chinner Cc: Miklos Szeredi , hch@infradead.org, tytso@mit.edu, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709065336.1e5e4d74@infradead.org> In-Reply-To: <20080709071346.GS11558@disturbed> References: <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> Organization: Intel X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1215611670 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55573 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16809 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: xfs On Wed, 9 Jul 2008 17:13:46 +1000 Dave Chinner wrote: > > one can argue about the need of doing the first 3 steps via a > > userland loop; it sure sounds like one needs to be really careful > > to not do any writes to the fs from the app that does snapshots > > (and that includes doing any syscalls in the kernel that allocate > > memory.. just because that already could cause unrelated data to be > > written from inside the app. Not fun.) > > Bloody hell! Doesn't *anyone* understand that a frozen filesystem is > *clean*? That the process of freezing it ensures all dirty data and > metadata is written out before the freeze completes? And that once > frozen, it can't be dirtied until unfrozen? > > That's 3 (or is it 4 - maybe 5 now that I think about it) different > ppl in 24 hours that have made this same broken argument about > being unable to write back dirty data on a frozen filesystem...... unless you also freeze the system as a whole (in a 'refrigerator suspend' way).. the "clean" part is just about a nanosecond long. After that stuff gets dirty again (you're doing that sendfile to receive more packets from the FTP upload etc etc). Sure you can pause those. But there's a real risk that you end up pausing the app that you want to unfreeze the fs (via the memory allocation->direct reclaim path). And no, mlock doesn't help. Especially with delayed allocation, where data writes will cause metadata activity, this is not just theory. -- If you want to reach me at my work email, use arjan@linux.intel.com For development, discussion and tips for power savings, visit http://www.lesswatts.org From owner-xfs@oss.sgi.com Wed Jul 9 06:55:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 06:55:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69Dt2xn014620 for ; Wed, 9 Jul 2008 06:55:04 -0700 X-ASG-Debug-ID: 1215611764-473a03cb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from casper.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2CC802CE915 for ; Wed, 9 Jul 2008 06:56:05 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id jQxmJ2otFpFsA7On for ; Wed, 09 Jul 2008 06:56:05 -0700 (PDT) Received: from c-71-193-193-226.hsd1.or.comcast.net ([71.193.193.226] helo=localhost.localdomain) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1KGa8h-0001PC-PI; Wed, 09 Jul 2008 13:55:24 +0000 Date: Wed, 9 Jul 2008 06:55:40 -0700 From: Arjan van de Ven To: Dave Chinner Cc: Theodore Tso , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709065540.57305d91@infradead.org> In-Reply-To: <20080709114958.GV11558@disturbed> References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> Organization: Intel X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1215611767 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55574 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16810 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: xfs On Wed, 9 Jul 2008 21:49:58 +1000 Dave Chinner wrote: > > (e) none of the above. The kernel compilation will appear to pause > until the filesystem is unfrozen. No other visible effect should > occur. It will get blocked in a write or filesystem transaction > because the fs is frozen. > > Look at vfs_check_frozen() - any call to that will block if the > filesystem is frozen or being frozen. The generic hook is in > __generic_file_aio_write_nolock() and various other filesystems have > calls in their specific write paths (fuse, ntfs, ocfs2, xfs, xip) to > do this. yeah and mmap doesn't happen > > For all other modifications, filesystem specific methods of > blocking transactions are used. XFS uses vfs_check_frozen() in > xfs_trans_alloc(), ext3 (and probably ocfs2) do it via > their ->write_super_lockfs method calling journal_lock_updates(), > ext4 via jbd2_lock_updates() and so on.... and what if it's the process that you need to unfreeze the fs later? Good luck. -- If you want to reach me at my work email, use arjan@linux.intel.com For development, discussion and tips for power savings, visit http://www.lesswatts.org From owner-xfs@oss.sgi.com Wed Jul 9 06:57:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 06:57:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69Dv5Lu015342 for ; Wed, 9 Jul 2008 06:57:07 -0700 X-ASG-Debug-ID: 1215611891-79a802b60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from g5t0006.atlanta.hp.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 98571C605FD for ; Wed, 9 Jul 2008 06:58:11 -0700 (PDT) Received: from g5t0006.atlanta.hp.com (g5t0006.atlanta.hp.com [15.192.0.43]) by cuda.sgi.com with ESMTP id CsUYH0tVEOBCaGvD for ; Wed, 09 Jul 2008 06:58:11 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g5t0006.atlanta.hp.com (Postfix) with ESMTP id C7013CB42; Wed, 9 Jul 2008 13:58:09 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g4t0009.houston.hp.com (Postfix) with ESMTP id 991677C488; Wed, 9 Jul 2008 13:58:06 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 9D63E39C00D; Wed, 9 Jul 2008 07:58:06 -0600 (MDT) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id B6H-VsiHETl7; Wed, 9 Jul 2008 07:58:02 -0600 (MDT) Received: from [16.116.96.85] (wizofoz.zko.hp.com [16.116.96.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ldl.fc.hp.com (Postfix) with ESMTP id 32C8439C017; Wed, 9 Jul 2008 07:58:01 -0600 (MDT) Message-ID: <4874C3E8.20804@hp.com> Date: Wed, 09 Jul 2008 09:58:00 -0400 From: jim owens User-Agent: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.7.13) Gecko/20060421 X-Accept-Language: en-us, en MIME-Version: 1.0 To: linux-fsdevel@vger.kernel.org CC: Dave Chinner , Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> In-Reply-To: <20080709114958.GV11558@disturbed> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Barracuda-Connect: g5t0006.atlanta.hp.com[15.192.0.43] X-Barracuda-Start-Time: 1215611891 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Status: Clean X-archive-position: 16811 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jowens@hp.com Precedence: bulk X-list: xfs Jumping into the battle... Advfs implemented freezefs and thawfs in 2001 so here is the design rational from a commercial unix view. Note - We already had built-in snapshots for local disk consistent backups so some choices might be different on Linux. NEED - provide way for SAN and hardware raid storage to do its snapshot/copy function while the system was in-use and get an image that could mount cleanly. Without freeze, at a minimum we usually needed filesystem metadata recovery to run, worst case is completely unusable snapshits :) freezefs() is single-level: ENOTSUPPOTED - by any other fs EOK - done EINPROGRESS EALREADY As implemented, freezefs only ensures the metadata is consistent so the filesystem copy can mount anywhere. This means ONLY SOME metadata (or no metadata) is flushed and then all metadata updates are stopped. User/kernel writes to already allocated file pages WILL go to a frozen disk. It also means writers that need storage allocation (not delaloc or existing) and things that semantically must force on-disk updates will hang during the freeze. These semantics meet the need and has the advantage of the best perfomance. The design specification for freezefs provided flags on the api to add more consistency options later if they were desired: - flush all dirty metadata - flush all existing dirty file data - prevent new dirty file data to disk but they would all add to the "kill the system" problem. freezefs has the timeout argument and the default timeout is a system config parameter: > 0 specifies the timeout value = 0 uses the default timeout < 0 disable timeout A program could call the freezefs/thawfs api, but the only current use is the separate commands # freezefs # [do your hardware raid stuff] # thawfs This is either operator driven or script/cron driven because hardware raid providers (especially our own) are really unfriendly and not helpful. NUMBER ONE RULE - freeze must not hang/crash the system because that defeats the customer reason for wanting it. WHY A TIMEOUT - need a way for operator to abort the freeze because with a frozen filesystem they may not even be able to do a login to thaw it! Users get pissed when the system is hung for a long time and our experience with SAN devices is that their response to commands is often unreasonably long. In addition to the user controllable timeout mechanism, we internally implement AUTO-THAW in the filesystem whenever necessary to prevent a kernel hang/crash. If an AUTO-THAW occurs, we post to the log and an event manager so the user knows the snapshot is bad. jim From owner-xfs@oss.sgi.com Wed Jul 9 06:57:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 06:57:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MIME_8BIT_HEADER autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69DvCI9015394 for ; Wed, 9 Jul 2008 06:57:12 -0700 X-ASG-Debug-ID: 1215611896-4b9e03230000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from casper.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AE7F02CECAB for ; Wed, 9 Jul 2008 06:58:17 -0700 (PDT) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by cuda.sgi.com with ESMTP id 3964NAHjdeMj42KM for ; Wed, 09 Jul 2008 06:58:17 -0700 (PDT) Received: from c-71-193-193-226.hsd1.or.comcast.net ([71.193.193.226] helo=localhost.localdomain) by casper.infradead.org with esmtpsa (Exim 4.69 #1 (Red Hat Linux)) id 1KGaAt-0001RH-Kw; Wed, 09 Jul 2008 13:57:40 +0000 Date: Wed, 9 Jul 2008 06:57:58 -0700 From: Arjan van de Ven To: Olaf =?UTF-8?B?RnLEhWN6eWs=?= Cc: Theodore Tso , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709065758.4ac6b3c5@infradead.org> In-Reply-To: <1215608360.20914.14.camel@venus.local.navi.pl> References: <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <20080709122401.GK9957@mit.edu> <1215608360.20914.14.camel@venus.local.navi.pl> Organization: Intel X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.10; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: casper.infradead.org[85.118.1.10] X-Barracuda-Start-Time: 1215611897 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55574 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m69DvCI9015401 X-archive-position: 16812 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: arjan@infradead.org Precedence: bulk X-list: xfs On Wed, 09 Jul 2008 14:59:20 +0200 Olaf Frączyk wrote: > On Wed, 2008-07-09 at 08:24 -0400, Theodore Tso wrote: > > On Wed, Jul 09, 2008 at 09:49:58PM +1000, Dave Chinner wrote: > > > (e) none of the above. The kernel compilation will appear to > > > pause until the filesystem is unfrozen. No other visible effect > > > should occur. It will get blocked in a write or filesystem > > > transaction because the fs is frozen. > > > > So if the process which froze the filesystem accidentally tries > > writing to a log file (or database file containing the backup > > information, or whatever) that happens to be on the filesystem that > > is frozen, that process will get blocked and you end up in a > > deadlock; did I get that right? > Where do you see the deadlock? > The process doesn't have a lock on filesystem or something. You can > always unfreeze from another process. > if it's one of your main filesystems... good luck starting a shell without writing a single thing to disk... FAIL. From owner-xfs@oss.sgi.com Wed Jul 9 07:12:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 07:12:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69ECO8C018009 for ; Wed, 9 Jul 2008 07:12:25 -0700 X-ASG-Debug-ID: 1215612809-469d005f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from g1t0026.austin.hp.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 74C28189F0D4 for ; Wed, 9 Jul 2008 07:13:30 -0700 (PDT) Received: from g1t0026.austin.hp.com (g1t0026.austin.hp.com [15.216.28.33]) by cuda.sgi.com with ESMTP id 6Rx0OgoKQBhIWye2 for ; Wed, 09 Jul 2008 07:13:30 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from g1t0038.austin.hp.com (g1t0038.austin.hp.com [16.236.32.44]) by g1t0026.austin.hp.com (Postfix) with ESMTP id 85ED2CBD3; Wed, 9 Jul 2008 14:13:27 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g1t0038.austin.hp.com (Postfix) with ESMTP id 9C6A33000D; Wed, 9 Jul 2008 14:13:26 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 8F64839C06E; Wed, 9 Jul 2008 08:13:25 -0600 (MDT) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id piTInnJ1aX2K; Wed, 9 Jul 2008 08:13:21 -0600 (MDT) Received: from [16.116.96.85] (wizofoz.zko.hp.com [16.116.96.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ldl.fc.hp.com (Postfix) with ESMTP id 3407639C00D; Wed, 9 Jul 2008 08:13:20 -0600 (MDT) Message-ID: <4874C77F.7070602@hp.com> Date: Wed, 09 Jul 2008 10:13:19 -0400 From: jim owens User-Agent: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.7.13) Gecko/20060421 X-Accept-Language: en-us, en MIME-Version: 1.0 To: linux-fsdevel@vger.kernel.org CC: Dave Chinner , Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, pavel@suse.cz, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <4874C3E8.20804@hp.com> In-Reply-To: <4874C3E8.20804@hp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Barracuda-Connect: g1t0026.austin.hp.com[15.216.28.33] X-Barracuda-Start-Time: 1215612810 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Status: Clean X-archive-position: 16813 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jowens@hp.com Precedence: bulk X-list: xfs Oops.. > WHY A TIMEOUT - need a way for operator to abort the > freeze instead of "abort" I should have said "limit" because it is really proactive control (so they will not get called in the middle of the night by pissed users). I forgot to make it clear that TIMEOUT is the same as AUTO-THAW in logging errors so the adnin knows they have a bad snapshot and can do it again. I also forgot to say that our customers all say they can deal with retrying a snapshot, but not with unknown bad snapshots and most definitely not with killing their 24/7 operations! jim From owner-xfs@oss.sgi.com Wed Jul 9 08:54:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 08:54:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.5 required=5.0 tests=ANY_BOUNCE_MESSAGE,AWL, BAYES_00,VBOUNCE_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69FsDcB032267 for ; Wed, 9 Jul 2008 08:54:13 -0700 X-ASG-Debug-ID: 1215618918-0b8903600000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from omr-d25.mx.aol.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 98E752CDA9B for ; Wed, 9 Jul 2008 08:55:18 -0700 (PDT) Received: from omr-d25.mx.aol.com (omr-d25.mx.aol.com [205.188.249.69]) by cuda.sgi.com with ESMTP id Dmz1g57TSNW1YzVL for ; Wed, 09 Jul 2008 08:55:18 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from rly-df02.mx.aol.com (rly-df02.mx.aol.com [205.188.252.6]) by omr-d25.mx.aol.com (v117.7) with ESMTP id MAILOMRD258-7d8b4874df59142; Wed, 09 Jul 2008 11:55:05 -0400 Received: from localhost (localhost) by rly-df02.mx.aol.com (8.14.1/8.14.1) id m69FsnFr024241; Wed, 9 Jul 2008 11:55:05 -0400 Date: Wed, 9 Jul 2008 11:55:05 -0400 From: Mail Delivery Subsystem Message-Id: <200807091555.m69FsnFr024241@rly-df02.mx.aol.com> To: MIME-Version: 1.0 Content-Type: multipart/report; report-type=delivery-status; boundary="m69FsnFr024241.1215618905/rly-df02.mx.aol.com" X-ASG-Orig-Subj: Returned mail: see transcript for details Subject: Returned mail: see transcript for details Auto-Submitted: auto-generated (failure) X-AOL-INRLY: reverse.204.8.184.66.static.ldmi.com [66.184.8.204] rly-df02 X-AOL-IP: 205.188.252.6 X-Barracuda-Connect: omr-d25.mx.aol.com[205.188.249.69] X-Barracuda-Start-Time: 1215618919 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16814 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@aol.com Precedence: bulk X-list: xfs This is a MIME-encapsulated message --m69FsnFr024241.1215618905/rly-df02.mx.aol.com The original message was received at Wed, 9 Jul 2008 11:54:35 -0400 from reverse.204.8.184.66.static.ldmi.com [66.184.8.204] *** ATTENTION *** Your e-mail is being returned to you because there was a problem with its delivery. The address which was undeliverable is listed in the section labeled: "----- The following addresses had permanent fatal errors -----". The reason your mail is being returned to you is listed in the section labeled: "----- Transcript of Session Follows -----". The line beginning with "<<<" describes the specific reason your e-mail could not be delivered. The next line contains a second error message which is a general translation for other e-mail servers. Please direct further questions regarding this message to your e-mail administrator. --AOL Postmaster ----- The following addresses had permanent fatal errors ----- (reason: 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent.) ----- Transcript of session follows ----- ... while talking to air-df04.mail.aol.com.: >>> DATA <<< 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent. 554 5.0.0 Service unavailable --m69FsnFr024241.1215618905/rly-df02.mx.aol.com Content-Type: message/delivery-status Reporting-MTA: dns; rly-df02.mx.aol.com Arrival-Date: Wed, 9 Jul 2008 11:54:35 -0400 Final-Recipient: RFC822; geoffbyrd@aol.com Action: failed Status: 5.0.0 Remote-MTA: DNS; air-df04.mail.aol.com Diagnostic-Code: SMTP; 554 TRANSACTION FAILED - Unrepairable Virus Detected. Your mail has not been sent. Last-Attempt-Date: Wed, 9 Jul 2008 11:55:05 -0400 --m69FsnFr024241.1215618905/rly-df02.mx.aol.com Content-Type: text/rfc822-headers Received: from oss.sgi.com (reverse.204.8.184.66.static.ldmi.com [66.184.8.204]) by rly-df02.mx.aol.com (v121.5) with ESMTP id MAILRELAYINDF026-5334874df39e6; Wed, 09 Jul 2008 11:54:34 -0400 From: linux-xfs@oss.sgi.com To: geoffbyrd@aol.com Subject: Delivery reports about your e-mail Date: Wed, 9 Jul 2008 11:54:34 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_0006_A29D1E24.83530DE3" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2600.0000 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 X-AOL-IP: 66.184.8.204 X-AOL-SCOLL-SCORE:0:2:146085616:9395240 X-AOL-SCOLL-URL_COUNT: X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_helo : n X-AOL-SCOLL-AUTHENTICATION: listenair ; SPF_822_from : n Message-ID: <200807091154.5334874df39e6@rly-df02.mx.aol.com> --m69FsnFr024241.1215618905/rly-df02.mx.aol.com-- From owner-xfs@oss.sgi.com Wed Jul 9 09:28:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 09:28:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69GSOlD003565 for ; Wed, 9 Jul 2008 09:28:25 -0700 X-ASG-Debug-ID: 1215620968-2ea502650000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AF87A189F6D9; Wed, 9 Jul 2008 09:29:28 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id FAWuvcUJXbLexYRn; Wed, 09 Jul 2008 09:29:28 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m69GTGNW017068 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 9 Jul 2008 18:29:16 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m69GTEMD017065; Wed, 9 Jul 2008 18:29:14 +0200 Date: Wed, 9 Jul 2008 18:29:14 +0200 From: Christoph Hellwig To: Timothy Shimmin Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] simplify xfs_setattr Subject: Re: [PATCH 2/3] simplify xfs_setattr Message-ID: <20080709162914.GA16308@lst.de> References: <20080627154557.GB31476@lst.de> <20080705172021.GA7177@lst.de> <48747DAD.7060501@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48747DAD.7060501@sgi.com> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215620969 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55584 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16815 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Wed, Jul 09, 2008 at 06:58:21PM +1000, Timothy Shimmin wrote: > > - if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) > > - flags |= ATTR_UTIME; > > -#ifdef ATTR_NO_BLOCK > > - if ((ia_valid & ATTR_NO_BLOCK)) > > - flags |= ATTR_NONBLOCK; > > -#endif > > - > > So this code looks different. > We are now dropping the flags. Why is that? > Presumably because we were mapping ia_valid's: > ATTR_MTIME_SET or ATTR_ATIME_SET --> ATTR_UTIME > ATTR_NO_BLOCK -> ATTR_NONBLOCK > But now we pass ATTR_?TIME_SET and ATTR_NO_BLOCK straight thru. > So previously we didn't map them onto va_mask bits but as separate flags > instead. Yeah, not that ATTR_NO_BLOCK doesn't actually exist in any tree I have access to, and thus it's not actually handled in the new xfs_setattr. > So we get rid of the test for XFS_AT_NOSET. > where: > #define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\ > XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ > XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) > > I can't see anywhere we set any of these. > Presumably out of the xattr calls. > Some left over from IRIX I guess. Probably. Note that linux uses the ATTR_ flags only for ->setattr so there are per defintion none that can't be set. > #define XFS_AT_UPDATIME 0x00010000 > #define XFS_AT_UPDMTIME 0x00020000 > #define XFS_AT_UPDCTIME 0x00040000 > 3 more not supported by vfs ATTR_* macros. > I can't see where we set any of these. > So no loss there I guess. > Presumably they were just for IRIX. It's an IRIX leftover. I will submit a patch to introduce something similar to Linux for 2.6.27, that's why I'd like these patches in for 2.6.26 so that I have a clean base to start from. From owner-xfs@oss.sgi.com Wed Jul 9 09:56:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 09:56:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69Gu7hf006502 for ; Wed, 9 Jul 2008 09:56:08 -0700 X-ASG-Debug-ID: 1215622631-6f9c03090000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6D360DDABEC for ; Wed, 9 Jul 2008 09:57:12 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id 4EdQua2VeC5VQRXX for ; Wed, 09 Jul 2008 09:57:12 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 2B31A8E008D; Wed, 9 Jul 2008 10:00:02 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id 165108E008B; Wed, 9 Jul 2008 10:00:02 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Wed, 9 Jul 2008 09:57:51 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Xfs Access to block zero exception and system crash Subject: RE: Xfs Access to block zero exception and system crash Date: Wed, 9 Jul 2008 09:57:48 -0700 Message-ID: <340C71CD25A7EB49BFA81AE8C839266702A08F91@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <4872E33E.3090107@sandeen.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xfs Access to block zero exception and system crash Thread-Index: AcjgrWReJLSDlJRQSj6EZpV6D5oEvQBNiDiQ References: <4872E0BC.6070400@pmc-sierra.com> <4872E33E.3090107@sandeen.net> From: "Sagar Borikar" To: "Eric Sandeen" Cc: X-OriginalArrivalTime: 09 Jul 2008 16:57:51.0012 (UTC) FILETIME=[EC1C2640:01C8E1E4] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215622632 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0208 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55584 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m69Gu8hf006509 X-archive-position: 16816 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Sagar_Borikar@pmc-sierra.com Precedence: bulk X-list: xfs Sagar Borikar wrote: > That's right Eric but I am still surprised that why should we get a dead > lock in this scenario as it is a plain copy of file in multiple > directories. Our customer is reporting similar kind of lockup in our > platform. ok, I guess I had missed that, sorry. > I do understand that we are chasing the access to block zero > exception and XFS forced shutdown which I mentioned earlier. But we > also see quite a few smbd processes which are writing data to XFS are in > uninterruptible sleep state and the system locks up too. Ok; then the next step is probably to do sysrq-t and see where things are stuck. It might be better to see if you can reproduce w/o the loopback file, too, since that's just another layer to go through that might be changing things. I ran it on actual device w/o loopback file and even there observed that XFS transactions going into uninterruptible sleep state and the copies were stalled. I had to hard reboot the system to bring XFS out of that state since soft reboot didn't work, it was waiting for file system to get unmounted. I shall provide the sysrq-t update later. > So I thought > the test which I am running could be pointing to similar issue which we > are observing on our platform. But does this indicate that the problem > lies with x86 XFS too ? or maybe the vm ... > Also I presume in enterprise market such kind > of simultaneous write situation may happen. Has anybody reported > similar issues to you? As you observed it over x86 and 2.6.24 kernel, > could you say what would be root cause of this? Haven't really seen it before that I recall, and at this point can't say for sure what it might be. -Eric > Sorry for lots of questions at same time :) But I am happy that you > were able to see the deadlock in x86 on your setup with 2.6.24 > > Thanks > Sagar > > > Eric Sandeen wrote: >> Sagar Borikar wrote: >> >>> Hi Eric, >>> >>> Did you see any issues in your test? >>> >> I got a deadlock but that's it; I don't think that's the bug you want to >> chase... >> >> >> -Eric >> >> >>> Thanks >>> Sagar >>> >>> >>> Sagar Borikar wrote: >>> >>>> Eric Sandeen wrote: >>>> >>>>> Sagar Borikar wrote: >>>>> >>>>> >>>>> >>>>> >>>>>> Could you kindly try with my test? I presume you should see failure >>>>>> soon. I tried this on >>>>>> 2 different x86 systems 2 times ( after rebooting the system ) and I >>>>>> saw it every time. >>>>>> >>>>>> >>>>> Sure. Is there a reason you're doing this on a loopback file? That >>>>> probably stresses the vm a bit more, and might get even trickier if the >>>>> loopback file is sparse... >>>>> >>>>> >>>> Initially I thought to do that since I didn't want to have a strict >>>> allocation limit but >>>> allowing allocations to grow as needed until the backing filesystem >>>> runs out of free space >>>> due to type of the test case I had. But then I dropped the plan and >>>> created a non-sparse >>>> loopback device. There was no specific reason to create loopback but >>>> as it was >>>> simplest option to do it. >>>> >>>>> But anyway, on an x86_64 machine with 2G of memory and a non-sparse 10G >>>>> loopback file on 2.6.24.7-92.fc8, your test runs w/o problems for me, >>>>> though the system does get sluggish. I let it run a bit then ran repair >>>>> and it found no problems, I'll run it overnight to see if anything else >>>>> turns up. >>>>> >>>>> >>>> That will be great. Thanks indeed. >>>> Sagar >>>> >>>> >>>>> -Eric >>>>> >>>>> >> > From owner-xfs@oss.sgi.com Wed Jul 9 13:54:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 13:54:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69Kscd1027876 for ; Wed, 9 Jul 2008 13:54:39 -0700 X-ASG-Debug-ID: 1215636928-7cbf01440000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from spitz.ucw.cz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C8ED52D1C3D for ; Wed, 9 Jul 2008 13:55:34 -0700 (PDT) Received: from spitz.ucw.cz (gprs189-60.eurotel.cz [160.218.189.60]) by cuda.sgi.com with ESMTP id DDNL9ouyg4f96XWD for ; Wed, 09 Jul 2008 13:55:34 -0700 (PDT) Received: by spitz.ucw.cz (Postfix, from userid 0) id 0853B27879; Wed, 9 Jul 2008 20:48:30 +0000 (UTC) Date: Wed, 9 Jul 2008 22:48:30 +0200 From: Pavel Machek To: Miklos Szeredi Cc: arjan@infradead.org, hch@infradead.org, tytso@mit.edu, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709204829.GH11006@ucw.cz> References: <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.9i X-Barracuda-Connect: gprs189-60.eurotel.cz[160.218.189.60] X-Barracuda-Start-Time: 1215636942 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55598 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16817 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pavel@suse.cz Precedence: bulk X-list: xfs On Wed 2008-07-09 09:08:07, Miklos Szeredi wrote: > On Tue, 8 Jul 2008, Arjan van de Ven wrote: > > I tihnk the idea there is > > > > freeze . do the snapshot op . unfreeze . make backup of snapshot > > Ah, so then my proposal would become > > run_frozen mountpoint do-snapshot > do-backup > release-snapshot > > and if they are afraid of deadlocks they can just implement the > timeout in userspace: > > run_frozen -t timeout mountpoint do-snapshot > > 'run_frozen' can be a trivial 30 line app, that can be guaranteed not > to deadlock. Userland apps can be swapped out and need kernel memory allocations during syscalls. I bet even sleep(30) uses kmalloc internally. So yes, even trivial applications can deadlock. -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html From owner-xfs@oss.sgi.com Wed Jul 9 13:55:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 13:55:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69Kt27Y027947 for ; Wed, 9 Jul 2008 13:55:03 -0700 X-ASG-Debug-ID: 1215636930-31a102d40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from spitz.ucw.cz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 02F69123BE7A for ; Wed, 9 Jul 2008 13:55:38 -0700 (PDT) Received: from spitz.ucw.cz (gprs189-60.eurotel.cz [160.218.189.60]) by cuda.sgi.com with ESMTP id oTWqmD2IiPI2x14m for ; Wed, 09 Jul 2008 13:55:38 -0700 (PDT) Received: by spitz.ucw.cz (Postfix, from userid 0) id 62F2427878; Wed, 9 Jul 2008 20:44:13 +0000 (UTC) Date: Wed, 9 Jul 2008 22:44:13 +0200 From: Pavel Machek To: Christoph Hellwig , Takashi Sato , akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , "linux-kernel@vger.kernel.org" , axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080709204412.GG11006@ucw.cz> References: <20080630212450t-sato@mail.jp.nec.com> <20080701081026.GB16691@infradead.org> <20080707110730.GG5643@ucw.cz> <20080708231026.GP11558@disturbed> <20080708232031.GE18195@elf.ucw.cz> <20080709005254.GQ11558@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080709005254.GQ11558@disturbed> User-Agent: Mutt/1.5.9i X-Barracuda-Connect: gprs189-60.eurotel.cz[160.218.189.60] X-Barracuda-Start-Time: 1215636967 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55597 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16818 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pavel@suse.cz Precedence: bulk X-list: xfs Hi! > > > > > I still disagree with this whole patch. There is not reason to let > > > > > the freeze request timeout - an auto-unfreezing will only confuse the > > > > > hell out of the caller. The only reason where the current XFS freeze > > > > > call can hang and this would be theoretically useful is when the > > > > > > > > What happens when someone dirties so much data that vm swaps out > > > > whatever process that frozen the filesystem? > > > > > > a) you can't dirty a frozen filesystem - by definition a frozen > > > filesystem is a *clean filesystem* and *cannot be dirtied*. > > > > Can you stop me? > > > > mmap("/some/huge_file", MAP_SHARED); > > > > then write to memory mapping? > > Sure - we can put a hook in ->page_mkwrite() to prevent it. We > don't right now because nobody in the real world really cares if one > half of a concurrent user data change is in the old snapshot or the > new one...... > > > > b) Swap doesn't write through the filesystem > > > c) you can still read from a frozen filesystem to page your > > > executable?? in. > > > > atime modification should mean dirty data, right? > > Metadata, not data. If that's really a problem (and it never has > been for XFS because we always allow in memory changes to atime) > then touch_atime could be easily changed to avoid this... > > > And dirty data mean > > memory pressure, right? > > If you walk enough inodes while the filesystem is frozen, it > theoretically could happen. Typically a filesystem is only for a > few seconds at a time so in the real world this has never, ever been > a problem. So we have freezing interface that does not really freeze, and that can break the system when filesystem is frozen for too long... :-(. Maybe you could use process freezer -- cgroup people are adding userspace interface to that -- to solve those... but that would mean stopping everyone but thread doing freezing... Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html From owner-xfs@oss.sgi.com Wed Jul 9 16:58:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 16:58:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=ANY_BOUNCE_MESSAGE,BAYES_05, MISSING_MIMEOLE,RDNS_NONE,VBOUNCE_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m69NwWkO008539 for ; Wed, 9 Jul 2008 16:58:33 -0700 X-ASG-Debug-ID: 1215647977-660b00d40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from outbound-mail-81.bluehost.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 7DC8318A15EC for ; Wed, 9 Jul 2008 16:59:37 -0700 (PDT) Received: from outbound-mail-81.bluehost.com (outbound-mail-81.bluehost.com [69.89.22.20]) by cuda.sgi.com with SMTP id gNu1rzwxnoRlalem for ; Wed, 09 Jul 2008 16:59:37 -0700 (PDT) Received: (qmail 28630 invoked for bounce); 9 Jul 2008 23:59:36 -0000 Date: 9 Jul 2008 23:59:36 -0000 From: MAILER-DAEMON@outbound-mail-81.bluehost.com To: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="1215647976outbound-mail-81.bluehost.com5534804" X-ASG-Orig-Subj: failure notice Subject: ***** SUSPECTED SPAM ***** failure notice X-Barracuda-Connect: outbound-mail-81.bluehost.com[69.89.22.20] X-Barracuda-Start-Time: 1215647978 Message-Id: <20080709235937.7DC8318A15EC@cuda.sgi.com> X-Barracuda-Bayes: INNOCENT GLOBAL 0.5014 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 2.01 X-Barracuda-Spam-Status: Yes, SCORE=2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=ANY_BOUNCE_MESSAGE, BOUNCE_MESSAGE, MSGID_FROM_MTA_ID, NO_REAL_NAME, VBOUNCE_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55609 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name 0.70 MSGID_FROM_MTA_ID Message-Id for external message added locally 0.00 VBOUNCE_MESSAGE Virus-scanner bounce message 0.00 BOUNCE_MESSAGE MTA bounce message 0.00 ANY_BOUNCE_MESSAGE Message is some kind of bounce message X-Priority: 5 (Lowest) X-MSMail-Priority: Low Importance: Low X-Barracuda-Spam-Flag: YES X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16819 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: MAILER-DAEMON@outbound-mail-81.bluehost.com Precedence: bulk X-list: xfs --1215647976outbound-mail-81.bluehost.com5534804 Hi. This is the qmail-send program at outbound-mail-81.bluehost.com. I'm afraid I wasn't able to deliver your message to the following addresses. This is a permanent error; I've given up. Sorry it didn't work out. : 209.85.201.27 failed after I sent the message. Remote host said: 552-5.7.0 Our system detected an illegal attachment on your message. 552-5.7.0 Please visit http://mail.google.com/support/bin/answer.py?answer=6590 552 5.7.0 to review our attachment guidelines. 9si11292553wfc.6 --- Enclosed are the original headers of the message. --1215647976outbound-mail-81.bluehost.com5534804 Content-Type: message/rfc822 Return-Path: Received: (qmail 28611 invoked by uid 0); 9 Jul 2008 23:59:36 -0000 Received: from unknown (HELO box303.bluehost.com) (69.89.31.103) by forwardproxy3.bluehost.com with SMTP; 9 Jul 2008 23:59:35 -0000 Received: from pop-cowbird.atl.sa.earthlink.net ([207.69.195.68]) by box303.bluehost.com with esmtp (Exim 4.69) (envelope-from ) id 1KGjZP-0007J8-9M for jasonsilver@crookedbush.com; Wed, 09 Jul 2008 17:59:35 -0600 Received: from user-119abd2.biz.mindspring.com ([66.149.45.162] helo=lucerne.solutionip.com) by pop-cowbird.atl.sa.earthlink.net with esmtp (Exim 3.36 #1) id 1KGjZN-000772-00 for jasonsilver@crookedbush.com; Wed, 09 Jul 2008 19:59:34 -0400 Received: from [172.16.1.215] (helo=oss.sgi.com) by lucerne.solutionip.com with esmtp (Exim 3.34 #1) id 1KGjZF-00061C-00 for jasonsilver@crookedbush.com; Wed, 09 Jul 2008 19:59:26 -0400 From: xfs@oss.sgi.com To: jasonsilver@crookedbush.com Subject: status Date: Wed, 9 Jul 2008 19:59:25 -0400 MIME-Version: 1.0 Content-Type: multipart/mixed; This is a multi-part message in MIME format... ---- --1215647976outbound-mail-81.bluehost.com5534804-- From owner-xfs@oss.sgi.com Wed Jul 9 22:02:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 22:02:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6A52JJU032708 for ; Wed, 9 Jul 2008 22:02:21 -0700 Received: from cxfsmac10.melbourne.sgi.com (cxfsmac10.melbourne.sgi.com [134.14.55.100]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA10318; Thu, 10 Jul 2008 15:03:15 +1000 Message-ID: <48759813.2080601@sgi.com> Date: Thu, 10 Jul 2008 15:03:15 +1000 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss Subject: Re: [PATCH] re-remove xfs custom bitops References: <480EB397.1040304@sandeen.net> <4829C360.5060500@sandeen.net> <482BF841.8050704@sgi.com> <48669A45.1050104@sandeen.net> <4868A114.9080106@sgi.com> <486C322D.7080203@sandeen.net> <486C75DD.2040109@sgi.com> In-Reply-To: <486C75DD.2040109@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16820 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Donald Douwsma wrote: > Eric Sandeen wrote: >> Donald Douwsma wrote: >> >>> First time round I hit an Oops on xfstests/177 while running the auto >>> group >>> on ppc32. I dont seem to hit it running the single test, its >>> intermittent. >> >> Funky. Do you ever hit it w/ the patch reverted? > > That's the question. So far no, the QA guys said they hit it a while > ago, but the time frame still matches last time. I dont think this > is related but I need to get some more ppc32 runs without. > > I'm probably being over cautious but I'd like to avoid the > inagain/outagain/inagain/outagain approach we keep using with > some of these cleanups. > > Don > Ok I hit the Oops again last weekend without the patch. Which means I have a patch to checkin and another bug to fix Yea! Dave, Eric said this should still be considered signed-off-by you, You ok with that? Eric, am I ok to add yours too since you kept this on the radar? Don From owner-xfs@oss.sgi.com Wed Jul 9 22:09:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 22:09:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A59HTe000829 for ; Wed, 9 Jul 2008 22:09:18 -0700 X-ASG-Debug-ID: 1215666622-176701cb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7E11DDE2D4B for ; Wed, 9 Jul 2008 22:10:22 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id yq28ENG8xegpG2EE for ; Wed, 09 Jul 2008 22:10:22 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id BEEA3AC6278; Thu, 10 Jul 2008 00:10:21 -0500 (CDT) Message-ID: <487599BD.2040003@sandeen.net> Date: Thu, 10 Jul 2008 00:10:21 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Donald Douwsma CC: xfs-oss X-ASG-Orig-Subj: Re: [PATCH] re-remove xfs custom bitops Subject: Re: [PATCH] re-remove xfs custom bitops References: <480EB397.1040304@sandeen.net> <4829C360.5060500@sandeen.net> <482BF841.8050704@sgi.com> <48669A45.1050104@sandeen.net> <4868A114.9080106@sgi.com> <486C322D.7080203@sandeen.net> <486C75DD.2040109@sgi.com> <48759813.2080601@sgi.com> In-Reply-To: <48759813.2080601@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215666623 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0004 1.0000 -2.0183 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55630 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16821 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Donald Douwsma wrote: > Donald Douwsma wrote: >> Eric Sandeen wrote: >>> Donald Douwsma wrote: >>> >>>> First time round I hit an Oops on xfstests/177 while running the auto >>>> group >>>> on ppc32. I dont seem to hit it running the single test, its >>>> intermittent. >>> Funky. Do you ever hit it w/ the patch reverted? >> That's the question. So far no, the QA guys said they hit it a while >> ago, but the time frame still matches last time. I dont think this >> is related but I need to get some more ppc32 runs without. >> >> I'm probably being over cautious but I'd like to avoid the >> inagain/outagain/inagain/outagain approach we keep using with >> some of these cleanups. >> >> Don >> > > Ok I hit the Oops again last weekend without the patch. > Which means I have a patch to checkin and another bug to fix Yea! > > Dave, Eric said this should still be considered signed-off-by you, > You ok with that? > Eric, am I ok to add yours too since you kept this on the radar? That's fine by me, thanks. -Eric From owner-xfs@oss.sgi.com Wed Jul 9 22:11:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 22:11:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A5BAND001223 for ; Wed, 9 Jul 2008 22:11:10 -0700 X-ASG-Debug-ID: 1215666735-201c01400000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bby1mta02.pmc-sierra.bc.ca (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 31362DE2D6B for ; Wed, 9 Jul 2008 22:12:15 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (bby1mta02.pmc-sierra.com [216.241.235.117]) by cuda.sgi.com with ESMTP id aMC18RDPZdTaaW4x for ; Wed, 09 Jul 2008 22:12:15 -0700 (PDT) Received: from bby1mta02.pmc-sierra.bc.ca (localhost.pmc-sierra.bc.ca [127.0.0.1]) by localhost (Postfix) with SMTP id 6A1918E0065; Wed, 9 Jul 2008 22:15:07 -0700 (PDT) Received: from bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca (BBY1EXG02.pmc-sierra.bc.ca [216.241.231.167]) by bby1mta02.pmc-sierra.bc.ca (Postfix) with SMTP id 53DC78E0058; Wed, 9 Jul 2008 22:15:07 -0700 (PDT) Received: from BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca ([216.241.231.156]) by bby1exg02.pmc_nt.nt.pmc-sierra.bc.ca with Microsoft SMTPSVC(6.0.3790.3959); Wed, 9 Jul 2008 22:12:55 -0700 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Xfs Access to block zero exception and system crash Subject: RE: Xfs Access to block zero exception and system crash Date: Wed, 9 Jul 2008 22:12:51 -0700 Message-ID: <340C71CD25A7EB49BFA81AE8C839266702A092A2@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> In-Reply-To: <340C71CD25A7EB49BFA81AE8C839266702A08F91@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Xfs Access to block zero exception and system crash Thread-Index: AcjgrWReJLSDlJRQSj6EZpV6D5oEvQBNiDiQABhR0dA= References: <4872E0BC.6070400@pmc-sierra.com> <4872E33E.3090107@sandeen.net> <340C71CD25A7EB49BFA81AE8C839266702A08F91@BBY1EXM10.pmc_nt.nt.pmc-sierra.bc.ca> From: "Sagar Borikar" To: "Eric Sandeen" Cc: X-OriginalArrivalTime: 10 Jul 2008 05:12:55.0924 (UTC) FILETIME=[9CAFA340:01C8E24B] X-Barracuda-Connect: bby1mta02.pmc-sierra.com[216.241.235.117] X-Barracuda-Start-Time: 1215666736 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55630 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m6A5BAND001225 X-archive-position: 16822 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Sagar_Borikar@pmc-sierra.com Precedence: bulk X-list: xfs Eric, Could be a slight digression but can you let me know why the fragmentation factor is going to 99% immediately? I observed this on both x86 and MIPS platform. Also to alleviate this issue, if I specify allocsize=512m what would be the consequences? Since default allocsize is 64k right? Also while mounting we are setting up default option for mounting file system. Thanks Sagar -----Original Message----- From: xfs-bounce@oss.sgi.com [mailto:xfs-bounce@oss.sgi.com] On Behalf Of Sagar Borikar Sent: Wednesday, July 09, 2008 10:28 PM To: Eric Sandeen Cc: xfs@oss.sgi.com Subject: RE: Xfs Access to block zero exception and system crash Sagar Borikar wrote: > That's right Eric but I am still surprised that why should we get a dead > lock in this scenario as it is a plain copy of file in multiple > directories. Our customer is reporting similar kind of lockup in our > platform. ok, I guess I had missed that, sorry. > I do understand that we are chasing the access to block zero > exception and XFS forced shutdown which I mentioned earlier. But we > also see quite a few smbd processes which are writing data to XFS are in > uninterruptible sleep state and the system locks up too. Ok; then the next step is probably to do sysrq-t and see where things are stuck. It might be better to see if you can reproduce w/o the loopback file, too, since that's just another layer to go through that might be changing things. I ran it on actual device w/o loopback file and even there observed that XFS transactions going into uninterruptible sleep state and the copies were stalled. I had to hard reboot the system to bring XFS out of that state since soft reboot didn't work, it was waiting for file system to get unmounted. I shall provide the sysrq-t update later. > So I thought > the test which I am running could be pointing to similar issue which we > are observing on our platform. But does this indicate that the problem > lies with x86 XFS too ? or maybe the vm ... > Also I presume in enterprise market such kind > of simultaneous write situation may happen. Has anybody reported > similar issues to you? As you observed it over x86 and 2.6.24 kernel, > could you say what would be root cause of this? Haven't really seen it before that I recall, and at this point can't say for sure what it might be. -Eric > Sorry for lots of questions at same time :) But I am happy that you > were able to see the deadlock in x86 on your setup with 2.6.24 > > Thanks > Sagar > > > Eric Sandeen wrote: >> Sagar Borikar wrote: >> >>> Hi Eric, >>> >>> Did you see any issues in your test? >>> >> I got a deadlock but that's it; I don't think that's the bug you want to >> chase... >> >> >> -Eric >> >> >>> Thanks >>> Sagar >>> >>> >>> Sagar Borikar wrote: >>> >>>> Eric Sandeen wrote: >>>> >>>>> Sagar Borikar wrote: >>>>> >>>>> >>>>> >>>>> >>>>>> Could you kindly try with my test? I presume you should see failure >>>>>> soon. I tried this on >>>>>> 2 different x86 systems 2 times ( after rebooting the system ) and I >>>>>> saw it every time. >>>>>> >>>>>> >>>>> Sure. Is there a reason you're doing this on a loopback file? That >>>>> probably stresses the vm a bit more, and might get even trickier if the >>>>> loopback file is sparse... >>>>> >>>>> >>>> Initially I thought to do that since I didn't want to have a strict >>>> allocation limit but >>>> allowing allocations to grow as needed until the backing filesystem >>>> runs out of free space >>>> due to type of the test case I had. But then I dropped the plan and >>>> created a non-sparse >>>> loopback device. There was no specific reason to create loopback but >>>> as it was >>>> simplest option to do it. >>>> >>>>> But anyway, on an x86_64 machine with 2G of memory and a non-sparse 10G >>>>> loopback file on 2.6.24.7-92.fc8, your test runs w/o problems for me, >>>>> though the system does get sluggish. I let it run a bit then ran repair >>>>> and it found no problems, I'll run it overnight to see if anything else >>>>> turns up. >>>>> >>>>> >>>> That will be great. Thanks indeed. >>>> Sagar >>>> >>>> >>>>> -Eric >>>>> >>>>> >> > From owner-xfs@oss.sgi.com Wed Jul 9 23:04:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 23:04:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A64Dwa004266 for ; Wed, 9 Jul 2008 23:04:15 -0700 X-ASG-Debug-ID: 1215669917-7d0200bd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0D0F02D330B for ; Wed, 9 Jul 2008 23:05:18 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id VrG1OBe1vPbU3GPJ for ; Wed, 09 Jul 2008 23:05:18 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAEJDdUh5LFxA/2dsb2JhbACwNw X-IronPort-AV: E=Sophos;i="4.30,336,1212330600"; d="scan'208";a="145783020" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 10 Jul 2008 15:35:07 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KGpH8-0005Qq-5x; Thu, 10 Jul 2008 16:05:06 +1000 Date: Thu, 10 Jul 2008 16:05:06 +1000 From: Dave Chinner To: Donald Douwsma Cc: Eric Sandeen , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] re-remove xfs custom bitops Subject: Re: [PATCH] re-remove xfs custom bitops Message-ID: <20080710060506.GW11558@disturbed> Mail-Followup-To: Donald Douwsma , Eric Sandeen , xfs-oss References: <480EB397.1040304@sandeen.net> <4829C360.5060500@sandeen.net> <482BF841.8050704@sgi.com> <48669A45.1050104@sandeen.net> <4868A114.9080106@sgi.com> <486C322D.7080203@sandeen.net> <486C75DD.2040109@sgi.com> <48759813.2080601@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48759813.2080601@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215669919 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3077 1.0000 -0.3158 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.32 X-Barracuda-Spam-Status: No, SCORE=-0.32 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55633 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16823 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Jul 10, 2008 at 03:03:15PM +1000, Donald Douwsma wrote: > Donald Douwsma wrote: >> Eric Sandeen wrote: >>> Donald Douwsma wrote: >>> >>>> First time round I hit an Oops on xfstests/177 while running the >>>> auto group >>>> on ppc32. I dont seem to hit it running the single test, its >>>> intermittent. >>> >>> Funky. Do you ever hit it w/ the patch reverted? >> >> That's the question. So far no, the QA guys said they hit it a while >> ago, but the time frame still matches last time. I dont think this >> is related but I need to get some more ppc32 runs without. >> >> I'm probably being over cautious but I'd like to avoid the >> inagain/outagain/inagain/outagain approach we keep using with >> some of these cleanups. >> >> Don >> > > Ok I hit the Oops again last weekend without the patch. > Which means I have a patch to checkin and another bug to fix Yea! > > Dave, Eric said this should still be considered signed-off-by you, > You ok with that? Yeah, no problems there. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 9 23:32:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 09 Jul 2008 23:32:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.3 required=5.0 tests=BAYES_50,HTML_MESSAGE, J_CHICKENPOX_23,J_CHICKENPOX_34,J_CHICKENPOX_53 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A6WdPv006139 for ; Wed, 9 Jul 2008 23:32:39 -0700 X-ASG-Debug-ID: 1215671622-73ed004f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from hu-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 74E80DE4FE4 for ; Wed, 9 Jul 2008 23:33:43 -0700 (PDT) Received: from hu-out-0506.google.com (hu-out-0506.google.com [72.14.214.234]) by cuda.sgi.com with ESMTP id iehb35Uh23h21rvu for ; Wed, 09 Jul 2008 23:33:43 -0700 (PDT) Received: by hu-out-0506.google.com with SMTP id 27so11144452hub.17 for ; Wed, 09 Jul 2008 23:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=+e8ws1yUaellAkA2k6+qQEu2fDD+H9IJvpHkGvOkDyI=; b=RnKrkxEcLYVPlHL7hu0RiMRO/EJZiiNzJd8ZUlo6jaMc7suYA5q5tl6o/Jc8zJ3cxT pNoPIG8br3FQcuO66OHFd7RAA3FBKCymIjY5PpGp3KOenPRI4giZquMueRlLBe0DI9gS asZH3lqKBVrz7iOjoOxYDyuCN/T47xhlASdTM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=kNiiiI7mUP5JuiEFFLqzOwt0pRT2y10vozcuD/oX8O7VGfv316XdfPeGsgocI76CQq vUY5LJunaol0OyDW84hD2T8/Q3/Q1X1/WuzNZImd0+dQwaiJQ1cnFKH0/QMyquEVo/0f XgzMjv9zkHvYNg2hxf+ZLubc7M/mL1+xm7ut4= Received: by 10.210.65.2 with SMTP id n2mr5817006eba.48.1215671595254; Wed, 09 Jul 2008 23:33:15 -0700 (PDT) Received: by 10.210.138.9 with HTTP; Wed, 9 Jul 2008 23:33:15 -0700 (PDT) Message-ID: <5667e290807092333h28c9776kf832c17dc46a5a6a@mail.gmail.com> Date: Thu, 10 Jul 2008 08:33:15 +0200 From: "Naomie Wattle" To: bulkmailhaley@gmail.com X-ASG-Orig-Subj: ABC's DVD for kids Subject: ABC's DVD for kids MIME-Version: 1.0 X-Barracuda-Connect: hu-out-0506.google.com[72.14.214.234] X-Barracuda-Start-Time: 1215671624 X-Barracuda-Bayes: INNOCENT GLOBAL 0.7173 1.0000 1.5030 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.50 X-Barracuda-Spam-Status: No, SCORE=1.50 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55633 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1092 X-archive-position: 16824 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: wattle.naomie@gmail.com Precedence: bulk X-list: xfs Promote early learning with our ABC DVD. This digital video disc is applicable to children that are 4-7 years of age. Children have fun while learning the letters of the alphabet. The process is unique and summated upon the South-African grade (R) and grade one1 syllabus. The kids are taught the letters through sight,and phonetic sounds. They are shown how to form the letters by associating with familiar objects. Animals, toys other children combined with music in conjunction with friendly narration ensures the entertainment of the kids. This scientifically researched video is.the first outcome based video of its kind in South Africa and will give your child a head start in the early learning stage. This video is an irresistible adventure that will form the basis for reading and writing skills for the early learner. Get it at: learningletters@gmail.com or unsubscribe: *not. now.thxs. at gmail.com.* Please send us your telephone number and we will phone u with more info or to take your order and arrange for delivery. Kind regards Judy [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Thu Jul 10 00:25:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 00:25:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6A7P5Cu016229 for ; Thu, 10 Jul 2008 00:25:07 -0700 Received: from linuxbuild.melbourne.sgi.com (linuxbuild.melbourne.sgi.com [134.14.54.115]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA12904; Thu, 10 Jul 2008 17:26:04 +1000 Received: by linuxbuild.melbourne.sgi.com (Postfix, from userid 16365) id 7F28732F6987; Thu, 10 Jul 2008 17:26:04 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: PARTIAL TAKE 981498 - Use the generic bitops rather than implementing them ourselves Message-Id: <20080710072604.7F28732F6987@linuxbuild.melbourne.sgi.com> Date: Thu, 10 Jul 2008 17:26:04 +1000 (EST) From: donaldd@sgi.com (Donald Douwsma) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16825 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Use the generic bitops rather than implementing them ourselves. This keeps xfs_lowbit64 as it was since there aren't good generic helpers there ... Patch inspired by Andi Kleen. Signed-off-by: Dave Chinner Signed-off-by: Eric Sandeen Date: Thu Jul 10 17:25:02 AEST 2008 Workarea: linuxbuild.melbourne.sgi.com:/home/donaldd/isms/2.6.x-xfs Inspected by: david@fromorbit.com,sandeen@sandeen.net The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31472a fs/xfs/xfs_bit.h - 1.25 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bit.h.diff?r1=text&tr1=1.25&r2=text&tr2=1.24&f=h - Use the generic bitops rather than implementing them ourselves. fs/xfs/xfs_bit.c - 1.34 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bit.c.diff?r1=text&tr1=1.34&r2=text&tr2=1.33&f=h - Use the generic bitops rather than implementing them ourselves. fs/xfs/xfs_rtalloc.c - 1.113 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_rtalloc.c.diff?r1=text&tr1=1.113&r2=text&tr2=1.112&f=h - Use the generic bitops rather than implementing them ourselves. From owner-xfs@oss.sgi.com Thu Jul 10 00:38:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 00:38:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from relay.sgi.com (relay2.corp.sgi.com [192.26.58.22]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A7cBpQ017167 for ; Thu, 10 Jul 2008 00:38:11 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1C95C30408A; Thu, 10 Jul 2008 00:39:12 -0700 (PDT) Received: from itchy.melbourne.sgi.com (postfix@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6A7d8jm2598471; Thu, 10 Jul 2008 17:39:09 +1000 (AEST) Received: by itchy.melbourne.sgi.com (Postfix, from userid 16403) id 8F29958878; Thu, 10 Jul 2008 17:39:05 +1000 (EST) From: Niv Sardi To: xfs@oss.sgi.com Cc: Niv Sardi Subject: [PATCH] Introduce xfs_bmap_add_attrfork_trans. Date: Thu, 10 Jul 2008 17:39:04 +1000 Message-Id: <1215675545-2707-4-git-send-email-xaiki@sgi.com> X-Mailer: git-send-email 1.5.6.2 In-Reply-To: <1215675545-2707-3-git-send-email-xaiki@sgi.com> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <1215675545-2707-2-git-send-email-xaiki@sgi.com> <1215675545-2707-3-git-send-email-xaiki@sgi.com> X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16826 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs That takes a transaction and doesn't require everything to be locked anymore. This doesn't commit the transaction ! so direct callers, willing to use xfs_trans_roll() should do it themselves. Change xfs_bmap_add_attrfork to do the initialization/allocation of the transaction and commit arround xfs_bmap_add_attrfork_trans. Signed-off-by: Niv Sardi --- fs/xfs/xfs_bmap.c | 107 ++++++++++++++++++++++++++++++++++------------------ fs/xfs/xfs_bmap.h | 11 +++++ 2 files changed, 81 insertions(+), 37 deletions(-) diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 53c259f..231c8bc 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c @@ -3941,20 +3941,20 @@ xfs_bunmap_trace( #endif /* - * Convert inode from non-attributed to attributed. - * Must not be in a transaction, ip must not be locked. + * Convert inode from non-attributed to attributed (transaction + * version: Use the transaction given via tpp) */ int /* error code */ -xfs_bmap_add_attrfork( - xfs_inode_t *ip, /* incore inode pointer */ +xfs_bmap_add_attrfork_trans( + struct xfs_trans **tpp, /* transaction pointer */ + struct xfs_inode *ip, /* incore inode pointer */ int size, /* space new attribute needs */ int rsvd) /* xact may use reserved blks */ { xfs_fsblock_t firstblock; /* 1st block/ag allocated */ - xfs_bmap_free_t flist; /* freed extent records */ - xfs_mount_t *mp; /* mount structure */ - xfs_trans_t *tp; /* transaction pointer */ - int blks; /* space reservation */ + struct xfs_bmap_free flist; /* freed extent records */ + struct xfs_mount *mp; /* mount structure */ + struct xfs_trans *tp; /* transaction pointer */ int version = 1; /* superblock attr version */ int committed; /* xaction was committed */ int logflags; /* logging flags */ @@ -3966,24 +3966,8 @@ xfs_bmap_add_attrfork( mp = ip->i_mount; ASSERT(!XFS_NOT_DQATTACHED(mp, ip)); - tp = xfs_trans_alloc(mp, XFS_TRANS_ADDAFORK); - blks = XFS_ADDAFORK_SPACE_RES(mp); - if (rsvd) - tp->t_flags |= XFS_TRANS_RESERVE; - if ((error = xfs_trans_reserve(tp, blks, XFS_ADDAFORK_LOG_RES(mp), 0, - XFS_TRANS_PERM_LOG_RES, XFS_ADDAFORK_LOG_COUNT))) - goto error0; - xfs_ilock(ip, XFS_ILOCK_EXCL); - error = XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, blks, 0, rsvd ? - XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : - XFS_QMOPT_RES_REGBLKS); - if (error) { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES); - return error; - } - if (XFS_IFORK_Q(ip)) - goto error1; + ASSERT(*tpp); + tp = *tpp; if (ip->i_d.di_aformat != XFS_DINODE_FMT_EXTENTS) { /* * For inodes coming from pre-6.2 filesystems. @@ -3991,10 +3975,7 @@ xfs_bmap_add_attrfork( ASSERT(ip->i_d.di_aformat == 0); ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; } - ASSERT(ip->i_d.di_anextents == 0); - VN_HOLD(XFS_ITOV(ip)); - xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); - xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + switch (ip->i_d.di_format) { case XFS_DINODE_FMT_DEV: ip->i_d.di_forkoff = roundup(sizeof(xfs_dev_t), 8) >> 3; @@ -4014,7 +3995,7 @@ xfs_bmap_add_attrfork( default: ASSERT(0); error = XFS_ERROR(EINVAL); - goto error1; + goto error0; } ip->i_df.if_ext_max = XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t); @@ -4045,7 +4026,7 @@ xfs_bmap_add_attrfork( if (logflags) xfs_trans_log_inode(tp, ip, logflags); if (error) - goto error2; + goto error1; if (!xfs_sb_version_hasattr(&mp->m_sb) || (!xfs_sb_version_hasattr2(&mp->m_sb) && version == 2)) { __int64_t sbfields = 0; @@ -4065,14 +4046,66 @@ xfs_bmap_add_attrfork( } else spin_unlock(&mp->m_sb_lock); } - if ((error = xfs_bmap_finish(&tp, &flist, &committed))) - goto error2; - error = xfs_trans_commit(tp, XFS_TRANS_PERM_LOG_RES); + error = xfs_bmap_finish(tpp, &flist, &committed); + if (error) + goto error1; ASSERT(ip->i_df.if_ext_max == XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t)); - return error; -error2: + return 0; +error1: xfs_bmap_cancel(&flist); +error0: + xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); + ASSERT(ip->i_df.if_ext_max == + XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t)); + return error; +} + +/* + * Convert inode from non-attributed to attributed. + * Must not be in a transaction, ip must not be locked. + */ +int +xfs_bmap_add_attrfork( + struct xfs_inode *ip, /* incore inode pointer */ + int size, /* space new attribute needs */ + int rsvd) /* xact may use reserved blks */ +{ + struct xfs_trans *tp; /* transaction pointer */ + struct xfs_mount *mp; /* mount structure */ + int blks; /* space reservation */ + int error; /* error return value */ + + mp = ip->i_mount; + tp = xfs_trans_alloc(mp, XFS_TRANS_ADDAFORK); + blks = XFS_ADDAFORK_SPACE_RES(mp); + + if (rsvd) + tp->t_flags |= XFS_TRANS_RESERVE; + error = xfs_trans_reserve(tp, blks, XFS_ADDAFORK_LOG_RES(mp), 0, + XFS_TRANS_PERM_LOG_RES, XFS_ADDAFORK_LOG_COUNT); + if (error) + goto error0; + + xfs_ilock(ip, XFS_ILOCK_EXCL); + error = XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, tp, ip, blks, 0, rsvd ? + XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : + XFS_QMOPT_RES_REGBLKS); + if (error) + goto error1; + + if (XFS_IFORK_Q(ip)) + goto error1; + + ASSERT(ip->i_d.di_anextents == 0); + VN_HOLD(XFS_ITOV(ip)); + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + + error = xfs_bmap_add_attrfork_trans(&tp, ip, size, rsvd); + if (error) + return error; + return xfs_trans_commit(tp, XFS_TRANS_PERM_LOG_RES); error1: xfs_iunlock(ip, XFS_ILOCK_EXCL); error0: diff --git a/fs/xfs/xfs_bmap.h b/fs/xfs/xfs_bmap.h index 6ff70cd..7a6b3f3 100644 --- a/fs/xfs/xfs_bmap.h +++ b/fs/xfs/xfs_bmap.h @@ -157,6 +157,17 @@ xfs_bmap_trace_exlist( #endif /* + * Convert inode from non-attributed to attributed (transaction + * version: Use the transaction given via tpp) + */ +int /* error code */ +xfs_bmap_add_attrfork_trans( + struct xfs_trans **tpp, /* transaction */ + struct xfs_inode *ip, /* incore inode pointer */ + int size, /* space needed for new attribute */ + int rsvd); /* flag for reserved block allocation */ + +/* * Convert inode from non-attributed to attributed. * Must not be in a transaction, ip must not be locked. */ -- 1.5.6.2 From owner-xfs@oss.sgi.com Thu Jul 10 00:38:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 00:38:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from relay.sgi.com (relay1.corp.sgi.com [192.26.58.214]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A7cCZS017177 for ; Thu, 10 Jul 2008 00:38:12 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by relay1.corp.sgi.com (Postfix) with ESMTP id 1BC5B8F806F; Thu, 10 Jul 2008 00:39:12 -0700 (PDT) Received: from itchy.melbourne.sgi.com (postfix@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6A7d8jm2593893; Thu, 10 Jul 2008 17:39:09 +1000 (AEST) Received: by itchy.melbourne.sgi.com (Postfix, from userid 16403) id 846D258875; Thu, 10 Jul 2008 17:39:05 +1000 (EST) From: Niv Sardi To: xfs@oss.sgi.com Cc: Niv Sardi Subject: [PATCH] Move xfs_attr_rolltrans to xfs_trans_roll Date: Thu, 10 Jul 2008 17:39:03 +1000 Message-Id: <1215675545-2707-3-git-send-email-xaiki@sgi.com> X-Mailer: git-send-email 1.5.6.2 In-Reply-To: <1215675545-2707-2-git-send-email-xaiki@sgi.com> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <1215675545-2707-2-git-send-email-xaiki@sgi.com> X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16827 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Move it from the attr code to the transaction code and make the attr code call the new function. We rolltrans is really usefull whenever we want to use rolling transaction, should be generic, it isn't dependent on any part of the attr code anyway. We use this excuse to change all the: if ((error = xfs_attr_rolltrans())) calls into: error = xfs_trans_roll(); if (error) Signed-off-by: Niv Sardi --- fs/xfs/xfs_attr.c | 30 +++++++++++++------ fs/xfs/xfs_attr_leaf.c | 73 +++++------------------------------------------ fs/xfs/xfs_attr_leaf.h | 2 - fs/xfs/xfs_trans.c | 63 +++++++++++++++++++++++++++++++++++++++++ fs/xfs/xfs_trans.h | 1 + 5 files changed, 92 insertions(+), 77 deletions(-) diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 4036bdc..4888a35 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c @@ -403,7 +403,9 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, * Commit the leaf transformation. We'll need another (linked) * transaction to add the new attribute to the leaf. */ - if ((error = xfs_attr_rolltrans(&args.trans, dp))) + + error = xfs_trans_roll(&args.trans, dp); + if (error) goto out; } @@ -1035,7 +1037,8 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) * Commit the current trans (including the inode) and start * a new one. */ - if ((error = xfs_attr_rolltrans(&args->trans, dp))) + error = xfs_trans_roll(&args->trans, dp); + if (error) return (error); /* @@ -1049,7 +1052,8 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) * Commit the transaction that added the attr name so that * later routines can manage their own transactions. */ - if ((error = xfs_attr_rolltrans(&args->trans, dp))) + error = xfs_trans_roll(&args->trans, dp); + if (error) return (error); /* @@ -1138,7 +1142,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *args) /* * Commit the remove and start the next trans in series. */ - error = xfs_attr_rolltrans(&args->trans, dp); + error = xfs_trans_roll(&args->trans, dp); } else if (args->rmtblkno > 0) { /* @@ -1369,7 +1373,8 @@ restart: * Commit the node conversion and start the next * trans in the chain. */ - if ((error = xfs_attr_rolltrans(&args->trans, dp))) + error = xfs_trans_roll(&args->trans, dp); + if (error) goto out; goto restart; @@ -1420,7 +1425,8 @@ restart: * Commit the leaf addition or btree split and start the next * trans in the chain. */ - if ((error = xfs_attr_rolltrans(&args->trans, dp))) + error = xfs_trans_roll(&args->trans, dp); + if (error) goto out; /* @@ -1520,7 +1526,8 @@ restart: /* * Commit and start the next trans in the chain. */ - if ((error = xfs_attr_rolltrans(&args->trans, dp))) + error = xfs_trans_roll(&args->trans, dp); + if (error) goto out; } else if (args->rmtblkno > 0) { @@ -1652,7 +1659,8 @@ xfs_attr_node_removename(xfs_da_args_t *args) /* * Commit the Btree join operation and start a new trans. */ - if ((error = xfs_attr_rolltrans(&args->trans, dp))) + error = xfs_trans_roll(&args->trans, dp); + if (error) goto out; } @@ -2153,7 +2161,8 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) /* * Start the next trans in the chain. */ - if ((error = xfs_attr_rolltrans(&args->trans, dp))) + error = xfs_trans_roll(&args->trans, dp); + if (error) return (error); } @@ -2303,7 +2312,8 @@ xfs_attr_rmtval_remove(xfs_da_args_t *args) /* * Close out trans and start the next one in the chain. */ - if ((error = xfs_attr_rolltrans(&args->trans, args->dp))) + error = xfs_trans_roll(&args->trans, args->dp); + if (error) return (error); } return(0); diff --git a/fs/xfs/xfs_attr_leaf.c b/fs/xfs/xfs_attr_leaf.c index 303d41e..36aa10c 100644 --- a/fs/xfs/xfs_attr_leaf.c +++ b/fs/xfs/xfs_attr_leaf.c @@ -2543,9 +2543,7 @@ xfs_attr_leaf_clearflag(xfs_da_args_t *args) /* * Commit the flag value change and start the next trans in series. */ - error = xfs_attr_rolltrans(&args->trans, args->dp); - - return(error); + return xfs_trans_roll(&args->trans, args->dp); } /* @@ -2592,7 +2590,7 @@ xfs_attr_leaf_setflag(xfs_da_args_t *args) /* * Commit the flag value change and start the next trans in series. */ - error = xfs_attr_rolltrans(&args->trans, args->dp); + error = xfs_trans_roll(&args->trans, args->dp); return(error); } @@ -2710,7 +2708,7 @@ xfs_attr_leaf_flipflags(xfs_da_args_t *args) /* * Commit the flag value change and start the next trans in series. */ - error = xfs_attr_rolltrans(&args->trans, args->dp); + error = xfs_trans_roll(&args->trans, args->dp); return(error); } @@ -2768,7 +2766,7 @@ xfs_attr_root_inactive(xfs_trans_t **trans, xfs_inode_t *dp) /* * Commit the invalidate and start the next transaction. */ - error = xfs_attr_rolltrans(trans, dp); + error = xfs_trans_roll(trans, dp); return (error); } @@ -2870,7 +2868,8 @@ xfs_attr_node_inactive(xfs_trans_t **trans, xfs_inode_t *dp, xfs_dabuf_t *bp, /* * Atomically commit the whole invalidate stuff. */ - if ((error = xfs_attr_rolltrans(trans, dp))) + error = xfs_trans_roll(trans, dp); + if (error) return (error); } @@ -3009,7 +3008,8 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp, /* * Roll to next transaction. */ - if ((error = xfs_attr_rolltrans(trans, dp))) + error = xfs_trans_roll(trans, dp); + if (error) return (error); } @@ -3019,60 +3019,3 @@ xfs_attr_leaf_freextent(xfs_trans_t **trans, xfs_inode_t *dp, return(0); } - - -/* - * Roll from one trans in the sequence of PERMANENT transactions to the next. - */ -int -xfs_attr_rolltrans(xfs_trans_t **transp, xfs_inode_t *dp) -{ - xfs_trans_t *trans; - unsigned int logres, count; - int error; - - /* - * Ensure that the inode is always logged. - */ - trans = *transp; - xfs_trans_log_inode(trans, dp, XFS_ILOG_CORE); - - /* - * Copy the critical parameters from one trans to the next. - */ - logres = trans->t_log_res; - count = trans->t_log_count; - *transp = xfs_trans_dup(trans); - - /* - * Commit the current transaction. - * If this commit failed, then it'd just unlock those items that - * are not marked ihold. That also means that a filesystem shutdown - * is in progress. The caller takes the responsibility to cancel - * the duplicate transaction that gets returned. - */ - if ((error = xfs_trans_commit(trans, 0))) - return (error); - - trans = *transp; - - /* - * Reserve space in the log for th next transaction. - * This also pushes items in the "AIL", the list of logged items, - * out to disk if they are taking up space at the tail of the log - * that we want to use. This requires that either nothing be locked - * across this call, or that anything that is locked be logged in - * the prior and the next transactions. - */ - error = xfs_trans_reserve(trans, 0, logres, 0, - XFS_TRANS_PERM_LOG_RES, count); - /* - * Ensure that the inode is in the new transaction and locked. - */ - if (!error) { - xfs_trans_ijoin(trans, dp, XFS_ILOCK_EXCL); - xfs_trans_ihold(trans, dp); - } - return (error); - -} diff --git a/fs/xfs/xfs_attr_leaf.h b/fs/xfs/xfs_attr_leaf.h index 040f732..698e078 100644 --- a/fs/xfs/xfs_attr_leaf.h +++ b/fs/xfs/xfs_attr_leaf.h @@ -301,6 +301,4 @@ int xfs_attr_leaf_order(struct xfs_dabuf *leaf1_bp, struct xfs_dabuf *leaf2_bp); int xfs_attr_leaf_newentsize(int namelen, int valuelen, int blocksize, int *local); -int xfs_attr_rolltrans(struct xfs_trans **transp, struct xfs_inode *dp); - #endif /* __XFS_ATTR_LEAF_H__ */ diff --git a/fs/xfs/xfs_trans.c b/fs/xfs/xfs_trans.c index 1403864..8403eac 100644 --- a/fs/xfs/xfs_trans.c +++ b/fs/xfs/xfs_trans.c @@ -43,6 +43,7 @@ #include "xfs_quota.h" #include "xfs_trans_priv.h" #include "xfs_trans_space.h" +#include "xfs_inode_item.h" STATIC void xfs_trans_apply_sb_deltas(xfs_trans_t *); @@ -1216,6 +1217,68 @@ xfs_trans_free( kmem_zone_free(xfs_trans_zone, tp); } +/* + * Roll from one trans in the sequence of PERMANENT transactions to + * the next: permanent transactions are only flushed out when + * committed with XFS_TRANS_RELEASE_LOG_RES, but we still want as soon + * as possible to let chunks of it go to the log. So we commit the + * chunk we've been working on and get a new transaction to continue. + */ +int +xfs_trans_roll( + struct xfs_trans **tpp, + struct xfs_inode *dp) +{ + struct xfs_trans *trans; + unsigned int logres, count; + int error; + + /* + * Ensure that the inode is always logged. + */ + trans = *tpp; + xfs_trans_log_inode(trans, dp, XFS_ILOG_CORE); + + /* + * Copy the critical parameters from one trans to the next. + */ + logres = trans->t_log_res; + count = trans->t_log_count; + *tpp = xfs_trans_dup(trans); + + /* + * Commit the current transaction. + * If this commit failed, then it'd just unlock those items that + * are not marked ihold. That also means that a filesystem shutdown + * is in progress. The caller takes the responsibility to cancel + * the duplicate transaction that gets returned. + */ + error = xfs_trans_commit(trans, 0); + if (error) + return (error); + + trans = *tpp; + + /* + * Reserve space in the log for th next transaction. + * This also pushes items in the "AIL", the list of logged items, + * out to disk if they are taking up space at the tail of the log + * that we want to use. This requires that either nothing be locked + * across this call, or that anything that is locked be logged in + * the prior and the next transactions. + */ + error = xfs_trans_reserve(trans, 0, logres, 0, + XFS_TRANS_PERM_LOG_RES, count); + /* + * Ensure that the inode is in the new transaction and locked. + */ + if (error) + return error; + + xfs_trans_ijoin(trans, dp, XFS_ILOCK_EXCL); + xfs_trans_ihold(trans, dp); + return 0; +} /* * THIS SHOULD BE REWRITTEN TO USE xfs_trans_next_item(). diff --git a/fs/xfs/xfs_trans.h b/fs/xfs/xfs_trans.h index 0804207..9161e99 100644 --- a/fs/xfs/xfs_trans.h +++ b/fs/xfs/xfs_trans.h @@ -986,6 +986,7 @@ int _xfs_trans_commit(xfs_trans_t *, int *); #define xfs_trans_commit(tp, flags) _xfs_trans_commit(tp, flags, NULL) void xfs_trans_cancel(xfs_trans_t *, int); +int xfs_trans_roll(struct xfs_trans **, struct xfs_inode *); int xfs_trans_ail_init(struct xfs_mount *); void xfs_trans_ail_destroy(struct xfs_mount *); void xfs_trans_push_ail(struct xfs_mount *, xfs_lsn_t); -- 1.5.6.2 From owner-xfs@oss.sgi.com Thu Jul 10 00:38:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 00:38:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45, J_CHICKENPOX_47 autolearn=no version=3.3.0-r574664 Received: from relay.sgi.com (netops-testserver-3.corp.sgi.com [192.26.57.72]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A7cKxq017250 for ; Thu, 10 Jul 2008 00:38:21 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by netops-testserver-3.corp.sgi.com (Postfix) with ESMTP id 3048F908C8; Thu, 10 Jul 2008 00:39:12 -0700 (PDT) Received: from itchy.melbourne.sgi.com (postfix@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6A7d8jm2597030; Thu, 10 Jul 2008 17:39:09 +1000 (AEST) Received: by itchy.melbourne.sgi.com (Postfix, from userid 16403) id 7B5F758877; Thu, 10 Jul 2008 17:39:05 +1000 (EST) From: Niv Sardi To: xfs@oss.sgi.com Cc: Niv Sardi Subject: [PATCH] Move attr log alloc size calculator to another function. Date: Thu, 10 Jul 2008 17:39:02 +1000 Message-Id: <1215675545-2707-2-git-send-email-xaiki@sgi.com> X-Mailer: git-send-email 1.5.6.2 In-Reply-To: <1215675545-2707-1-git-send-email-xaiki@sgi.com> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16828 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs We will need that to be able to calculate the size of log we need for a specific attr (for Create+EA). The local flag is needed so that we can fail if we run into ENOSPC when trying to alloc blocks. Signed-off-by: Niv Sardi --- fs/xfs/xfs_attr.c | 80 +++++++++++++++++++++++++++++++--------------------- fs/xfs/xfs_attr.h | 1 + 2 files changed, 49 insertions(+), 32 deletions(-) diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index df151a8..4036bdc 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c @@ -196,6 +196,46 @@ xfs_attr_get( return(error); } +/* + * Calculate how many blocks we need for the new attribute, + */ +int +xfs_attr_calc_size( + struct xfs_inode *ip, + int namelen, + int valuelen, + int *local) +{ + struct xfs_mount *mp = ip->i_mount; + int size; + int nblks; + + /* + * Determine space new attribute will use, and if it would be + * "local" or "remote" (note: local != inline). + */ + size = xfs_attr_leaf_newentsize(namelen, valuelen, + mp->m_sb.sb_blocksize, local); + + nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); + if (*local) { + if (size > (mp->m_sb.sb_blocksize >> 1)) { + /* Double split possible */ + nblks *= 2; + } + } else { + /* + * Out of line attribute, cannot double split, but + * make room for the attribute value itself. + */ + uint dblocks = XFS_B_TO_FSB(mp, valuelen); + nblks += dblocks; + nblks += XFS_NEXTENTADD_SPACE_RES(mp, dblocks, XFS_ATTR_FORK); + } + + return nblks; +} + STATIC int xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, char *value, int valuelen, int flags) @@ -204,10 +244,9 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, xfs_fsblock_t firstblock; xfs_bmap_free_t flist; int error, err2, committed; - int local, size; - uint nblks; xfs_mount_t *mp = dp->i_mount; int rsvd = (flags & ATTR_ROOT) != 0; + int local; /* * Attach the dquots to the inode. @@ -244,30 +283,8 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, args.addname = 1; args.oknoent = 1; - /* - * Determine space new attribute will use, and if it would be - * "local" or "remote" (note: local != inline). - */ - size = xfs_attr_leaf_newentsize(name->len, valuelen, - mp->m_sb.sb_blocksize, &local); - - nblks = XFS_DAENTER_SPACE_RES(mp, XFS_ATTR_FORK); - if (local) { - if (size > (mp->m_sb.sb_blocksize >> 1)) { - /* Double split possible */ - nblks <<= 1; - } - } else { - uint dblocks = XFS_B_TO_FSB(mp, valuelen); - /* Out of line attribute, cannot double split, but make - * room for the attribute value itself. - */ - nblks += dblocks; - nblks += XFS_NEXTENTADD_SPACE_RES(mp, dblocks, XFS_ATTR_FORK); - } - /* Size is now blocks for attribute data */ - args.total = nblks; + args.total = xfs_attr_calc_size(dp, name->len, valuelen, &local); /* * Start our first transaction of the day. @@ -289,18 +306,17 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, if (rsvd) args.trans->t_flags |= XFS_TRANS_RESERVE; - if ((error = xfs_trans_reserve(args.trans, (uint) nblks, - XFS_ATTRSET_LOG_RES(mp, nblks), - 0, XFS_TRANS_PERM_LOG_RES, - XFS_ATTRSET_LOG_COUNT))) { + if ((error = xfs_trans_reserve(args.trans, args.total, + XFS_ATTRSET_LOG_RES(mp, args.total), 0, + XFS_TRANS_PERM_LOG_RES, XFS_ATTRSET_LOG_COUNT))) { xfs_trans_cancel(args.trans, 0); return(error); } xfs_ilock(dp, XFS_ILOCK_EXCL); - error = XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, args.trans, dp, nblks, 0, - rsvd ? XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : - XFS_QMOPT_RES_REGBLKS); + error = XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, args.trans, dp, args.total, 0, + rsvd ? XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : + XFS_QMOPT_RES_REGBLKS); if (error) { xfs_iunlock(dp, XFS_ILOCK_EXCL); xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES); diff --git a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h index 6cfc938..f99395c 100644 --- a/fs/xfs/xfs_attr.h +++ b/fs/xfs/xfs_attr.h @@ -158,6 +158,7 @@ struct xfs_da_args; /* * Overall external interface routines. */ +int xfs_attr_calc_size(struct xfs_inode *, int, int, int *); int xfs_attr_inactive(struct xfs_inode *dp); int xfs_attr_shortform_getvalue(struct xfs_da_args *); -- 1.5.6.2 From owner-xfs@oss.sgi.com Thu Jul 10 00:38:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 00:38:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45, J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from relay.sgi.com (netops-testserver-3.corp.sgi.com [192.26.57.72]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A7cdkg017594 for ; Thu, 10 Jul 2008 00:38:39 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by netops-testserver-3.corp.sgi.com (Postfix) with ESMTP id 1D141908C4; Thu, 10 Jul 2008 00:39:12 -0700 (PDT) Received: from itchy.melbourne.sgi.com (postfix@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6A7d8jm2550759; Thu, 10 Jul 2008 17:39:09 +1000 (AEST) Received: by itchy.melbourne.sgi.com (Postfix, from userid 16403) id 9CB1758879; Thu, 10 Jul 2008 17:39:05 +1000 (EST) From: Niv Sardi To: xfs@oss.sgi.com Cc: Niv Sardi Subject: [PATCH] Give a transaction to xfs_attr_set_int Date: Thu, 10 Jul 2008 17:39:05 +1000 Message-Id: <1215675545-2707-5-git-send-email-xaiki@sgi.com> X-Mailer: git-send-email 1.5.6.2 In-Reply-To: <1215675545-2707-4-git-send-email-xaiki@sgi.com> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <1215675545-2707-2-git-send-email-xaiki@sgi.com> <1215675545-2707-3-git-send-email-xaiki@sgi.com> <1215675545-2707-4-git-send-email-xaiki@sgi.com> X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16829 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs We introduce xfs_attr_set_int_trans that takes a transaction pointer as an argument (or creates one if NULL) and only finishes the transaction if it has created it. We use xfs_trans_roll to do the trans_dup dance. xfs_attr_set_int is changed to a wrapper that will only call xfs_attr_set_int_trans with a NULL transaction. make it use the new xfs_bmap_add_attrfork_trans(), and roll the transaction after the call. This is needed for Create+EA/Parent Pointers Signed-off-by: Niv Sardi --- fs/xfs/xfs_attr.c | 139 ++++++++++++++++++++++++++++++++++++----------------- 1 files changed, 94 insertions(+), 45 deletions(-) diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 4888a35..8e9598d 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c @@ -236,9 +236,19 @@ xfs_attr_calc_size( return nblks; } +/* + * So if the trans is given we don't have the right to dispose of it, + * we can't commit it either as we don't know if the caller is + * done with it. + */ STATIC int -xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, - char *value, int valuelen, int flags) +xfs_attr_set_int_trans( + xfs_trans_t **tpp, + xfs_inode_t *dp, + struct xfs_name *name, + char *value, + int valuelen, + int flags) { xfs_da_args_t args; xfs_fsblock_t firstblock; @@ -260,10 +270,14 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, */ if (XFS_IFORK_Q(dp) == 0) { int sf_size = sizeof(xfs_attr_sf_hdr_t) + - XFS_ATTR_SF_ENTSIZE_BYNAME(name->len, valuelen); + XFS_ATTR_SF_ENTSIZE_BYNAME(name->len, valuelen); - if ((error = xfs_bmap_add_attrfork(dp, sf_size, rsvd))) - return(error); + error = xfs_bmap_add_attrfork_trans(tpp, dp, sf_size, rsvd); + if (error) + return error; + error = xfs_trans_roll(tpp, dp); + if (error) + return error; } /* @@ -286,45 +300,52 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, /* Size is now blocks for attribute data */ args.total = xfs_attr_calc_size(dp, name->len, valuelen, &local); - /* - * Start our first transaction of the day. - * - * All future transactions during this code must be "chained" off - * this one via the trans_dup() call. All transactions will contain - * the inode, and the inode will always be marked with trans_ihold(). - * Since the inode will be locked in all transactions, we must log - * the inode in every transaction to let it float upward through - * the log. - */ - args.trans = xfs_trans_alloc(mp, XFS_TRANS_ATTR_SET); + if (tpp) { + ASSERT(*tpp); + args.trans = *tpp; + } else { + /* + * Start our first transaction of the day. + * + * All future transactions during this code must be "chained" off + * this one via the trans_dup() call. All transactions will contain + * the inode, and the inode will always be marked with trans_ihold(). + * Since the inode will be locked in all transactions, we must log + * the inode in every transaction to let it float upward through + * the log. + */ + args.trans = xfs_trans_alloc(mp, XFS_TRANS_ATTR_SET); - /* - * Root fork attributes can use reserved data blocks for this - * operation if necessary - */ + /* + * Root fork attributes can use reserved data blocks for this + * operation if necessary + */ - if (rsvd) - args.trans->t_flags |= XFS_TRANS_RESERVE; + if (rsvd) + args.trans->t_flags |= XFS_TRANS_RESERVE; - if ((error = xfs_trans_reserve(args.trans, args.total, - XFS_ATTRSET_LOG_RES(mp, args.total), 0, - XFS_TRANS_PERM_LOG_RES, XFS_ATTRSET_LOG_COUNT))) { - xfs_trans_cancel(args.trans, 0); - return(error); - } - xfs_ilock(dp, XFS_ILOCK_EXCL); + error = xfs_trans_reserve(args.trans, args.total, + XFS_ATTRSET_LOG_RES(mp, args.total), 0, + XFS_TRANS_PERM_LOG_RES, XFS_ATTRSET_LOG_COUNT); + if (error) { + xfs_trans_cancel(args.trans, 0); + return(error); + } + xfs_ilock(dp, XFS_ILOCK_EXCL); - error = XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, args.trans, dp, args.total, 0, - rsvd ? XFS_QMOPT_RES_REGBLKS | XFS_QMOPT_FORCE_RES : + error = XFS_TRANS_RESERVE_QUOTA_NBLKS(mp, args.trans, dp, + args.total, 0, + rsvd?XFS_QMOPT_RES_REGBLKS|XFS_QMOPT_FORCE_RES: XFS_QMOPT_RES_REGBLKS); - if (error) { - xfs_iunlock(dp, XFS_ILOCK_EXCL); - xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES); - return (error); - } + if (error) { + xfs_iunlock(dp, XFS_ILOCK_EXCL); + xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES); + return (error); + } - xfs_trans_ijoin(args.trans, dp, XFS_ILOCK_EXCL); - xfs_trans_ihold(args.trans, dp); + xfs_trans_ijoin(args.trans, dp, XFS_ILOCK_EXCL); + xfs_trans_ihold(args.trans, dp); + } /* * If the attribute list is non-existent or a shortform list, @@ -360,8 +381,14 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, if (mp->m_flags & XFS_MOUNT_WSYNC) { xfs_trans_set_sync(args.trans); } - err2 = xfs_trans_commit(args.trans, - XFS_TRANS_RELEASE_LOG_RES); + + /* Only finish trans if it's ours */ + if (tpp) { + err2 = xfs_trans_roll(&args.trans, dp); + } else { + err2 = xfs_trans_commit(args.trans, + XFS_TRANS_RELEASE_LOG_RES); + } xfs_iunlock(dp, XFS_ILOCK_EXCL); /* @@ -370,6 +397,8 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, if (!error && (flags & ATTR_KERNOTIME) == 0) { xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } + if (tpp) + *tpp = args.trans; return(error == 0 ? err2 : error); } @@ -415,13 +444,13 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, } else { error = xfs_attr_node_addname(&args); } - if (error) { + if (error) goto out; - } /* * If this is a synchronous mount, make sure that the - * transaction goes to disk before returning to the user. + * transaction goes to disk before returning to the user. If + * this is not our transaction, the allocator should do this. */ if (mp->m_flags & XFS_MOUNT_WSYNC) { xfs_trans_set_sync(args.trans); @@ -430,8 +459,12 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, /* * Commit the last in the sequence of transactions. */ - xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE); - error = xfs_trans_commit(args.trans, XFS_TRANS_RELEASE_LOG_RES); + if (tpp) { + xfs_trans_roll(&args.trans, dp); + } else { + xfs_trans_log_inode(args.trans, dp, XFS_ILOG_CORE); + error = xfs_trans_commit(args.trans, XFS_TRANS_RELEASE_LOG_RES); + } xfs_iunlock(dp, XFS_ILOCK_EXCL); /* @@ -441,6 +474,8 @@ xfs_attr_set_int(xfs_inode_t *dp, struct xfs_name *name, xfs_ichgtime(dp, XFS_ICHGTIME_CHG); } + if (tpp) + *tpp = args.trans; return(error); out: @@ -448,9 +483,23 @@ out: xfs_trans_cancel(args.trans, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); xfs_iunlock(dp, XFS_ILOCK_EXCL); + if (tpp) + *tpp = args.trans; return(error); } +STATIC int +xfs_attr_set_int( + xfs_inode_t *dp, + struct xfs_name *name, + char *value, + int valuelen, + int flags) +{ + return xfs_attr_set_int_trans(NULL, dp, name, + value, valuelen, flags); +} + int xfs_attr_set( xfs_inode_t *dp, -- 1.5.6.2 From owner-xfs@oss.sgi.com Thu Jul 10 00:39:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 00:39:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from relay.sgi.com (relay2.corp.sgi.com [192.26.58.22]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6A7dGWu018290 for ; Thu, 10 Jul 2008 00:39:16 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by relay2.corp.sgi.com (Postfix) with ESMTP id 1F126304076 for ; Thu, 10 Jul 2008 00:39:12 -0700 (PDT) Received: from itchy.melbourne.sgi.com (postfix@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6A7d8jm2589202 for ; Thu, 10 Jul 2008 17:39:09 +1000 (AEST) Received: by itchy.melbourne.sgi.com (Postfix, from userid 16403) id 6745D58876; Thu, 10 Jul 2008 17:39:05 +1000 (EST) From: Niv Sardi To: xfs@oss.sgi.com Subject: [UPDATED RFC] Create with EA initial work Date: Thu, 10 Jul 2008 17:39:01 +1000 Message-Id: <1215675545-2707-1-git-send-email-xaiki@sgi.com> X-Mailer: git-send-email 1.5.6.2 In-Reply-To: <1214196150-5427-1-git-send-email-xaiki@sgi.com> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16830 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Thanks to everyone for the review of the former patchset, this ones fixes the bugs found by dgc, changes the naming of the *_trans_* functions, splits out xfs_bmap_add_attrfork{,_trans} to have one version doing the whole allocation and calling into the other as suggested by hch, and has the x_t -> struct x changes too. There is a bug in this, that I can see with the Parent Pointers code going on top of it (that will be posted soon), it is basically calling xfs_attr_set_int_trans() in xfs_create() just before the last commit. For some reason, the first call to xfs_roll_trans (after xfs_bmap_add_attrfork_trans()) will complain about the inode being unlocked after xfs_trans_commit(). I understand I need to call xfs_trans_ihold(ip) on it, but we already do in xfs_create() so I think I must be missing something else… any ideas ? From owner-xfs@oss.sgi.com Thu Jul 10 09:47:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 09:47:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DATE_IN_FUTURE_06_12, J_CHICKENPOX_44 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6AGlIsW026122 for ; Thu, 10 Jul 2008 09:47:18 -0700 X-ASG-Debug-ID: 1215708503-5b3b02dc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from yx-out-1718.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5E5892D7DEB for ; Thu, 10 Jul 2008 09:48:23 -0700 (PDT) Received: from yx-out-1718.google.com (yx-out-1718.google.com [74.125.44.153]) by cuda.sgi.com with ESMTP id hqSLy4qTdDejaNBs for ; Thu, 10 Jul 2008 09:48:23 -0700 (PDT) Received: by yx-out-1718.google.com with SMTP id 36so895715yxh.32 for ; Thu, 10 Jul 2008 09:48:21 -0700 (PDT) Received: by 10.114.125.2 with SMTP id x2mr11455564wac.59.1215708499133; Thu, 10 Jul 2008 09:48:19 -0700 (PDT) Received: from localhost ( [67.160.173.222]) by mx.google.com with ESMTPS id 9sm365897wfc.6.2008.07.10.09.47.47 (version=SSLv3 cipher=RC4-MD5); Thu, 10 Jul 2008 09:48:18 -0700 (PDT) Date: Thu, 10 Jul 2008 17:53:40 -0700 From: Brandon Philips To: Andreas Gruenbacher , tes@sgi.com Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] acl: Fix WALK_TREE_RECURSIVE for the WALK_TREE_DEREFERENCE case Subject: [PATCH] acl: Fix WALK_TREE_RECURSIVE for the WALK_TREE_DEREFERENCE case Message-ID: <20080711005340.GA30185@potty.ifup.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: yx-out-1718.google.com[74.125.44.153] X-Barracuda-Start-Time: 1215708504 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0049 1.0000 -1.9887 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.49 X-Barracuda-Spam-Status: No, SCORE=-0.49 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=DATE_IN_FUTURE_06_12 X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55677 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 DATE_IN_FUTURE_06_12 Date: is 6 to 12 hours after Received: date X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16831 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: brandon@ifup.org Precedence: bulk X-list: xfs NOTE: Sending to xfs@oss.sgi.com instead of acl-devel since it doesn't seem active anymore. getfacl.c calls walk_tree() with WALK_TREE_DEREFERENCE. This causes a stat() of symlinks which in turn causes S_ISDIR(st.st_mode) to be true on symlinks. This causes getfacl -P to return the contents of symlinks... e.g. $ mkdir -p test/sub $ mkdir test/link $ touch test/link/file $ ln -s `pwd`/test/link test/sub/link $ getfacl -P -R test/sub # file: test/sub # owner: philips # group: users user::rwx group::r-x other::r-x # file: test/sub/link/file # owner: philips # group: users user::rw- group::r-- other::r-- After the fix: $ getfacl -R -P test/sub/ # file: test/sub/ # owner: philips # group: users user::rwx group::r-x other::r-x Signed-off-by: Brandon Philips --- libmisc/walk_tree.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) Index: acl-2.2.47/libmisc/walk_tree.c =================================================================== --- acl-2.2.47.orig/libmisc/walk_tree.c +++ acl-2.2.47/libmisc/walk_tree.c @@ -93,8 +93,15 @@ static int walk_tree_rec(const char *pat have_dir_stat = 1; } err = func(path, &st, flags, arg); + + /* + * Recurse if WALK_TREE_RECURSIVE and the path is: + * a dir not from a symlink + * a link and follow_symlinks + */ if ((flags & WALK_TREE_RECURSIVE) && - (S_ISDIR(st.st_mode) || (S_ISLNK(st.st_mode) && follow_symlinks))) { + (!(flags & WALK_TREE_SYMLINK) && S_ISDIR(st.st_mode)) || + ((flags & WALK_TREE_SYMLINK) && follow_symlinks)) { struct dirent *entry; /* From owner-xfs@oss.sgi.com Thu Jul 10 15:41:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 15:41:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6AMfo6U030424 for ; Thu, 10 Jul 2008 15:41:52 -0700 X-ASG-Debug-ID: 1215729774-724003880000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5A5DCDF2F31 for ; Thu, 10 Jul 2008 15:42:55 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ySo8bYDKupSItD0N for ; Thu, 10 Jul 2008 15:42:55 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHYrdkh5LFxA/2dsb2JhbACyFA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146254480" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 08:12:39 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH4qU-0002jZ-23 for xfs@oss.sgi.com; Fri, 11 Jul 2008 08:42:38 +1000 Date: Fri, 11 Jul 2008 08:42:38 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [patch] xfsqa 078 - use rmdir to remove directories Subject: Re: [patch] xfsqa 078 - use rmdir to remove directories Message-ID: <20080710224237.GX11558@disturbed> Mail-Followup-To: xfs@oss.sgi.com References: <20080522061120.GP173056135@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080522061120.GP173056135@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215729776 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55699 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16832 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs ping? On Thu, May 22, 2008 at 04:11:20PM +1000, David Chinner wrote: > > If test 078 fails and you try to run it again immediately, it > will execute a 'rm -f' on a directory which will fail. This should > be a rmdir.... > > Signed-off-by: Dave Chinner > --- > xfstests/078 | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > Index: xfs-cmds/xfstests/078 > =================================================================== > --- xfs-cmds.orig/xfstests/078 2008-03-20 09:10:02.000000000 +1100 > +++ xfs-cmds/xfstests/078 2008-05-15 23:21:58.192413673 +1000 > @@ -50,8 +50,8 @@ _filter_io() > # real QA test starts here > > echo "*** create loop mount point" > -rm -f $LOOP_MNT 2>/dev/null > -mkdir $LOOP_MNT || _fail "cannot create loopback mount point" > +rmdir $LOOP_MNT 2>/dev/null > +mkdir -p $LOOP_MNT || _fail "cannot create loopback mount point" > > _grow_loop() > { > > -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 10 15:43:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 15:43:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_29 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6AMhZDP030789 for ; Thu, 10 Jul 2008 15:43:36 -0700 X-ASG-Debug-ID: 1215729880-05d103470000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B68F5DF358C for ; Thu, 10 Jul 2008 15:44:40 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 6RloNwfu7twzruql for ; Thu, 10 Jul 2008 15:44:40 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHYrdkh5LFxA/2dsb2JhbACyFA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146255441" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 08:14:39 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH4sR-0002mD-Gb for xfs@oss.sgi.com; Fri, 11 Jul 2008 08:44:39 +1000 Date: Fri, 11 Jul 2008 08:44:34 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [patch] allow mkfs to make larger logs Subject: Re: [patch] allow mkfs to make larger logs Message-ID: <20080710224434.GY11558@disturbed> Mail-Followup-To: xfs@oss.sgi.com References: <20080522061222.GQ173056135@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080522061222.GQ173056135@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215729881 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55699 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16833 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs ping? On Thu, May 22, 2008 at 04:12:22PM +1000, David Chinner wrote: > > Increase the maximum log size supported by mkfs. > > The log size can be increased easily in mkfs by changing a few > defines and a couple of types to allow the log size to increase to > just under 2GB. Theoretically, the log size can be made much, much > larger than this (up to 2^32 sectors), but going beyond 2^31 > *bytes* causes integer overflow issues in the kernel log code. > > We use a maximum size of just under 2GB as exactly 2GB will cause > overflow issues on the first transaction reservation. > > Maximum log size is now reached at a fs size of ~4TB. > > Signed-off-by: Dave Chinner > --- > xfsprogs/include/xfs_fs.h | 11 +++++++---- > xfsprogs/mkfs/xfs_mkfs.c | 14 +++++++------- > 2 files changed, 14 insertions(+), 11 deletions(-) > > Index: xfs-cmds/xfsprogs/include/xfs_fs.h > =================================================================== > --- xfs-cmds.orig/xfsprogs/include/xfs_fs.h 2008-05-15 16:32:52.929462025 +1000 > +++ xfs-cmds/xfsprogs/include/xfs_fs.h 2008-05-15 18:50:19.494520368 +1000 > @@ -248,10 +248,13 @@ typedef struct xfs_fsop_resblks { > * Minimum and maximum sizes need for growth checks > */ > #define XFS_MIN_AG_BLOCKS 64 > -#define XFS_MIN_LOG_BLOCKS 512 > -#define XFS_MAX_LOG_BLOCKS (64 * 1024) > -#define XFS_MIN_LOG_BYTES (256 * 1024) > -#define XFS_MAX_LOG_BYTES (128 * 1024 * 1024) > +#define XFS_MIN_LOG_BLOCKS 512ULL > +#define XFS_MAX_LOG_BLOCKS (1024 * 1024ULL) > +#define XFS_MIN_LOG_BYTES (10 * 1024 * 1024ULL) > + > +/* keep the maximum size under 2^31 by a small amount */ > +#define XFS_MAX_LOG_BYTES \ > + ((2 * 1024 * 1024 * 1024ULL) - XFS_MIN_LOG_BYTES) > > /* > * Structures for XFS_IOC_FSGROWFSDATA, XFS_IOC_FSGROWFSLOG & XFS_IOC_FSGROWFSRT > Index: xfs-cmds/xfsprogs/mkfs/xfs_mkfs.c > =================================================================== > --- xfs-cmds.orig/xfsprogs/mkfs/xfs_mkfs.c 2008-05-15 16:32:53.013451121 +1000 > +++ xfs-cmds/xfsprogs/mkfs/xfs_mkfs.c 2008-05-15 18:47:54.093343349 +1000 > @@ -362,13 +362,13 @@ validate_log_size(__uint64_t logblocks, > } > if (logblocks > XFS_MAX_LOG_BLOCKS) { > fprintf(stderr, > - _("log size %lld blocks too large, maximum size is %d blocks\n"), > + _("log size %lld blocks too large, maximum size is %lld blocks\n"), > (long long)logblocks, XFS_MAX_LOG_BLOCKS); > usage(); > } > if ((logblocks << blocklog) > XFS_MAX_LOG_BYTES) { > fprintf(stderr, > - _("log size %lld bytes too large, maximum size is %d bytes\n"), > + _("log size %lld bytes too large, maximum size is %lld bytes\n"), > (long long)(logblocks << blocklog), XFS_MAX_LOG_BYTES); > usage(); > } > @@ -1724,7 +1724,7 @@ reported by the device (%u).\n"), > min_logblocks = max_tr_res * XFS_MIN_LOG_FACTOR; > min_logblocks = MAX(XFS_MIN_LOG_BLOCKS, min_logblocks); > if (!logsize && dblocks >= (1024*1024*1024) >> blocklog) > - min_logblocks = MAX(min_logblocks, (10*1024*1024)>>blocklog); > + min_logblocks = MAX(min_logblocks, XFS_MIN_LOG_BYTES>>blocklog); > if (logsize && xi.logBBsize > 0 && logblocks > DTOBT(xi.logBBsize)) { > fprintf(stderr, > _("size %s specified for log subvolume is too large, maximum is %lld blocks\n"), > @@ -1744,10 +1744,10 @@ _("size %s specified for log subvolume i > logblocks = 0; > } else if (loginternal && !logsize) { > /* > - * logblocks grows from min_logblocks to XFS_MAX_LOG_BLOCKS > - * at 128GB > - * > - * 2048 = 128GB / MAX_LOG_BYTES > + * With a 2GB max log size, default to maximum size > + * at 4TB. This keeps the same ratio from the older > + * max log size of 128M at 256GB fs size. IOWs, > + * the ratio of fs size to log size is 2048:1. > */ > logblocks = (dblocks << blocklog) / 2048; > logblocks = logblocks >> blocklog; > > -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 10 15:44:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 15:44:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6AMiCcX031075 for ; Thu, 10 Jul 2008 15:44:12 -0700 X-ASG-Debug-ID: 1215729917-269c02250000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9C9452D7BA0 for ; Thu, 10 Jul 2008 15:45:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id lpAAxVMQAKfVgHJS for ; Thu, 10 Jul 2008 15:45:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHYrdkh5LFxA/2dsb2JhbACyFA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146255765" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 08:15:15 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH4t1-0002ne-F4 for xfs@oss.sgi.com; Fri, 11 Jul 2008 08:45:15 +1000 Date: Fri, 11 Jul 2008 08:45:15 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [patch] xfsqa test to check log size scaling Subject: Re: [patch] xfsqa test to check log size scaling Message-ID: <20080710224515.GZ11558@disturbed> Mail-Followup-To: xfs@oss.sgi.com References: <20080522061257.GR173056135@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080522061257.GR173056135@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215729918 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55698 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16834 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs ping? On Thu, May 22, 2008 at 04:12:57PM +1000, David Chinner wrote: > XFS-QA test to check that log size scaling works correctly > for old and new maximum log sizes. > > Signed-off-by: Dave Chinner > --- > xfstests/188 | 88 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ > xfstests/188.out | 16 ++++++++++ > xfstests/group | 1 > 3 files changed, 105 insertions(+) > > Index: xfs-cmds/xfstests/188 > =================================================================== > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ xfs-cmds/xfstests/188 2008-05-15 22:39:08.741203552 +1000 > @@ -0,0 +1,88 @@ > +#! /bin/sh > +# FS QA Test No. 188 > +# > +# large log size mkfs test - ensure the log size scaling works > +# > +#----------------------------------------------------------------------- > +# Copyright (c) 2008 Silicon Graphics, Inc. All Rights Reserved. > +#----------------------------------------------------------------------- > +# > +# creator > +owner=dgc@sgi.com > + > +seq=`basename $0` > +echo "QA output created by $seq" > + > +here=`pwd` > +tmp=/tmp/$$ > +status=1 # failure is the default! > +trap "_cleanup; exit \$status" 0 1 2 3 15 > + > +_cleanup() > +{ > + cd / > + rm -f $tmp.* > + _cleanup_testdir > +} > + > +# get standard environment, filters and checks > +. ./common.rc > +. ./common.filter > + > +# real QA test starts here > +_supported_fs xfs > +_supported_os Linux > + > +_setup_testdir > +_require_scratch > +_scratch_mkfs_xfs >/dev/null 2>&1 > +_scratch_mount > + > +_require_loop > +LOOP_DEV=$SCRATCH_MNT/test_fs > +LOOP_MNT=$SCRATCH_MNT/test_fs_dir > + > +_do_mkfs() > +{ > + for i in $*; do > + echo -n "fssize=${i}g " > + $MKFS_XFS_PROG -f -b size=4096 -l version=2 \ > + -d name=$LOOP_DEV,size=${i}g |grep log > + mount -o loop -t xfs $LOOP_DEV $LOOP_MNT > + echo "test write" > $LOOP_MNT/test > + umount $LOOP_MNT > + done > +} > +# make large holey file > +$XFS_IO_PROG -f -c "truncate 100t" $LOOP_DEV > + > +#make loopback mount dir > +mkdir $LOOP_MNT > + > +# test if large logs are supported > +LARGE_LOG= > +$MKFS_XFS_PROG -f -l size=256m -d name=$LOOP_DEV,size=10g > /dev/null 2>&1 > +if [ $? -eq 0 ]; then > + LARGE_LOG=true > +fi > + > +# walk over standard sizes (up to 256GB) > +_do_mkfs 1 2 4 8 16 32 64 128 256 > + > +if [ -n "$LARGE_LOG" ]; then > + # walk over larger sizes > + _do_mkfs 512 1024 2048 4096 8192 16384 > +else > + # just cut'n'paste from the golden output for the remaining sizes > + cat << EOF > +fssize=512g log =internal log bsize=4096 blocks=65536, version=2 > +fssize=1024g log =internal log bsize=4096 blocks=131072, version=2 > +fssize=2048g log =internal log bsize=4096 blocks=262144, version=2 > +fssize=4096g log =internal log bsize=4096 blocks=521728, version=2 > +fssize=8192g log =internal log bsize=4096 blocks=521728, version=2 > +fssize=16384g log =internal log bsize=4096 blocks=521728, version=2 > +EOF > +fi > + > +status=0 > +exit > Index: xfs-cmds/xfstests/188.out > =================================================================== > --- /dev/null 1970-01-01 00:00:00.000000000 +0000 > +++ xfs-cmds/xfstests/188.out 2008-05-15 22:39:26.254922874 +1000 > @@ -0,0 +1,16 @@ > +QA output created by 188 > +fssize=1g log =internal log bsize=4096 blocks=2560, version=2 > +fssize=2g log =internal log bsize=4096 blocks=2560, version=2 > +fssize=4g log =internal log bsize=4096 blocks=2560, version=2 > +fssize=8g log =internal log bsize=4096 blocks=2560, version=2 > +fssize=16g log =internal log bsize=4096 blocks=2560, version=2 > +fssize=32g log =internal log bsize=4096 blocks=4096, version=2 > +fssize=64g log =internal log bsize=4096 blocks=8192, version=2 > +fssize=128g log =internal log bsize=4096 blocks=16384, version=2 > +fssize=256g log =internal log bsize=4096 blocks=32768, version=2 > +fssize=512g log =internal log bsize=4096 blocks=65536, version=2 > +fssize=1024g log =internal log bsize=4096 blocks=131072, version=2 > +fssize=2048g log =internal log bsize=4096 blocks=262144, version=2 > +fssize=4096g log =internal log bsize=4096 blocks=521728, version=2 > +fssize=8192g log =internal log bsize=4096 blocks=521728, version=2 > +fssize=16384g log =internal log bsize=4096 blocks=521728, version=2 > Index: xfs-cmds/xfstests/group > =================================================================== > --- xfs-cmds.orig/xfstests/group 2008-05-15 16:32:52.489519140 +1000 > +++ xfs-cmds/xfstests/group 2008-05-15 22:38:32.000000000 +1000 > @@ -275,3 +275,4 @@ filestreams dgc@sgi.com > 185 dmapi auto > 186 attr auto > 187 attr auto > +188 log metadata auto > > -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 10 17:32:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 17:32:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B0VxbR012864 for ; Thu, 10 Jul 2008 17:32:01 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA04031; Fri, 11 Jul 2008 10:32:57 +1000 Message-ID: <4876AA39.804@sgi.com> Date: Fri, 11 Jul 2008 10:32:57 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 2/3] simplify xfs_setattr References: <20080627154557.GB31476@lst.de> <20080705172021.GA7177@lst.de> <48747DAD.7060501@sgi.com> <20080709162914.GA16308@lst.de> In-Reply-To: <20080709162914.GA16308@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16835 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Wed, Jul 09, 2008 at 06:58:21PM +1000, Timothy Shimmin wrote: >>> - if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) >>> - flags |= ATTR_UTIME; >>> -#ifdef ATTR_NO_BLOCK >>> - if ((ia_valid & ATTR_NO_BLOCK)) >>> - flags |= ATTR_NONBLOCK; >>> -#endif >>> - >> So this code looks different. >> We are now dropping the flags. Why is that? >> Presumably because we were mapping ia_valid's: >> ATTR_MTIME_SET or ATTR_ATIME_SET --> ATTR_UTIME >> ATTR_NO_BLOCK -> ATTR_NONBLOCK >> But now we pass ATTR_?TIME_SET and ATTR_NO_BLOCK straight thru. >> So previously we didn't map them onto va_mask bits but as separate flags >> instead. > > Yeah, not that ATTR_NO_BLOCK doesn't actually exist in any tree I have > access to, and thus it's not actually handled in the new xfs_setattr. > Hmm...confusing re NO_BLOCK. 1 linux-2.6/xfs_vnode.h 228 #define ATTR_NONBLOCK 0x100 2 linux-2.6/xfs_ioctl.c xfs_ioc_space 686 attr_flags |= ATTR_NONBLOCK; 3 linux-2.6/xfs_ioctl.c xfs_ioc_fssetxattr 899 attr_flags |= ATTR_NONBLOCK; 4 linux-2.6/xfs_ioctl.c xfs_ioc_setxflags 951 attr_flags |= ATTR_NONBLOCK; 5 linux-2.6/xfs_iops.c xfs_vn_setattr 703 flags |= ATTR_NONBLOCK; 1 xfs/xfs_dmapi.h 169 #define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) 2 xfs/xfs_vnodeops.c xfs_setattr 200 int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; 3 xfs/xfs_vnodeops.c xfs_setattr 757 0, 0, AT_DELAY_FLAG(flags)); 4 xfs/xfs_vnodeops.c xfs_free_file_space 3536 AT_DELAY_FLAG(attr_flags), NULL); So it's just used for dmapi stuff as it only looks like it is tested by AT_DELAY_FLAG(). So for xfs_setattr it will be expecting it coming in as flags param and then testing it via AT_DELAY_FLAG. Hmmm...doesn't seem so good. So looks like it was handled by xfs_setattr and still is. So are we going to be doing the right thing now? If it could just never be set then what is the point of using AT_DELAY_FLAG() in xfs_setattr? >> So we get rid of the test for XFS_AT_NOSET. >> where: >> #define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\ >> XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ >> XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) >> >> I can't see anywhere we set any of these. >> Presumably out of the xattr calls. >> Some left over from IRIX I guess. > > Probably. Note that linux uses the ATTR_ flags only for ->setattr so > there are per defintion none that can't be set. > Which is nice. >> #define XFS_AT_UPDATIME 0x00010000 >> #define XFS_AT_UPDMTIME 0x00020000 >> #define XFS_AT_UPDCTIME 0x00040000 >> 3 more not supported by vfs ATTR_* macros. >> I can't see where we set any of these. >> So no loss there I guess. >> Presumably they were just for IRIX. > > It's an IRIX leftover. I will submit a patch to introduce something > similar to Linux for 2.6.27, that's why I'd like these patches in for > 2.6.26 so that I have a clean base to start from. Ok. --Tim From owner-xfs@oss.sgi.com Thu Jul 10 18:07:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:07:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B170Ym015834 for ; Thu, 10 Jul 2008 18:07:00 -0700 X-ASG-Debug-ID: 1215738480-64c001250000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BBF20DF3C9C for ; Thu, 10 Jul 2008 18:08:01 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id qbp094yC3jddYMQk for ; Thu, 10 Jul 2008 18:08:01 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSEE X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146346294" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:37:59 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH779-0007wV-6s; Fri, 11 Jul 2008 11:07:59 +1000 Date: Fri, 11 Jul 2008 11:07:59 +1000 From: Dave Chinner To: Timothy Shimmin Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] simplify xfs_setattr Subject: Re: [PATCH 2/3] simplify xfs_setattr Message-ID: <20080711010759.GA11558@disturbed> Mail-Followup-To: Timothy Shimmin , Christoph Hellwig , xfs@oss.sgi.com References: <20080627154557.GB31476@lst.de> <20080705172021.GA7177@lst.de> <48747DAD.7060501@sgi.com> <20080709162914.GA16308@lst.de> <4876AA39.804@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4876AA39.804@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738484 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55708 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16836 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 10:32:57AM +1000, Timothy Shimmin wrote: > Christoph Hellwig wrote: > > On Wed, Jul 09, 2008 at 06:58:21PM +1000, Timothy Shimmin wrote: > >>> - if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) > >>> - flags |= ATTR_UTIME; > >>> -#ifdef ATTR_NO_BLOCK > >>> - if ((ia_valid & ATTR_NO_BLOCK)) > >>> - flags |= ATTR_NONBLOCK; > >>> -#endif > >>> - > >> So this code looks different. > >> We are now dropping the flags. Why is that? > >> Presumably because we were mapping ia_valid's: > >> ATTR_MTIME_SET or ATTR_ATIME_SET --> ATTR_UTIME > >> ATTR_NO_BLOCK -> ATTR_NONBLOCK > >> But now we pass ATTR_?TIME_SET and ATTR_NO_BLOCK straight thru. > >> So previously we didn't map them onto va_mask bits but as separate flags > >> instead. > > > > Yeah, not that ATTR_NO_BLOCK doesn't actually exist in any tree I have > > access to, and thus it's not actually handled in the new xfs_setattr. Look in SLES9 and SLES10. It's used to enable the NFS server to return EAGAIN for truncates that might block for a long time. This can occur if a file migration to/from HSM is in progress. This will return EJUKEBOX to NFS clients to prevent them from unnecessarily resending the truncate over the wire due to timeouts and blocking multiple (potentially all) nfsds trying to service the truncate.... It's just that someone here NACKed the mainline patches to the NFS server to set this flag.... ;) Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 10 18:09:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:09:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B19Nh2016302 for ; Thu, 10 Jul 2008 18:09:23 -0700 X-ASG-Debug-ID: 1215738627-679d01190000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0AA43DF3F41; Thu, 10 Jul 2008 18:10:28 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id yf7PlUxWV3bHn7jE; Thu, 10 Jul 2008 18:10:28 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6B1AHNW020574 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 11 Jul 2008 03:10:17 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6B1AHBe020572; Fri, 11 Jul 2008 03:10:17 +0200 Date: Fri, 11 Jul 2008 03:10:17 +0200 From: Christoph Hellwig To: Timothy Shimmin Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] simplify xfs_setattr Subject: Re: [PATCH 2/3] simplify xfs_setattr Message-ID: <20080711011017.GA20486@lst.de> References: <20080627154557.GB31476@lst.de> <20080705172021.GA7177@lst.de> <48747DAD.7060501@sgi.com> <20080709162914.GA16308@lst.de> <4876AA39.804@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4876AA39.804@sgi.com> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215738629 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55708 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16837 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 10:32:57AM +1000, Timothy Shimmin wrote: > Hmm...confusing re NO_BLOCK. > > 1 linux-2.6/xfs_vnode.h 228 #define ATTR_NONBLOCK 0x100 > 2 linux-2.6/xfs_ioctl.c xfs_ioc_space 686 attr_flags |= ATTR_NONBLOCK; > 3 linux-2.6/xfs_ioctl.c xfs_ioc_fssetxattr 899 attr_flags |= ATTR_NONBLOCK; > 4 linux-2.6/xfs_ioctl.c xfs_ioc_setxflags 951 attr_flags |= ATTR_NONBLOCK; > 5 linux-2.6/xfs_iops.c xfs_vn_setattr 703 flags |= ATTR_NONBLOCK; > > 1 xfs/xfs_dmapi.h 169 #define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) > 2 xfs/xfs_vnodeops.c xfs_setattr 200 int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; > 3 xfs/xfs_vnodeops.c xfs_setattr 757 0, 0, AT_DELAY_FLAG(flags)); > 4 xfs/xfs_vnodeops.c xfs_free_file_space 3536 AT_DELAY_FLAG(attr_flags), NULL); > > So it's just used for dmapi stuff as it only looks like it is tested by > AT_DELAY_FLAG(). > So for xfs_setattr it will be expecting it coming in as flags param > and then testing it via AT_DELAY_FLAG. > Hmmm...doesn't seem so good. So looks like it was handled by > xfs_setattr and still is. > So are we going to be doing the right thing now? > If it could just never be set then what is the point of using > AT_DELAY_FLAG() in xfs_setattr? We scan till set XFS_ATTR_NONBLOCK, just not coming from xfs_vn_setattr. Currently that's only done in xfs_ioc_space. > > > >> So we get rid of the test for XFS_AT_NOSET. > >> where: > >> #define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\ > >> XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ > >> XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) > >> > >> I can't see anywhere we set any of these. > >> Presumably out of the xattr calls. > >> Some left over from IRIX I guess. > > > > Probably. Note that linux uses the ATTR_ flags only for ->setattr so > > there are per defintion none that can't be set. > > > Which is nice. > > >> #define XFS_AT_UPDATIME 0x00010000 > >> #define XFS_AT_UPDMTIME 0x00020000 > >> #define XFS_AT_UPDCTIME 0x00040000 > >> 3 more not supported by vfs ATTR_* macros. > >> I can't see where we set any of these. > >> So no loss there I guess. > >> Presumably they were just for IRIX. > > > > It's an IRIX leftover. I will submit a patch to introduce something > > similar to Linux for 2.6.27, that's why I'd like these patches in for > > 2.6.26 so that I have a clean base to start from. > Ok. > > --Tim ---end quoted text--- From owner-xfs@oss.sgi.com Thu Jul 10 18:10:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:10:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1AJIU016585 for ; Thu, 10 Jul 2008 18:10:19 -0700 X-ASG-Debug-ID: 1215738683-2a3103680000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8B7852DADF7; Thu, 10 Jul 2008 18:11:23 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id j2QiRgG0G0CMGyFY; Thu, 10 Jul 2008 18:11:23 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6B1BENW020630 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 11 Jul 2008 03:11:14 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6B1BEqi020628; Fri, 11 Jul 2008 03:11:14 +0200 Date: Fri, 11 Jul 2008 03:11:14 +0200 From: Christoph Hellwig To: Timothy Shimmin , Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] simplify xfs_setattr Subject: Re: [PATCH 2/3] simplify xfs_setattr Message-ID: <20080711011114.GB20486@lst.de> References: <20080627154557.GB31476@lst.de> <20080705172021.GA7177@lst.de> <48747DAD.7060501@sgi.com> <20080709162914.GA16308@lst.de> <4876AA39.804@sgi.com> <20080711010759.GA11558@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080711010759.GA11558@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1215738685 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16838 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 11:07:59AM +1000, Dave Chinner wrote: > It's just that someone here NACKed the mainline patches to the > NFS server to set this flag.... ;) Get proper hsm support in mainline and we can talk about enhancing subsystems to deal with it. From owner-xfs@oss.sgi.com Thu Jul 10 18:12:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:12:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1Co2G017329 for ; Thu, 10 Jul 2008 18:12:50 -0700 X-ASG-Debug-ID: 1215738834-13ba016d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0535C18B0C62 for ; Thu, 10 Jul 2008 18:13:55 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id JIMTBgc7QUWqRmtf for ; Thu, 10 Jul 2008 18:13:55 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146350265" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:43:51 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH7Co-00086b-Qc; Fri, 11 Jul 2008 11:13:50 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org, matthew@wil.cx, Dave Chinner X-ASG-Orig-Subj: [PATCH 2/6] Replace the XFS buf iodone semaphore with a completion Subject: [PATCH 2/6] Replace the XFS buf iodone semaphore with a completion Date: Fri, 11 Jul 2008 11:13:46 +1000 Message-Id: <1215738830-31048-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1215738830-31048-1-git-send-email-david@fromorbit.com> References: <1215738830-31048-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738836 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16840 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs The xfs_buf_t b_iodonesema is really just a semaphore that wants to be a completion. Change it to a completion and remove the last user of the sema_t from XFS. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_buf.c | 6 +++--- fs/xfs/linux-2.6/xfs_buf.h | 4 ++-- fs/xfs/xfs_buf_item.c | 2 +- fs/xfs/xfs_rw.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 9cc8f02..9438c90 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -253,7 +253,7 @@ _xfs_buf_initialize( memset(bp, 0, sizeof(xfs_buf_t)); atomic_set(&bp->b_hold, 1); - init_MUTEX_LOCKED(&bp->b_iodonesema); + init_completion(&bp->b_iowait); INIT_LIST_HEAD(&bp->b_list); INIT_LIST_HEAD(&bp->b_hash_list); init_MUTEX_LOCKED(&bp->b_sema); /* held, no waiters */ @@ -1037,7 +1037,7 @@ xfs_buf_ioend( xfs_buf_iodone_work(&bp->b_iodone_work); } } else { - up(&bp->b_iodonesema); + complete(&bp->b_iowait); } } @@ -1275,7 +1275,7 @@ xfs_buf_iowait( XB_TRACE(bp, "iowait", 0); if (atomic_read(&bp->b_io_remaining)) blk_run_address_space(bp->b_target->bt_mapping); - down(&bp->b_iodonesema); + wait_for_completion(&bp->b_iowait); XB_TRACE(bp, "iowaited", (long)bp->b_error); return bp->b_error; } diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h index 29d1d4a..fe01099 100644 --- a/fs/xfs/linux-2.6/xfs_buf.h +++ b/fs/xfs/linux-2.6/xfs_buf.h @@ -157,7 +157,7 @@ typedef struct xfs_buf { xfs_buf_iodone_t b_iodone; /* I/O completion function */ xfs_buf_relse_t b_relse; /* releasing function */ xfs_buf_bdstrat_t b_strat; /* pre-write function */ - struct semaphore b_iodonesema; /* Semaphore for I/O waiters */ + struct completion b_iowait; /* queue for I/O waiters */ void *b_fspriv; void *b_fspriv2; void *b_fspriv3; @@ -352,7 +352,7 @@ extern void xfs_buf_trace(xfs_buf_t *, char *, void *, void *); #define XFS_BUF_CPSEMA(bp) (xfs_buf_cond_lock(bp) == 0) #define XFS_BUF_VSEMA(bp) xfs_buf_unlock(bp) #define XFS_BUF_PSEMA(bp,x) xfs_buf_lock(bp) -#define XFS_BUF_V_IODONESEMA(bp) up(&bp->b_iodonesema); +#define XFS_BUF_FINISH_IOWAIT(bp) complete(&bp->b_iowait); #define XFS_BUF_SET_TARGET(bp, target) ((bp)->b_target = (target)) #define XFS_BUF_TARGET(bp) ((bp)->b_target) diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index d86ca2c..215c36d 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -1056,7 +1056,7 @@ xfs_buf_iodone_callbacks( anyway. */ XFS_BUF_SET_BRELSE_FUNC(bp,xfs_buf_error_relse); XFS_BUF_DONE(bp); - XFS_BUF_V_IODONESEMA(bp); + XFS_BUF_FINISH_IOWAIT(bp); } return; } diff --git a/fs/xfs/xfs_rw.c b/fs/xfs/xfs_rw.c index b0f31c0..3a82576 100644 --- a/fs/xfs/xfs_rw.c +++ b/fs/xfs/xfs_rw.c @@ -314,7 +314,7 @@ xfs_bioerror_relse( * ASYNC buffers. */ XFS_BUF_ERROR(bp, EIO); - XFS_BUF_V_IODONESEMA(bp); + XFS_BUF_FINISH_IOWAIT(bp); } else { xfs_buf_relse(bp); } -- 1.5.6 From owner-xfs@oss.sgi.com Thu Jul 10 18:12:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:12:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1Crpq017368 for ; Thu, 10 Jul 2008 18:12:53 -0700 X-ASG-Debug-ID: 1215738832-237f001d0002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E154918B0CD8 for ; Thu, 10 Jul 2008 18:13:57 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id X9kw8eOLfZa1aB18 for ; Thu, 10 Jul 2008 18:13:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146350288" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:43:52 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH7Cp-00086j-I5; Fri, 11 Jul 2008 11:13:51 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org, matthew@wil.cx, Dave Chinner X-ASG-Orig-Subj: [PATCH 4/6] Replace inode flush semaphore with a completion Subject: [PATCH 4/6] Replace inode flush semaphore with a completion Date: Fri, 11 Jul 2008 11:13:48 +1000 Message-Id: <1215738830-31048-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1215738830-31048-1-git-send-email-david@fromorbit.com> References: <1215738830-31048-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738838 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16841 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Use the new completion flush code to implement the inode flush lock. Removes one of the final users of semaphores in the XFS code base. Version 2: o make flock functions static inlines o use new completion interfaces Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 32 ++++++++------------------------ fs/xfs/xfs_inode.c | 11 +++++------ fs/xfs/xfs_inode.h | 25 +++++++++++++++++++++---- fs/xfs/xfs_inode_item.c | 11 +++++------ 4 files changed, 39 insertions(+), 40 deletions(-) diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index b07604b..eb4db18 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -216,7 +216,14 @@ finish_inode: mrlock_init(&ip->i_iolock, MRLOCK_BARRIER, "xfsio", ip->i_ino); init_waitqueue_head(&ip->i_ipin_wait); atomic_set(&ip->i_pincount, 0); - initnsema(&ip->i_flock, 1, "xfsfino"); + + /* + * Because we want to use a counting completion, complete + * the flush completion once to allow a single access to + * the flush completion without blocking. + */ + init_completion(&ip->i_flush); + complete(&ip->i_flush); if (lock_flags) xfs_ilock(ip, lock_flags); @@ -775,26 +782,3 @@ xfs_isilocked( } #endif -/* - * The following three routines simply manage the i_flock - * semaphore embedded in the inode. This semaphore synchronizes - * processes attempting to flush the in-core inode back to disk. - */ -void -xfs_iflock(xfs_inode_t *ip) -{ - psema(&(ip->i_flock), PINOD|PLTWAIT); -} - -int -xfs_iflock_nowait(xfs_inode_t *ip) -{ - return (cpsema(&(ip->i_flock))); -} - -void -xfs_ifunlock(xfs_inode_t *ip) -{ - ASSERT(issemalocked(&(ip->i_flock))); - vsema(&(ip->i_flock)); -} diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index bedc661..1047bdc 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -2630,7 +2630,6 @@ xfs_idestroy( xfs_idestroy_fork(ip, XFS_ATTR_FORK); mrfree(&ip->i_lock); mrfree(&ip->i_iolock); - freesema(&ip->i_flock); #ifdef XFS_INODE_TRACE ktrace_free(ip->i_trace); @@ -3048,10 +3047,10 @@ cluster_corrupt_out: /* * xfs_iflush() will write a modified inode's changes out to the * inode's on disk home. The caller must have the inode lock held - * in at least shared mode and the inode flush semaphore must be - * held as well. The inode lock will still be held upon return from + * in at least shared mode and the inode flush completion must be + * active as well. The inode lock will still be held upon return from * the call and the caller is free to unlock it. - * The inode flush lock will be unlocked when the inode reaches the disk. + * The inode flush will be completed when the inode reaches the disk. * The flags indicate how the inode's buffer should be written out. */ int @@ -3070,7 +3069,7 @@ xfs_iflush( XFS_STATS_INC(xs_iflush_count); ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)); - ASSERT(issemalocked(&(ip->i_flock))); + ASSERT(!completion_done(&ip->i_flush)); ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || ip->i_d.di_nextents > ip->i_df.if_ext_max); @@ -3233,7 +3232,7 @@ xfs_iflush_int( #endif ASSERT(xfs_isilocked(ip, XFS_ILOCK_EXCL|XFS_ILOCK_SHARED)); - ASSERT(issemalocked(&(ip->i_flock))); + ASSERT(!completion_done(&ip->i_flush)); ASSERT(ip->i_d.di_format != XFS_DINODE_FMT_BTREE || ip->i_d.di_nextents > ip->i_df.if_ext_max); diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 17a04b6..086282d 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -223,7 +223,7 @@ typedef struct xfs_inode { struct xfs_inode_log_item *i_itemp; /* logging information */ mrlock_t i_lock; /* inode lock */ mrlock_t i_iolock; /* inode IO lock */ - sema_t i_flock; /* inode flush lock */ + struct completion i_flush; /* inode flush completion q */ atomic_t i_pincount; /* inode pin count */ wait_queue_head_t i_ipin_wait; /* inode pinning wait queue */ spinlock_t i_flags_lock; /* inode i_flags lock */ @@ -473,11 +473,8 @@ int xfs_ilock_nowait(xfs_inode_t *, uint); void xfs_iunlock(xfs_inode_t *, uint); void xfs_ilock_demote(xfs_inode_t *, uint); int xfs_isilocked(xfs_inode_t *, uint); -void xfs_iflock(xfs_inode_t *); -int xfs_iflock_nowait(xfs_inode_t *); uint xfs_ilock_map_shared(xfs_inode_t *); void xfs_iunlock_map_shared(xfs_inode_t *, uint); -void xfs_ifunlock(xfs_inode_t *); void xfs_ireclaim(xfs_inode_t *); int xfs_finish_reclaim(xfs_inode_t *, int, int); int xfs_finish_reclaim_all(struct xfs_mount *, int); @@ -570,6 +567,26 @@ extern struct kmem_zone *xfs_ifork_zone; extern struct kmem_zone *xfs_inode_zone; extern struct kmem_zone *xfs_ili_zone; +/* + * Manage the i_flush queue embedded in the inode. This completion + * queue synchronizes processes attempting to flush the in-core + * inode back to disk. + */ +static inline void xfs_iflock(xfs_inode_t *ip) +{ + wait_for_completion(&ip->i_flush); +} + +static inline int xfs_iflock_nowait(xfs_inode_t *ip) +{ + return try_wait_for_completion(&ip->i_flush); +} + +static inline void xfs_ifunlock(xfs_inode_t *ip) +{ + complete(&ip->i_flush); +} + #endif /* __KERNEL__ */ #endif /* __XFS_INODE_H__ */ diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c index 0eee08a..97c7452 100644 --- a/fs/xfs/xfs_inode_item.c +++ b/fs/xfs/xfs_inode_item.c @@ -779,11 +779,10 @@ xfs_inode_item_pushbuf( ASSERT(iip->ili_push_owner == current_pid()); /* - * If flushlock isn't locked anymore, chances are that the - * inode flush completed and the inode was taken off the AIL. - * So, just get out. + * If a flush is not in progress anymore, chances are that the + * inode was taken off the AIL. So, just get out. */ - if (!issemalocked(&(ip->i_flock)) || + if (completion_done(&ip->i_flush) || ((iip->ili_item.li_flags & XFS_LI_IN_AIL) == 0)) { iip->ili_pushbuf_flag = 0; xfs_iunlock(ip, XFS_ILOCK_SHARED); @@ -805,7 +804,7 @@ xfs_inode_item_pushbuf( * If not, we can flush it async. */ dopush = ((iip->ili_item.li_flags & XFS_LI_IN_AIL) && - issemalocked(&(ip->i_flock))); + !completion_done(&ip->i_flush)); iip->ili_pushbuf_flag = 0; xfs_iunlock(ip, XFS_ILOCK_SHARED); xfs_buftrace("INODE ITEM PUSH", bp); @@ -858,7 +857,7 @@ xfs_inode_item_push( ip = iip->ili_inode; ASSERT(xfs_isilocked(ip, XFS_ILOCK_SHARED)); - ASSERT(issemalocked(&(ip->i_flock))); + ASSERT(!completion_done(&ip->i_flush)); /* * Since we were able to lock the inode's flush lock and * we found it on the AIL, the inode must be dirty. This -- 1.5.6 From owner-xfs@oss.sgi.com Thu Jul 10 18:12:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:12:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1CmM3017315 for ; Thu, 10 Jul 2008 18:12:48 -0700 X-ASG-Debug-ID: 1215738832-237f001d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6A28018B0C60 for ; Thu, 10 Jul 2008 18:13:53 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id MCycY5cWG4QEg4jL for ; Thu, 10 Jul 2008 18:13:53 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146350267" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:43:51 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH7Co-00086W-M5; Fri, 11 Jul 2008 11:13:50 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org, matthew@wil.cx X-ASG-Orig-Subj: [RESEND, PATCH 0/6] Remove most users of semaphores from XFS Subject: [RESEND, PATCH 0/6] Remove most users of semaphores from XFS Date: Fri, 11 Jul 2008 11:13:44 +1000 Message-Id: <1215738830-31048-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738834 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16839 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs This series aims to convert all but one of the remaining users of semaphores in the XFS code to use completions. Two of these semaphores don't quite match to completion semantics, but a small amount of additional code on top of the completions fixes this problem. I'm open to suggestions on different/better ways to implement this. The patch series does not touch the b_lock semaphore in the xfs_buf_t. At this point I'm not sure what we want to do with that semaphore so I've ignored that for now. Also, this lock uses linux primitives, not the xfs sema_t primitives so it doesn't need changing to allow me to remove the sema_t. Version 2: o remove "flush" based API and just add the minimum necessary extensions to allow counting completions to do what is needed by XFS. o change XFS patches to make use of new API o clean up the XFS APIs using the new completion API a little. From owner-xfs@oss.sgi.com Thu Jul 10 18:12:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:12:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1CqVL017346 for ; Thu, 10 Jul 2008 18:12:52 -0700 X-ASG-Debug-ID: 1215738834-13ba016d0001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id ADCF918B0CD8 for ; Thu, 10 Jul 2008 18:13:56 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id w9rEZBg9ky0mhDDE for ; Thu, 10 Jul 2008 18:13:56 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146350272" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:43:51 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH7Co-00086d-Se; Fri, 11 Jul 2008 11:13:51 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org, matthew@wil.cx, Dave Chinner X-ASG-Orig-Subj: [PATCH 3/6] Extend completions to provide XFS object flush requirements Subject: [PATCH 3/6] Extend completions to provide XFS object flush requirements Date: Fri, 11 Jul 2008 11:13:47 +1000 Message-Id: <1215738830-31048-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1215738830-31048-1-git-send-email-david@fromorbit.com> References: <1215738830-31048-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738837 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0004 1.0000 -2.0184 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16843 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs XFS object flushing doesn't quite match existing completion semantics. It mixed exclusive access with completion. That is, we need to mark an object as being flushed before flushing it to disk, and then block any other attempt to flush it until the completion occurs. We do this but adding an extra count to the completion before we start using them. However, we still need to determine if there is a completion in progress, and allow no-blocking attempts fo completions to decrement the count. To do this we introduce: int try_wait_for_completion(struct completion *x) returns a failure status if done == 0, otherwise decrements done to zero and returns a "started" status. This is provided to allow counted completions to begin safely while holding object locks in inverted order. int completion_done(struct completion *x) returns 1 if there is no waiter, 0 if there is a waiter (i.e. a completion in progress). This replaces the use of semaphores for providing this exclusion and completion mechanism. Version 2: o remove "flush" based API and just add the minimum necessary extensions to allow counting completions to do what is needed by XFS. o docbook format comments Signed-off-by: Dave Chinner --- include/linux/completion.h | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 45 insertions(+), 0 deletions(-) diff --git a/include/linux/completion.h b/include/linux/completion.h index d2961b6..57faa60 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h @@ -55,4 +55,49 @@ extern void complete_all(struct completion *); #define INIT_COMPLETION(x) ((x).done = 0) + +/** + * try_wait_for_completion - try to decrement a completion without blocking + * @x: completion structure + * + * Returns: 0 if a decrement cannot be done without blocking + * 1 if a decrement succeeded. + * + * If a completion is being used as a counting completion, + * attempt to decrement the counter without blocking. This + * enables us to avoid waiting if the resource the completion + * is protecting is not available. + */ +static inline bool try_wait_for_completion(struct completion *x) +{ + int ret = 1; + + spin_lock_irq(&x->wait.lock); + if (!x->done) + ret = 0; + else + x->done--; + spin_unlock_irq(&x->wait.lock); + return ret; +} + +/** + * completion_done - Test to see if a completion has any waiters + * @x: completion structure + * + * Returns: 0 if there are waiters (wait_for_completion() in progress) + * 1 if there are no waiters. + * + */ +static inline bool completion_done(struct completion *x) +{ + int ret = 1; + + spin_lock_irq(&x->wait.lock); + if (!x->done) + ret = 0; + spin_unlock_irq(&x->wait.lock); + return ret; +} + #endif -- 1.5.6 From owner-xfs@oss.sgi.com Thu Jul 10 18:12:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:13:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_48 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1CrJj017372 for ; Thu, 10 Jul 2008 18:12:54 -0700 X-ASG-Debug-ID: 1215738837-2a2f03980000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5C48B2DAE13 for ; Thu, 10 Jul 2008 18:13:57 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id gPfzJaKwytvYTlDt for ; Thu, 10 Jul 2008 18:13:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146350290" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:43:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH7Cp-00086n-U3; Fri, 11 Jul 2008 11:13:51 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org, matthew@wil.cx, Dave Chinner X-ASG-Orig-Subj: [PATCH 5/6] Replace dquot flush semaphore with a completion Subject: [PATCH 5/6] Replace dquot flush semaphore with a completion Date: Fri, 11 Jul 2008 11:13:49 +1000 Message-Id: <1215738830-31048-6-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1215738830-31048-1-git-send-email-david@fromorbit.com> References: <1215738830-31048-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738839 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16845 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Use the new completion flush code to implement the dquot flush lock. Removes one of the final users of semaphores in the XFS code base. Version 2: o make xfs_qm_dqflock_nowait() a static inline and rename to match xfs_dqflock/xfs_dqfunlock operations. o use new completion interface. Signed-off-by: Dave Chinner --- fs/xfs/quota/xfs_dquot.c | 34 ++++++++++++---------------------- fs/xfs/quota/xfs_dquot.h | 29 ++++++++++++++++++----------- fs/xfs/quota/xfs_dquot_item.c | 8 ++++---- fs/xfs/quota/xfs_qm.c | 8 ++++---- 4 files changed, 38 insertions(+), 41 deletions(-) diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index fc9f3fb..4a2194d 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c @@ -101,9 +101,16 @@ xfs_qm_dqinit( if (brandnewdquot) { dqp->dq_flnext = dqp->dq_flprev = dqp; mutex_init(&dqp->q_qlock); - initnsema(&dqp->q_flock, 1, "fdq"); sv_init(&dqp->q_pinwait, SV_DEFAULT, "pdq"); + /* + * Because we want to use a counting completion, complete + * the flush completion once to allow a single access to + * the flush completion without blocking. + */ + init_completion(&dqp->q_flush); + complete(&dqp->q_flush); + #ifdef XFS_DQUOT_TRACE dqp->q_trace = ktrace_alloc(DQUOT_TRACE_SIZE, KM_SLEEP); xfs_dqtrace_entry(dqp, "DQINIT"); @@ -150,7 +157,6 @@ xfs_qm_dqdestroy( ASSERT(! XFS_DQ_IS_ON_FREELIST(dqp)); mutex_destroy(&dqp->q_qlock); - freesema(&dqp->q_flock); sv_destroy(&dqp->q_pinwait); #ifdef XFS_DQUOT_TRACE @@ -1211,7 +1217,7 @@ xfs_qm_dqflush( int error; ASSERT(XFS_DQ_IS_LOCKED(dqp)); - ASSERT(XFS_DQ_IS_FLUSH_LOCKED(dqp)); + ASSERT(!completion_done(&dqp->q_flush)); xfs_dqtrace_entry(dqp, "DQFLUSH"); /* @@ -1348,34 +1354,18 @@ xfs_qm_dqflush_done( xfs_dqfunlock(dqp); } - -int -xfs_qm_dqflock_nowait( - xfs_dquot_t *dqp) -{ - int locked; - - locked = cpsema(&((dqp)->q_flock)); - - /* XXX ifdef these out */ - if (locked) - (dqp)->dq_flags |= XFS_DQ_FLOCKED; - return (locked); -} - - int xfs_qm_dqlock_nowait( xfs_dquot_t *dqp) { - return (mutex_trylock(&((dqp)->q_qlock))); + return mutex_trylock(&dqp->q_qlock); } void xfs_dqlock( xfs_dquot_t *dqp) { - mutex_lock(&(dqp->q_qlock)); + mutex_lock(&dqp->q_qlock); } void @@ -1468,7 +1458,7 @@ xfs_qm_dqpurge( * if we're turning off quotas. Basically, we need this flush * lock, and are willing to block on it. */ - if (! xfs_qm_dqflock_nowait(dqp)) { + if (!xfs_dqflock_nowait(dqp)) { /* * Block on the flush lock after nudging dquot buffer, * if it is incore. diff --git a/fs/xfs/quota/xfs_dquot.h b/fs/xfs/quota/xfs_dquot.h index f7393bb..8958d0f 100644 --- a/fs/xfs/quota/xfs_dquot.h +++ b/fs/xfs/quota/xfs_dquot.h @@ -82,7 +82,7 @@ typedef struct xfs_dquot { xfs_qcnt_t q_res_icount; /* total inos allocd+reserved */ xfs_qcnt_t q_res_rtbcount;/* total realtime blks used+reserved */ mutex_t q_qlock; /* quota lock */ - sema_t q_flock; /* flush lock */ + struct completion q_flush; /* flush completion queue */ uint q_pincount; /* pin count for this dquot */ sv_t q_pinwait; /* sync var for pinning */ #ifdef XFS_DQUOT_TRACE @@ -113,17 +113,25 @@ XFS_DQ_IS_LOCKED(xfs_dquot_t *dqp) /* - * The following three routines simply manage the q_flock - * semaphore embedded in the dquot. This semaphore synchronizes - * processes attempting to flush the in-core dquot back to disk. + * Manage the q_flush completion queue embedded in the dquot. This completion + * queue synchronizes processes attempting to flush the in-core dquot back to + * disk. */ -#define xfs_dqflock(dqp) { psema(&((dqp)->q_flock), PINOD | PRECALC);\ - (dqp)->dq_flags |= XFS_DQ_FLOCKED; } -#define xfs_dqfunlock(dqp) { ASSERT(issemalocked(&((dqp)->q_flock))); \ - vsema(&((dqp)->q_flock)); \ - (dqp)->dq_flags &= ~(XFS_DQ_FLOCKED); } +static inline void xfs_dqflock(xfs_dquot_t *dqp) +{ + wait_for_completion(&dqp->q_flush); +} + +static inline int xfs_dqflock_nowait(xfs_dquot_t *dqp) +{ + return try_wait_for_completion(&dqp->q_flush); +} + +static inline void xfs_dqfunlock(xfs_dquot_t *dqp) +{ + complete(&dqp->q_flush); +} -#define XFS_DQ_IS_FLUSH_LOCKED(dqp) (issemalocked(&((dqp)->q_flock))) #define XFS_DQ_IS_ON_FREELIST(dqp) ((dqp)->dq_flnext != (dqp)) #define XFS_DQ_IS_DIRTY(dqp) ((dqp)->dq_flags & XFS_DQ_DIRTY) #define XFS_QM_ISUDQ(dqp) ((dqp)->dq_flags & XFS_DQ_USER) @@ -167,7 +175,6 @@ extern int xfs_qm_dqflush(xfs_dquot_t *, uint); extern int xfs_qm_dqpurge(xfs_dquot_t *); extern void xfs_qm_dqunpin_wait(xfs_dquot_t *); extern int xfs_qm_dqlock_nowait(xfs_dquot_t *); -extern int xfs_qm_dqflock_nowait(xfs_dquot_t *); extern void xfs_qm_dqflock_pushbuf_wait(xfs_dquot_t *dqp); extern void xfs_qm_adjust_dqtimers(xfs_mount_t *, xfs_disk_dquot_t *); diff --git a/fs/xfs/quota/xfs_dquot_item.c b/fs/xfs/quota/xfs_dquot_item.c index 08d2fc8..f028644 100644 --- a/fs/xfs/quota/xfs_dquot_item.c +++ b/fs/xfs/quota/xfs_dquot_item.c @@ -151,7 +151,7 @@ xfs_qm_dquot_logitem_push( dqp = logitem->qli_dquot; ASSERT(XFS_DQ_IS_LOCKED(dqp)); - ASSERT(XFS_DQ_IS_FLUSH_LOCKED(dqp)); + ASSERT(!completion_done(&dqp->q_flush)); /* * Since we were able to lock the dquot's flush lock and @@ -245,7 +245,7 @@ xfs_qm_dquot_logitem_pushbuf( * inode flush completed and the inode was taken off the AIL. * So, just get out. */ - if (!issemalocked(&(dqp->q_flock)) || + if (completion_done(&dqp->q_flush) || ((qip->qli_item.li_flags & XFS_LI_IN_AIL) == 0)) { qip->qli_pushbuf_flag = 0; xfs_dqunlock(dqp); @@ -258,7 +258,7 @@ xfs_qm_dquot_logitem_pushbuf( if (bp != NULL) { if (XFS_BUF_ISDELAYWRITE(bp)) { dopush = ((qip->qli_item.li_flags & XFS_LI_IN_AIL) && - issemalocked(&(dqp->q_flock))); + !completion_done(&dqp->q_flush)); qip->qli_pushbuf_flag = 0; xfs_dqunlock(dqp); @@ -317,7 +317,7 @@ xfs_qm_dquot_logitem_trylock( return (XFS_ITEM_LOCKED); retval = XFS_ITEM_SUCCESS; - if (! xfs_qm_dqflock_nowait(dqp)) { + if (!xfs_dqflock_nowait(dqp)) { /* * The dquot is already being flushed. It may have been * flushed delayed write, however, and we don't want to diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c index 26370a3..234b6d1 100644 --- a/fs/xfs/quota/xfs_qm.c +++ b/fs/xfs/quota/xfs_qm.c @@ -484,7 +484,7 @@ again: xfs_dqtrace_entry(dqp, "FLUSHALL: DQDIRTY"); /* XXX a sentinel would be better */ recl = XFS_QI_MPLRECLAIMS(mp); - if (! xfs_qm_dqflock_nowait(dqp)) { + if (!xfs_dqflock_nowait(dqp)) { /* * If we can't grab the flush lock then check * to see if the dquot has been flushed delayed @@ -1062,7 +1062,7 @@ xfs_qm_sync( /* XXX a sentinel would be better */ recl = XFS_QI_MPLRECLAIMS(mp); - if (! xfs_qm_dqflock_nowait(dqp)) { + if (!xfs_dqflock_nowait(dqp)) { if (nowait) { xfs_dqunlock(dqp); continue; @@ -2079,7 +2079,7 @@ xfs_qm_shake_freelist( * Try to grab the flush lock. If this dquot is in the process of * getting flushed to disk, we don't want to reclaim it. */ - if (! xfs_qm_dqflock_nowait(dqp)) { + if (!xfs_dqflock_nowait(dqp)) { xfs_dqunlock(dqp); dqp = dqp->dq_flnext; continue; @@ -2257,7 +2257,7 @@ xfs_qm_dqreclaim_one(void) * Try to grab the flush lock. If this dquot is in the process of * getting flushed to disk, we don't want to reclaim it. */ - if (! xfs_qm_dqflock_nowait(dqp)) { + if (!xfs_dqflock_nowait(dqp)) { xfs_dqunlock(dqp); continue; } -- 1.5.6 From owner-xfs@oss.sgi.com Thu Jul 10 18:12:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:12:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_57, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1Cpt5017345 for ; Thu, 10 Jul 2008 18:12:52 -0700 X-ASG-Debug-ID: 1215738832-237f001d0001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B0C0818B0CC3 for ; Thu, 10 Jul 2008 18:13:54 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 7gXcfiXuYYelrQCD for ; Thu, 10 Jul 2008 18:13:54 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146350266" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:43:51 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH7Co-00086Z-Oh; Fri, 11 Jul 2008 11:13:50 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org, matthew@wil.cx, Dave Chinner X-ASG-Orig-Subj: [PATCH 1/6] Clean up stale references to semaphores Subject: [PATCH 1/6] Clean up stale references to semaphores Date: Fri, 11 Jul 2008 11:13:45 +1000 Message-Id: <1215738830-31048-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1215738830-31048-1-git-send-email-david@fromorbit.com> References: <1215738830-31048-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738836 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16842 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs A lot of code has been converted away from semaphores, but there are still comments that reference semaphore behaviour. The log code is the worst offender. Update the comments to reflect what the code really does now. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_vnode.c | 6 ++-- fs/xfs/xfs_log.c | 67 ++++++++++++++++++++---------------------- fs/xfs/xfs_log_priv.h | 12 ++++---- 3 files changed, 41 insertions(+), 44 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index bc7afe0..1881c79 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c @@ -33,7 +33,7 @@ /* - * Dedicated vnode inactive/reclaim sync semaphores. + * Dedicated vnode inactive/reclaim sync wait queues. * Prime number of hash buckets since address is used as the key. */ #define NVSYNC 37 @@ -84,8 +84,8 @@ vn_ioerror( /* * Revalidate the Linux inode from the XFS inode. - * Note: i_size _not_ updated; we must hold the inode - * semaphore when doing that - callers responsibility. + * Note: i_size _not_ updated; we must hold the i_mutex when doing + * that - callers responsibility. */ int vn_revalidate( diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 2497de8..760d543 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -357,11 +357,11 @@ xfs_log_done(xfs_mount_t *mp, * Asynchronous forces are implemented by setting the WANT_SYNC * bit in the appropriate in-core log and then returning. * - * Synchronous forces are implemented with a semaphore. All callers - * to force a given lsn to disk will wait on a semaphore attached to the + * Synchronous forces are implemented with a signal variable. All callers + * to force a given lsn to disk will wait on a the sv attached to the * specific in-core log. When given in-core log finally completes its * write to disk, that thread will wake up all threads waiting on the - * semaphore. + * sv. */ int _xfs_log_force( @@ -707,7 +707,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) if (!(iclog->ic_state == XLOG_STATE_ACTIVE || iclog->ic_state == XLOG_STATE_DIRTY)) { if (!XLOG_FORCED_SHUTDOWN(log)) { - sv_wait(&iclog->ic_forcesema, PMEM, + sv_wait(&iclog->ic_force_wait, PMEM, &log->l_icloglock, s); } else { spin_unlock(&log->l_icloglock); @@ -748,7 +748,7 @@ xfs_log_unmount_write(xfs_mount_t *mp) || iclog->ic_state == XLOG_STATE_DIRTY || iclog->ic_state == XLOG_STATE_IOERROR) ) { - sv_wait(&iclog->ic_forcesema, PMEM, + sv_wait(&iclog->ic_force_wait, PMEM, &log->l_icloglock, s); } else { spin_unlock(&log->l_icloglock); @@ -838,7 +838,7 @@ xfs_log_move_tail(xfs_mount_t *mp, break; tail_lsn = 0; free_bytes -= tic->t_unit_res; - sv_signal(&tic->t_sema); + sv_signal(&tic->t_wait); tic = tic->t_next; } while (tic != log->l_write_headq); } @@ -859,7 +859,7 @@ xfs_log_move_tail(xfs_mount_t *mp, break; tail_lsn = 0; free_bytes -= need_bytes; - sv_signal(&tic->t_sema); + sv_signal(&tic->t_wait); tic = tic->t_next; } while (tic != log->l_reserve_headq); } @@ -1285,8 +1285,8 @@ xlog_alloc_log(xfs_mount_t *mp, ASSERT(XFS_BUF_ISBUSY(iclog->ic_bp)); ASSERT(XFS_BUF_VALUSEMA(iclog->ic_bp) <= 0); - sv_init(&iclog->ic_forcesema, SV_DEFAULT, "iclog-force"); - sv_init(&iclog->ic_writesema, SV_DEFAULT, "iclog-write"); + sv_init(&iclog->ic_force_wait, SV_DEFAULT, "iclog-force"); + sv_init(&iclog->ic_write_wait, SV_DEFAULT, "iclog-write"); iclogp = &iclog->ic_next; } @@ -1565,8 +1565,8 @@ xlog_dealloc_log(xlog_t *log) iclog = log->l_iclog; for (i=0; il_iclog_bufs; i++) { - sv_destroy(&iclog->ic_forcesema); - sv_destroy(&iclog->ic_writesema); + sv_destroy(&iclog->ic_force_wait); + sv_destroy(&iclog->ic_write_wait); xfs_buf_free(iclog->ic_bp); #ifdef XFS_LOG_TRACE if (iclog->ic_trace != NULL) { @@ -1976,7 +1976,7 @@ xlog_write(xfs_mount_t * mp, /* Clean iclogs starting from the head. This ordering must be * maintained, so an iclog doesn't become ACTIVE beyond one that * is SYNCING. This is also required to maintain the notion that we use - * a counting semaphore to hold off would be writers to the log when every + * a ordered wait queue to hold off would be writers to the log when every * iclog is trying to sync to disk. * * State Change: DIRTY -> ACTIVE @@ -2240,7 +2240,7 @@ xlog_state_do_callback( xlog_state_clean_log(log); /* wake up threads waiting in xfs_log_force() */ - sv_broadcast(&iclog->ic_forcesema); + sv_broadcast(&iclog->ic_force_wait); iclog = iclog->ic_next; } while (first_iclog != iclog); @@ -2302,8 +2302,7 @@ xlog_state_do_callback( * the second completion goes through. * * Callbacks could take time, so they are done outside the scope of the - * global state machine log lock. Assume that the calls to cvsema won't - * take a long time. At least we know it won't sleep. + * global state machine log lock. */ STATIC void xlog_state_done_syncing( @@ -2339,7 +2338,7 @@ xlog_state_done_syncing( * iclog buffer, we wake them all, one will get to do the * I/O, the others get to wait for the result. */ - sv_broadcast(&iclog->ic_writesema); + sv_broadcast(&iclog->ic_write_wait); spin_unlock(&log->l_icloglock); xlog_state_do_callback(log, aborted, iclog); /* also cleans log */ } /* xlog_state_done_syncing */ @@ -2347,11 +2346,9 @@ xlog_state_done_syncing( /* * If the head of the in-core log ring is not (ACTIVE or DIRTY), then we must - * sleep. The flush semaphore is set to the number of in-core buffers and - * decremented around disk syncing. Therefore, if all buffers are syncing, - * this semaphore will cause new writes to sleep until a sync completes. - * Otherwise, this code just does p() followed by v(). This approximates - * a sleep/wakeup except we can't race. + * sleep. We wait on the flush queue on the head iclog as that should be + * the first iclog to complete flushing. Hence if all iclogs are syncing, + * we will wait here and all new writes will sleep until a sync completes. * * The in-core logs are used in a circular fashion. They are not used * out-of-order even when an iclog past the head is free. @@ -2501,7 +2498,7 @@ xlog_grant_log_space(xlog_t *log, goto error_return; XFS_STATS_INC(xs_sleep_logspace); - sv_wait(&tic->t_sema, PINOD|PLTWAIT, &log->l_grant_lock, s); + sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s); /* * If we got an error, and the filesystem is shutting down, * we'll catch it down below. So just continue... @@ -2527,7 +2524,7 @@ redo: xlog_trace_loggrant(log, tic, "xlog_grant_log_space: sleep 2"); XFS_STATS_INC(xs_sleep_logspace); - sv_wait(&tic->t_sema, PINOD|PLTWAIT, &log->l_grant_lock, s); + sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s); if (XLOG_FORCED_SHUTDOWN(log)) { spin_lock(&log->l_grant_lock); @@ -2626,7 +2623,7 @@ xlog_regrant_write_log_space(xlog_t *log, if (free_bytes < ntic->t_unit_res) break; free_bytes -= ntic->t_unit_res; - sv_signal(&ntic->t_sema); + sv_signal(&ntic->t_wait); ntic = ntic->t_next; } while (ntic != log->l_write_headq); @@ -2637,7 +2634,7 @@ xlog_regrant_write_log_space(xlog_t *log, xlog_trace_loggrant(log, tic, "xlog_regrant_write_log_space: sleep 1"); XFS_STATS_INC(xs_sleep_logspace); - sv_wait(&tic->t_sema, PINOD|PLTWAIT, + sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s); /* If we're shutting down, this tic is already @@ -2666,7 +2663,7 @@ redo: if ((tic->t_flags & XLOG_TIC_IN_Q) == 0) xlog_ins_ticketq(&log->l_write_headq, tic); XFS_STATS_INC(xs_sleep_logspace); - sv_wait(&tic->t_sema, PINOD|PLTWAIT, &log->l_grant_lock, s); + sv_wait(&tic->t_wait, PINOD|PLTWAIT, &log->l_grant_lock, s); /* If we're shutting down, this tic is already off the queue */ if (XLOG_FORCED_SHUTDOWN(log)) { @@ -2909,7 +2906,7 @@ xlog_state_switch_iclogs(xlog_t *log, * 2. the current iclog is drity, and the previous iclog is in the * active or dirty state. * - * We may sleep (call psema) if: + * We may sleep if: * * 1. the current iclog is not in the active nor dirty state. * 2. the current iclog dirty, and the previous iclog is not in the @@ -3006,7 +3003,7 @@ maybe_sleep: return XFS_ERROR(EIO); } XFS_STATS_INC(xs_log_force_sleep); - sv_wait(&iclog->ic_forcesema, PINOD, &log->l_icloglock, s); + sv_wait(&iclog->ic_force_wait, PINOD, &log->l_icloglock, s); /* * No need to grab the log lock here since we're * only deciding whether or not to return EIO @@ -3089,7 +3086,7 @@ try_again: XLOG_STATE_SYNCING))) { ASSERT(!(iclog->ic_state & XLOG_STATE_IOERROR)); XFS_STATS_INC(xs_log_force_sleep); - sv_wait(&iclog->ic_prev->ic_writesema, PSWP, + sv_wait(&iclog->ic_prev->ic_write_wait, PSWP, &log->l_icloglock, s); *log_flushed = 1; already_slept = 1; @@ -3109,7 +3106,7 @@ try_again: !(iclog->ic_state & (XLOG_STATE_ACTIVE | XLOG_STATE_DIRTY))) { /* - * Don't wait on the forcesema if we know that we've + * Don't wait on completion if we know that we've * gotten a log write error. */ if (iclog->ic_state & XLOG_STATE_IOERROR) { @@ -3117,7 +3114,7 @@ try_again: return XFS_ERROR(EIO); } XFS_STATS_INC(xs_log_force_sleep); - sv_wait(&iclog->ic_forcesema, PSWP, &log->l_icloglock, s); + sv_wait(&iclog->ic_force_wait, PSWP, &log->l_icloglock, s); /* * No need to grab the log lock here since we're * only deciding whether or not to return EIO @@ -3173,7 +3170,7 @@ STATIC void xlog_ticket_put(xlog_t *log, xlog_ticket_t *ticket) { - sv_destroy(&ticket->t_sema); + sv_destroy(&ticket->t_wait); kmem_zone_free(xfs_log_ticket_zone, ticket); } /* xlog_ticket_put */ @@ -3263,7 +3260,7 @@ xlog_ticket_get(xlog_t *log, tic->t_trans_type = 0; if (xflags & XFS_LOG_PERM_RESERV) tic->t_flags |= XLOG_TIC_PERM_RESERV; - sv_init(&(tic->t_sema), SV_DEFAULT, "logtick"); + sv_init(&(tic->t_wait), SV_DEFAULT, "logtick"); xlog_tic_reset_res(tic); @@ -3550,14 +3547,14 @@ xfs_log_force_umount( */ if ((tic = log->l_reserve_headq)) { do { - sv_signal(&tic->t_sema); + sv_signal(&tic->t_wait); tic = tic->t_next; } while (tic != log->l_reserve_headq); } if ((tic = log->l_write_headq)) { do { - sv_signal(&tic->t_sema); + sv_signal(&tic->t_wait); tic = tic->t_next; } while (tic != log->l_write_headq); } diff --git a/fs/xfs/xfs_log_priv.h b/fs/xfs/xfs_log_priv.h index 6245913..7dcf11e 100644 --- a/fs/xfs/xfs_log_priv.h +++ b/fs/xfs/xfs_log_priv.h @@ -241,7 +241,7 @@ typedef struct xlog_res { } xlog_res_t; typedef struct xlog_ticket { - sv_t t_sema; /* sleep on this semaphore : 20 */ + sv_t t_wait; /* ticket wait queue : 20 */ struct xlog_ticket *t_next; /* :4|8 */ struct xlog_ticket *t_prev; /* :4|8 */ xlog_tid_t t_tid; /* transaction identifier : 4 */ @@ -314,7 +314,7 @@ typedef struct xlog_rec_ext_header { * xlog_rec_header_t into the reserved space. * - ic_data follows, so a write to disk can start at the beginning of * the iclog. - * - ic_forcesema is used to implement synchronous forcing of the iclog to disk. + * - ic_forcewait is used to implement synchronous forcing of the iclog to disk. * - ic_next is the pointer to the next iclog in the ring. * - ic_bp is a pointer to the buffer used to write this incore log to disk. * - ic_log is a pointer back to the global log structure. @@ -339,8 +339,8 @@ typedef struct xlog_rec_ext_header { * and move everything else out to subsequent cachelines. */ typedef struct xlog_iclog_fields { - sv_t ic_forcesema; - sv_t ic_writesema; + sv_t ic_force_wait; + sv_t ic_write_wait; struct xlog_in_core *ic_next; struct xlog_in_core *ic_prev; struct xfs_buf *ic_bp; @@ -377,8 +377,8 @@ typedef struct xlog_in_core { /* * Defines to save our code from this glop. */ -#define ic_forcesema hic_fields.ic_forcesema -#define ic_writesema hic_fields.ic_writesema +#define ic_force_wait hic_fields.ic_force_wait +#define ic_write_wait hic_fields.ic_write_wait #define ic_next hic_fields.ic_next #define ic_prev hic_fields.ic_prev #define ic_bp hic_fields.ic_bp -- 1.5.6 From owner-xfs@oss.sgi.com Thu Jul 10 18:12:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 18:13:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52, J_CHICKENPOX_92,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B1CrZf017369 for ; Thu, 10 Jul 2008 18:12:53 -0700 X-ASG-Debug-ID: 1215738834-13ba016d0002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3C08B18B0CE3 for ; Thu, 10 Jul 2008 18:13:58 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id rJoG0rvXca1NQV1Z for ; Thu, 10 Jul 2008 18:13:58 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAF9Odkh5LFxA/2dsb2JhbACxSA X-IronPort-AV: E=Sophos;i="4.30,341,1212330600"; d="scan'208";a="146350291" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 10:43:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH7Cq-00086p-0T; Fri, 11 Jul 2008 11:13:52 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: linux-kernel@vger.kernel.org, matthew@wil.cx, Dave Chinner X-ASG-Orig-Subj: [PATCH 6/6] Remove the sema_t from XFS. Subject: [PATCH 6/6] Remove the sema_t from XFS. Date: Fri, 11 Jul 2008 11:13:50 +1000 Message-Id: <1215738830-31048-7-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1215738830-31048-1-git-send-email-david@fromorbit.com> References: <1215738830-31048-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215738839 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55707 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16844 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Now that all users of the sema_t are gone from XFS we can finally kill it. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/sema.h | 52 ------------------------------------------ fs/xfs/linux-2.6/xfs_linux.h | 2 +- 2 files changed, 1 insertions(+), 53 deletions(-) delete mode 100644 fs/xfs/linux-2.6/sema.h diff --git a/fs/xfs/linux-2.6/sema.h b/fs/xfs/linux-2.6/sema.h deleted file mode 100644 index 3abe7e9..0000000 --- a/fs/xfs/linux-2.6/sema.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2000-2002,2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef __XFS_SUPPORT_SEMA_H__ -#define __XFS_SUPPORT_SEMA_H__ - -#include -#include -#include -#include - -/* - * sema_t structure just maps to struct semaphore in Linux kernel. - */ - -typedef struct semaphore sema_t; - -#define initnsema(sp, val, name) sema_init(sp, val) -#define psema(sp, b) down(sp) -#define vsema(sp) up(sp) -#define freesema(sema) do { } while (0) - -static inline int issemalocked(sema_t *sp) -{ - return down_trylock(sp) || (up(sp), 0); -} - -/* - * Map cpsema (try to get the sema) to down_trylock. We need to switch - * the return values since cpsema returns 1 (acquired) 0 (failed) and - * down_trylock returns the reverse 0 (acquired) 1 (failed). - */ -static inline int cpsema(sema_t *sp) -{ - return down_trylock(sp) ? 0 : 1; -} - -#endif /* __XFS_SUPPORT_SEMA_H__ */ diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index 4d45d93..4fb838f 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h @@ -45,13 +45,13 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include -- 1.5.6 From owner-xfs@oss.sgi.com Thu Jul 10 19:32:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 19:32:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B2W8m1027290 for ; Thu, 10 Jul 2008 19:32:08 -0700 X-ASG-Debug-ID: 1215743593-5d0e01ad0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A075318B15AF for ; Thu, 10 Jul 2008 19:33:13 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id WNttfAiq3H7Cf0wI for ; Thu, 10 Jul 2008 19:33:13 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 125C7AC6278 for ; Thu, 10 Jul 2008 21:33:12 -0500 (CDT) Message-ID: <4876C667.608@sandeen.net> Date: Thu, 10 Jul 2008 21:33:11 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: deadlocked xfs Subject: deadlocked xfs Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215743593 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55712 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16846 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs while running fs_mark: fs_mark -d /mnt/test -D 256 -n 100000 -t 4 -s 20480 -F -S 0 which runs 4 threads making 20k files,things got stuffed up in the log, see sysrq-w output at: http://sandeen.fedorapeople.org/xfs/deadxfs 2 threads down this path: [] :xfs:xlog_state_get_iclog_space+0x83/0x187 [] :xfs:xlog_write+0x121/0x486 [] :xfs:xfs_log_write+0x2a/0x50 this is on a 4 cpu AMD. I made the fs with: mkfs.xfs -dsize=1t,agcount=32 -l lazy-count=1 -f /dev/sdb and mounted with: mount -o nobarrier,logbsize=256k,logbufs=8,inode64 /dev/sdb /mnt/test has this been seen before? Thanks, -Eric From owner-xfs@oss.sgi.com Thu Jul 10 19:47:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 19:47:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B2lBQq029130 for ; Thu, 10 Jul 2008 19:47:12 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA07030; Fri, 11 Jul 2008 12:48:11 +1000 Message-ID: <4876C9EB.7060601@sgi.com> Date: Fri, 11 Jul 2008 12:48:11 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> In-Reply-To: <4876C667.608@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16847 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Thanks for the report Eric. This looks very similar to a deadlock Lachlan recently hit in the patch for "Use atomics for iclog reference counting" http://oss.sgi.com/archives/xfs/2008-02/msg00130.html It seems this patch can cause deadlocks under heavy log traffic. I don't think anyone has a fix yet ... Lachlan is out this week, but Tim can follow-up here ... Cheers -- Mark Eric Sandeen wrote: > while running fs_mark: > > fs_mark -d /mnt/test -D 256 -n 100000 -t 4 -s 20480 -F -S 0 > > which runs 4 threads making 20k files,things got stuffed up in the log, > see sysrq-w output at: > > http://sandeen.fedorapeople.org/xfs/deadxfs > > 2 threads down this path: > > [] :xfs:xlog_state_get_iclog_space+0x83/0x187 > [] :xfs:xlog_write+0x121/0x486 > [] :xfs:xfs_log_write+0x2a/0x50 > > this is on a 4 cpu AMD. > > I made the fs with: > > mkfs.xfs -dsize=1t,agcount=32 -l lazy-count=1 -f /dev/sdb > > and mounted with: > > mount -o nobarrier,logbsize=256k,logbufs=8,inode64 /dev/sdb /mnt/test > > has this been seen before? > > Thanks, > > -Eric > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Thu Jul 10 19:55:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 19:55:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B2thdX030354 for ; Thu, 10 Jul 2008 19:55:43 -0700 X-ASG-Debug-ID: 1215745008-0b4501d00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 349922DB1CD for ; Thu, 10 Jul 2008 19:56:48 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id nQsnmNl4BdnT8bvl for ; Thu, 10 Jul 2008 19:56:48 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 4C350AC6278; Thu, 10 Jul 2008 21:56:48 -0500 (CDT) Message-ID: <4876CBF0.2010404@sandeen.net> Date: Thu, 10 Jul 2008 21:56:48 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> In-Reply-To: <4876C9EB.7060601@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215745009 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55714 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16848 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mark Goodwin wrote: > Thanks for the report Eric. This looks very similar to a > deadlock Lachlan recently hit in the patch for > "Use atomics for iclog reference counting" > http://oss.sgi.com/archives/xfs/2008-02/msg00130.html > > It seems this patch can cause deadlocks under heavy log traffic. > I don't think anyone has a fix yet ... Lachlan is out this week, > but Tim can follow-up here ... thanks I'll look into that. Forgot to mention this was on 2.6.26-rc2 -Eric > Cheers > -- Mark > > Eric Sandeen wrote: >> while running fs_mark: >> >> fs_mark -d /mnt/test -D 256 -n 100000 -t 4 -s 20480 -F -S 0 >> >> which runs 4 threads making 20k files,things got stuffed up in the log, >> see sysrq-w output at: >> >> http://sandeen.fedorapeople.org/xfs/deadxfs >> >> 2 threads down this path: >> >> [] :xfs:xlog_state_get_iclog_space+0x83/0x187 >> [] :xfs:xlog_write+0x121/0x486 >> [] :xfs:xfs_log_write+0x2a/0x50 >> >> this is on a 4 cpu AMD. >> >> I made the fs with: >> >> mkfs.xfs -dsize=1t,agcount=32 -l lazy-count=1 -f /dev/sdb >> >> and mounted with: >> >> mount -o nobarrier,logbsize=256k,logbufs=8,inode64 /dev/sdb /mnt/test >> >> has this been seen before? >> >> Thanks, >> >> -Eric >> >> > From owner-xfs@oss.sgi.com Thu Jul 10 20:20:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 20:20:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B3Kea6005508 for ; Thu, 10 Jul 2008 20:20:41 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA07497; Fri, 11 Jul 2008 13:21:39 +1000 Message-ID: <4876D1C3.4000006@sgi.com> Date: Fri, 11 Jul 2008 13:21:39 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: markgw@sgi.com, xfs-oss Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> In-Reply-To: <4876C9EB.7060601@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16849 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > Thanks for the report Eric. This looks very similar to a > deadlock Lachlan recently hit in the patch for > "Use atomics for iclog reference counting" > http://oss.sgi.com/archives/xfs/2008-02/msg00130.html > > It seems this patch can cause deadlocks under heavy log traffic. > I don't think anyone has a fix yet ... Lachlan is out this week, > but Tim can follow-up here ... > > Cheers > -- Mark > Okay, what Mark is talking about is pv#983925. Details below from the bug - from Lachlan and me. I'm sorry that this info didn't go out sooner. I'm not sure if Lachlan got any further with this but he's been away. --Tim Lachlan wrote: [....stuff deleted...] > It's the same signature every time with the current iclog in WANT_SYNC state > and the rest of the iclogs in DO_CALLBACK state. The current iclog log should > transition from WANT_SYNC to SYNCING to DONE_SYNC and eventually to ACTIVE so > the threads above can continue but it's not a happening. > > I suspect this mod is the culprit: > > mod xfs-linux-melb:xfs-kern:30505a header > ========================================== > - SM_Location: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb > - Workarea: chook.melbourne.sgi.com:/build/dgc/isms/2.6.x-xfs > - xfs-linux-melb:xfs-kern:30505a 02/15/08 > - PV Incidents affected: 975671 > - Inspected by: tes@sgi.com > - Description: > Use atomics for iclog reference counting > > Now that we update the log tail LSN less frequently on > transaction completion, we pass the contention straight to > the global log state lock (l_iclog_lock) during transaction > completion. > > We currently have to take this lock to decrement the iclog > reference count. there is a reference count on each iclog, > so we need to take �he global lock for all refcount changes. > > When large numbers of processes are all doing small trnasctions, > the iclog reference counts will be quite high, and the state change > that absolutely requires the l_iclog_lock is the except rather than > the norm. > > Change the reference counting on the iclogs to use atomic_inc/dec > so that we can use atomic_dec_and_lock during transaction completion > and avoid the need for grabbing the l_iclog_lock for every reference > count decrement except the one that matters - the last. > - Files affected: xfsidbg.c 1.343, xfs_log.c 1.347, > xfs_log_priv.h 1.125 > - Author: dgc > - xfsidbg.c: > use correct atomic accessor for the iclog refcount. > - xfs_log.c: > Reduce contention on the iclog state lock by using atomic > reference counters for the iclogs and only grabbing the > iclog lock on transaction completion when the last reference > to the iclog is being removed. > - xfs_log_priv.h: > change ic_refcount to an atomic_t. > > > It made this change which moved the refcount 'decrement and test' operation > outside the l_icloglock spinlock and therefore can race. > > @@ -2819,18 +2819,21 @@ xlog_state_release_iclog( > { > int sync = 0; /* do we sync? */ > > - spin_lock(&log->l_icloglock); > + if (iclog->ic_state & XLOG_STATE_IOERROR) > + return XFS_ERROR(EIO); > + > + ASSERT(atomic_read(&iclog->ic_refcnt) > 0); > + if (!atomic_dec_and_lock(&iclog->ic_refcnt, &log->l_icloglock)) > + return 0; > + > if (iclog->ic_state & XLOG_STATE_IOERROR) { > spin_unlock(&log->l_icloglock); > return XFS_ERROR(EIO); > } > > The above code will race with this code in xlog_state_get_iclog_space(): > > spin_lock(&log->l_icloglock); > atomic_inc(&iclog->ic_refcnt); /* prevents sync */ > > ... > > if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { > xlog_state_switch_iclogs(log, iclog, iclog->ic_size); > > /* If I'm the only one writing to this iclog, sync it to disk */ > if (atomic_read(&iclog->ic_refcnt) == 1) { > spin_unlock(&log->l_icloglock); > if ((error = xlog_state_release_iclog(log, iclog))) > return error; > } else { > atomic_dec(&iclog->ic_refcnt); > spin_unlock(&log->l_icloglock); > } > goto restart; > } > > Previously xlog_state_release_iclog() would wait for the spinlock to be > released above but will now do the atomic_dec_and_lock() while the above > code is executing. The above atomic_read() will return 2, the > atomic_dec_and_lock() in xlog_state_release_iclog() will return false and > return without syncing the iclog and then the above code will decrement the > atomic counter. The iclog never gets out of WANT_SYNC state and everything > gets stuck behind it. > > > ========================== > ADDITIONAL INFORMATION (ADD) > From: tes@sgi.com (BugWorks) > Date: Jul 01 2008 09:59:49PM > ========================== > > Hi, > > Okay, I've just been trying to understand what Lachlan was saying > about the problem and Lachlan kindly gave me an explanation. > > Based on that, below is my understanding so I remember what is going > wrong here ;-) Correct me if I got this wrong. > > > Bad scenario (current code) > ---------------------------- > Process A has a reference on iclog > and iclog-refcnt == 1 > > Process B tries to get some log space, > and takes lock and bumps count to 2 > Process B tests to see if its refcnt is just 1 > but it isn't so it moves on, _up_ to the refcnt decrement > > Process A decides to release its iclog > and calls xlog_state_release_iclog > It does a decrement WITHOUT taking lock > The refcnt goes from 2 to 1 and so it just > returns without sync'ing. > > Process B now does its decrement and takes > the refcnt from 1 to 0. and releases the lock. > > > Good scenario (with previous code) > ----------------------------------- > Process A has a reference on iclog > and iclog-refcnt == 1 > > Process B tries to get some logspace, > and takes lock and bumps count to 2. > Process B tests to see if its refcnt is just 1 > but it isn't so it moves on, _up_ to the refcnt decrement. > > Process A decides to release its iclog > and calls xlog_state_release_iclog. > However, it can't get the lock yet and so it waits. > > Process B now decrements its refcnt from 2 > back to 1 and releases the lock. > > Process A now can get its lock and decrements > the refcnt, finds it goes from 1 to zero and > can now do the sync'ing. > ----------------------------------- > > --Tim From owner-xfs@oss.sgi.com Thu Jul 10 20:21:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 20:22:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B3LvCk005860 for ; Thu, 10 Jul 2008 20:21:57 -0700 X-ASG-Debug-ID: 1215746581-3a04003a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5FDCB18B194C for ; Thu, 10 Jul 2008 20:23:02 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 6wSAHcdt81A2C8Pu for ; Thu, 10 Jul 2008 20:23:02 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAEpudkh5LFxA/2dsb2JhbACxFg X-IronPort-AV: E=Sophos;i="4.30,342,1212330600"; d="scan'208";a="146445539" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 12:52:59 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH9Dm-0002TA-NW; Fri, 11 Jul 2008 13:22:58 +1000 Date: Fri, 11 Jul 2008 13:22:58 +1000 From: Dave Chinner To: Mark Goodwin Cc: Eric Sandeen , xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs Message-ID: <20080711032258.GB11558@disturbed> Mail-Followup-To: Mark Goodwin , Eric Sandeen , xfs-oss References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4876C9EB.7060601@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215746583 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0004 1.0000 -2.0186 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55715 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16850 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 12:48:11PM +1000, Mark Goodwin wrote: > Thanks for the report Eric. This looks very similar to a > deadlock Lachlan recently hit in the patch for > "Use atomics for iclog reference counting" > http://oss.sgi.com/archives/xfs/2008-02/msg00130.html > > It seems this patch can cause deadlocks under heavy log traffic. > I don't think anyone has a fix yet ... Lachlan is out this week, > but Tim can follow-up here ... Nice to know - why didn't anyone email me or report this to the list when the bug was first found? I mean, I wrote that code, I know what it is supposed to be doing and as a result should be able help find and fix the bug. Can you please post what details you have about the problem (test case, stack traces, debugging info, etc) so I can try to find the problem. This is a regression that is in the mainline kernel that is due to be released probably in the next couple of days. Having a little bit of time to try and find the bug would have been nice... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 10 20:49:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 20:49:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B3nAO5008688 for ; Thu, 10 Jul 2008 20:49:11 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA08015; Fri, 11 Jul 2008 13:50:10 +1000 Message-ID: <4876D872.2060408@sgi.com> Date: Fri, 11 Jul 2008 13:50:10 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Mark Goodwin , Eric Sandeen , xfs-oss Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <20080711032258.GB11558@disturbed> In-Reply-To: <20080711032258.GB11558@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16851 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Fri, Jul 11, 2008 at 12:48:11PM +1000, Mark Goodwin wrote: >> Thanks for the report Eric. This looks very similar to a >> deadlock Lachlan recently hit in the patch for >> "Use atomics for iclog reference counting" >> http://oss.sgi.com/archives/xfs/2008-02/msg00130.html >> >> It seems this patch can cause deadlocks under heavy log traffic. >> I don't think anyone has a fix yet ... Lachlan is out this week, >> but Tim can follow-up here ... > > Nice to know - why didn't anyone email me or report this to the > list when the bug was first found? I mean, I wrote that code, I know > what it is supposed to be doing and as a result should be able Only recently found and didn't think it was this easy to hit. But no excuses ... > help find and fix the bug. Can you please post what details you have > about the problem (test case, stack traces, debugging info, etc) > so I can try to find the problem. See Tim's follow-up. > This is a regression that is in the mainline kernel that is due to > be released probably in the next couple of days. Having a little > bit of time to try and find the bug would have been nice... At this stage, I think it would be safest to back-out the commit, all the way to mainline. Tim, can you please work thru that today with priority. Thanks -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Thu Jul 10 21:01:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:01:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B4185Z010415 for ; Thu, 10 Jul 2008 21:01:08 -0700 X-ASG-Debug-ID: 1215748933-1bbf00450000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 700FDDF4EB8 for ; Thu, 10 Jul 2008 21:02:13 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id iH0IUhP3SQ03KDHl for ; Thu, 10 Jul 2008 21:02:13 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 4A95DAC6278; Thu, 10 Jul 2008 23:02:13 -0500 (CDT) Message-ID: <4876DB44.7020905@sandeen.net> Date: Thu, 10 Jul 2008 23:02:12 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <20080711032258.GB11558@disturbed> <4876D872.2060408@sgi.com> In-Reply-To: <4876D872.2060408@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215748934 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55716 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16852 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mark Goodwin wrote: > At this stage, I think it would be safest to back-out the commit, > all the way to mainline. Tim, can you please work thru that today > with priority. how 'bout I test my testcase w/ the patch removed to at least be sure that's it. :) Then maybe we can see if Dave, having been alerted to the problem, has a notion of how to fix it? -Eric From owner-xfs@oss.sgi.com Thu Jul 10 21:03:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:03:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B43jpO010927 for ; Thu, 10 Jul 2008 21:03:46 -0700 X-ASG-Debug-ID: 1215749090-092201f40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D1239DF4EDD for ; Thu, 10 Jul 2008 21:04:50 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Gp5TsKg00B5ZMjrl for ; Thu, 10 Jul 2008 21:04:50 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAFp4dkh5LFxA/2dsb2JhbACwew X-IronPort-AV: E=Sophos;i="4.30,342,1212330600"; d="scan'208";a="146475199" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 13:34:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH9sF-0004qU-OV; Fri, 11 Jul 2008 14:04:47 +1000 Date: Fri, 11 Jul 2008 14:04:47 +1000 From: Dave Chinner To: Timothy Shimmin Cc: Eric Sandeen , markgw@sgi.com, xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs Message-ID: <20080711040447.GC11558@disturbed> Mail-Followup-To: Timothy Shimmin , Eric Sandeen , markgw@sgi.com, xfs-oss References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4876D1C3.4000006@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215749091 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55716 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16853 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 01:21:39PM +1000, Timothy Shimmin wrote: > > It made this change which moved the refcount 'decrement and test' operation > > outside the l_icloglock spinlock and therefore can race. Just FYI, this is not a 'decrement and test' operation - it's an 'decrement and return locked if zero' operation. Best to explain it is this comment in lib/dec_and_lock.c: /* * This is an implementation of the notion of "decrement a * reference count, and return locked if it decremented to zero". * * NOTE NOTE NOTE! This is _not_ equivalent to * * if (atomic_dec_and_test(&atomic)) { * spin_lock(&lock); * return 1; * } * return 0; * * because the spin-lock and the decrement must be * "atomic". */ > > spin_lock(&log->l_icloglock); > > atomic_inc(&iclog->ic_refcnt); /* prevents sync */ > > > > ... > > > > if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { > > xlog_state_switch_iclogs(log, iclog, iclog->ic_size); > > > > /* If I'm the only one writing to this iclog, sync it to disk */ > > if (atomic_read(&iclog->ic_refcnt) == 1) { > > spin_unlock(&log->l_icloglock); > > if ((error = xlog_state_release_iclog(log, iclog))) > > return error; > > } else { > > atomic_dec(&iclog->ic_refcnt); > > spin_unlock(&log->l_icloglock); > > } > > goto restart; > > } Ok, so all the increments of ic_refcnt are done under l_icloglock. That means through this section of code we can not ever have teh reference count increase. It can decrease, but never to zero because that requires holding the l_icloglock. > > Previously xlog_state_release_iclog() would wait for the spinlock to be > > released above but will now do the atomic_dec_and_lock() while the above > > code is executing. The above atomic_read() will return 2, the > > atomic_dec_and_lock() in xlog_state_release_iclog() will return false and > > return without syncing the iclog and then the above code will decrement the > > atomic counter. The iclog never gets out of WANT_SYNC state and everything > > gets stuck behind it. So what that means is that need the semantics here to be an atomic 'decrement unless the count is 1' i.e.: if (atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { spin_unlock(&log->l_icloglock); if ((error = xlog_state_release_iclog(log, iclog))) return error; } else { spin_unlock(&log->l_icloglock); } This means that the compare + decrement becomes atomic, thereby closing the race condition where another unlocked thread can decrement the reference count in between the compare and decrement here. Patch for you to test, Eric, below. (I haven't been able to test it because UML panics on boot right now. I need to hoover in the unit-at-atime build patch that Jeff Dike posted this morning) Cheers, Dave. -- Dave Chinner david@fromorbit.com Fix reference counting race on log buffers When we release the iclog, we do an atomic_dec_and_lock to determine if we are the last reference to enable update of log headers and writeout. however, in xlog_state_get_iclog_space() we need to check if we have the last reference count there. if we do, we release the log buffer, otherwise we decrement the reference count. The issue is that the compare and decrement in xlog_state_get_iclog_space() is not atomic, so both places can see a reference count of 2 and neither will release the iclog. That leads to a filesystem hang. Close the hole replacing the compare and decrement with atomic_add_unless() to ensure that they are executed atomically. Signed-off-by: Dave Chinner --- fs/xfs/xfs_log.c | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 760d543..8033f8a 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -2425,13 +2425,19 @@ restart: if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { xlog_state_switch_iclogs(log, iclog, iclog->ic_size); - /* If I'm the only one writing to this iclog, sync it to disk */ - if (atomic_read(&iclog->ic_refcnt) == 1) { + /* + * If I'm the only one writing to this iclog, sync it to disk. + * We need to do an atomic compare and decrement here to avoid + * racing with concurrent atomic_dec_and_lock() calls in + * xlog_state_release_iclog() when there is more than one + * reference to the iclog. + */ + if (atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { spin_unlock(&log->l_icloglock); - if ((error = xlog_state_release_iclog(log, iclog))) + error = xlog_state_release_iclog(log, iclog); + if (error) return error; } else { - atomic_dec(&iclog->ic_refcnt); spin_unlock(&log->l_icloglock); } goto restart; From owner-xfs@oss.sgi.com Thu Jul 10 21:04:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:04:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B44X3j011120 for ; Thu, 10 Jul 2008 21:04:35 -0700 X-ASG-Debug-ID: 1215749138-3218032e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 70D1E2DB401 for ; Thu, 10 Jul 2008 21:05:38 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id a5zOh1lTV6F5T7XE for ; Thu, 10 Jul 2008 21:05:38 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAFp4dkh5LFxA/2dsb2JhbACwew X-IronPort-AV: E=Sophos;i="4.30,342,1212330600"; d="scan'208";a="146475592" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 13:35:36 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KH9t2-0004rv-LQ; Fri, 11 Jul 2008 14:05:36 +1000 Date: Fri, 11 Jul 2008 14:05:36 +1000 From: Dave Chinner To: Mark Goodwin Cc: Eric Sandeen , xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs Message-ID: <20080711040536.GD11558@disturbed> Mail-Followup-To: Mark Goodwin , Eric Sandeen , xfs-oss References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <20080711032258.GB11558@disturbed> <4876D872.2060408@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4876D872.2060408@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215749139 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55717 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16854 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 01:50:10PM +1000, Mark Goodwin wrote: > > > Dave Chinner wrote: >> On Fri, Jul 11, 2008 at 12:48:11PM +1000, Mark Goodwin wrote: >>> Thanks for the report Eric. This looks very similar to a >>> deadlock Lachlan recently hit in the patch for >>> "Use atomics for iclog reference counting" >>> http://oss.sgi.com/archives/xfs/2008-02/msg00130.html >>> >>> It seems this patch can cause deadlocks under heavy log traffic. >>> I don't think anyone has a fix yet ... Lachlan is out this week, >>> but Tim can follow-up here ... >> >> Nice to know - why didn't anyone email me or report this to the >> list when the bug was first found? I mean, I wrote that code, I know >> what it is supposed to be doing and as a result should be able > > Only recently found and didn't think it was this easy to hit. > But no excuses ... > >> help find and fix the bug. Can you please post what details you have >> about the problem (test case, stack traces, debugging info, etc) >> so I can try to find the problem. > > See Tim's follow-up. > >> This is a regression that is in the mainline kernel that is due to >> be released probably in the next couple of days. Having a little >> bit of time to try and find the bug would have been nice... > > At this stage, I think it would be safest to back-out the commit, > all the way to mainline. Tim, can you please work thru that today > with priority. No, do not back it out. I just posted the fix. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 10 21:07:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:07:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B47DPw011856 for ; Thu, 10 Jul 2008 21:07:15 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08428; Fri, 11 Jul 2008 14:08:12 +1000 Message-ID: <4876DCAC.5040903@sgi.com> Date: Fri, 11 Jul 2008 14:08:12 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: David Chinner CC: markgw@sgi.com, Eric Sandeen , xfs-oss Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <20080711032258.GB11558@disturbed> <4876D872.2060408@sgi.com> In-Reply-To: <4876D872.2060408@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16855 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > > > Dave Chinner wrote: >> On Fri, Jul 11, 2008 at 12:48:11PM +1000, Mark Goodwin wrote: >>> Thanks for the report Eric. This looks very similar to a >>> deadlock Lachlan recently hit in the patch for >>> "Use atomics for iclog reference counting" >>> http://oss.sgi.com/archives/xfs/2008-02/msg00130.html >>> >>> It seems this patch can cause deadlocks under heavy log traffic. >>> I don't think anyone has a fix yet ... Lachlan is out this week, >>> but Tim can follow-up here ... >> >> Nice to know - why didn't anyone email me or report this to the >> list when the bug was first found? I mean, I wrote that code, I know >> what it is supposed to be doing and as a result should be able > > Only recently found and didn't think it was this easy to hit. > But no excuses ... > >> help find and fix the bug. Can you please post what details you have >> about the problem (test case, stack traces, debugging info, etc) >> so I can try to find the problem. > > See Tim's follow-up. > Remaining info from bug.... > While stress testing I'm frequently hitting a deadlock in the log code where > many threads are stuck in xlog_state_get_iclog_space(). > > Stack traceback for pid 16570 > 0xffff8100421fa4c0 16570 4620 0 2 D 0xffff8100421fa810 rm > rsp rip Function (args) > 0xffff81003c41d908 0xffffffff8062be32 thread_return > 0xffff81003c41d9a0 0xffffffff8062c205 schedule_timeout+0x1e (0x7fffffffffffffff) > 0xffff81003c41da10 0xffffffff803954f0 xlog_state_get_iclog_space+0xed (0xffff81007d33d650, invalid, 0xffff81003c41db00, 0xffff81007c1d39c0, 0xffff81003c41db08, 0xffff81003c41db0c) > 0xffff81003c41daa0 0xffffffff8039578d xlog_write+0x118 (0xffff81007c97d338, 0xffff81003c41db58, invalid, 0xffff81007c1d39c0, 0xffff81003c41dba0, 0xffff81003c41dce0, 0xffff810000000002) > 0xffff81003c41db40 0xffffffff80395cb4 xlog_commit_record+0x6e (0xffff81007c97d338, 0xffff81007c1d39c0, 0xffff81003c41dce0, 0xffff81003c41dba0) > 0xffff81003c41db90 0xffffffff80396c31 xfs_log_done+0x34 (invalid, 0xffff81007c1d39c0, invalid, invalid) > 0xffff81003c41dbc0 0xffffffff803a1271 _xfs_trans_commit+0x24a (0xffff81007a99c780, invalid, 0x0) > 0xffff81003c41dd20 0xffffffff8035eb2e xfs_bmap_finish+0xaa (0xffff81003c41de38, 0xffff81003c41ddc8, 0xffff81003c41dde0) > 0xffff81003c41dd80 0xffffffff8038ae2b xfs_itruncate_finish+0x376 (0xffff81003c41de38, 0xffff81007b9c5670, invalid, invalid, 0x1) > 0xffff81003c41de20 0xffffffff803ab720 xfs_inactive+0x27d (0xffff81007b9c5670) > 0xffff81003c41de70 0xffffffff803b663e xfs_fs_clear_inode+0xbd (0xffff810073cf0438) > 0xffff81003c41de90 0xffffffff802964af clear_inode+0x9c (0xffff810073cf0438) > 0xffff81003c41dea0 0xffffffff80296598 generic_delete_inode+0x92 (0xffff810073cf0438) > 0xffff81003c41dec0 0xffffffff8028d953 do_unlinkat+0xdd (invalid, invalid) > 0xffff81003c41df80 0xffffffff8020ae4b system_call_after_swapgs+0x7b (invalid, invalid, invalid, invalid, invalid, invalid) > Enter to end, to continue: > Stack traceback for pid 24088 > 0xffff81003b804a00 24088 4649 0 6 D 0xffff81003b804d50 xfs_io > rsp rip Function (args) > 0xffff81003e403288 0xffffffff8062be32 thread_return > 0xffff81003e403320 0xffffffff8062c205 schedule_timeout+0x1e (0x7fffffffffffffff) > 0xffff81003e403390 0xffffffff803954f0 xlog_state_get_iclog_space+0xed (0xffff81007d33d650, invalid, 0xffff81003e403480, 0xffff8100741499c0, 0xffff81003e403488, 0xffff81003e40348c) > 0xffff81003e403420 0xffffffff8039578d xlog_write+0x118 (0xffff81007c97d338, 0xffff81003e4034f8, invalid, 0xffff8100741499c0, 0xffff81003e5b9858, 0x0, 0x0) > 0xffff81003e4034c0 0xffffffff80395d13 xfs_log_write+0x33 (0xffff81007c97d338) > 0xffff81003e4034e0 0xffffffff803a1256 _xfs_trans_commit+0x22f (0xffff81003e5b9810, invalid, 0x0) > 0xffff81003e403640 0xffffffff8038fdba xfs_iomap_write_allocate+0x2eb (0xffff81007b9e7c90, invalid, invalid, 0xffff81003e403788, 0xffff81003e4037b4) > 0xffff81003e403730 0xffffffff80390dd6 xfs_iomap+0x35a (0xffff81007b9e7c90, 0x19edd000, invalid, invalid, 0xffff81003e403898, 0xffff81003e403804) > 0xffff81003e4037f0 0xffffffff803acf45 xfs_map_blocks+0x2c (invalid, invalid, invalid, invalid, invalid) > 0xffff81003e403820 0xffffffff803ae04e xfs_page_state_convert+0x28b (0xffff81007b9e6c18, 0xffffe200028ac0f0, 0xffff81003e403b58, invalid, 0x100000000) > 0xffff81003e403910 0xffffffff803ae61e xfs_vm_writepage+0xca (0xffffe200028ac0f0, 0xffff81003e403b58) > 0xffff81003e403940 0xffffffff80260c16 __writepage+0xd (invalid, invalid, 0xffff81007b9e6e00) > 0xffff81003e403950 0xffffffff8026112c write_cache_pages+0x19e (0xffff81007b9e6e00, 0xffff81003e403b58, 0xffffffff80260c09, 0xffff81007b9e6e00) > 0xffff81003e403a50 0xffffffff802612a0 do_writepages+0x23 (invalid, 0xffff81003e403b58) > 0xffff81003e403a60 0xffffffff8029ebca __writeback_single_inode+0x150 (0xffff81007b9e6c18, 0xffff81003e403b58) > 0xffff81003e403ae0 0xffffffff8029f124 sync_sb_inodes+0x1b4 (0xffff81007c15d3f8, 0xffff81003e403b58) > 0xffff81003e403b20 0xffffffff8029f406 writeback_inodes+0x81 (0xffff81003e403b58) > 0xffff81003e403b40 0xffffffff802616f9 balance_dirty_pages_ratelimited_nr+0x15e (invalid, invalid) > 0xffff81003e403bf0 0xffffffff8025bcb6 generic_file_buffered_write+0x20c (0xffff81003e403df8, 0xffff81003e403ee8, 0x1, 0x3c7c8000, 0xffff81003e403e78, invalid, 0x0) > 0xffff81003e403cf0 0xffffffff803b56b4 xfs_write+0x68a (0xffff81007b58d360, 0xffff81003e403df8, 0xffff81003e403ee8, 0x1, 0xffff81003e403e78, invalid) > 0xffff81003e403df0 0xffffffff8028411f do_sync_write+0xc9 (0xffff810079de9530, 0x51d000, 0x1000, 0xffff81003e403f48) > 0xffff81003e403f10 0xffffffff8028485f vfs_write+0xad (0xffff810079de9530, 0x51d000, invalid, 0xffff81003e403f48) > 0xffff81003e403f40 0xffffffff80284e87 sys_pwrite64+0x50 (invalid, 0x51d000, 0x1000, 0x3c7c8000) > 0xffff81003e403f80 0xffffffff8020ae4b system_call_after_swapgs+0x7b (invalid, invalid, invalid, invalid, invalid, invalid) > > Taking a look at the log and iclog structures... > > [2]kdb> xlog 0xffff81007d33d650 > xlog at 0xffff81007d33d650 > &flush_wait: 0xffff81007d33d6d0 ICLOG: 0xffff81007c193710 > &icloglock: 0xffff81007d33d720 tail_lsn: [58:173319] last_sync_lsn: [58:173319] > mp: 0xffff81007c97d338 xbuf: 0xffff81007c8e9e08 l_covered_state: need > flags: log 0x0 <> logBBstart: 0 logsize: 134217728 logBBsize: 262144 > curr_cycle: 58 prev_cycle: 58 curr_block: 213344 prev_block: 213280 > iclog_bak: 0xffff81007d33d830 iclog_size: 0x8000 (32768) num iclogs: 8 > l_iclog_hsize 512 l_iclog_heads 1 > l_sectbb_log 0 l_sectbb_mask 0 > &grant_lock: 0xffff81007d33d7d0 resHeadQ: 0x0000000000000000 wrHeadQ: 0x0000000000000000 > GResCycle: 58 GResBytes: 110263292 GWrCycle: 58 GWrBytes: 110263292 > GResBlocks: 215357 GResRemain: 508 GWrBlocks: 215357 GWrRemain: 508 > trace: 0x0000000000000000 grant_trace: use xlog value > [2]kdb> > [2]kdb> xicall 0xffff81007c193710 > xlog_in_core/header at 0xffff81007c193710/0xffffc2001110d000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a00033f60 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 212768 num_ops: 92 > cycle_data: 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 > size: 32768 > > -------------------------------------------------- > data: 0xffffc2001110d200 &forcesema: 0xffff81007c193710 next: 0xffff81007c1932f8 bp: 0xffff81007d102608 > log: 0xffff81007d33d650 callb: 0xffff810077915898 callb_tail: 0xffff81003e43cad8 > size: 32256 (OFFSET: 32240) trace: 0xffff81007aa78560 refcnt: 0 bwritecnt: 0 state: 0x2 > ================================================= > xlog_in_core/header at 0xffff81007c1932f8/0xffffc20011116000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a00033fa0 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 212832 num_ops: 99 > cycle_data: 7c1d39c0 127c8 121 121 121 121 122 122 123 123 36120100 3412 0 0 0 0 0 0 0 0 69020000 5 41425443 1c84 4 16 155 60 0 1cd9400 1d05600 1d24600 1d52a00 1e3 > size: 32768 > > -------------------------------------------------- > data: 0xffffc20011116200 &forcesema: 0xffff81007c1932f8 next: 0xffff81007d297610 bp: 0xffff81007d102408 > log: 0xffff81007d33d650 callb: 0xffff81007206b898 callb_tail: 0xffff8100715010f8 > size: 32256 (OFFSET: 32256) trace: 0xffff81007aa781d0 refcnt: 0 bwritecnt: 0 state: 0x10 > ================================================= > xlog_in_core/header at 0xffff81007d297610/0xffffc2001111f000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a00033fe0 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 212896 num_ops: 102 > cycle_data: 7c1d39c0 2dd 3d 547a 1f7d 0 24 2000000 2f6 1 11 1 4a 6730 72d9 631a 6d46 db00 0 6240000d 8400000b 9fa00025 d2e00010 c2c00001 3400001 3da00001 85600001 100000 > size: 32768 > > -------------------------------------------------- > data: 0xffffc2001111f200 &forcesema: 0xffff81007d297610 next: 0xffff81007d296198 bp: 0xffff81007d102208 > log: 0xffff81007d33d650 callb: 0xffff81007aac3548 callb_tail: 0xffff81006cdf2788 > size: 32256 (OFFSET: 32256) trace: 0xffff81007a9ef860 refcnt: 0 bwritecnt: 0 state: 0x10 > ================================================= > xlog_in_core/header at 0xffff81007d296198/0xffffc20011128000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a00034020 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 212960 num_ops: 105 > cycle_data: 7aa7bcd8 0 7e00001 4de00001 4d000001 56600001 49400001 5ae00001 9f600001 4f800001 1f03000 0 1 3 5 a 1f 4347 55b4 5e62 644a 716a df1400 e59800 ea0600 efc000 f9 > size: 32768 > > -------------------------------------------------- > data: 0xffffc20011128200 &forcesema: 0xffff81007d296198 next: 0xffff81007e59cd20 bp: 0xffff81007d102008 > log: 0xffff81007d33d650 callb: 0xffff81006cd5b798 callb_tail: 0xffff81006c4d10f8 > size: 32256 (OFFSET: 32256) trace: 0xffff81007aa78680 refcnt: 0 bwritecnt: 0 state: 0x10 > ================================================= > xlog_in_core/header at 0xffff81007e59cd20/0xffffc20000354000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a00034060 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 213024 num_ops: 93 > cycle_data: 7aa7bcd8 0 91400001 46600001 67200001 8800001 49400001 5ae00001 9f600001 4f800001 0 4fe00001 79c00001 99600001 c9c00001 b4e0000d ede0000d 31000017 7580003a 0 5f60 > size: 32768 > > -------------------------------------------------- > data: 0xffffc20000354200 &forcesema: 0xffff81007e59cd20 next: 0xffff81007e59c4f0 bp: 0xffff81007d102e08 > log: 0xffff81007d33d650 callb: 0xffff81003fd86068 callb_tail: 0xffff81003e4fca58 > size: 32256 (OFFSET: 32256) trace: 0xffff81007a9efef0 refcnt: 0 bwritecnt: 0 state: 0x10 > ================================================= > xlog_in_core/header at 0xffff81007e59c4f0/0xffffc2000035d000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a000340a0 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 213088 num_ops: 88 > cycle_data: 7c1d39c0 127c8 121 121 121 121 122 122 123 123 36120100 5d10 6a72 1 3 2030000 ba00001 35600001 3a800001 d6800001 dd200001 e0800001 83000800 6127 6164 58b7 72d > size: 32768 > > -------------------------------------------------- > data: 0xffffc2000035d200 &forcesema: 0xffff81007e59c4f0 next: 0xffff81007d5084f0 bp: 0xffff81007d102c08 > log: 0xffff81007d33d650 callb: 0xffff81006a091818 callb_tail: 0xffff81007206b548 > size: 32256 (OFFSET: 32256) trace: 0xffff81007aa786e0 refcnt: 0 bwritecnt: 0 state: 0x10 > ================================================= > xlog_in_core/header at 0xffff81007d5084f0/0xffffc20000366000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a000340e0 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 213152 num_ops: 101 > cycle_data: 7aa7bcd8 5f75 6af1 1 3 e359cb09 4 7 11 143 1c 0 1ceba00 1d10800 1d29800 1d5f800 1e53000 1e97000 1ed1800 1f16400 7936448 35 de7a00 e4c800 e9dc00 ee3c00 f7a800 > size: 32768 > > -------------------------------------------------- > data: 0xffffc20000366200 &forcesema: 0xffff81007d5084f0 next: 0xffff81007e59c908 bp: 0xffff81007d102a08 > log: 0xffff81007d33d650 callb: 0xffff8100778a6da8 callb_tail: 0xffff8100779144b8 > size: 32256 (OFFSET: 32256) trace: 0xffff81007a981b60 refcnt: 0 bwritecnt: 0 state: 0x10 > ================================================= > xlog_in_core/header at 0xffff81007e59c908/0xffffc2000036f000 > magicno: feedbabe cycle: 58 version: 2 lsn: 0x3a00034120 > tail_lsn: 0x3a0000d587 len: 32256 prev_block: 213216 num_ops: 118 > cycle_data: 7aa7bcd8 5f75 6af1 1 3 0 1f01 7b 79 c42c00 0 0 0 0 0 0 0 0 0 4ce00001 b174 80000000 80000000 80000000 80000000 0 0 0 0 68800010 72e6 2000000 31c 1 8c > size: 32768 > > -------------------------------------------------- > data: 0xffffc2000036f200 &forcesema: 0xffff81007e59c908 next: 0xffff81007c193710 bp: 0xffff81007d102808 > log: 0xffff81007d33d650 callb: 0xffff81006a1c8168 callb_tail: 0xffff81004714d0f8 > size: 32256 (OFFSET: 32256) trace: 0xffff81007aa78f80 refcnt: 0 bwritecnt: 0 state: 0x10 > ================================================= From owner-xfs@oss.sgi.com Thu Jul 10 21:09:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:09:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B49Gfh012283 for ; Thu, 10 Jul 2008 21:09:16 -0700 X-ASG-Debug-ID: 1215749422-34f203290000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E93492D935C for ; Thu, 10 Jul 2008 21:10:22 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id G3MPIGB9AwGMp5BE for ; Thu, 10 Jul 2008 21:10:22 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 2E5B5AC6278; Thu, 10 Jul 2008 23:10:22 -0500 (CDT) Message-ID: <4876DD2D.2010903@sandeen.net> Date: Thu, 10 Jul 2008 23:10:21 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Timothy Shimmin , Eric Sandeen , markgw@sgi.com, xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> <20080711040447.GC11558@disturbed> In-Reply-To: <20080711040447.GC11558@disturbed> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215749422 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55717 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16856 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Dave Chinner wrote: > Patch for you to test, Eric, below. > > (I haven't been able to test it because UML panics on boot right now. > I need to hoover in the unit-at-atime build patch that Jeff Dike > posted this morning) > > Cheers, > > Dave. Dave, you frighten me. Testing now, will let it run a while. -Eric From owner-xfs@oss.sgi.com Thu Jul 10 21:12:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:12:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B4CN3Q013004 for ; Thu, 10 Jul 2008 21:12:24 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08550; Fri, 11 Jul 2008 14:13:23 +1000 Message-ID: <4876DDE3.7020801@sgi.com> Date: Fri, 11 Jul 2008 14:13:23 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: markgw@sgi.com, xfs-oss Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> <20080711040447.GC11558@disturbed> <4876DD2D.2010903@sandeen.net> In-Reply-To: <4876DD2D.2010903@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16857 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Dave Chinner wrote: > >> Patch for you to test, Eric, below. >> >> (I haven't been able to test it because UML panics on boot right now. >> I need to hoover in the unit-at-atime build patch that Jeff Dike >> posted this morning) >> >> Cheers, >> >> Dave. > > Dave, you frighten me. > > Testing now, will let it run a while. > Excellent. And it happened pretty reliably before, right? Thanks, Tim. From owner-xfs@oss.sgi.com Thu Jul 10 21:16:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:16:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B4GV7j013865 for ; Thu, 10 Jul 2008 21:16:33 -0700 X-ASG-Debug-ID: 1215749856-7d2c034e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E63C3DF4E37; Thu, 10 Jul 2008 21:17:36 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id EaPZfHM5q4mK0X5h; Thu, 10 Jul 2008 21:17:36 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KHA4e-0002BN-8Z; Fri, 11 Jul 2008 04:17:36 +0000 Date: Fri, 11 Jul 2008 00:17:36 -0400 From: Christoph Hellwig To: Timothy Shimmin , Eric Sandeen , markgw@sgi.com, xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs Message-ID: <20080711041736.GA29688@infradead.org> References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> <20080711040447.GC11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080711040447.GC11558@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1215749857 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55718 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16858 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 02:04:47PM +1000, Dave Chinner wrote: > xlog_state_switch_iclogs(log, iclog, iclog->ic_size); > > - /* If I'm the only one writing to this iclog, sync it to disk */ > - if (atomic_read(&iclog->ic_refcnt) == 1) { > + /* > + * If I'm the only one writing to this iclog, sync it to disk. > + * We need to do an atomic compare and decrement here to avoid > + * racing with concurrent atomic_dec_and_lock() calls in > + * xlog_state_release_iclog() when there is more than one > + * reference to the iclog. > + */ > + if (atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { > spin_unlock(&log->l_icloglock); > - if ((error = xlog_state_release_iclog(log, iclog))) > + error = xlog_state_release_iclog(log, iclog); > + if (error) > return error; > } else { > - atomic_dec(&iclog->ic_refcnt); > spin_unlock(&log->l_icloglock); > } > goto restart; Independent ofwether it actually fixes the bug (which I think it will) this looks good. Doing anything with the return value from atomic_read except for printing it is most likely bogus, and this one clearly is. From owner-xfs@oss.sgi.com Thu Jul 10 21:17:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:17:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B4HRJt014095 for ; Thu, 10 Jul 2008 21:17:28 -0700 X-ASG-Debug-ID: 1215749912-31d803a90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E8D671BB4C2F for ; Thu, 10 Jul 2008 21:18:32 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id lKIFkwKbKR1VCQ9I for ; Thu, 10 Jul 2008 21:18:32 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 25A08AC6278; Thu, 10 Jul 2008 23:18:32 -0500 (CDT) Message-ID: <4876DF17.9090904@sandeen.net> Date: Thu, 10 Jul 2008 23:18:31 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Timothy Shimmin CC: markgw@sgi.com, xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> <20080711040447.GC11558@disturbed> <4876DD2D.2010903@sandeen.net> <4876DDE3.7020801@sgi.com> In-Reply-To: <4876DDE3.7020801@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215749913 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55717 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16859 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Timothy Shimmin wrote: > Eric Sandeen wrote: >> Dave Chinner wrote: >> >>> Patch for you to test, Eric, below. >>> >>> (I haven't been able to test it because UML panics on boot right now. >>> I need to hoover in the unit-at-atime build patch that Jeff Dike >>> posted this morning) >>> >>> Cheers, >>> >>> Dave. >> Dave, you frighten me. >> >> Testing now, will let it run a while. >> > Excellent. > > And it happened pretty reliably before, right? It did, yep, though sometimes took a while. But, w/ the patch it actually deadlocked really quickly (< 2000 inodes written) -Eric From owner-xfs@oss.sgi.com Thu Jul 10 21:25:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:26:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B4Prqu015501 for ; Thu, 10 Jul 2008 21:25:53 -0700 X-ASG-Debug-ID: 1215750419-7943000e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6BADD1BB47A7 for ; Thu, 10 Jul 2008 21:26:59 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id a6AHhclhksbFK2Mh for ; Thu, 10 Jul 2008 21:26:59 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id DCB4CAC6278; Thu, 10 Jul 2008 23:26:58 -0500 (CDT) Message-ID: <4876E112.4010607@sandeen.net> Date: Thu, 10 Jul 2008 23:26:58 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Timothy Shimmin CC: markgw@sgi.com, xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> <20080711040447.GC11558@disturbed> <4876DD2D.2010903@sandeen.net> <4876DDE3.7020801@sgi.com> <4876DF17.9090904@sandeen.net> In-Reply-To: <4876DF17.9090904@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215750419 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55719 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16860 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Eric Sandeen wrote: > But, w/ the patch it actually deadlocked really quickly (< 2000 inodes > written) ok testing a fixed up version ... will let you know in my AM if it survived. -Eric From owner-xfs@oss.sgi.com Thu Jul 10 21:26:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:26:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B4QUlU015639 for ; Thu, 10 Jul 2008 21:26:31 -0700 X-ASG-Debug-ID: 1215750454-7945001c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0DD901BB47AF for ; Thu, 10 Jul 2008 21:27:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id RX0FPlMAvppmTUGD for ; Thu, 10 Jul 2008 21:27:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAE58dkh5LFxA/2dsb2JhbACwZw X-IronPort-AV: E=Sophos;i="4.30,342,1212330600"; d="scan'208";a="146491963" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 13:57:33 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KHAEG-0005UX-8s; Fri, 11 Jul 2008 14:27:32 +1000 Date: Fri, 11 Jul 2008 14:27:32 +1000 From: Dave Chinner To: Eric Sandeen Cc: Timothy Shimmin , markgw@sgi.com, xfs-oss X-ASG-Orig-Subj: Re: deadlocked xfs Subject: Re: deadlocked xfs Message-ID: <20080711042732.GE11558@disturbed> Mail-Followup-To: Eric Sandeen , Timothy Shimmin , markgw@sgi.com, xfs-oss References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> <20080711040447.GC11558@disturbed> <4876DD2D.2010903@sandeen.net> <4876DDE3.7020801@sgi.com> <4876DF17.9090904@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4876DF17.9090904@sandeen.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215750456 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55719 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16861 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Jul 10, 2008 at 11:18:31PM -0500, Eric Sandeen wrote: > Timothy Shimmin wrote: > > Eric Sandeen wrote: > >> Dave Chinner wrote: > >> > >>> Patch for you to test, Eric, below. > >>> > >>> (I haven't been able to test it because UML panics on boot right now. > >>> I need to hoover in the unit-at-atime build patch that Jeff Dike > >>> posted this morning) > >>> > >>> Cheers, > >>> > >>> Dave. > >> Dave, you frighten me. > >> > >> Testing now, will let it run a while. > >> > > Excellent. > > > > And it happened pretty reliably before, right? > > It did, yep, though sometimes took a while. > > But, w/ the patch it actually deadlocked really quickly (< 2000 inodes > written) Yeah, inverted the if/else logic, I think. Like I said, untested. I'll send out an updated patch as soon as I get uml running again. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 10 21:44:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 21:44:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B4hw4Z019576 for ; Thu, 10 Jul 2008 21:44:00 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA09172; Fri, 11 Jul 2008 14:44:58 +1000 Message-ID: <4876E54A.7040506@sgi.com> Date: Fri, 11 Jul 2008 14:44:58 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen , markgw@sgi.com, xfs-oss CC: Timothy Shimmin Subject: Re: deadlocked xfs References: <4876C667.608@sandeen.net> <4876C9EB.7060601@sgi.com> <4876D1C3.4000006@sgi.com> <20080711040447.GC11558@disturbed> In-Reply-To: <20080711040447.GC11558@disturbed> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16862 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Fri, Jul 11, 2008 at 01:21:39PM +1000, Timothy Shimmin wrote: >>> It made this change which moved the refcount 'decrement and test' operation >>> outside the l_icloglock spinlock and therefore can race. > > Just FYI, this is not a 'decrement and test' operation - it's > an 'decrement and return locked if zero' operation. Best to > explain it is this comment in lib/dec_and_lock.c: > Fine, although I didn't write the above :) > /* > * This is an implementation of the notion of "decrement a > * reference count, and return locked if it decremented to zero". > * > * NOTE NOTE NOTE! This is _not_ equivalent to > * > * if (atomic_dec_and_test(&atomic)) { > * spin_lock(&lock); > * return 1; > * } > * return 0; > * > * because the spin-lock and the decrement must be > * "atomic". > */ > > >>> spin_lock(&log->l_icloglock); >>> atomic_inc(&iclog->ic_refcnt); /* prevents sync */ >>> >>> ... >>> >>> if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { >>> xlog_state_switch_iclogs(log, iclog, iclog->ic_size); >>> >>> /* If I'm the only one writing to this iclog, sync it to disk */ >>> if (atomic_read(&iclog->ic_refcnt) == 1) { >>> spin_unlock(&log->l_icloglock); >>> if ((error = xlog_state_release_iclog(log, iclog))) >>> return error; >>> } else { >>> atomic_dec(&iclog->ic_refcnt); >>> spin_unlock(&log->l_icloglock); >>> } >>> goto restart; >>> } > > Ok, so all the increments of ic_refcnt are done under l_icloglock. > That means through this section of code we can not ever have teh reference > count increase. It can decrease, but never to zero because that > requires holding the l_icloglock. > >>> Previously xlog_state_release_iclog() would wait for the spinlock to be >>> released above but will now do the atomic_dec_and_lock() while the above >>> code is executing. The above atomic_read() will return 2, the >>> atomic_dec_and_lock() in xlog_state_release_iclog() will return false and >>> return without syncing the iclog and then the above code will decrement the >>> atomic counter. The iclog never gets out of WANT_SYNC state and everything >>> gets stuck behind it. > > So what that means is that need the semantics here to be an > atomic 'decrement unless the count is 1' i.e.: > > if (atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { > spin_unlock(&log->l_icloglock); > if ((error = xlog_state_release_iclog(log, iclog))) > return error; > } else { > spin_unlock(&log->l_icloglock); > } > Gee, they have an atomic_ almost everything :-) When I was talking to Lachlan he was saying it would need to make the atomic_read and the dec somehow atomic (close the window) - didn't realise such a func existed. (And yeah, I hear you saying well one needs to look... he must have gotten on to one of the corruption fixes..dunno...) Just saw email, yeah didn't pick up on the reverse logic there - atomic decrement unless equal to one, yep (reverse if/else logic). > This means that the compare + decrement becomes atomic, thereby > closing the race condition where another unlocked thread can > decrement the reference count in between the compare and decrement > here. > Yep. --Tim From owner-xfs@oss.sgi.com Thu Jul 10 22:00:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 22:00:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B50IBk022495 for ; Thu, 10 Jul 2008 22:00:22 -0700 X-ASG-Debug-ID: 1215752483-066600ff0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B9B8F1BB4C6F for ; Thu, 10 Jul 2008 22:01:23 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id wPhOlc0ZolkEoKKJ for ; Thu, 10 Jul 2008 22:01:23 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAFeDdkh5LFxA/2dsb2JhbACwUw X-IronPort-AV: E=Sophos;i="4.30,342,1212330600"; d="scan'208";a="146517038" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 14:31:22 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KHAkz-0001uF-2q; Fri, 11 Jul 2008 15:01:21 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH] Fix reference counting race on log buffers Subject: [PATCH] Fix reference counting race on log buffers Date: Fri, 11 Jul 2008 15:01:21 +1000 Message-Id: <1215752481-6862-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215752484 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55720 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16863 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs When we release the iclog, we do an atomic_dec_and_lock to determine if we are the last reference to enable update of log headers and writeout. however, in xlog_state_get_iclog_space() we need to check if we have the last reference count there. if we do, we release the log buffer, otherwise we decrement the reference count. The issue is that the compare and decrement in xlog_state_get_iclog_space() is not atomic, so both places can see a reference count of 2 and neither will release the iclog. That leads to a filesystem hang. Close the hole replacing the compare and decrement with atomic_add_unless() to ensure that they are executed atomically. Signed-off-by: Dave Chinner --- fs/xfs/xfs_log.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 760d543..0816c5d 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -2425,13 +2425,20 @@ restart: if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { xlog_state_switch_iclogs(log, iclog, iclog->ic_size); - /* If I'm the only one writing to this iclog, sync it to disk */ - if (atomic_read(&iclog->ic_refcnt) == 1) { + /* + * If I'm the only one writing to this iclog, sync it to disk. + * We need to do an atomic compare and decrement here to avoid + * racing with concurrent atomic_dec_and_lock() calls in + * xlog_state_release_iclog() when there is more than one + * reference to the iclog. + */ + if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { + /* we are the only one */ spin_unlock(&log->l_icloglock); - if ((error = xlog_state_release_iclog(log, iclog))) + error = xlog_state_release_iclog(log, iclog); + if (error) return error; } else { - atomic_dec(&iclog->ic_refcnt); spin_unlock(&log->l_icloglock); } goto restart; -- 1.5.6 From owner-xfs@oss.sgi.com Thu Jul 10 22:24:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 22:24:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B5OfZB026693 for ; Thu, 10 Jul 2008 22:24:43 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA10003; Fri, 11 Jul 2008 15:25:43 +1000 Message-ID: <4876EED7.8060004@sgi.com> Date: Fri, 11 Jul 2008 15:25:43 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Dave Chinner CC: xfs@oss.sgi.com Subject: Re: [PATCH] Fix reference counting race on log buffers References: <1215752481-6862-1-git-send-email-david@fromorbit.com> In-Reply-To: <1215752481-6862-1-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16864 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Dave, Yeah, looks good. Thanks. (My personal preference is for reversing if/else than using ! as it is easier to read but whatever :) But will need Eric's result before checking it in. --Tim Dave Chinner wrote: > When we release the iclog, we do an atomic_dec_and_lock to determine > if we are the last reference to enable update of log headers and > writeout. however, in xlog_state_get_iclog_space() we need to check > if we have the last reference count there. if we do, we release the > log buffer, otherwise we decrement the reference count. > > The issue is that the compare and decrement in > xlog_state_get_iclog_space() is not atomic, so both places can see a > reference count of 2 and neither will release the iclog. That leads > to a filesystem hang. > > Close the hole replacing the compare and decrement with > atomic_add_unless() to ensure that they are executed atomically. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_log.c | 15 +++++++++++---- > 1 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c > index 760d543..0816c5d 100644 > --- a/fs/xfs/xfs_log.c > +++ b/fs/xfs/xfs_log.c > @@ -2425,13 +2425,20 @@ restart: > if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { > xlog_state_switch_iclogs(log, iclog, iclog->ic_size); > > - /* If I'm the only one writing to this iclog, sync it to disk */ > - if (atomic_read(&iclog->ic_refcnt) == 1) { > + /* > + * If I'm the only one writing to this iclog, sync it to disk. > + * We need to do an atomic compare and decrement here to avoid > + * racing with concurrent atomic_dec_and_lock() calls in > + * xlog_state_release_iclog() when there is more than one > + * reference to the iclog. > + */ > + if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { > + /* we are the only one */ > spin_unlock(&log->l_icloglock); > - if ((error = xlog_state_release_iclog(log, iclog))) > + error = xlog_state_release_iclog(log, iclog); > + if (error) > return error; > } else { > - atomic_dec(&iclog->ic_refcnt); > spin_unlock(&log->l_icloglock); > } > goto restart; From owner-xfs@oss.sgi.com Thu Jul 10 22:29:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 22:29:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B5Trsd027790 for ; Thu, 10 Jul 2008 22:29:54 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA10227; Fri, 11 Jul 2008 15:30:53 +1000 Message-ID: <4876F00C.7090307@sgi.com> Date: Fri, 11 Jul 2008 15:30:52 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Dave Chinner CC: xfs@oss.sgi.com Subject: Re: [PATCH] Fix reference counting race on log buffers References: <1215752481-6862-1-git-send-email-david@fromorbit.com> <4876EED7.8060004@sgi.com> In-Reply-To: <4876EED7.8060004@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16865 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Timothy Shimmin wrote: > Dave, > > Yeah, looks good. Thanks. > (My personal preference is for reversing if/else than using ! > as it is easier to read but whatever :) > > But will need Eric's result before checking it in. > And please push straight to Linus as I won't be able to check it in today as about to go to QLD. Thanks, --Tim From owner-xfs@oss.sgi.com Thu Jul 10 22:37:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 22:37:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from relay.sgi.com (netops-testserver-3.corp.sgi.com [192.26.57.72]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B5bN5V029237 for ; Thu, 10 Jul 2008 22:37:23 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by netops-testserver-3.corp.sgi.com (Postfix) with ESMTP id C493E908BE; Thu, 10 Jul 2008 22:38:25 -0700 (PDT) Received: from itchy.melbourne.sgi.com (postfix@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6B5cLjm2608974; Fri, 11 Jul 2008 15:38:21 +1000 (AEST) Received: by itchy.melbourne.sgi.com (Postfix, from userid 16403) id 7B28F58833; Fri, 11 Jul 2008 15:38:15 +1000 (EST) From: Niv Sardi To: xfs@oss.sgi.com Cc: Niv Sardi Subject: [PATCH] Export xfs_attr_set_int_trans Date: Fri, 11 Jul 2008 15:38:14 +1000 Message-Id: <1215754695-6958-1-git-send-email-xaiki@sgi.com> X-Mailer: git-send-email 1.5.6.2 In-Reply-To: <1215675545-2707-5-git-send-email-xaiki@sgi.com> References: <1215675545-2707-5-git-send-email-xaiki@sgi.com> X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16866 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs make xfs_attr_set_int_trans non static so we can use it outside of xfs_attr.c (Needed to use it in vnodeops.c, for create+EA) Signed-off-by: Niv Sardi --- fs/xfs/xfs_attr.c | 2 +- fs/xfs/xfs_attr.h | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/xfs/xfs_attr.c b/fs/xfs/xfs_attr.c index 8e9598d..24ba91d 100644 --- a/fs/xfs/xfs_attr.c +++ b/fs/xfs/xfs_attr.c @@ -241,7 +241,7 @@ xfs_attr_calc_size( * we can't commit it either as we don't know if the caller is * done with it. */ -STATIC int +int xfs_attr_set_int_trans( xfs_trans_t **tpp, xfs_inode_t *dp, diff --git a/fs/xfs/xfs_attr.h b/fs/xfs/xfs_attr.h index f99395c..32e80f9 100644 --- a/fs/xfs/xfs_attr.h +++ b/fs/xfs/xfs_attr.h @@ -161,6 +161,9 @@ struct xfs_da_args; int xfs_attr_calc_size(struct xfs_inode *, int, int, int *); int xfs_attr_inactive(struct xfs_inode *dp); +int xfs_attr_set_int_trans(struct xfs_trans **, struct xfs_inode *, + struct xfs_name *, char *, int, int); + int xfs_attr_shortform_getvalue(struct xfs_da_args *); int xfs_attr_fetch(struct xfs_inode *, struct xfs_name *, char *, int *, int); int xfs_attr_rmtval_get(struct xfs_da_args *args); -- 1.5.6.2 From owner-xfs@oss.sgi.com Thu Jul 10 22:37:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 22:37:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from relay.sgi.com (relay1.corp.sgi.com [192.26.58.214]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B5bNag029246 for ; Thu, 10 Jul 2008 22:37:24 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by relay1.corp.sgi.com (Postfix) with ESMTP id CA6D48F8062; Thu, 10 Jul 2008 22:38:25 -0700 (PDT) Received: from itchy.melbourne.sgi.com (postfix@itchy.melbourne.sgi.com [134.14.55.96]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6B5cLjm2582826; Fri, 11 Jul 2008 15:38:21 +1000 (AEST) Received: by itchy.melbourne.sgi.com (Postfix, from userid 16403) id 878E0585E8; Fri, 11 Jul 2008 15:38:15 +1000 (EST) From: Niv Sardi To: xfs@oss.sgi.com Cc: Niv Sardi Subject: [PATCH] hack to test create + ea Date: Fri, 11 Jul 2008 15:38:15 +1000 Message-Id: <1215754695-6958-2-git-send-email-xaiki@sgi.com> X-Mailer: git-send-email 1.5.6.2 In-Reply-To: <1215754695-6958-1-git-send-email-xaiki@sgi.com> References: <1215675545-2707-5-git-send-email-xaiki@sgi.com> <1215754695-6958-1-git-send-email-xaiki@sgi.com> X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16867 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs --- fs/xfs/xfs_vnodeops.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index e475e37..48df96b 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -1789,6 +1789,9 @@ xfs_create( */ XFS_QM_DQVOPCREATE(mp, tp, ip, udqp, gdqp); + /* hack to test create + ea */ + xfs_attr_set_int_trans(&tp, ip, name, "TEST", strlen("TEST"), ATTR_ROOT); + /* * xfs_trans_commit normally decrements the vnode ref count * when it unlocks the inode. Since we want to return the -- 1.5.6.2 From owner-xfs@oss.sgi.com Thu Jul 10 22:43:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 22:43:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_13 autolearn=no version=3.3.0-r574664 Received: from relay.sgi.com (relay1.corp.sgi.com [192.26.58.214]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B5hkkE030643 for ; Thu, 10 Jul 2008 22:43:47 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by relay1.corp.sgi.com (Postfix) with ESMTP id 112628F8066 for ; Thu, 10 Jul 2008 22:44:50 -0700 (PDT) Received: from lagoh (xaiki@melb-sw-corp-251-1.corp.sgi.com [134.15.251.1]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6B5ihjm2592843 for ; Fri, 11 Jul 2008 15:44:47 +1000 (AEST) From: Niv Sardi To: xfs@oss.sgi.com Subject: Re: [PATCH] Give a transaction to xfs_attr_set_int In-Reply-To: <1215675545-2707-5-git-send-email-xaiki@sgi.com> (Niv Sardi's message of "Thu, 10 Jul 2008 17:39:05 +1000") References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <1215675545-2707-2-git-send-email-xaiki@sgi.com> <1215675545-2707-3-git-send-email-xaiki@sgi.com> <1215675545-2707-4-git-send-email-xaiki@sgi.com> <1215675545-2707-5-git-send-email-xaiki@sgi.com> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (i486-pc-linux-gnu) Date: Fri, 11 Jul 2008 15:44:39 +1000 Message-ID: <878ww9asag.fsf@cxhome.ath.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16868 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Ok, so following are 2 patches that will, export xfs_attr_set_int_trans, and use it where we would use it in Parent Pointers (and V4ACL to what I understand). This exposes the bug that I refered to before, and that I'm not sure I understand fully. Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 10 22:58:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 22:58:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_13 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B5wqhh000511 for ; Thu, 10 Jul 2008 22:58:53 -0700 X-ASG-Debug-ID: 1215755996-1b3500f10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 23C4B2DB77B; Thu, 10 Jul 2008 22:59:56 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id GXMagFhknOUifVLC; Thu, 10 Jul 2008 22:59:56 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KHBfg-0006F5-F7; Fri, 11 Jul 2008 05:59:56 +0000 Date: Fri, 11 Jul 2008 01:59:56 -0400 From: Christoph Hellwig To: Niv Sardi Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Give a transaction to xfs_attr_set_int Subject: Re: [PATCH] Give a transaction to xfs_attr_set_int Message-ID: <20080711055956.GA23951@infradead.org> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <1215675545-2707-2-git-send-email-xaiki@sgi.com> <1215675545-2707-3-git-send-email-xaiki@sgi.com> <1215675545-2707-4-git-send-email-xaiki@sgi.com> <1215675545-2707-5-git-send-email-xaiki@sgi.com> <878ww9asag.fsf@cxhome.ath.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878ww9asag.fsf@cxhome.ath.cx> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1215755998 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55724 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16869 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 03:44:39PM +1000, Niv Sardi wrote: > > Ok, so following are 2 patches that will, export xfs_attr_set_int_trans, > and use it where we would use it in Parent Pointers (and V4ACL to what I > understand). > > This exposes the bug that I refered to before, and that I'm not sure I > understand fully. Actually plain Posix ACLs and selinux need it too to guarantee atomicy. See xfs_init_security() and whatever _ACL_INHERIT expans to in fs/xfs/linux-2.6/xfs_iops.c. These might be good testcases to get started with this work. From owner-xfs@oss.sgi.com Thu Jul 10 23:27:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 23:27:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B6RAAB002916 for ; Thu, 10 Jul 2008 23:27:10 -0700 X-ASG-Debug-ID: 1215757695-5fa2027f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7082DDF5454 for ; Thu, 10 Jul 2008 23:28:15 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id l9PHhTnC9hAerXNq for ; Thu, 10 Jul 2008 23:28:15 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 72159AC6278; Fri, 11 Jul 2008 01:28:14 -0500 (CDT) Message-ID: <4876FD7E.3080207@sandeen.net> Date: Fri, 11 Jul 2008 01:28:14 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Dave Chinner CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Fix reference counting race on log buffers Subject: Re: [PATCH] Fix reference counting race on log buffers References: <1215752481-6862-1-git-send-email-david@fromorbit.com> In-Reply-To: <1215752481-6862-1-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215757696 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55725 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16870 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Dave Chinner wrote: > When we release the iclog, we do an atomic_dec_and_lock to determine > if we are the last reference to enable update of log headers and > writeout. however, in xlog_state_get_iclog_space() we need to check > if we have the last reference count there. if we do, we release the > log buffer, otherwise we decrement the reference count. > > The issue is that the compare and decrement in > xlog_state_get_iclog_space() is not atomic, so both places can see a > reference count of 2 and neither will release the iclog. That leads > to a filesystem hang. > > Close the hole replacing the compare and decrement with > atomic_add_unless() to ensure that they are executed atomically. > > Signed-off-by: Dave Chinner Tested-by: Eric Sandeen Passes the fs_mark testcase I hit this on, 18 million inodes & counting. Thanks, -Eric > --- > fs/xfs/xfs_log.c | 15 +++++++++++---- > 1 files changed, 11 insertions(+), 4 deletions(-) > > diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c > index 760d543..0816c5d 100644 > --- a/fs/xfs/xfs_log.c > +++ b/fs/xfs/xfs_log.c > @@ -2425,13 +2425,20 @@ restart: > if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { > xlog_state_switch_iclogs(log, iclog, iclog->ic_size); > > - /* If I'm the only one writing to this iclog, sync it to disk */ > - if (atomic_read(&iclog->ic_refcnt) == 1) { > + /* > + * If I'm the only one writing to this iclog, sync it to disk. > + * We need to do an atomic compare and decrement here to avoid > + * racing with concurrent atomic_dec_and_lock() calls in > + * xlog_state_release_iclog() when there is more than one > + * reference to the iclog. > + */ > + if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { > + /* we are the only one */ > spin_unlock(&log->l_icloglock); > - if ((error = xlog_state_release_iclog(log, iclog))) > + error = xlog_state_release_iclog(log, iclog); > + if (error) > return error; > } else { > - atomic_dec(&iclog->ic_refcnt); > spin_unlock(&log->l_icloglock); > } > goto restart; From owner-xfs@oss.sgi.com Thu Jul 10 23:52:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 10 Jul 2008 23:52:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6B6qh1f004546 for ; Thu, 10 Jul 2008 23:52:44 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA11715; Fri, 11 Jul 2008 16:53:42 +1000 Message-ID: <48770375.1060308@sgi.com> Date: Fri, 11 Jul 2008 16:53:41 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Dave Chinner , xfs@oss.sgi.com Subject: Re: [PATCH] Fix reference counting race on log buffers References: <1215752481-6862-1-git-send-email-david@fromorbit.com> <4876FD7E.3080207@sandeen.net> In-Reply-To: <4876FD7E.3080207@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16871 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Dave Chinner wrote: >> When we release the iclog, we do an atomic_dec_and_lock to determine >> if we are the last reference to enable update of log headers and >> writeout. however, in xlog_state_get_iclog_space() we need to check >> if we have the last reference count there. if we do, we release the >> log buffer, otherwise we decrement the reference count. >> >> The issue is that the compare and decrement in >> xlog_state_get_iclog_space() is not atomic, so both places can see a >> reference count of 2 and neither will release the iclog. That leads >> to a filesystem hang. >> >> Close the hole replacing the compare and decrement with >> atomic_add_unless() to ensure that they are executed atomically. >> >> Signed-off-by: Dave Chinner > > Tested-by: Eric Sandeen > > Passes the fs_mark testcase I hit this on, 18 million inodes & counting. Thanks Eric & Dave. Given the short time available, could one of you please push this directly to Linus? I don't have anyone here to do that until Monday, which is probably too late. Cheers -- Mark > > Thanks, > -Eric > >> --- >> fs/xfs/xfs_log.c | 15 +++++++++++---- >> 1 files changed, 11 insertions(+), 4 deletions(-) >> >> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c >> index 760d543..0816c5d 100644 >> --- a/fs/xfs/xfs_log.c >> +++ b/fs/xfs/xfs_log.c >> @@ -2425,13 +2425,20 @@ restart: >> if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { >> xlog_state_switch_iclogs(log, iclog, iclog->ic_size); >> >> - /* If I'm the only one writing to this iclog, sync it to disk */ >> - if (atomic_read(&iclog->ic_refcnt) == 1) { >> + /* >> + * If I'm the only one writing to this iclog, sync it to disk. >> + * We need to do an atomic compare and decrement here to avoid >> + * racing with concurrent atomic_dec_and_lock() calls in >> + * xlog_state_release_iclog() when there is more than one >> + * reference to the iclog. >> + */ >> + if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { >> + /* we are the only one */ >> spin_unlock(&log->l_icloglock); >> - if ((error = xlog_state_release_iclog(log, iclog))) >> + error = xlog_state_release_iclog(log, iclog); >> + if (error) >> return error; >> } else { >> - atomic_dec(&iclog->ic_refcnt); >> spin_unlock(&log->l_icloglock); >> } >> goto restart; > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Fri Jul 11 00:18:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 00:18:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B7Io6a008922 for ; Fri, 11 Jul 2008 00:18:50 -0700 X-ASG-Debug-ID: 1215760794-484f03d60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BAF831BB5000 for ; Fri, 11 Jul 2008 00:19:55 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id NZSikBeVLCXTkgeE for ; Fri, 11 Jul 2008 00:19:55 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAESmdkh5LFxA/2dsb2JhbACwCg X-IronPort-AV: E=Sophos;i="4.30,343,1212330600"; d="scan'208";a="146614876" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 16:49:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KHCv3-0003cv-CO; Fri, 11 Jul 2008 17:19:53 +1000 Date: Fri, 11 Jul 2008 17:19:53 +1000 From: Dave Chinner To: Timothy Shimmin Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Fix reference counting race on log buffers Subject: Re: [PATCH] Fix reference counting race on log buffers Message-ID: <20080711071953.GR29319@disturbed> Mail-Followup-To: Timothy Shimmin , xfs@oss.sgi.com References: <1215752481-6862-1-git-send-email-david@fromorbit.com> <4876EED7.8060004@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4876EED7.8060004@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215760796 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0002 1.0000 -2.0199 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55726 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16872 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 03:25:43PM +1000, Timothy Shimmin wrote: > Dave, > > Yeah, looks good. Thanks. Thanks, Tim - I'll add the right tags and send it to Linus. > (My personal preference is for reversing if/else than using ! > as it is easier to read but whatever :) It looked funny with one line in the upper branch, and I added the comment inside the if() because it wasn't obvious from the code (either way) which branch was the 'only ref' branch.... > But will need Eric's result before checking it in. Seems like it's working fine, and i've got a coupl eof runs through xfsqa now, so it should be good to go. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Jul 11 00:43:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 00:43:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B7h27L015250 for ; Fri, 11 Jul 2008 00:43:02 -0700 X-ASG-Debug-ID: 1215762246-0e3b01270000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D1FFD1BB50D7 for ; Fri, 11 Jul 2008 00:44:06 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id hpBWYPtAKDmKOQGX for ; Fri, 11 Jul 2008 00:44:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAASqdkh5LFxA/2dsb2JhbACwAw X-IronPort-AV: E=Sophos;i="4.30,343,1212330600"; d="scan'208";a="146629875" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 17:14:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KHDIJ-0000KH-8J; Fri, 11 Jul 2008 17:43:55 +1000 Date: Fri, 11 Jul 2008 17:43:55 +1000 From: Dave Chinner To: torvalds@linux-foundation.org Cc: xfs@oss.sgi.com, linux-kernel@vger.kernel.org X-ASG-Orig-Subj: [XFS REGRESSION, PATCH] Fix reference counting race on log buffers Subject: [XFS REGRESSION, PATCH] Fix reference counting race on log buffers Message-ID: <20080711074355.GT29319@disturbed> Mail-Followup-To: torvalds@linux-foundation.org, xfs@oss.sgi.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215762247 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55726 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16873 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs When we release the iclog, we do an atomic_dec_and_lock to determine if we are the last reference and need to trigger update of log headers and writeout. However, in xlog_state_get_iclog_space() we also need to check if we have the last reference count there. If we do, we release the log buffer, otherwise we decrement the reference count. The issue is that the compare and decrement in xlog_state_get_iclog_space() is not atomic, so both places can see a reference count of 2 and neither will release the iclog. That leads to a filesystem hang. Close the race by replacing the atomic_read() and atomic_dec() pair with atomic_add_unless() to ensure that they are executed atomically. Signed-off-by: Dave Chinner Reviewed-by: Tim Shimmin Tested-by: Eric Sandeen --- fs/xfs/xfs_log.c | 15 +++++++++++---- 1 files changed, 11 insertions(+), 4 deletions(-) diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c index 760d543..0816c5d 100644 --- a/fs/xfs/xfs_log.c +++ b/fs/xfs/xfs_log.c @@ -2425,13 +2425,20 @@ restart: if (iclog->ic_size - iclog->ic_offset < 2*sizeof(xlog_op_header_t)) { xlog_state_switch_iclogs(log, iclog, iclog->ic_size); - /* If I'm the only one writing to this iclog, sync it to disk */ - if (atomic_read(&iclog->ic_refcnt) == 1) { + /* + * If I'm the only one writing to this iclog, sync it to disk. + * We need to do an atomic compare and decrement here to avoid + * racing with concurrent atomic_dec_and_lock() calls in + * xlog_state_release_iclog() when there is more than one + * reference to the iclog. + */ + if (!atomic_add_unless(&iclog->ic_refcnt, -1, 1)) { + /* we are the only one */ spin_unlock(&log->l_icloglock); - if ((error = xlog_state_release_iclog(log, iclog))) + error = xlog_state_release_iclog(log, iclog); + if (error) return error; } else { - atomic_dec(&iclog->ic_refcnt); spin_unlock(&log->l_icloglock); } goto restart; From owner-xfs@oss.sgi.com Fri Jul 11 01:41:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 01:41:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_45 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6B8fl0x019268 for ; Fri, 11 Jul 2008 01:41:47 -0700 X-ASG-Debug-ID: 1215765771-75ec00e50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 07132DC1D3E for ; Fri, 11 Jul 2008 01:42:51 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id B8VuN226HgjGXsEB for ; Fri, 11 Jul 2008 01:42:51 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEABW4dkh5LFxA/2dsb2JhbACwKg X-IronPort-AV: E=Sophos;i="4.30,343,1212330600"; d="scan'208";a="146660671" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 11 Jul 2008 18:12:50 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KHEDJ-0004dM-4Q; Fri, 11 Jul 2008 18:42:49 +1000 Date: Fri, 11 Jul 2008 18:42:49 +1000 From: Dave Chinner To: Mikael Abrahamsson Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080711084248.GU29319@disturbed> Mail-Followup-To: Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215765773 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55734 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16874 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 09:46:47AM +0200, Mikael Abrahamsson wrote: > > I received this when running xfs_fsr to defragment my xfs volume (which > resides on a crypted lvm). Hmmmm. XFS has a history of triggering unique bugs in crypted volumes - thank you for letting us know up front that this is what you are using. > Could it be that something is wrong with my xfs volume and this is not > being properly handled (since it seems to refer to getbmap below?). Could be - xfs_check will tell you if there is anything wrong with it. > Kernel is configured with oldconfig from ubuntu hardy stock kernel plus > Alsa. Hardware can be seen at > . > > Kernel oopsed (caps lock+other flashing when I woke up this morning), > don't know if it's related to the below bug or if it's something else. > Screensaver was on so I couldn't see any text to see more info. > > Jul 8 04:44:56 via kernel: [554197.888008] ------------[ cut here ]------------ > Jul 8 04:44:56 via kernel: [554197.888008] kernel BUG at fs/xfs/support/debug.c:81! > Jul 8 04:44:56 via kernel: [554197.888008] invalid opcode: 0000 [#1] SMP > Jul 8 04:44:56 via kernel: [554197.888008] Modules linked in: soundcore > ac97_bus isofs udf crc_itu_t nvidia(P) af_packet rfcomm l2c ^^^^^^^^^ That could also be a factor. > Pid: 16200, comm: xfs_fsr Tainted: P (2.6.26-rc8 #1) > EIP: 0060:[] EFLAGS: 00010282 CPU: 0 > EIP is at assfail+0x1b/0x20 [xfs] ^^^^^^^ Oh - you must be running a debug XFS. CONFIG_XFS_DEBUG was only introduced in 2.6.26-rc1 and defaults to 'N', so you must have selected the non-default option when prompted. This will cause your machine to oops at the slightest inconsistency that is found, regardless of whether it is fatal or not. Like the help text says, don't set this unless you are an XFS developer.... That aside, what was the assert failure reported prior to the oops? i.e. paste the lines in the log before the ---[ cut here ]--- line? One of them will start with 'Assertion failed:', I think.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Jul 11 03:20:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 03:20:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_52 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6BAKqcf025711 for ; Fri, 11 Jul 2008 03:20:53 -0700 X-ASG-Debug-ID: 1215771717-3851021f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from uplift.swm.pp.se (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BBBFADF7BEC for ; Fri, 11 Jul 2008 03:21:58 -0700 (PDT) Received: from uplift.swm.pp.se (swm.pp.se [212.247.200.143]) by cuda.sgi.com with ESMTP id IDwCQ8HZYe6M3Vah for ; Fri, 11 Jul 2008 03:21:58 -0700 (PDT) Received: by uplift.swm.pp.se (Postfix, from userid 501) id E46BEADADD; Fri, 11 Jul 2008 12:21:56 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by uplift.swm.pp.se (Postfix) with ESMTP id D6EB3ADADC; Fri, 11 Jul 2008 12:21:56 +0200 (CEST) Date: Fri, 11 Jul 2008 12:21:56 +0200 (CEST) From: Mikael Abrahamsson To: Dave Chinner cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 In-Reply-To: <20080711084248.GU29319@disturbed> Message-ID: References: <20080711084248.GU29319@disturbed> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) Organization: People's Front Against WWW MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Barracuda-Connect: swm.pp.se[212.247.200.143] X-Barracuda-Start-Time: 1215771718 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55741 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16875 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: swmike@swm.pp.se Precedence: bulk X-list: xfs On Fri, 11 Jul 2008, Dave Chinner wrote: > That aside, what was the assert failure reported prior to the oops? i.e. > paste the lines in the log before the ---[ cut here ]--- line? One of > them will start with 'Assertion failed:', I think.... These ones? Jul 8 04:44:56 via kernel: [554197.888008] Assertion failed: whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, line: 5879 Jul 9 03:25:21 via kernel: [42940.748007] Assertion failed: whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, line: 5879 I'll happily rebuild the kernel without the debug option and do xfs_check to weed out any possible logical problem with the volume, if you don't need any further information from the current state of my volume. I should also say that this assert failue happened two nights in a row so I guess it's fairly reproducible (didn't happen on the 10th, and today, the 11th it seems to have panic:ed around 03:30 (I start the defragmentation via cron at 03:00) which I think is related. -- Mikael Abrahamsson email: swmike@swm.pp.se From owner-xfs@oss.sgi.com Fri Jul 11 10:03:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 10:03:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6BH38AZ027961 for ; Fri, 11 Jul 2008 10:03:08 -0700 X-ASG-Debug-ID: 1215795851-49c6016f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3787618B8603 for ; Fri, 11 Jul 2008 10:04:11 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 9AYXip8Cg0fNMZve for ; Fri, 11 Jul 2008 10:04:11 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 375E1AC6278 for ; Fri, 11 Jul 2008 12:04:11 -0500 (CDT) Message-ID: <4877928A.1020008@sandeen.net> Date: Fri, 11 Jul 2008 12:04:10 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: xfs leaking? Subject: xfs leaking? Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215795854 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55767 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16876 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs after my fill-the-1T-fs-with-20k-files test I tried an xfs_repair, and it was sorrowfully slow compared to e2fsck of ext4 - I stopped it after almost 2 hours, and only half complete. I noticed that during the run, I was about out of memory (8G) and swapping badly. So I unmounted the fs, dropped caches, and was astounded to find 10492540 buffer heads still in the slab caches. This was all on 2.6.26-rc2 (I need to update) and lazy-count=1, 1T fs, 32 ags, mounted with inode64, nobarriers, and maximal logbuf count & size. Rebooted, let the fs_mark test run just a bit, then tried removing the xfs module because I forgot to load the one with dave's fix, and: slab error in kmem_cache_destroy(): cache `xfs_inode': Can't free all objects Pid: 3676, comm: rmmod Not tainted 2.6.26-rc2 #3 Call Trace: [] kmem_cache_destroy+0x7d/0xb9 [] :xfs:xfs_cleanup+0x5c/0xf9 [] :xfs:exit_xfs_fs+0x1a/0x28 [] sys_delete_module+0x186/0x1de [] tracesys+0xd5/0xda slab error in kmem_cache_destroy(): cache `xfs_buf_item': Can't free all objects Pid: 3676, comm: rmmod Not tainted 2.6.26-rc2 #3 Call Trace: [] kmem_cache_destroy+0x7d/0xb9 [] :xfs:xfs_cleanup+0xa0/0xf9 [] :xfs:exit_xfs_fs+0x1a/0x28 [] sys_delete_module+0x186/0x1de [] tracesys+0xd5/0xda slab error in kmem_cache_destroy(): cache `xfs_ili': Can't free all objects Pid: 3676, comm: rmmod Not tainted 2.6.26-rc2 #3 Call Trace: [] kmem_cache_destroy+0x7d/0xb9 [] :xfs:xfs_cleanup+0xe4/0xf9 [] :xfs:exit_xfs_fs+0x1a/0x28 [] sys_delete_module+0x186/0x1de [] tracesys+0xd5/0xda slab error in kmem_cache_destroy(): cache `xfs_buf': Can't free all objects Pid: 3676, comm: rmmod Not tainted 2.6.26-rc2 #3 Call Trace: [] kmem_cache_destroy+0x7d/0xb9 [] :xfs:exit_xfs_fs+0x1f/0x28 [] sys_delete_module+0x186/0x1de [] tracesys+0xd5/0xda slab error in kmem_cache_destroy(): cache `xfs_vnode': Can't free all objects Pid: 3676, comm: rmmod Not tainted 2.6.26-rc2 #3 Call Trace: [] kmem_cache_destroy+0x7d/0xb9 [] :xfs:xfs_destroy_zones+0x21/0x36 [] sys_delete_module+0x186/0x1de [] tracesys+0xd5/0xda BUG: unable to handle kernel paging request at ffffffffa03ebabb IP: [] strnlen+0x11/0x1a PGD 203067 PUD 207063 PMD 21d714067 PTE 0 Oops: 0000 [1] SMP CPU 2 Modules linked in: autofs4 hidp rfcomm l2cap bluetooth sunrpc ipv6 dm_multipath sbs sbshc battery acpi_memhotplug ac parport_pc lp parport sg dcdbas ide_cd_mod cdrom tg3 button serio_raw k8temp i2c_piix4 shpchp pcspkr i2c_core hwmon dm_snapshot dm_zero dm_mirror dm_log dm_mod qla2xxx scsi_transport_fc sata_svw libata sd_mod scsi_mod ext3 jbd uhci_hcd ohci_hcd ehci_hcd [last unloaded: xfs] Pid: 3687, comm: grep Not tainted 2.6.26-rc2 #3 RIP: 0010:[] [] strnlen+0x11/0x1a RSP: 0018:ffff810107163cc0 EFLAGS: 00010297 RAX: ffffffffa03ebabb RBX: ffff810107163d28 RCX: ffffffff8056ae84 RDX: ffff810107163d58 RSI: fffffffffffffffe RDI: ffffffffa03ebabb RBP: ffff81010718b0cc R08: 00000000ffffffff R09: 0000000000000240 R10: ffffffffffffffff R11: ffff81011fc113c0 R12: ffffffffa03ebabb R13: 0000000000000011 R14: 0000000000000010 R15: ffff81010718c000 FS: 00007f09e29386e0(0000) GS:ffff81011faa3940(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b CR2: ffffffffa03ebabb CR3: 000000011d4b9000 CR4: 00000000000006e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Process grep (pid: 3687, threadinfo ffff810107162000, task ffff81011dd461c0) Stack: ffffffff8031b5a2 0000000000000001 000000008029c713 0000000000000f34 ffff81010718b0cc ffffffff8056ae84 ffff81011dc420c0 0000000000039c1c ffff81011ddb6540 0000000000000000 0000000000008404 ffff81011dc420c0 Call Trace: [] ? vsnprintf+0x31a/0x585 [] ? seq_printf+0x67/0x8f [] ? s_show+0x160/0x28d [] ? s_show+0x228/0x28d [] ? seq_read+0x109/0x29d [] ? proc_reg_read+0x73/0x8e [] ? vfs_read+0xaa/0x132 [] ? sys_read+0x45/0x6e [] ? tracesys+0xd5/0xda Code: f2 ae 48 f7 d1 48 8d 44 11 ff 40 38 30 74 0a 48 ff c8 48 39 d0 73 f3 31 c0 c3 48 89 f8 eb 03 48 ff c0 48 ff ce 48 83 fe ff 74 05 <80> 38 00 75 ef 48 29 f8 c3 31 c0 eb 12 41 38 c8 74 0a 48 ff c2 RIP [] strnlen+0x11/0x1a RSP CR2: ffffffffa03ebabb ---[ end trace 6767d9b951178909 ]--- -Eric From owner-xfs@oss.sgi.com Fri Jul 11 12:01:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 12:01:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6BJ1C0T002541 for ; Fri, 11 Jul 2008 12:01:13 -0700 X-ASG-Debug-ID: 1215802938-6e9d00390000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from Chamillionaire.breakpoint.cc (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 238D711E5F8F for ; Fri, 11 Jul 2008 12:02:18 -0700 (PDT) Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [85.10.199.196]) by cuda.sgi.com with ESMTP id ptaPOBNXL7a4M7UY for ; Fri, 11 Jul 2008 12:02:18 -0700 (PDT) Received: id: bigeasy by Chamillionaire.breakpoint.cc with local (easymta 1.00 BETA 1) id 1KHNsg-0001z7-00; Fri, 11 Jul 2008 21:02:10 +0200 Date: Fri, 11 Jul 2008 21:02:09 +0200 From: Sebastian Siewior To: Dave Chinner Cc: Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080711190209.GA7401@Chamillionaire.breakpoint.cc> References: <20080711084248.GU29319@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20080711084248.GU29319@disturbed> X-Key-Id: FE3F4706 X-Key-Fingerprint: FFDA BBBB 3563 1B27 75C9 925B 98D5 5C1C FE3F 4706 User-Agent: Mutt/1.5.16 (2007-06-09) X-Barracuda-Connect: Chamillionaire.breakpoint.cc[85.10.199.196] X-Barracuda-Start-Time: 1215802939 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55772 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16877 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@ml.breakpoint.cc Precedence: bulk X-list: xfs * Dave Chinner | 2008-07-11 18:42:49 [+1000]: >Oh - you must be running a debug XFS. CONFIG_XFS_DEBUG was only >introduced in 2.6.26-rc1 and defaults to 'N', so you must have >selected the non-default option when prompted. This will cause your >machine to oops at the slightest inconsistency that is found, >regardless of whether it is fatal or not. Like the help text says, >don't set this unless you are an XFS developer.... Could you please add this to the Kconfig entry. Debug mode is usually noisy, little slower and mostly usefull just to the developers but *I* would not expect to BUG() in the non-fatal case. Not sure but if this is just for hch and you than a define in xfs.h might be safer :) >Dave. Sebastian From owner-xfs@oss.sgi.com Fri Jul 11 12:51:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 12:51:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6BJpXJq010235 for ; Fri, 11 Jul 2008 12:51:35 -0700 X-ASG-Debug-ID: 1215805958-4c4500320000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D4E3A2DF038 for ; Fri, 11 Jul 2008 12:52:39 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id K7yvUC11ENYxlWbq for ; Fri, 11 Jul 2008 12:52:39 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 4A138A84DC5; Fri, 11 Jul 2008 14:52:38 -0500 (CDT) Message-ID: <4877BA05.4000109@sandeen.net> Date: Fri, 11 Jul 2008 14:52:37 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Sebastian Siewior CC: Dave Chinner , Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 References: <20080711084248.GU29319@disturbed> <20080711190209.GA7401@Chamillionaire.breakpoint.cc> In-Reply-To: <20080711190209.GA7401@Chamillionaire.breakpoint.cc> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215805959 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55777 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16878 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Sebastian Siewior wrote: > * Dave Chinner | 2008-07-11 18:42:49 [+1000]: > >> Oh - you must be running a debug XFS. CONFIG_XFS_DEBUG was only >> introduced in 2.6.26-rc1 and defaults to 'N', so you must have >> selected the non-default option when prompted. This will cause your >> machine to oops at the slightest inconsistency that is found, >> regardless of whether it is fatal or not. Like the help text says, >> don't set this unless you are an XFS developer.... > Could you please add this to the Kconfig entry. Debug mode is usually > noisy, little slower and mostly usefull just to the developers but *I* > would not expect to BUG() in the non-fatal case. > Not sure but if this is just for hch and you than a define in xfs.h > might be safer :) > >> Dave. > Sebastian > > heh, it ws hch who added the Kconfig option in the first place :) > Back when I first submitted XFS for mainline inclusion we made the > decision that the debug code is far to extensive to be accidentally > enabled by users in mainline. But then again it's often quite useful > to track problems down and hacking the makefile all the time is rather > annoying. Given all the debug options with even more overhead like > lockdep or DEBUG_PAGE_ALLOC users (or rather developers) should know > by now what they're doing. > > > Signed-off-by: Christoph Hellwig But yeah, a bit more of a stern warning about the fatality of the debug tests might be useful. Just in case anyone reads that part and not the "only use this if you are an xfs developer" part ;) -Eric From owner-xfs@oss.sgi.com Fri Jul 11 16:21:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 16:21:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6BNL0kO028620 for ; Fri, 11 Jul 2008 16:21:02 -0700 X-ASG-Debug-ID: 1215818524-3ec000720000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CE7A618BA5D2 for ; Fri, 11 Jul 2008 16:22:05 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ytiqRef8R371SCtV for ; Fri, 11 Jul 2008 16:22:05 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAICHd0h5LFxA/2dsb2JhbACqRA X-IronPort-AV: E=Sophos;i="4.30,348,1212330600"; d="scan'208";a="147025742" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 12 Jul 2008 08:52:03 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KHRw9-0003Nx-UR; Sat, 12 Jul 2008 09:22:01 +1000 Date: Sat, 12 Jul 2008 09:22:01 +1000 From: Dave Chinner To: Sebastian Siewior Cc: Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080711232201.GG11558@disturbed> Mail-Followup-To: Sebastian Siewior , Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080711084248.GU29319@disturbed> <20080711190209.GA7401@Chamillionaire.breakpoint.cc> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080711190209.GA7401@Chamillionaire.breakpoint.cc> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215818526 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0274 1.0000 -1.8434 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.84 X-Barracuda-Spam-Status: No, SCORE=-1.84 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55790 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16879 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 09:02:09PM +0200, Sebastian Siewior wrote: > * Dave Chinner | 2008-07-11 18:42:49 [+1000]: > > >Oh - you must be running a debug XFS. CONFIG_XFS_DEBUG was only > >introduced in 2.6.26-rc1 and defaults to 'N', so you must have > >selected the non-default option when prompted. This will cause your > >machine to oops at the slightest inconsistency that is found, > >regardless of whether it is fatal or not. Like the help text says, > >don't set this unless you are an XFS developer.... > Could you please add this to the Kconfig entry. I effectively quoted from it: config XFS_DEBUG bool "XFS Debugging support (EXPERIMENTAL)" depends on XFS_FS && EXPERIMENTAL help Say Y here to get an XFS build with many debugging features, including ASSERT checks, function wrappers around macros, and extra sanity-checking functions in various code paths. Note that the resulting code will be HUGE and SLOW, and probably not useful unless you are debugging a particular problem. Say N unless you are an XFS developer, or you play one on TV. > Debug mode is usually > noisy, little slower and mostly usefull just to the developers but *I* > would not expect to BUG() in the non-fatal case. What do you expect debug code to do? Asserts are designed to drop the machine into a debugger when they fail so the problem can be, well, debugged. > Not sure but if this is just for hch and you than a define in xfs.h > might be safer :) And any other XFS developer using the XFS git tree or mainline, as tends to happen these days. And there are cases where a debug XFS might be needed to help find a problem that is being hit out in the field. Like all other debug config options, don't set them unless you know what you are doing.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Jul 11 16:37:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 16:37:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6BNbUmQ029816 for ; Fri, 11 Jul 2008 16:37:30 -0700 X-ASG-Debug-ID: 1215819514-0f0f002a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2CC67DFE816 for ; Fri, 11 Jul 2008 16:38:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id cHcac6LIPPlRgvdE for ; Fri, 11 Jul 2008 16:38:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAMeKd0h5LFxA/2dsb2JhbACqXA X-IronPort-AV: E=Sophos;i="4.30,348,1212330600"; d="scan'208";a="147031439" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 12 Jul 2008 09:08:33 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KHSC8-0003la-RQ; Sat, 12 Jul 2008 09:38:32 +1000 Date: Sat, 12 Jul 2008 09:38:32 +1000 From: Dave Chinner To: Eric Sandeen Cc: xfs-oss X-ASG-Orig-Subj: Re: xfs leaking? Subject: Re: xfs leaking? Message-ID: <20080711233832.GH11558@disturbed> Mail-Followup-To: Eric Sandeen , xfs-oss References: <4877928A.1020008@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4877928A.1020008@sandeen.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1215819516 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55791 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16880 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 12:04:10PM -0500, Eric Sandeen wrote: > after my fill-the-1T-fs-with-20k-files test I tried an xfs_repair, and > it was sorrowfully slow compared to e2fsck of ext4 - I stopped it after > almost 2 hours, and only half complete. > > I noticed that during the run, I was about out of memory (8G) and > swapping badly. > > So I unmounted the fs, dropped caches, and was astounded to find > 10492540 buffer heads still in the slab caches. Curious - that implies buffer heads aren't being freed. But if the pages have been freed, then the bufferheads should have been. Generic code or VM bug perhaps? > This was all on 2.6.26-rc2 (I need to update) and lazy-count=1, 1T fs, > 32 ags, mounted with inode64, nobarriers, and maximal logbuf count & size. > > Rebooted, let the fs_mark test run just a bit, then tried removing the > xfs module because I forgot to load the one with dave's fix, and: > > slab error in kmem_cache_destroy(): cache `xfs_inode': Can't free all objects > Pid: 3676, comm: rmmod Not tainted 2.6.26-rc2 #3 > > Call Trace: > [] kmem_cache_destroy+0x7d/0xb9 > [] :xfs:xfs_cleanup+0x5c/0xf9 > [] :xfs:exit_xfs_fs+0x1a/0x28 > [] sys_delete_module+0x186/0x1de > [] tracesys+0xd5/0xda .... That's rather unhealthy. I'm running a 2.6.26-rc9-git? on my uml system, and when no filesystems are mounted all the XFS slab caches have zero objects in them, even after several runs on xfsqa. So I don't see any obvious leak here. You did unmount the filesystem(s) first, right? I'd suggest updating to 2.6.26-rc9 and repeating the test. After unmounting all the filesystems and before you rmmod the kernel module, dump /proc/slabinfo so we can see if there are remaining objects in the XFs slabs.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Fri Jul 11 17:34:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 17:34:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6C0YMkK001008 for ; Fri, 11 Jul 2008 17:34:23 -0700 X-ASG-Debug-ID: 1215822928-4b2f01a50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 47FB92E048D for ; Fri, 11 Jul 2008 17:35:28 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id KIhUIK8iomlbfLbx for ; Fri, 11 Jul 2008 17:35:28 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 5B0EAAC6278; Fri, 11 Jul 2008 19:35:28 -0500 (CDT) Message-ID: <4877FC4F.7020906@sandeen.net> Date: Fri, 11 Jul 2008 19:35:27 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen , xfs-oss X-ASG-Orig-Subj: Re: xfs leaking? Subject: Re: xfs leaking? References: <4877928A.1020008@sandeen.net> <20080711233832.GH11558@disturbed> In-Reply-To: <20080711233832.GH11558@disturbed> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215822929 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55794 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16881 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Dave Chinner wrote: > I'd suggest updating to 2.6.26-rc9 and repeating the test. After > unmounting all the filesystems and before you rmmod the kernel > module, dump /proc/slabinfo so we can see if there are remaining > objects in the XFs slabs.... Yep I fired up on 2.6.26-rc9 this morning after I sent the mail. And I wish I'd checked the slabs before the explosion last time ... it'll be full again in a while and I'll try again. The complete lack of memory may well explain the horrendous repair performance, too. :) -Eric > Cheers, > > Dave. From owner-xfs@oss.sgi.com Fri Jul 11 18:30:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 18:30:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6C1UY30004857 for ; Fri, 11 Jul 2008 18:30:34 -0700 X-ASG-Debug-ID: 1215826299-28d603c40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 84AF912E0051 for ; Fri, 11 Jul 2008 18:31:39 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id a82izg9XFjn5sUz1 for ; Fri, 11 Jul 2008 18:31:39 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 7DEFDAC6278; Fri, 11 Jul 2008 20:31:39 -0500 (CDT) Message-ID: <4878097B.7040604@sandeen.net> Date: Fri, 11 Jul 2008 20:31:39 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen , xfs-oss X-ASG-Orig-Subj: Re: xfs leaking? Subject: Re: xfs leaking? References: <4877928A.1020008@sandeen.net> <20080711233832.GH11558@disturbed> In-Reply-To: <20080711233832.GH11558@disturbed> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215826300 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55797 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16882 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Dave Chinner wrote: > On Fri, Jul 11, 2008 at 12:04:10PM -0500, Eric Sandeen wrote: >> after my fill-the-1T-fs-with-20k-files test I tried an xfs_repair, and >> it was sorrowfully slow compared to e2fsck of ext4 - I stopped it after >> almost 2 hours, and only half complete. >> >> I noticed that during the run, I was about out of memory (8G) and >> swapping badly. >> >> So I unmounted the fs, dropped caches, and was astounded to find >> 10492540 buffer heads still in the slab caches. Hm that sounds like I unmounted after xfs_repair. That didn't come out right - no, I did not repair a mounted filesystem ;) -Eric From owner-xfs@oss.sgi.com Fri Jul 11 19:01:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 19:01:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6C21YYV006764 for ; Fri, 11 Jul 2008 19:01:35 -0700 X-ASG-Debug-ID: 1215828159-1b9801290000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 52FD12E0701 for ; Fri, 11 Jul 2008 19:02:39 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id PoBL5YcIIWeMJ9Le for ; Fri, 11 Jul 2008 19:02:39 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 53D7DAC6278 for ; Fri, 11 Jul 2008 21:02:39 -0500 (CDT) Message-ID: <487810BE.5050701@sandeen.net> Date: Fri, 11 Jul 2008 21:02:38 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: Re: xfs leaking? Subject: Re: xfs leaking? References: <4877928A.1020008@sandeen.net> <20080711233832.GH11558@disturbed> <4877FC4F.7020906@sandeen.net> In-Reply-To: <4877FC4F.7020906@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1215828160 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55800 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16883 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Eric Sandeen wrote: > Dave Chinner wrote: > >> I'd suggest updating to 2.6.26-rc9 and repeating the test. After >> unmounting all the filesystems and before you rmmod the kernel >> module, dump /proc/slabinfo so we can see if there are remaining >> objects in the XFs slabs.... > > Yep I fired up on 2.6.26-rc9 this morning after I sent the mail. And I > wish I'd checked the slabs before the explosion last time ... it'll be > full again in a while and I'll try again. 2.6.26-rc9 passed without incident. > The complete lack of memory may well explain the horrendous repair > performance, too. :) about 12min, not bad. (twice that of e2fsck/ext4 though, for this test!) :) -Eric > -Eric > >> Cheers, >> >> Dave. > > From owner-xfs@oss.sgi.com Fri Jul 11 22:05:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 11 Jul 2008 22:06:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6C55JBj029158 for ; Fri, 11 Jul 2008 22:05:20 -0700 X-ASG-Debug-ID: 1215839185-47e003840000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from Chamillionaire.breakpoint.cc (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2C298DFEC13 for ; Fri, 11 Jul 2008 22:06:25 -0700 (PDT) Received: from Chamillionaire.breakpoint.cc (Chamillionaire.breakpoint.cc [85.10.199.196]) by cuda.sgi.com with ESMTP id hacZCWaJ9bqaEFmd for ; Fri, 11 Jul 2008 22:06:25 -0700 (PDT) Received: id: bigeasy by Chamillionaire.breakpoint.cc with local (easymta 1.00 BETA 1) id 1KHXJE-0002y3-UC; Sat, 12 Jul 2008 07:06:12 +0200 Date: Sat, 12 Jul 2008 07:06:12 +0200 From: Sebastian Siewior To: Dave Chinner Cc: Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080712050612.GA11334@Chamillionaire.breakpoint.cc> References: <20080711084248.GU29319@disturbed> <20080711190209.GA7401@Chamillionaire.breakpoint.cc> <20080711232201.GG11558@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20080711232201.GG11558@disturbed> X-Key-Id: FE3F4706 X-Key-Fingerprint: FFDA BBBB 3563 1B27 75C9 925B 98D5 5C1C FE3F 4706 User-Agent: Mutt/1.5.16 (2007-06-09) X-Barracuda-Connect: Chamillionaire.breakpoint.cc[85.10.199.196] X-Barracuda-Start-Time: 1215839186 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=UNPARSEABLE_RELAY X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55812 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 UNPARSEABLE_RELAY Informational: message has unparseable relay lines X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16884 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lkml@ml.breakpoint.cc Precedence: bulk X-list: xfs * Dave Chinner | 2008-07-12 09:22:01 [+1000]: >I effectively quoted from it: > >config XFS_DEBUG > bool "XFS Debugging support (EXPERIMENTAL)" > depends on XFS_FS && EXPERIMENTAL > help > Say Y here to get an XFS build with many debugging features, > including ASSERT checks, function wrappers around macros, > and extra sanity-checking functions in various code paths. > > Note that the resulting code will be HUGE and SLOW, and probably > not useful unless you are debugging a particular problem. > > Say N unless you are an XFS developer, or you play one on TV. > >> Debug mode is usually >> noisy, little slower and mostly usefull just to the developers but *I* >> would not expect to BUG() in the non-fatal case. > >What do you expect debug code to do? Asserts are designed to >drop the machine into a debugger when they fail so the problem can >be, well, debugged. Sorry, I haven't read this. Userspace assert() results in abort() so it sane to bug() in kernel. >Dave. Sebastian From owner-xfs@oss.sgi.com Sat Jul 12 04:38:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 12 Jul 2008 04:38:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=BAYES_50,J_CHICKENPOX_56, RCVD_IN_PSBL autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6CBcDJD028021 for ; Sat, 12 Jul 2008 04:38:13 -0700 X-ASG-Debug-ID: 1215862759-352301570000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from naf-server05.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 33614DFECED for ; Sat, 12 Jul 2008 04:39:19 -0700 (PDT) Received: from naf-server05.com (naf-server05.com [69.73.155.186]) by cuda.sgi.com with ESMTP id 4BUZNCeJFa2dQ4dV for ; Sat, 12 Jul 2008 04:39:19 -0700 (PDT) Received: from apache by naf-server05.com with local (Exim 4.68) (envelope-from ) id 1KHdRe-0008UD-KI for linux-xfs@oss.sgi.com; Sat, 12 Jul 2008 07:39:18 -0400 To: linux-xfs@oss.sgi.com X-ASG-Orig-Subj: Update Your E-mail now. Subject: Update Your E-mail now. From: "Email Update Center." Reply-To: webupdate@live.com MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit Message-Id: Date: Sat, 12 Jul 2008 07:39:18 -0400 X-Barracuda-Connect: naf-server05.com[69.73.155.186] X-Barracuda-Start-Time: 1215862760 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5012 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55838 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16885 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: webupdate@update.org Precedence: bulk X-list: xfs Update Your E-mail now. Dear Email Owner, This message is from messaging center to all Email owners. We are currently upgrading our data base and e-mail center. We are deleting all unused email to create more space for new one. CONFIRM YOUR EMAIL BELOW. Email Username : .......... ..... EMAIL Password : ................ Warning!!! Email owner that refuses to update his or her Email,within Seven days of receiving this warning will lose his or her Email permanently. From owner-xfs@oss.sgi.com Sun Jul 13 10:14:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jul 2008 10:15:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6DHEnmW024112 for ; Sun, 13 Jul 2008 10:14:51 -0700 X-ASG-Debug-ID: 1215969356-0fe5015f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from g5t0006.atlanta.hp.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0AEA5E07265 for ; Sun, 13 Jul 2008 10:15:56 -0700 (PDT) Received: from g5t0006.atlanta.hp.com (g5t0006.atlanta.hp.com [15.192.0.43]) by cuda.sgi.com with ESMTP id MQwly8eCaNX1AwIa for ; Sun, 13 Jul 2008 10:15:56 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from g1t0039.austin.hp.com (g1t0039.austin.hp.com [16.236.32.45]) by g5t0006.atlanta.hp.com (Postfix) with ESMTP id AB930C0CF; Sun, 13 Jul 2008 17:15:53 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g1t0039.austin.hp.com (Postfix) with ESMTP id 5A70634033; Sun, 13 Jul 2008 17:15:51 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 552C839C08D; Sun, 13 Jul 2008 11:15:51 -0600 (MDT) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id V2mIb01gbNjs; Sun, 13 Jul 2008 11:15:47 -0600 (MDT) Received: from [16.116.96.85] (wizofoz.zko.hp.com [16.116.96.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ldl.fc.hp.com (Postfix) with ESMTP id 49FAB39C08F; Sun, 13 Jul 2008 11:15:46 -0600 (MDT) Message-ID: <487A383F.50600@hp.com> Date: Sun, 13 Jul 2008 13:15:43 -0400 From: jim owens User-Agent: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.7.13) Gecko/20060421 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pavel Machek CC: linux-fsdevel@vger.kernel.org, Dave Chinner , Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <4874C3E8.20804@hp.com> <20080713120602.GC7517@elf.ucw.cz> In-Reply-To: <20080713120602.GC7517@elf.ucw.cz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Barracuda-Connect: g5t0006.atlanta.hp.com[15.192.0.43] X-Barracuda-Start-Time: 1215969357 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Status: Clean X-archive-position: 16886 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jowens@hp.com Precedence: bulk X-list: xfs Pavel Machek wrote: >>This means ONLY SOME metadata (or no metadata) is flushed and >>then all metadata updates are stopped. User/kernel writes >>to already allocated file pages WILL go to a frozen disk. > > That's the difference here. They do write file data, and thus avoid > mmap()-writes problem. > > ...and they _still_ provide auto-thaw. > Pavel One of the hardest things to make people understand is that stopping file data writes in the filesystem during a freeze is not just dangerous, it is also __worthless__ unless you have a complete "user environment freeze" mechanism. In a real 24/7 environment, the DB and application stack may be poorly glued together stuff from multiple vendors. And unless each independent component has a freeze and they can all be coordinated, the data in the pipeline is never stable enough to say "if you stop all writes to disk and take a snapshot, this is the same as an orderly shutdown, backup, restore, and startup". If you need to stop applications before a freeze, there is no reason to implement "stop writing file data to disk". The only real way to make it work (and what the smart apps do) is to have application "checkpoint" commands so they can roll-back to a stable point from the snapshot while allowing new user activity to proceed. People who don't have checkpoints or some other way to make their environment stable with a transitioning snapshot must stop all user activity before snapshotting and have maintenance windows defined to do that. jim From owner-xfs@oss.sgi.com Sun Jul 13 21:06:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jul 2008 21:06:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6E46U2j014893 for ; Sun, 13 Jul 2008 21:06:31 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA11309; Mon, 14 Jul 2008 14:07:30 +1000 Message-ID: <487AD102.9020306@sgi.com> Date: Mon, 14 Jul 2008 14:07:30 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: xfs-oss Subject: Re: xfs leaking? References: <4877928A.1020008@sandeen.net> <20080711233832.GH11558@disturbed> <4877FC4F.7020906@sandeen.net> <487810BE.5050701@sandeen.net> In-Reply-To: <487810BE.5050701@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16887 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > > 2.6.26-rc9 passed without incident. So what is the conclusion here? Because you just down-rev? Or do we have an intermittent leak of some kind? Cheers -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Sun Jul 13 21:11:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jul 2008 21:12:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6E4BwUr015488 for ; Sun, 13 Jul 2008 21:11:58 -0700 X-ASG-Debug-ID: 1216008783-482301560000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 480A518C3785; Sun, 13 Jul 2008 21:13:04 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 4kdQmTLG9KeNmlJR; Sun, 13 Jul 2008 21:13:04 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KIFQt-0000tl-LZ; Mon, 14 Jul 2008 04:13:03 +0000 Date: Mon, 14 Jul 2008 00:13:03 -0400 From: Christoph Hellwig To: Mark Goodwin Cc: Eric Sandeen , xfs-oss X-ASG-Orig-Subj: Re: xfs leaking? Subject: Re: xfs leaking? Message-ID: <20080714041303.GA5040@infradead.org> References: <4877928A.1020008@sandeen.net> <20080711233832.GH11558@disturbed> <4877FC4F.7020906@sandeen.net> <487810BE.5050701@sandeen.net> <487AD102.9020306@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <487AD102.9020306@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216008785 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55992 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16888 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 14, 2008 at 02:07:30PM +1000, Mark Goodwin wrote: > > > Eric Sandeen wrote: >> >> 2.6.26-rc9 passed without incident. > > So what is the conclusion here? Because you just down-rev? Or do we have > an intermittent leak of some kind? The symptoms in the first post look like an inode leak, which is more likely to be in common code than in XFS. I'd expect -rc9 just fixed it or Eric didn't manage to hit it as easily. From owner-xfs@oss.sgi.com Sun Jul 13 21:14:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jul 2008 21:14:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6E4EOIq015959 for ; Sun, 13 Jul 2008 21:14:25 -0700 X-ASG-Debug-ID: 1216008929-335f00590000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D2C24E0884E for ; Sun, 13 Jul 2008 21:15:30 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id FONojpJFcV6kgk0U for ; Sun, 13 Jul 2008 21:15:30 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 806ECAC3592; Sun, 13 Jul 2008 23:15:29 -0500 (CDT) Message-ID: <487AD2E1.6030704@sandeen.net> Date: Sun, 13 Jul 2008 23:15:29 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: xfs-oss X-ASG-Orig-Subj: Re: xfs leaking? Subject: Re: xfs leaking? References: <4877928A.1020008@sandeen.net> <20080711233832.GH11558@disturbed> <4877FC4F.7020906@sandeen.net> <487810BE.5050701@sandeen.net> <487AD102.9020306@sgi.com> In-Reply-To: <487AD102.9020306@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216008931 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.55993 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16889 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mark Goodwin wrote: > > Eric Sandeen wrote: >> 2.6.26-rc9 passed without incident. > > So what is the conclusion here? Because you just down-rev? Or do we have > an intermittent leak of some kind? haven't yet re-tested on -rc2... not 100% sure yet. So far I'd be willing to chalk it up to something wrong in -rc2. -Eric From owner-xfs@oss.sgi.com Sun Jul 13 23:34:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 13 Jul 2008 23:35:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6E6YW4X025542 for ; Sun, 13 Jul 2008 23:34:33 -0700 X-ASG-Debug-ID: 1216017336-2bed03c70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gprs189-60.eurotel.cz (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C7A042EA21C for ; Sun, 13 Jul 2008 23:35:37 -0700 (PDT) Received: from gprs189-60.eurotel.cz (gprs189-60.eurotel.cz [160.218.189.60]) by cuda.sgi.com with ESMTP id J1HuIoqnsvadFeW1 for ; Sun, 13 Jul 2008 23:35:37 -0700 (PDT) Received: by gprs189-60.eurotel.cz (Postfix, from userid 1000) id 19D3417EF3; Mon, 14 Jul 2008 08:36:18 +0200 (CEST) Date: Mon, 14 Jul 2008 08:36:17 +0200 From: Pavel Machek To: jim owens Cc: linux-fsdevel@vger.kernel.org, Dave Chinner , Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Message-ID: <20080714063617.GF31949@elf.ucw.cz> References: <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <4874C3E8.20804@hp.com> <20080713120602.GC7517@elf.ucw.cz> <487A383F.50600@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <487A383F.50600@hp.com> X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.17 (2007-11-01) X-Barracuda-Connect: gprs189-60.eurotel.cz[160.218.189.60] X-Barracuda-Start-Time: 1216017338 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56001 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16890 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pavel@suse.cz Precedence: bulk X-list: xfs On Sun 2008-07-13 13:15:43, jim owens wrote: > Pavel Machek wrote: > >>> This means ONLY SOME metadata (or no metadata) is flushed and >>> then all metadata updates are stopped. User/kernel writes >>> to already allocated file pages WILL go to a frozen disk. >> >> That's the difference here. They do write file data, and thus avoid >> mmap()-writes problem. >> >> ...and they _still_ provide auto-thaw. >> Pavel > > One of the hardest things to make people understand is that > stopping file data writes in the filesystem during a freeze > is not just dangerous, it is also __worthless__ unless you > have a complete "user environment freeze" mechanism. Eh? > And unless each independent component has a freeze and they > can all be coordinated, the data in the pipeline is never > stable enough to say "if you stop all writes to disk and > take a snapshot, this is the same as an orderly shutdown, > backup, restore, and startup". If you also freeze data writes, at least snapshot is not worse than _unexpected_ shutdown. And apps should already be ready for unexpected shutdowns (using fsync etc). Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html From owner-xfs@oss.sgi.com Mon Jul 14 00:03:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 00:03:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6E73OsG029374 for ; Mon, 14 Jul 2008 00:03:27 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA14426; Mon, 14 Jul 2008 17:04:31 +1000 From: tes@sgi.com Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id 9B83E58C4C3F; Mon, 14 Jul 2008 17:04:31 +1000 (EST) Date: Mon, 14 Jul 2008 17:04:31 +1000 To: xfs-dev@sgi.com, xfs@oss.sgi.com Subject: [PATCH] fix up delta calculation for xfs_bmap_add_extent_unwritten_real Message-ID: <487afa7f.JM4ZHhEHVRIFNZ+O%tes@sgi.com> User-Agent: nail 11.25 7/29/05 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16891 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs pv#984030 Patch provided by olaf@sgi.com and has been reviewed but putting out there for others to see the change. A bug was found in xfs_bmap_add_extent_unwritten_real() which will not affect xfs in its normal use. In a particular case, the delta param which is supposed to describe the region where extents have changed was not updated appropriately. The case of interest is: 1707 case 0: 1708 /* 1709 * Setting the middle part of a previous oldext extent to 1710 * newext. Contiguity is impossible here. 1711 * One extent becomes three extents. 1712 */ where we are not left-filling (on LHS) or right-filling (on RHS) and so are also not contiguous with neighbours. But we are in the middle. PREV:------------------------------------------------------------>| -----------------------|--------------------|---------------------- | cur->bc_rec.b LHS | r[0] = new | r[1] RHS | -----------------------|--------------------|---------------------- So our new extent is in the middle and r[1] is on the RHS. The LHS, cur, is set to PREV after making PREV's count smaller to its new size. However, this means that our original PREV's count is no longer covering the whole range. So Olaf's change leave's PREV alone and just updates cur->bc_rec.b to have PREV's contents and decrements its new count. Mainly, because below we calculate the delta based on the PREV values (in particular expecting the original block count). We are not using PREV anywhere else after that AFAICS so I think the change is safe from causing a regression elsewhere. --Tim xfs_bmap.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: 2.6.x-xfs-quilt/fs/xfs/xfs_bmap.c =================================================================== --- 2.6.x-xfs-quilt.orig/fs/xfs/xfs_bmap.c 2008-07-04 15:34:38.000000000 +1000 +++ 2.6.x-xfs-quilt/fs/xfs/xfs_bmap.c 2008-07-09 16:24:17.250532483 +1000 @@ -1740,9 +1740,9 @@ xfs_bmap_add_extent_unwritten_real( r[1].br_state))) goto done; /* new left extent - oldext */ - PREV.br_blockcount = - new->br_startoff - PREV.br_startoff; cur->bc_rec.b = PREV; + cur->bc_rec.b.br_blockcount = + new->br_startoff - PREV.br_startoff; if ((error = xfs_bmbt_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); From owner-xfs@oss.sgi.com Mon Jul 14 00:28:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 00:29:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6E7SsC5003357 for ; Mon, 14 Jul 2008 00:28:55 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA15060; Mon, 14 Jul 2008 17:29:53 +1000 Message-ID: <487B019B.9090401@sgi.com> Date: Mon, 14 Jul 2008 17:34:51 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Mikael Abrahamsson CC: Dave Chinner , linux-kernel@vger.kernel.org, xfs@oss.sgi.com Subject: Re: xfs bug in 2.6.26-rc9 References: <20080711084248.GU29319@disturbed> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16892 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Mikael Abrahamsson wrote: > On Fri, 11 Jul 2008, Dave Chinner wrote: > >> That aside, what was the assert failure reported prior to the oops? >> i.e. paste the lines in the log before the ---[ cut here ]--- line? >> One of them will start with 'Assertion failed:', I think.... > > These ones? > > Jul 8 04:44:56 via kernel: [554197.888008] Assertion failed: whichfork > == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, > line: 5879 > Jul 9 03:25:21 via kernel: [42940.748007] Assertion failed: whichfork > == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, > line: 5879 xfs_ilock(ip, XFS_IOLOCK_SHARED); if (whichfork == XFS_DATA_FORK && (ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) { /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */ error = xfs_flush_pages(ip, (xfs_off_t)0, -1, 0, FI_REMAPF); if (error) { xfs_iunlock(ip, XFS_IOLOCK_SHARED); return error; } } ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0); This is a race between xfs_fsr and a mmap write. xfs_fsr acquires the iolock and then flushes the file and because it has the iolock it doesn't expect any new delayed allocations to occur. A mmap write can allocate delayed allocations without acquiring the iolock so is able to get in after the flush but before the ASSERT. > > I'll happily rebuild the kernel without the debug option and do > xfs_check to weed out any possible logical problem with the volume, if > you don't need any further information from the current state of my volume. > > I should also say that this assert failue happened two nights in a row > so I guess it's fairly reproducible (didn't happen on the 10th, and > today, the 11th it seems to have panic:ed around 03:30 (I start the > defragmentation via cron at 03:00) which I think is related. > From owner-xfs@oss.sgi.com Mon Jul 14 00:29:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 00:29:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6E7Thwf003563 for ; Mon, 14 Jul 2008 00:29:44 -0700 X-ASG-Debug-ID: 1216020649-69df02f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CB0F12EA5DE for ; Mon, 14 Jul 2008 00:30:49 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 6AnbqEZdN7mCfNGZ for ; Mon, 14 Jul 2008 00:30:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADubekh5LFxA/2dsb2JhbACoOw X-IronPort-AV: E=Sophos;i="4.30,357,1212330600"; d="scan'208";a="148482980" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 14 Jul 2008 17:00:47 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KIIW4-0001gu-6H; Mon, 14 Jul 2008 17:30:36 +1000 Date: Mon, 14 Jul 2008 17:30:35 +1000 From: Dave Chinner To: Mikael Abrahamsson Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080714073035.GV29319@disturbed> Mail-Followup-To: Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com References: <20080711084248.GU29319@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216020650 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56005 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16893 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 12:21:56PM +0200, Mikael Abrahamsson wrote: > On Fri, 11 Jul 2008, Dave Chinner wrote: > >> That aside, what was the assert failure reported prior to the oops? >> i.e. paste the lines in the log before the ---[ cut here ]--- line? One >> of them will start with 'Assertion failed:', I think.... > > These ones? > > Jul 8 04:44:56 via kernel: [554197.888008] Assertion failed: whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, line: 5879 > Jul 9 03:25:21 via kernel: [42940.748007] Assertion failed: whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, line: 5879 That implies a flush to disk failed to write everything, but no error was reported back to the flush. Not particularly conclusive what caused your problem. That being said, it's not a fatal error - it simply means that the bmap will return a bogus block number reported for the delalloc extent that still exists. This implies an in-memory error, not an on-disk error... > I should also say that this assert failue happened two nights in a row so > I guess it's fairly reproducible (didn't happen on the 10th, and today, > the 11th it seems to have panic:ed around 03:30 (I start the > defragmentation via cron at 03:00) which I think is related. Can you find the file it is failing on and run 'xfs_bmap -vvp ' to just extract the extent map outside the context of xfs_fsr? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 14 01:15:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 01:15:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6E8FEB1007217 for ; Mon, 14 Jul 2008 01:15:14 -0700 X-ASG-Debug-ID: 1216023380-2f6e01190000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from uplift.swm.pp.se (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B35762EAA0F for ; Mon, 14 Jul 2008 01:16:20 -0700 (PDT) Received: from uplift.swm.pp.se (swm.pp.se [212.247.200.143]) by cuda.sgi.com with ESMTP id baZ1tc95x9DfGgwB for ; Mon, 14 Jul 2008 01:16:20 -0700 (PDT) Received: by uplift.swm.pp.se (Postfix, from userid 501) id 9C218ADADF; Mon, 14 Jul 2008 10:16:19 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by uplift.swm.pp.se (Postfix) with ESMTP id 91268ADAD9; Mon, 14 Jul 2008 10:16:19 +0200 (CEST) Date: Mon, 14 Jul 2008 10:16:19 +0200 (CEST) From: Mikael Abrahamsson To: Dave Chinner cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 In-Reply-To: <20080714073035.GV29319@disturbed> Message-ID: References: <20080711084248.GU29319@disturbed> <20080714073035.GV29319@disturbed> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) Organization: People's Front Against WWW MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: swm.pp.se[212.247.200.143] X-Barracuda-Start-Time: 1216023381 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56008 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16894 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: swmike@swm.pp.se Precedence: bulk X-list: xfs On Mon, 14 Jul 2008, Dave Chinner wrote: > Can you find the file it is failing on and run 'xfs_bmap -vvp ' to > just extract the extent map outside the context of xfs_fsr? It's run twice without any errors now, so I guess I can't reproduce it anymore. If it happens again, how can I find out which file is causing the problem? I looked at the xfs_fsr man page and it didn't say much, would it help if I ran it in "-v" mode? -- Mikael Abrahamsson email: swmike@swm.pp.se From owner-xfs@oss.sgi.com Mon Jul 14 05:12:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 05:12:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ECCWLH028552 for ; Mon, 14 Jul 2008 05:12:34 -0700 X-ASG-Debug-ID: 1216037617-7ade00380000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6429018C77DC for ; Mon, 14 Jul 2008 05:13:37 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id a2IG1b0UctWbpmlq for ; Mon, 14 Jul 2008 05:13:37 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAJXdekh5LFxA/2dsb2JhbACpCg X-IronPort-AV: E=Sophos;i="4.30,359,1212330600"; d="scan'208";a="148648254" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 14 Jul 2008 21:43:35 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KIMvt-0007T2-AX; Mon, 14 Jul 2008 22:13:33 +1000 Date: Mon, 14 Jul 2008 22:13:32 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-mm@kvack.org X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080714121332.GX29319@disturbed> Mail-Followup-To: Lachlan McIlroy , Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-mm@kvack.org References: <20080711084248.GU29319@disturbed> <487B019B.9090401@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <487B019B.9090401@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216037619 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56024 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16895 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 14, 2008 at 05:34:51PM +1000, Lachlan McIlroy wrote: > Mikael Abrahamsson wrote: >> On Fri, 11 Jul 2008, Dave Chinner wrote: >> >>> That aside, what was the assert failure reported prior to the oops? >>> i.e. paste the lines in the log before the ---[ cut here ]--- line? >>> One of them will start with 'Assertion failed:', I think.... >> >> These ones? >> >> Jul 8 04:44:56 via kernel: [554197.888008] Assertion failed: whichfork >> == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, >> line: 5879 >> Jul 9 03:25:21 via kernel: [42940.748007] Assertion failed: whichfork >> == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, >> line: 5879 > > xfs_ilock(ip, XFS_IOLOCK_SHARED); > > if (whichfork == XFS_DATA_FORK && > (ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) { > /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */ > error = xfs_flush_pages(ip, (xfs_off_t)0, > -1, 0, FI_REMAPF); > if (error) { > xfs_iunlock(ip, XFS_IOLOCK_SHARED); > return error; > } > } > > ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0); > > This is a race between xfs_fsr and a mmap write. xfs_fsr acquires the > iolock and then flushes the file and because it has the iolock it doesn't > expect any new delayed allocations to occur. A mmap write can allocate > delayed allocations without acquiring the iolock so is able to get in > after the flush but before the ASSERT. Christoph and I were contemplating this problem with ->page_mkwrite reecently. The problem is that we can't, right now, return an EAGAIN-like error to ->page_mkwrite() and have it retry the page fault. Other parts of the page faulting code can do this, so it seems like a solvable problem. The basic concept is that if we can return a EAGAIN result we can try-lock the inode and hold the locks necessary to avoid this race or prevent the page fault from dirtying the page until the filesystem is unfrozen. Added linux-mm to the cc list for discussion. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 14 06:13:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 06:13:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6EDDNSA000902 for ; Mon, 14 Jul 2008 06:13:24 -0700 X-ASG-Debug-ID: 1216041269-555d02550000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 08208E0FD04 for ; Mon, 14 Jul 2008 06:14:30 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id nWq8GE3VHmLuFaNu for ; Mon, 14 Jul 2008 06:14:30 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.161]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6EDCs2e010671; Mon, 14 Jul 2008 22:12:54 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m6EDCs114391; Mon, 14 Jul 2008 22:12:54 +0900 (JST) Received: from shoin.jp.nec.com (shoin.jp.nec.com [10.26.220.3]) by mailsv.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6EDCr8N014788; Mon, 14 Jul 2008 22:12:53 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Mon, 14 Jul 2008 22:12:51 +0900 Message-Id: <88E7CDF01964465CB9F33DE11298271D@nsl.ad.nec.co.jp> From: "Takashi Sato" To: "jim owens" Cc: , , , , , , , , , , , "Miklos Szeredi" , "Arjan van de Ven" , "Theodore Tso" , "Dave Chinner" References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <4874C3E8.20804@hp.com> In-Reply-To: <4874C3E8.20804@hp.com> X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature Date: Mon, 14 Jul 2008 22:12:51 +0900 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="ISO-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6000.16480 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545 X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1216041271 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56029 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16896 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi, jim owens wrote: > In addition to the user controllable timeout mechanism, > we internally implement AUTO-THAW in the filesystem > whenever necessary to prevent a kernel hang/crash. > > If an AUTO-THAW occurs, we post to the log and an > event manager so the user knows the snapshot is bad. I am interested in AUTO-THAW. What is the difference between the timeout and AUTO-THAW? When the kernel detects a deadlock, does it occur to solve it? Cheers, Takashi From owner-xfs@oss.sgi.com Mon Jul 14 06:17:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 06:18:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6EDHw7E001776 for ; Mon, 14 Jul 2008 06:17:58 -0700 X-ASG-Debug-ID: 1216041545-274402000000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from g4t0015.houston.hp.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 14F142EB6CF for ; Mon, 14 Jul 2008 06:19:05 -0700 (PDT) Received: from g4t0015.houston.hp.com (g4t0015.houston.hp.com [15.201.24.18]) by cuda.sgi.com with ESMTP id EE2xupV6dw1Z64VC for ; Mon, 14 Jul 2008 06:19:05 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from g5t0029.atlanta.hp.com (g5t0029.atlanta.hp.com [16.228.8.141]) by g4t0015.houston.hp.com (Postfix) with ESMTP id 128C9887B; Mon, 14 Jul 2008 13:19:03 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g5t0029.atlanta.hp.com (Postfix) with ESMTP id 6BDBC100D8; Mon, 14 Jul 2008 13:17:30 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id C7B3839C091; Mon, 14 Jul 2008 07:17:29 -0600 (MDT) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WmFMwECsksbx; Mon, 14 Jul 2008 07:17:26 -0600 (MDT) Received: from [16.116.96.85] (wizofoz.zko.hp.com [16.116.96.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ldl.fc.hp.com (Postfix) with ESMTP id AEA49134027; Mon, 14 Jul 2008 07:17:24 -0600 (MDT) Message-ID: <487B51DD.2080206@hp.com> Date: Mon, 14 Jul 2008 09:17:17 -0400 From: jim owens User-Agent: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.7.13) Gecko/20060421 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Pavel Machek CC: linux-fsdevel@vger.kernel.org, Dave Chinner , Theodore Tso , Arjan van de Ven , Miklos Szeredi , hch@infradead.org, t-sato@yk.jp.nec.com, akpm@linux-foundation.org, viro@ZenIV.linux.org.uk, linux-ext4@vger.kernel.org, xfs@oss.sgi.com, dm-devel@redhat.com, linux-kernel@vger.kernel.org, axboe@kernel.dk, mtk.manpages@googlemail.com X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <4874C3E8.20804@hp.com> <20080713120602.GC7517@elf.ucw.cz> <487A383F.50600@hp.com> <20080714063617.GF31949@elf.ucw.cz> In-Reply-To: <20080714063617.GF31949@elf.ucw.cz> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Barracuda-Connect: g4t0015.houston.hp.com[15.201.24.18] X-Barracuda-Start-Time: 1216041546 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Status: Clean X-archive-position: 16897 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jowens@hp.com Precedence: bulk X-list: xfs Pavel Machek wrote: > If you also freeze data writes, at least snapshot is not worse than > _unexpected_ shutdown. True. But the key point is also that stopping file writes is __no better__ than an unexpected shutdown for applications. Once kernel people accept that it is identical to an unknown shutdown state, they realize that as you said... > And apps should already be ready for unexpected shutdowns (using fsync > etc). The people writing the code outside the kernel are the ones responsible for the logic of handling "we don't know what application writes made it to disk". Remember that immediately after fsync(), the next write can make the file inconsistent. For example, look at this simple sales processing database type sequence: write(sale_last_name_file, "Mackek" write(sale_first_name_file, "Pavel") fsync(sale_last_name_file) fsync(sale_first_name_file) ... write(sale_last_name_file, "Owens") write(sale_first_name_file, "Jim") fsync(sale_last_name_file) FREEZEFS [defined to NOT allow file data writes] So if we restart from that snapshot, the sales order thinks the customer is "Pavel Owens"... unless there is some mechanism such as seqence numbers that tie the files together. And if they have such a mechanism then it doesn't matter if we allow even more writes such as: write(sale_first_name_file, "Ted") There just is no way inside the kernel to know a freeze was triggered at a stable application point such that data before the freeze must be on disk and data after the freez must not go to disk. This issue is not unique to freeze, it is also present with filesystems that have snapshots and cow/versioning built in. jim From owner-xfs@oss.sgi.com Mon Jul 14 06:41:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 06:41:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_12 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6EDfnK4003880 for ; Mon, 14 Jul 2008 06:41:49 -0700 X-ASG-Debug-ID: 1216042974-184303210000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rproxy.teamix.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B5E462EBAA3 for ; Mon, 14 Jul 2008 06:42:54 -0700 (PDT) Received: from rproxy.teamix.net (postman.teamix.net [194.150.191.120]) by cuda.sgi.com with ESMTP id K0WIBsNOBAz57LdC for ; Mon, 14 Jul 2008 06:42:54 -0700 (PDT) Received: from nb27steigerwald.qs.de (unknown [212.204.70.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rproxy.teamix.net (Postfix) with ESMTP id DEFA98144 for ; Mon, 14 Jul 2008 15:42:52 +0200 (CEST) From: Martin Steigerwald Organization: team(ix) GmbH To: xfs@oss.sgi.com X-ASG-Orig-Subj: Is it possible the check an frozen XFS filesytem to avoid downtime Subject: Is it possible the check an frozen XFS filesytem to avoid downtime Date: Mon, 14 Jul 2008 15:42:51 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807141542.51613.ms@teamix.de> X-Barracuda-Connect: postman.teamix.net[194.150.191.120] X-Barracuda-Start-Time: 1216042975 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56029 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16898 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@teamix.de Precedence: bulk X-list: xfs Hi! We seen in-memory corruption on two XFS filesystem on a server heartbeat cluster of one of our customers: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1563 of file fs/xfs/xfs_alloc.c. Caller 0xffffffff8824eb5d Call Trace: [] :xfs:xfs_free_ag_extent+0x1a6/0x6b5 [] :xfs:xfs_free_extent+0xa9/0xc9 [] :xfs:xfs_bmap_finish+0xf0/0x169 [] :xfs:xfs_itruncate_finish+0x180/0x2c1 [] :xfs:xfs_setattr+0x841/0xe59 [] sock_common_recvmsg+0x30/0x45 [] :xfs:xfs_vn_setattr+0x121/0x144 [] notify_change+0x156/0x2ef [] :nfsd:nfsd_setattr+0x334/0x4b1 [] :nfsd:nfsd3_proc_setattr+0xa2/0xae [] :nfsd:nfsd_dispatch+0xdd/0x19e [] :sunrpc:svc_process+0x3cb/0x6d9 [] __down_read+0x12/0x9a [] :nfsd:nfsd+0x192/0x2b0 [] child_rip+0xa/0x12 [] :nfsd:nfsd+0x0/0x2b0 [] child_rip+0x0/0x12 xfs_force_shutdown(dm-1,0x8) called from line 4261 of file fs/xfs/xfs_bmap.c. Return address = 0xffffffff88258673 Filesystem "dm-1": Corruption of in-memory data detected. Shutting down filesystem: dm-1 Please umount the filesystem, and rectify the problem(s) on Linux version 2.6.21-1-amd64 (Debian 2.6.21-4~bpo.1) (nobse@backports.org) (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Tue Jun 5 07:43:32 UTC 2007 We plan to do a takeover so that the server which appears to have memory errors can be memtested. After the takeover we would like to make sure that the XFS filesystems are intact. Is it possible to do so without taking the filesystem completely offline? I thought about mounting read only and it might be the best choice available, but then it will *fail* write accesses. I would prefer if these are just stalled. I tried xfs_freeze -f on my laptop home directory, but then did not machine to get it check via xfs_check or xfs_repair -nd... is it possible at all? Ciao, -- Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90 From owner-xfs@oss.sgi.com Mon Jul 14 07:03:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 07:03:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6EE3Z8s005780 for ; Mon, 14 Jul 2008 07:03:37 -0700 X-ASG-Debug-ID: 1216044283-606702e50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from g1t0027.austin.hp.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 645D8E1007D for ; Mon, 14 Jul 2008 07:04:43 -0700 (PDT) Received: from g1t0027.austin.hp.com (g1t0027.austin.hp.com [15.216.28.34]) by cuda.sgi.com with ESMTP id KVWiI5iaIyQDM548 for ; Mon, 14 Jul 2008 07:04:43 -0700 (PDT) X-ASG-Whitelist: Barracuda Reputation Received: from g1t0039.austin.hp.com (g1t0039.austin.hp.com [16.236.32.45]) by g1t0027.austin.hp.com (Postfix) with ESMTP id 94766389F4; Mon, 14 Jul 2008 14:04:42 +0000 (UTC) Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30]) by g1t0039.austin.hp.com (Postfix) with ESMTP id 33E5634105; Mon, 14 Jul 2008 14:04:39 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl.fc.hp.com (Postfix) with ESMTP id 636C3134027; Mon, 14 Jul 2008 08:04:39 -0600 (MDT) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com Received: from ldl.fc.hp.com ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lmwvqHY7ZG73; Mon, 14 Jul 2008 08:04:35 -0600 (MDT) Received: from [16.116.96.85] (wizofoz.zko.hp.com [16.116.96.85]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ldl.fc.hp.com (Postfix) with ESMTP id 00BFA39C092; Mon, 14 Jul 2008 08:04:32 -0600 (MDT) Message-ID: <487B5CEE.90404@hp.com> Date: Mon, 14 Jul 2008 10:04:30 -0400 From: jim owens User-Agent: Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:1.7.13) Gecko/20060421 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Takashi Sato CC: mtk.manpages@googlemail.com, axboe@kernel.dk, linux-kernel@vger.kernel.org, dm-devel@redhat.com, xfs@oss.sgi.com, linux-ext4@vger.kernel.org, viro@ZenIV.linux.org.uk, akpm@linux-foundation.org, pavel@suse.cz, linux-fsdevel@vger.kernel.org, hch@infradead.org, Miklos Szeredi , Arjan van de Ven , Theodore Tso , Dave Chinner X-ASG-Orig-Subj: Re: [PATCH 3/3] Add timeout feature Subject: Re: [PATCH 3/3] Add timeout feature References: <20080709005254.GQ11558@disturbed> <20080709010922.GE9957@mit.edu> <20080709061621.GA5260@infradead.org> <20080708234120.5072111f@infradead.org> <20080708235502.1c52a586@infradead.org> <20080709071346.GS11558@disturbed> <20080709110900.GI9957@mit.edu> <20080709114958.GV11558@disturbed> <4874C3E8.20804@hp.com> <88E7CDF01964465CB9F33DE11298271D@nsl.ad.nec.co.jp> In-Reply-To: <88E7CDF01964465CB9F33DE11298271D@nsl.ad.nec.co.jp> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Barracuda-Connect: g1t0027.austin.hp.com[15.216.28.34] X-Barracuda-Start-Time: 1216044283 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Status: Clean X-archive-position: 16899 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jowens@hp.com Precedence: bulk X-list: xfs Takashi Sato wrote: > What is the difference between the timeout and AUTO-THAW? > When the kernel detects a deadlock, does it occur to solve it? TIMEOUT is a user-specified limit for the freeze. It is not a deadlock preventer or deadlock breaker. The reason it exists is: - middle of the night (low but not zero users) - cron triggers freeze and hardware snapshot - san is overloaded by tape copy traffic so hardware will take 2 hours to ack snapshot done - user "company president" tries to create a report needed for an AM meeting with bankers - with so few users, system will just patiently wait for hardware to finish - after 10 minutes "company president" pages admin, admin's boss, and "IT vice president" in a real unhappy mood AUTO-THAW is simply a name for the effect of all deadlock preventer and deadlock breaker code that the kernel has in the freeze implementation paths... if that code would unfreeze the filesystem. We also implemented deadlock preventer code that does not thaw the freeze. None of the AUTO-THAW code is there to stop a stupid userspace program caller of freeze. It handles things like "a system in our cluster is going down so we must have this filesystem unfrozen or the whole cluster will crash". In places where there could be a kernel deadlock we made it "lock-only-if-non-blocking" and if we could not wait to retry later, the failure to lock would trigger an immediate unfreeze. Deadlock prevention needs code in critical paths in more than just filesystems. Sometimes this is as simple as an "I can't wait on freeze" flag added to a vm-filesystem interface. Timers just don't work for keeping the kernel alive because they don't trigger on resource exhaustion. jim From owner-xfs@oss.sgi.com Mon Jul 14 15:12:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 15:12:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6EMCXaa019105 for ; Mon, 14 Jul 2008 15:12:34 -0700 X-ASG-Debug-ID: 1216073620-59b4028b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from elf.torek.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0A6D1E1C639 for ; Mon, 14 Jul 2008 15:13:40 -0700 (PDT) Received: from elf.torek.net (mail.torek.net [67.40.109.61]) by cuda.sgi.com with ESMTP id Eh2ajnmC0KB7EEf4 for ; Mon, 14 Jul 2008 15:13:40 -0700 (PDT) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.11.6/8.11.2) with ESMTP id m6EMDeE23640 for ; Mon, 14 Jul 2008 16:13:40 -0600 (MDT) Message-Id: <200807142213.m6EMDeE23640@elf.torek.net> From: Chris Torek To: xfs@oss.sgi.com X-ASG-Orig-Subj: question about xfs_fsync on linux Subject: question about xfs_fsync on linux Date: Mon, 14 Jul 2008 16:13:40 -0600 X-Barracuda-Connect: mail.torek.net[67.40.109.61] X-Barracuda-Start-Time: 1216073621 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0004 1.0000 -2.0184 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56065 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16900 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: chris.torek@windriver.com Precedence: bulk X-list: xfs The implementation of xfs_fsync() in 2.6.2x, for reasonably late x, reads as follows in xfs_vnodeops.c: error = filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping); We have a customer who is seeing data not "make it" to disk on a stress test that involves doing an fsync() or fdatasync() and then deliberately rebooting the machine (to simulate a failure; note that the underlying RAID has its own battery backup and this is just one of many different parts of the stress-test). Looking into this, I am now wondering if this call should read: error = filemap_write_and_wait(vn_to_inode(XFS_ITOV(ip))->i_mapping); instead. From a quick skim, it seems as though fdatawait does not start dirty page pushes, but rather only wait for any that are currently in progress. The write-and-wait call starts them first, which seems more appropriate for an fsync. I must admit to being relatively unfamiliar with all the innards of the Linux filemap code though. Chris From owner-xfs@oss.sgi.com Mon Jul 14 16:02:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 16:02:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6EN1xlD022967 for ; Mon, 14 Jul 2008 16:02:00 -0700 X-ASG-Debug-ID: 1216076584-25fa01770000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DC90B2EF126 for ; Mon, 14 Jul 2008 16:03:04 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id HI6WhCJdqUZ44sBJ for ; Mon, 14 Jul 2008 16:03:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEADN1e0h5LFxA/2dsb2JhbACsXg X-IronPort-AV: E=Sophos;i="4.30,361,1212330600"; d="scan'208";a="149001118" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 15 Jul 2008 08:33:02 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KIX4O-0004jY-Pp; Tue, 15 Jul 2008 09:03:00 +1000 Date: Tue, 15 Jul 2008 09:03:00 +1000 From: Dave Chinner To: Chris Torek Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: question about xfs_fsync on linux Subject: Re: question about xfs_fsync on linux Message-ID: <20080714230300.GY29319@disturbed> Mail-Followup-To: Chris Torek , xfs@oss.sgi.com References: <200807142213.m6EMDeE23640@elf.torek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200807142213.m6EMDeE23640@elf.torek.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216076585 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4560 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56068 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16901 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 14, 2008 at 04:13:40PM -0600, Chris Torek wrote: > The implementation of xfs_fsync() in 2.6.2x, for reasonably late x, > reads as follows in xfs_vnodeops.c: What kernel(s), exactly, is/are showing this problem? > error = filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping); > > We have a customer who is seeing data not "make it" to disk on a > stress test that involves doing an fsync() or fdatasync() and then > deliberately rebooting the machine (to simulate a failure; note > that the underlying RAID has its own battery backup and this is > just one of many different parts of the stress-test). What is the symptom? The file size does not change? The file the right size but has no data in it? > Looking into this, I am now wondering if this call should read: > > error = filemap_write_and_wait(vn_to_inode(XFS_ITOV(ip))->i_mapping); > > instead. No, the filemap_fdatawrite() has already been executed by this point. We only need to wait for I/O completion here. See do_fsync(): 78 long do_fsync(struct file *file, int datasync) 79 { ..... 90 ret = filemap_fdatawrite(mapping); ..... 97 err = file->f_op->fsync(file, file->f_path.dentry, datasync); ..... The ->fsync() method in XFS is xfs_fsync().... However, I do ask exactly what kernel version you are running, because this mod that has gone into 2.6.26: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=978b7237123d007b9fa983af6e0e2fa8f97f9934 might be the fix you need for .24 or .25 kernels, (not sure about .22 or .23 where all this changed, nor .21 or earlier which I don't think even had the wait...) Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 14 18:29:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 18:29:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6F1TGCj004423 for ; Mon, 14 Jul 2008 18:29:16 -0700 X-ASG-Debug-ID: 1216085422-1fe903620000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from elf.torek.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3329C2EEB67 for ; Mon, 14 Jul 2008 18:30:22 -0700 (PDT) Received: from elf.torek.net (mail.torek.net [67.40.109.61]) by cuda.sgi.com with ESMTP id gG6nGISuyuxHZRZW for ; Mon, 14 Jul 2008 18:30:22 -0700 (PDT) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.11.6/8.11.2) with ESMTP id m6F1THE23901; Mon, 14 Jul 2008 19:29:18 -0600 (MDT) Message-Id: <200807150129.m6F1THE23901@elf.torek.net> From: Chris Torek To: Dave Chinner cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: question about xfs_fsync on linux Subject: Re: question about xfs_fsync on linux In-Reply-To: Your message of "Tue, 15 Jul 2008 09:03:00 +1000." <20080714230300.GY29319@disturbed> Date: Mon, 14 Jul 2008 19:29:16 -0600 X-Barracuda-Connect: mail.torek.net[67.40.109.61] X-Barracuda-Start-Time: 1216085423 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56076 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16902 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: chris.torek@windriver.com Precedence: bulk X-list: xfs >What kernel(s), exactly, is/are showing this problem? Well, that part is a bit tricky. The base kernel is 2.6.21 but it has a lot of patches, including the one you mentioned. (The customer is double checking to make sure they actually have that patch in.) >> We have a customer who is seeing data not "make it" to disk on a >> stress test that involves doing an fsync() or fdatasync() and then >> deliberately rebooting the machine (to simulate a failure; note >> that the underlying RAID has its own battery backup and this is >> just one of many different parts of the stress-test). > >What is the symptom? The file size does not change? The file the >right size but has no data in it? Their system has a large number of databases (on the order of 50) all open simultaneously, and is using directIO (with a call to fdatasync()) to make entries in many of them, and apparently *some* of them get corrupted. Exactly how, I do not know: naturally, we cannot reproduce this with our own system, and when they tried a simplified system with just one database the problem went away on their end too. (Agh.) >No, the filemap_fdatawrite() has already been executed by this >point [by do_fsync()]. D'oh! I somehow missed this in eyeballing the code paths. >However, I do ask exactly what kernel version you are running ... It is mostly 2.6.21. We brought in a large number of miscellaneous XFS fixes, not including the ones that remove the "behavior" layer stuff, but definitely including this one: >http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit; >h=978b7237123d007b9fa983af6e0e2fa8f97f9934 (which of course necessitated a bit of hacking on the patches to fit, as a lot of the later ones assume the bhv* layer has been removed). Chris From owner-xfs@oss.sgi.com Mon Jul 14 19:07:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 19:07:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6F270Pa007203 for ; Mon, 14 Jul 2008 19:07:02 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA06636; Tue, 15 Jul 2008 12:07:52 +1000 Message-ID: <487C07A4.70202@sgi.com> Date: Tue, 15 Jul 2008 12:12:52 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Lachlan McIlroy , Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-mm@kvack.org Subject: Re: xfs bug in 2.6.26-rc9 References: <20080711084248.GU29319@disturbed> <487B019B.9090401@sgi.com> <20080714121332.GX29319@disturbed> In-Reply-To: <20080714121332.GX29319@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16903 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Mon, Jul 14, 2008 at 05:34:51PM +1000, Lachlan McIlroy wrote: >> Mikael Abrahamsson wrote: >>> On Fri, 11 Jul 2008, Dave Chinner wrote: >>> >>>> That aside, what was the assert failure reported prior to the oops? >>>> i.e. paste the lines in the log before the ---[ cut here ]--- line? >>>> One of them will start with 'Assertion failed:', I think.... >>> These ones? >>> >>> Jul 8 04:44:56 via kernel: [554197.888008] Assertion failed: whichfork >>> == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, >>> line: 5879 >>> Jul 9 03:25:21 via kernel: [42940.748007] Assertion failed: whichfork >>> == XFS_ATTR_FORK || ip->i_delayed_blks == 0, file: fs/xfs/xfs_bmap.c, >>> line: 5879 >> xfs_ilock(ip, XFS_IOLOCK_SHARED); >> >> if (whichfork == XFS_DATA_FORK && >> (ip->i_delayed_blks || ip->i_size > ip->i_d.di_size)) { >> /* xfs_fsize_t last_byte = xfs_file_last_byte(ip); */ >> error = xfs_flush_pages(ip, (xfs_off_t)0, >> -1, 0, FI_REMAPF); >> if (error) { >> xfs_iunlock(ip, XFS_IOLOCK_SHARED); >> return error; >> } >> } >> >> ASSERT(whichfork == XFS_ATTR_FORK || ip->i_delayed_blks == 0); >> >> This is a race between xfs_fsr and a mmap write. xfs_fsr acquires the >> iolock and then flushes the file and because it has the iolock it doesn't >> expect any new delayed allocations to occur. A mmap write can allocate >> delayed allocations without acquiring the iolock so is able to get in >> after the flush but before the ASSERT. > > Christoph and I were contemplating this problem with ->page_mkwrite > reecently. The problem is that we can't, right now, return an > EAGAIN-like error to ->page_mkwrite() and have it retry the > page fault. Other parts of the page faulting code can do this, > so it seems like a solvable problem. > > The basic concept is that if we can return a EAGAIN result we can > try-lock the inode and hold the locks necessary to avoid this race > or prevent the page fault from dirtying the page until the > filesystem is unfrozen. Why do we need to try-lock the inode? Will we have an ABBA deadlock if we block on the iolock in ->page_mkwrite()? From owner-xfs@oss.sgi.com Mon Jul 14 19:37:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 19:37:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6F2bLP3009249 for ; Mon, 14 Jul 2008 19:37:22 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA07495; Tue, 15 Jul 2008 12:38:25 +1000 Message-ID: <487C0ECD.5050205@sgi.com> Date: Tue, 15 Jul 2008 12:43:25 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: tes@sgi.com CC: xfs-dev@sgi.com, xfs@oss.sgi.com Subject: Re: [PATCH] fix up delta calculation for xfs_bmap_add_extent_unwritten_real References: <487afa7f.JM4ZHhEHVRIFNZ+O%tes@sgi.com> In-Reply-To: <487afa7f.JM4ZHhEHVRIFNZ+O%tes@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16904 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Looks good to me. I can't understand why this code is inconsistent with the other cases - no other cases adjusts PREV or the cursor (other than the state). To be consistent it would update PREV to become the new LHS by passing 'new->br_startoff - PREV.br_startoff' into xfs_bmbt_update() and then inserting r[0] and r[1] although that way would require an extra call to xfs_bmbt_increment(). tes@sgi.com wrote: > pv#984030 > Patch provided by olaf@sgi.com and has been reviewed > but putting out there for others to see the change. > > A bug was found in xfs_bmap_add_extent_unwritten_real() which will > not affect xfs in its normal use. > In a particular case, the delta param which is supposed to describe > the region where extents have changed was not updated appropriately. > > The case of interest is: > 1707 case 0: > 1708 /* > 1709 * Setting the middle part of a previous oldext extent to > 1710 * newext. Contiguity is impossible here. > 1711 * One extent becomes three extents. > 1712 */ > > where we are not left-filling (on LHS) or right-filling (on RHS) and so > are also not contiguous with neighbours. But we are in the middle. > > PREV:------------------------------------------------------------>| > -----------------------|--------------------|---------------------- > | cur->bc_rec.b LHS | r[0] = new | r[1] RHS | > -----------------------|--------------------|---------------------- > > So our new extent is in the middle and r[1] is on the RHS. > The LHS, cur, is set to PREV after making PREV's count smaller > to its new size. However, this means that our original PREV's count > is no longer covering the whole range. > So Olaf's change leave's PREV alone and just updates cur->bc_rec.b to have > PREV's contents and decrements its new count. > Mainly, because below we calculate the delta based on the PREV values > (in particular expecting the original block count). > We are not using PREV anywhere else after that AFAICS so I think the > change is safe from causing a regression elsewhere. > > --Tim > > xfs_bmap.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > Index: 2.6.x-xfs-quilt/fs/xfs/xfs_bmap.c > =================================================================== > --- 2.6.x-xfs-quilt.orig/fs/xfs/xfs_bmap.c 2008-07-04 15:34:38.000000000 +1000 > +++ 2.6.x-xfs-quilt/fs/xfs/xfs_bmap.c 2008-07-09 16:24:17.250532483 +1000 > @@ -1740,9 +1740,9 @@ xfs_bmap_add_extent_unwritten_real( > r[1].br_state))) > goto done; > /* new left extent - oldext */ > - PREV.br_blockcount = > - new->br_startoff - PREV.br_startoff; > cur->bc_rec.b = PREV; > + cur->bc_rec.b.br_blockcount = > + new->br_startoff - PREV.br_startoff; > if ((error = xfs_bmbt_insert(cur, &i))) > goto done; > XFS_WANT_CORRUPTED_GOTO(i == 1, done); > > > From owner-xfs@oss.sgi.com Mon Jul 14 19:47:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 19:47:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6F2le73010172 for ; Mon, 14 Jul 2008 19:47:40 -0700 X-ASG-Debug-ID: 1216090126-6dc8026e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 15DF12EF9FF for ; Mon, 14 Jul 2008 19:48:47 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 7BAohlK7B2Spm9ir for ; Mon, 14 Jul 2008 19:48:47 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHKte0h5LFxA/2dsb2JhbACsSQ X-IronPort-AV: E=Sophos;i="4.30,363,1212330600"; d="scan'208";a="149193711" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 15 Jul 2008 12:18:32 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KIaac-00006i-OV; Tue, 15 Jul 2008 12:48:30 +1000 Date: Tue, 15 Jul 2008 12:48:30 +1000 From: Dave Chinner To: Chris Torek Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: question about xfs_fsync on linux Subject: Re: question about xfs_fsync on linux Message-ID: <20080715024830.GZ29319@disturbed> Mail-Followup-To: Chris Torek , xfs@oss.sgi.com References: <20080714230300.GY29319@disturbed> <200807150129.m6F1THE23901@elf.torek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200807150129.m6F1THE23901@elf.torek.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216090128 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1263 1.0000 -1.2371 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.24 X-Barracuda-Spam-Status: No, SCORE=-1.24 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56082 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16905 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 14, 2008 at 07:29:16PM -0600, Chris Torek wrote: > >What kernel(s), exactly, is/are showing this problem? > > Well, that part is a bit tricky. The base kernel is 2.6.21 > but it has a lot of patches, including the one you mentioned. > (The customer is double checking to make sure they actually have > that patch in.) Well, you are pretty much on your own, then. Really, we cannot help diagnose problems on old kernels with a random set of backported patches in them. If you can provide a reproducable test case that triggers the problem on a recent, pristine tree then we can find the problem and fix it. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 14 20:17:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 20:18:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6F3HvKo012520 for ; Mon, 14 Jul 2008 20:17:57 -0700 X-ASG-Debug-ID: 1216091943-4b9003220000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8BAD4E1FCDB for ; Mon, 14 Jul 2008 20:19:03 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id AFOhUqmAuia78tFq for ; Mon, 14 Jul 2008 20:19:03 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoEAHy0e0h5LFxA/2dsb2JhbACsMQ X-IronPort-AV: E=Sophos;i="4.30,363,1212330600"; d="scan'208";a="149216213" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 15 Jul 2008 12:48:50 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KIb3o-0000m7-Ks; Tue, 15 Jul 2008 13:18:40 +1000 Date: Tue, 15 Jul 2008 13:18:40 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-mm@kvack.org X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080715031840.GB29319@disturbed> Mail-Followup-To: Lachlan McIlroy , Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-mm@kvack.org References: <20080711084248.GU29319@disturbed> <487B019B.9090401@sgi.com> <20080714121332.GX29319@disturbed> <487C07A4.70202@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <487C07A4.70202@sgi.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216091944 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56083 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16906 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 15, 2008 at 12:12:52PM +1000, Lachlan McIlroy wrote: > Dave Chinner wrote: >> On Mon, Jul 14, 2008 at 05:34:51PM +1000, Lachlan McIlroy wrote: >>> This is a race between xfs_fsr and a mmap write. xfs_fsr acquires the >>> iolock and then flushes the file and because it has the iolock it doesn't >>> expect any new delayed allocations to occur. A mmap write can allocate >>> delayed allocations without acquiring the iolock so is able to get in >>> after the flush but before the ASSERT. >> >> Christoph and I were contemplating this problem with ->page_mkwrite >> reecently. The problem is that we can't, right now, return an >> EAGAIN-like error to ->page_mkwrite() and have it retry the >> page fault. Other parts of the page faulting code can do this, >> so it seems like a solvable problem. >> >> The basic concept is that if we can return a EAGAIN result we can >> try-lock the inode and hold the locks necessary to avoid this race >> or prevent the page fault from dirtying the page until the >> filesystem is unfrozen. > Why do we need to try-lock the inode? Will we have an ABBA deadlock > if we block on the iolock in ->page_mkwrite()? Yes. With the mmap_sem. Look at the rules in mm/filemap.c and replace i_mutex with iolock.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 14 20:37:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 20:37:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6F3bLhg018589 for ; Mon, 14 Jul 2008 20:37:23 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA08904; Tue, 15 Jul 2008 13:38:23 +1000 Message-ID: <487C1BAF.2030404@sgi.com> Date: Tue, 15 Jul 2008 13:38:23 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Martin Steigerwald CC: xfs@oss.sgi.com Subject: Re: Is it possible the check an frozen XFS filesytem to avoid downtime References: <200807141542.51613.ms@teamix.de> In-Reply-To: <200807141542.51613.ms@teamix.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16907 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Hi Martin, Martin Steigerwald wrote: > Hi! > > We seen in-memory corruption on two XFS filesystem on a server heartbeat > cluster of one of our customers: > > > XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1563 of file > fs/xfs/xfs_alloc.c. Caller 0xffffffff8824eb5d > > Call Trace: > [] :xfs:xfs_free_ag_extent+0x1a6/0x6b5 > [] :xfs:xfs_free_extent+0xa9/0xc9 > [] :xfs:xfs_bmap_finish+0xf0/0x169 > [] :xfs:xfs_itruncate_finish+0x180/0x2c1 > [] :xfs:xfs_setattr+0x841/0xe59 > [] sock_common_recvmsg+0x30/0x45 > [] :xfs:xfs_vn_setattr+0x121/0x144 > [] notify_change+0x156/0x2ef > [] :nfsd:nfsd_setattr+0x334/0x4b1 > [] :nfsd:nfsd3_proc_setattr+0xa2/0xae > [] :nfsd:nfsd_dispatch+0xdd/0x19e > [] :sunrpc:svc_process+0x3cb/0x6d9 > [] __down_read+0x12/0x9a > [] :nfsd:nfsd+0x192/0x2b0 > [] child_rip+0xa/0x12 > [] :nfsd:nfsd+0x0/0x2b0 > [] child_rip+0x0/0x12 > > xfs_force_shutdown(dm-1,0x8) called from line 4261 of file fs/xfs/xfs_bmap.c. > Return address = 0xffffffff88258673 > Filesystem "dm-1": Corruption of in-memory data detected. Shutting down > filesystem: dm-1 > Please umount the filesystem, and rectify the problem(s) > > on > > Linux version 2.6.21-1-amd64 (Debian 2.6.21-4~bpo.1) (nobse@backports.org) > (gcc version 4.1.2 20061115 (prerelease) (Debian 4.1.1-21)) #1 SMP Tue Jun 5 > 07:43:32 UTC 2007 > > > We plan to do a takeover so that the server which appears to have memory > errors can be memtested. > > After the takeover we would like to make sure that the XFS filesystems are > intact. Is it possible to do so without taking the filesystem completely > offline? > > I thought about mounting read only and it might be the best choice available, > but then it will *fail* write accesses. I would prefer if these are just > stalled. > > I tried xfs_freeze -f on my laptop home directory, but then did not machine to > get it check via xfs_check or xfs_repair -nd... is it possible at all? > > Ciao, When I last tried (and I don't think Barry has done anything to it to change things) it wouldn't work. However, I think it could/should be changed to make it work. My notes from the SGI bug: 958642: running xfs_check and "xfs_repair -n" on a frozen xfs filesystem > We've been asked a few times about the possibility of running xfs_check > or xfs_repair -n on a frozen filesystem. > And a while back I looked into what some of the hinderances were. > And now I've forgotten ;-)) > > I think there are hinderances for libxfs_init (check_open()) and > for having a dirty log. > > For libxfs_init, I found that I couldn't run the tools without error'ing out. > I think I found out that I needed the INACTIVE flag, > without READONLY/DANGEROUSLY, like xfs_logprint does. > > ---------------------------------------- > Date: Thu, 19 Oct 2006 11:24:06 +1000 > From: Timothy Shimmin > To: lachlan@sgi.com > cc: xfs-dev@sgi.com > Subject: Re: init.c patch > ------------------------------------------------------ > Ok, my understanding of the READONLY/DANGEROUSLY flags were wrong. > I thought they were just overriding flags when you were guaranteeing you were only reading > and it would be more permissive, > but they are for doing stuff on readonly (ro) mounts. > They are rather confusing to me. When you go with defaults for repair and db then > it doesn't set the INACTIVE flag. > It means if I do _not_ want to be fatal then I need to set INACTIVE but not set READONLY or > DANGEROUSLY - which is what logprint does. > > I would have thought they'd be an option which for commands which don't modify anything, > that they can read from a non-ro mounted filesystem (at the users risk) - > which is what logprint does. i.e an option which just sets INACTIVE and only > produces a warning. > > The other alternative is to be able to test for a frozen fs as you suggested. > ---------------------------------------------------------- > > Lachlan suggested using a check_isfrozen() routine instead of overriding > check_isactive(). > > > And as far as the dirty log is concerned... > It will be dirty when it is frozen, but in a special way. > It will have an unmount record followed by a dummy record - > solely used so that when mounted again it can do > the unlinked list processing. > So we could add code to test if the log just had an unmount record > followed by a dummy record and continue anyway knowing that > the metadata was consistent. > e.g. in xfs_repair/phase2.c:zero_log() it calls xlog_find_tail() > and tests if (head_blk != tail_blk) to know if the log is dirty. > I think libxfs should provide a routine: libxfs_dirty_log > or in the libxlog code with a suitable name, > which could say how dirty the log is ;-) > Is it dirty such that we have real transactions to replay or > does it just have to do the unlinked processing as in the case of > a frozen filesystem. > It would be nice anyway to have an abstraction here because > it is finding out the head and tail blocks solely for this purpose > and doesn't really care what they are. > > --Tim --Tim From owner-xfs@oss.sgi.com Mon Jul 14 21:13:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 21:13:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from emu.melbourne.sgi.com (emu.melbourne.sgi.com [134.14.54.11]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6F4CxGN021000 for ; Mon, 14 Jul 2008 21:13:01 -0700 Received: by emu.melbourne.sgi.com (Postfix, from userid 1116) id 726EC5064F27; Tue, 15 Jul 2008 16:12:12 +1000 (EST) To: xfs@oss.sgi.com Subject: TAKE xfstests/078 Message-Id: <20080715061212.726EC5064F27@emu.melbourne.sgi.com> Date: Tue, 15 Jul 2008 16:12:12 +1000 (EST) From: tes@emu.melbourne.sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16908 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@emu.melbourne.sgi.com Precedence: bulk X-list: xfs If test 078 fails and you try to run it again immediately, it will execute a 'rm -f' on a directory which will fail. This should be a rmdir.... Signed-off-by: Dave Chinner Date: Tue Jul 15 14:13:12 AEST 2008 Workarea: emu.melbourne.sgi.com:/home/tes/isms/xfs-cmds Inspected by: dgc@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/xfs-cmds/master-melb Modid: master-melb:xfs-cmds:31637a xfstests/078 - 1.12 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-cmds/xfstests/078.diff?r1=text&tr1=1.12&r2=text&tr2=1.11&f=h - If test 078 fails and you try to run it again immediately, it will execute a 'rm -f' on a directory which will fail. This should be a rmdir.... Signed-off-by: Dave Chinner From owner-xfs@oss.sgi.com Mon Jul 14 23:35:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 14 Jul 2008 23:35:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6F6ZVFr030554 for ; Mon, 14 Jul 2008 23:35:33 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA13040; Tue, 15 Jul 2008 16:36:29 +1000 Message-ID: <487C456D.3010509@sgi.com> Date: Tue, 15 Jul 2008 16:36:29 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 3/3] kill vn_revalidate References: <20080627154602.GC31476@lst.de> <20080705172110.GB7177@lst.de> In-Reply-To: <20080705172110.GB7177@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16909 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Hi, Looks reasonable. Looking at changes... * remove calls to vn_revalidate from: -> xfs_ioctl_setattr (but call xfs_diflags_to_linux(ip) for FSX_XFLAGS instead which is the relevant bit of vn_revalidate) -> xfs_dm_set_fileattr (after call to xfs_setattr) -> xfs_vn_setattr (after call to xfs_setattr) -> xfs_xattr_system_set (after call to xfs_acl_vset -> xfs_acl_setmode -> xfs_setattr) So we now do inode field sets in xfs_setattr instead of waiting until after calling xfs_setattr (either directly or indirectly) to get vn_revalidate to set the inode fields. Okay. * in xfs_setattr we now explicitly set for linux inode: i_mode, i_uid, i_gid, i_atime, i_mtime, i_ctime It looks like we didn't set i_atime in vn_revalidate previously. This change looks weird: > */ > - iattr.ia_mask = XFS_AT_MODE; > + iattr.ia_valid = ATTR_MODE; > iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; I didn't think there was an ia_mask field - was this really from another patch? Confused. --Tim Christoph Hellwig wrote: > On Fri, Jun 27, 2008 at 05:46:02PM +0200, Christoph Hellwig wrote: >> These days most of the attributes in struct inode are properly kept in >> sync by XFS. This patch removes the need for vn_revalidate completely >> by: >> >> - keeping inode.i_flags uptodate after any flags are updated in >> xfs_ioctl_setattr >> - keeping i_mode, i_uid and i_gid uptodate in xfs_setattr > > Version that doesn't require the generic ACL patch below: > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-05 10:04:56.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-05 12:02:24.000000000 +0200 > @@ -2665,7 +2665,6 @@ xfs_dm_set_fileattr( > { > dm_fileattr_t stat; > struct iattr iattr; > - int error; > > /* Returns negative errors to DMAPI */ > > @@ -2720,10 +2719,7 @@ xfs_dm_set_fileattr( > iattr.ia_size = stat.fa_size; > } > > - error = xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); > - if (!error) > - vn_revalidate(vn_from_inode(inode)); /* update Linux inode flags */ > - return(-error); /* Return negative error to DMAPI */ > + return -xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); > } > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-05 10:04:56.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-05 12:02:24.000000000 +0200 > @@ -920,6 +920,30 @@ xfs_set_diflags( > ip->i_d.di_flags = di_flags; > } > > +STATIC void > +xfs_diflags_to_linux( > + struct xfs_inode *ip) > +{ > + struct inode *inode = XFS_ITOV(ip); > + unsigned int xflags = xfs_ip2xflags(ip); > + > + if (xflags & XFS_XFLAG_IMMUTABLE) > + inode->i_flags |= S_IMMUTABLE; > + else > + inode->i_flags &= ~S_IMMUTABLE; > + if (xflags & XFS_XFLAG_APPEND) > + inode->i_flags |= S_APPEND; > + else > + inode->i_flags &= ~S_APPEND; > + if (xflags & XFS_XFLAG_SYNC) > + inode->i_flags |= S_SYNC; > + else > + inode->i_flags &= ~S_SYNC; > + if (xflags & XFS_XFLAG_NOATIME) > + inode->i_flags |= S_NOATIME; > + else > + inode->i_flags &= ~S_NOATIME; > +} > > #define FSX_PROJID 1 > #define FSX_EXTSIZE 2 > @@ -1118,8 +1142,10 @@ xfs_ioctl_setattr( > > if (mask & FSX_EXTSIZE) > ip->i_d.di_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog; > - if (mask & FSX_XFLAGS) > + if (mask & FSX_XFLAGS) { > xfs_set_diflags(ip, fa->fsx_xflags); > + xfs_diflags_to_linux(ip); > + } > > xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); > xfs_ichgtime(ip, XFS_ICHGTIME_CHG); > @@ -1157,7 +1183,6 @@ xfs_ioctl_setattr( > (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); > } > > - vn_revalidate(XFS_ITOV(ip)); /* update flags */ > return 0; > > error_return: > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-05 10:04:56.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-05 12:02:24.000000000 +0200 > @@ -658,21 +658,7 @@ xfs_vn_setattr( > struct dentry *dentry, > struct iattr *iattr) > { > - struct inode *inode = dentry->d_inode; > - int error; > - > - if (iattr->ia_valid & ATTR_ATIME) > - inode->i_atime = iattr->ia_atime; > - > - if (iattr->ia_valid & ATTR_MODE) { > - if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) > - inode->i_mode &= ~S_ISGID; > - } > - > - error = xfs_setattr(XFS_I(inode), iattr, 0, NULL); > - if (likely(!error)) > - vn_revalidate(vn_from_inode(inode)); > - return -error; > + return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0, NULL); > } > > /* > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-05 10:04:17.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-05 12:02:24.000000000 +0200 > @@ -177,7 +177,6 @@ EXPORT_SYMBOL(uuid_hash64); > EXPORT_SYMBOL(uuid_is_nil); > EXPORT_SYMBOL(uuid_table_remove); > EXPORT_SYMBOL(vn_hold); > -EXPORT_SYMBOL(vn_revalidate); > > #if defined(CONFIG_XFS_POSIX_ACL) > EXPORT_SYMBOL(xfs_acl_vtoacl); > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-05 10:02:09.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-05 10:04:57.000000000 +0200 > @@ -82,56 +82,6 @@ vn_ioerror( > xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l); > } > > -/* > - * Revalidate the Linux inode from the XFS inode. > - * Note: i_size _not_ updated; we must hold the inode > - * semaphore when doing that - callers responsibility. > - */ > -int > -vn_revalidate( > - bhv_vnode_t *vp) > -{ > - struct inode *inode = vn_to_inode(vp); > - struct xfs_inode *ip = XFS_I(inode); > - struct xfs_mount *mp = ip->i_mount; > - unsigned long xflags; > - > - xfs_itrace_entry(ip); > - > - if (XFS_FORCED_SHUTDOWN(mp)) > - return -EIO; > - > - xfs_ilock(ip, XFS_ILOCK_SHARED); > - inode->i_mode = ip->i_d.di_mode; > - inode->i_uid = ip->i_d.di_uid; > - inode->i_gid = ip->i_d.di_gid; > - inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; > - inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; > - inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; > - inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; > - > - xflags = xfs_ip2xflags(ip); > - if (xflags & XFS_XFLAG_IMMUTABLE) > - inode->i_flags |= S_IMMUTABLE; > - else > - inode->i_flags &= ~S_IMMUTABLE; > - if (xflags & XFS_XFLAG_APPEND) > - inode->i_flags |= S_APPEND; > - else > - inode->i_flags &= ~S_APPEND; > - if (xflags & XFS_XFLAG_SYNC) > - inode->i_flags |= S_SYNC; > - else > - inode->i_flags &= ~S_SYNC; > - if (xflags & XFS_XFLAG_NOATIME) > - inode->i_flags |= S_NOATIME; > - else > - inode->i_flags &= ~S_NOATIME; > - xfs_iunlock(ip, XFS_ILOCK_SHARED); > - > - xfs_iflags_clear(ip, XFS_IMODIFIED); > - return 0; > -} > > /* > * Add a reference to a referenced vnode. > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-05 10:04:56.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-05 10:04:57.000000000 +0200 > @@ -67,7 +67,6 @@ static inline struct inode *vn_to_inode( > > > extern void vn_init(void); > -extern int vn_revalidate(bhv_vnode_t *); > > /* > * Yeah, these don't take vnode anymore at all, all this should be > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-05 10:04:56.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-05 10:04:57.000000000 +0200 > @@ -83,6 +83,7 @@ xfs_setattr( > cred_t *credp) > { > xfs_mount_t *mp = ip->i_mount; > + struct inode *inode = XFS_ITOV(ip); > int mask = iattr->ia_valid; > xfs_trans_t *tp; > int code; > @@ -446,6 +447,9 @@ xfs_setattr( > ip->i_d.di_mode &= S_IFMT; > ip->i_d.di_mode |= iattr->ia_mode & ~S_IFMT; > > + inode->i_mode &= S_IFMT; > + inode->i_mode |= iattr->ia_mode & ~S_IFMT; > + > xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); > timeflags |= XFS_ICHGTIME_CHG; > } > @@ -481,6 +485,7 @@ xfs_setattr( > &ip->i_udquot, udqp); > } > ip->i_d.di_uid = uid; > + inode->i_uid = uid; > } > if (igid != gid) { > if (XFS_IS_GQUOTA_ON(mp)) { > @@ -491,6 +496,7 @@ xfs_setattr( > &ip->i_gdquot, gdqp); > } > ip->i_d.di_gid = gid; > + inode->i_gid = gid; > } > > xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); > @@ -503,12 +509,14 @@ xfs_setattr( > */ > if (mask & (ATTR_ATIME|ATTR_MTIME)) { > if (mask & ATTR_ATIME) { > + inode->i_atime = iattr->ia_atime; > ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; > ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; > ip->i_update_core = 1; > timeflags &= ~XFS_ICHGTIME_ACC; > } > if (mask & ATTR_MTIME) { > + inode->i_mtime = iattr->ia_mtime; > ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; > ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; > timeflags &= ~XFS_ICHGTIME_MOD; > @@ -524,6 +532,7 @@ xfs_setattr( > */ > > if ((flags & XFS_ATTR_DMI) && (mask & ATTR_CTIME)) { > + inode->i_ctime = iattr->ia_ctime; > ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; > ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; > ip->i_update_core = 1; > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-05 10:02:09.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-05 12:02:24.000000000 +0200 > @@ -64,7 +64,7 @@ static int > xfs_xattr_system_set(struct inode *inode, const char *name, > const void *value, size_t size, int flags) > { > - int error, acl; > + int acl; > > acl = xfs_decode_acl(name); > if (acl < 0) > @@ -75,10 +75,7 @@ xfs_xattr_system_set(struct inode *inode > if (!value) > return xfs_acl_vremove(inode, acl); > > - error = xfs_acl_vset(inode, (void *)value, size, acl); > - if (!error) > - vn_revalidate(inode); > - return error; > + return xfs_acl_vset(inode, (void *)value, size, acl); > } > > static struct xattr_handler xfs_xattr_system_handler = { > Index: linux-2.6-xfs/fs/xfs/xfs_acl.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-05 12:26:45.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-05 12:26:53.000000000 +0200 > @@ -734,7 +734,7 @@ xfs_acl_setmode( > * Copy the u::, g::, o::, and m:: bits from the ACL into the > * mode. The m:: bits take precedence over the g:: bits. > */ > - iattr.ia_mask = XFS_AT_MODE; > + iattr.ia_valid = ATTR_MODE; > iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; > iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); > ap = acl->acl_entry; > From owner-xfs@oss.sgi.com Tue Jul 15 00:43:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 00:43:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12, J_CHICKENPOX_53,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6F7hB4W009682 for ; Tue, 15 Jul 2008 00:43:11 -0700 X-ASG-Debug-ID: 1216107855-324002ad0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rproxy.teamix.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0ACB11BB86BD for ; Tue, 15 Jul 2008 00:44:15 -0700 (PDT) Received: from rproxy.teamix.net (postman.teamix.net [194.150.191.120]) by cuda.sgi.com with ESMTP id JcVCWNswDKaIefHX for ; Tue, 15 Jul 2008 00:44:15 -0700 (PDT) Received: from nb27steigerwald.qs.de (unknown [212.204.70.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rproxy.teamix.net (Postfix) with ESMTP id CEE7B80C1; Tue, 15 Jul 2008 09:44:14 +0200 (CEST) From: Martin Steigerwald Organization: team(ix) GmbH To: Timothy Shimmin X-ASG-Orig-Subj: Re: Is it possible the check an frozen XFS filesytem to avoid downtime Subject: Re: Is it possible the check an frozen XFS filesytem to avoid downtime Date: Tue, 15 Jul 2008 09:44:12 +0200 User-Agent: KMail/1.9.9 Cc: xfs@oss.sgi.com References: <200807141542.51613.ms@teamix.de> <487C1BAF.2030404@sgi.com> In-Reply-To: <487C1BAF.2030404@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807150944.13277.ms@teamix.de> X-Barracuda-Connect: postman.teamix.net[194.150.191.120] X-Barracuda-Start-Time: 1216107858 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56099 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16910 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@teamix.de Precedence: bulk X-list: xfs Am Dienstag, 15. Juli 2008 05:38:23 schrieb Timothy Shimmin: > Hi Martin, Hi Tim, > Martin Steigerwald wrote: > > Hi! > > > > We seen in-memory corruption on two XFS filesystem on a server heartbeat > > cluster of one of our customers: > > > > > > XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1563 of file > > fs/xfs/xfs_alloc.c. Caller 0xffffffff8824eb5d > > > > Call Trace: > > [] :xfs:xfs_free_ag_extent+0x1a6/0x6b5 > > [] :xfs:xfs_free_extent+0xa9/0xc9 > > [] :xfs:xfs_bmap_finish+0xf0/0x169 > > [] :xfs:xfs_itruncate_finish+0x180/0x2c1 > > [] :xfs:xfs_setattr+0x841/0xe59 > > [] sock_common_recvmsg+0x30/0x45 > > [] :xfs:xfs_vn_setattr+0x121/0x144 > > [] notify_change+0x156/0x2ef > > [] :nfsd:nfsd_setattr+0x334/0x4b1 > > [] :nfsd:nfsd3_proc_setattr+0xa2/0xae > > [] :nfsd:nfsd_dispatch+0xdd/0x19e > > [] :sunrpc:svc_process+0x3cb/0x6d9 > > [] __down_read+0x12/0x9a > > [] :nfsd:nfsd+0x192/0x2b0 > > [] child_rip+0xa/0x12 > > [] :nfsd:nfsd+0x0/0x2b0 > > [] child_rip+0x0/0x12 > > > > xfs_force_shutdown(dm-1,0x8) called from line 4261 of file > > fs/xfs/xfs_bmap.c. Return address = 0xffffffff88258673 > > Filesystem "dm-1": Corruption of in-memory data detected. Shutting down > > filesystem: dm-1 > > Please umount the filesystem, and rectify the problem(s) > > > > on > > > > Linux version 2.6.21-1-amd64 (Debian 2.6.21-4~bpo.1) > > (nobse@backports.org) (gcc version 4.1.2 20061115 (prerelease) (Debian > > 4.1.1-21)) #1 SMP Tue Jun 5 07:43:32 UTC 2007 > > > > > > We plan to do a takeover so that the server which appears to have memory > > errors can be memtested. > > > > After the takeover we would like to make sure that the XFS filesystems > > are intact. Is it possible to do so without taking the filesystem > > completely offline? > > > > I thought about mounting read only and it might be the best choice > > available, but then it will *fail* write accesses. I would prefer if > > these are just stalled. > > > > I tried xfs_freeze -f on my laptop home directory, but then did not > > machine to get it check via xfs_check or xfs_repair -nd... is it possible > > at all? > > > > Ciao, > > When I last tried (and I don't think Barry has done anything to it to > change things) it wouldn't work. > However, I think it could/should be changed to make it work. Okay... we recommended the customer to do it the safe way unmounting the filesystem completely. He did and the filesystem appear to be intact *phew*. XFS appeared to detect the in memory corruption early enough. Its a bit strange however, cause we now know that the server sports ECC RAM. Well we will see what memtest86+ has to say about it. > My notes from the SGI bug: > > 958642: running xfs_check and "xfs_repair -n" on a frozen xfs filesystem > > > We've been asked a few times about the possibility of running xfs_check > > or xfs_repair -n on a frozen filesystem. > > And a while back I looked into what some of the hinderances were. > > And now I've forgotten ;-)) > > > > I think there are hinderances for libxfs_init (check_open()) and > > for having a dirty log. > > > > For libxfs_init, I found that I couldn't run the tools without error'ing > > out. I think I found out that I needed the INACTIVE flag, > > without READONLY/DANGEROUSLY, like xfs_logprint does. > > > > ---------------------------------------- > > Date: Thu, 19 Oct 2006 11:24:06 +1000 > > From: Timothy Shimmin > > To: lachlan@sgi.com > > cc: xfs-dev@sgi.com > > Subject: Re: init.c patch > > ------------------------------------------------------ > > Ok, my understanding of the READONLY/DANGEROUSLY flags were wrong. > > I thought they were just overriding flags when you were guaranteeing > > you were only reading and it would be more permissive, > > but they are for doing stuff on readonly (ro) mounts. > > > > They are rather confusing to me. When you go with defaults for repair > > and db then it doesn't set the INACTIVE flag. > > It means if I do _not_ want to be fatal then I need to set INACTIVE but > > not set READONLY or DANGEROUSLY - which is what logprint does. > > I think that there should be different options for readonly / frozen fs checking and dangerous repair... since I think readonly checks are a different thing than repairing a mounted filesystem and hoping that the running XFS will not choke upon the filesystem that xfs_repair changes under its hood. I expected a "-r" for read only in xfs_check and xfs_repair, well but for xfs_repair this option is already taken for specifying the realtime volume. Ciao, -- Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90 From owner-xfs@oss.sgi.com Tue Jul 15 00:46:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 00:46:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6F7kDwf010161 for ; Tue, 15 Jul 2008 00:46:13 -0700 X-ASG-Debug-ID: 1216108039-69b901e50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rproxy.teamix.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F00A3E213C8 for ; Tue, 15 Jul 2008 00:47:20 -0700 (PDT) Received: from rproxy.teamix.net (postman.teamix.net [194.150.191.120]) by cuda.sgi.com with ESMTP id qiBUppcJx3bXWsiK for ; Tue, 15 Jul 2008 00:47:20 -0700 (PDT) Received: from nb27steigerwald.qs.de (unknown [212.204.70.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rproxy.teamix.net (Postfix) with ESMTP id 0AD3E80C1; Tue, 15 Jul 2008 09:47:19 +0200 (CEST) From: Martin Steigerwald Organization: team(ix) GmbH To: Timothy Shimmin X-ASG-Orig-Subj: Re: Is it possible the check an frozen XFS filesytem to avoid downtime Subject: Re: Is it possible the check an frozen XFS filesytem to avoid downtime Date: Tue, 15 Jul 2008 09:47:17 +0200 User-Agent: KMail/1.9.9 Cc: xfs@oss.sgi.com References: <200807141542.51613.ms@teamix.de> <487C1BAF.2030404@sgi.com> In-Reply-To: <487C1BAF.2030404@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807150947.17727.ms@teamix.de> X-Barracuda-Connect: postman.teamix.net[194.150.191.120] X-Barracuda-Start-Time: 1216108040 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56100 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16911 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@teamix.de Precedence: bulk X-list: xfs Am Dienstag, 15. Juli 2008 05:38:23 schrieb Timothy Shimmin: > Hi Martin, > > Martin Steigerwald wrote: > > Hi! > > > > We seen in-memory corruption on two XFS filesystem on a server heartbeat > > cluster of one of our customers: > > > > > > XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1563 of file > > fs/xfs/xfs_alloc.c. Caller 0xffffffff8824eb5d > > > > Call Trace: > > [] :xfs:xfs_free_ag_extent+0x1a6/0x6b5 > > [] :xfs:xfs_free_extent+0xa9/0xc9 > > [] :xfs:xfs_bmap_finish+0xf0/0x169 > > [] :xfs:xfs_itruncate_finish+0x180/0x2c1 > > [] :xfs:xfs_setattr+0x841/0xe59 > > [] sock_common_recvmsg+0x30/0x45 > > [] :xfs:xfs_vn_setattr+0x121/0x144 > > [] notify_change+0x156/0x2ef > > [] :nfsd:nfsd_setattr+0x334/0x4b1 > > [] :nfsd:nfsd3_proc_setattr+0xa2/0xae > > [] :nfsd:nfsd_dispatch+0xdd/0x19e > > [] :sunrpc:svc_process+0x3cb/0x6d9 > > [] __down_read+0x12/0x9a > > [] :nfsd:nfsd+0x192/0x2b0 > > [] child_rip+0xa/0x12 > > [] :nfsd:nfsd+0x0/0x2b0 > > [] child_rip+0x0/0x12 > > > > xfs_force_shutdown(dm-1,0x8) called from line 4261 of file > > fs/xfs/xfs_bmap.c. Return address = 0xffffffff88258673 > > Filesystem "dm-1": Corruption of in-memory data detected. Shutting down > > filesystem: dm-1 > > Please umount the filesystem, and rectify the problem(s) > > > > on > > > > Linux version 2.6.21-1-amd64 (Debian 2.6.21-4~bpo.1) > > (nobse@backports.org) (gcc version 4.1.2 20061115 (prerelease) (Debian > > 4.1.1-21)) #1 SMP Tue Jun 5 07:43:32 UTC 2007 > > > > > > We plan to do a takeover so that the server which appears to have memory > > errors can be memtested. > > > > After the takeover we would like to make sure that the XFS filesystems > > are intact. Is it possible to do so without taking the filesystem > > completely offline? > > > > I thought about mounting read only and it might be the best choice > > available, but then it will *fail* write accesses. I would prefer if > > these are just stalled. > > > > I tried xfs_freeze -f on my laptop home directory, but then did not > > machine to get it check via xfs_check or xfs_repair -nd... is it possible > > at all? > > > > Ciao, > > When I last tried (and I don't think Barry has done anything to it to > change things) it wouldn't work. > However, I think it could/should be changed to make it work. I am wondering whether it would need to set an option at all. Shouldn't checking a filesystem that is not being written too be safe? So xfs_check and xfs_repair -n could just check whether fs is readonly or frozen and if so continue without requiring a special option? They can print the fact aka Checking a frozen filesystem or Checking a read only filesystem in the beginning tough. Only thing is the log itself... when that is not cleared upon a freeze or readonly mount, it might be a problem for xfs_check and xfs_repair -n. Ciao, -- Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90 From owner-xfs@oss.sgi.com Tue Jul 15 05:06:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 05:06:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6FC6FVB031899 for ; Tue, 15 Jul 2008 05:06:16 -0700 X-ASG-Debug-ID: 1216123638-790c02f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 28DBB2F18F1; Tue, 15 Jul 2008 05:07:19 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id EKsAadnsjDVfITQq; Tue, 15 Jul 2008 05:07:19 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6FC77Ng026133 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 15 Jul 2008 14:07:07 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6FC77rZ026130; Tue, 15 Jul 2008 14:07:07 +0200 Date: Tue, 15 Jul 2008 14:07:07 +0200 From: Christoph Hellwig To: Timothy Shimmin Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] kill vn_revalidate Subject: Re: [PATCH 3/3] kill vn_revalidate Message-ID: <20080715120707.GA24902@lst.de> References: <20080627154602.GC31476@lst.de> <20080705172110.GB7177@lst.de> <487C456D.3010509@sgi.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="G4iJoqBmSsgzjUCe" Content-Disposition: inline In-Reply-To: <487C456D.3010509@sgi.com> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216123641 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56116 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16912 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Tue, Jul 15, 2008 at 04:36:29PM +1000, Timothy Shimmin wrote: > * in xfs_setattr we now explicitly set for linux inode: > i_mode, i_uid, i_gid, i_atime, i_mtime, i_ctime > It looks like we didn't set i_atime in vn_revalidate previously. That was intentional because the VFS updates this one directly and we already must only update it from setattr. > This change looks weird: > > */ > > - iattr.ia_mask = XFS_AT_MODE; > > + iattr.ia_valid = ATTR_MODE; > > iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; > > I didn't think there was an ia_mask field - was this really > from another patch? Confused. That's because the previous patch did a botched bhv_vattr to iattr conversion and I only noticed this when compiling the second patch and accidentally fixed it there. I've updated both patches to correct this and attached them. --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xfs-simplify-xfs_setattr Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-15 13:37:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-15 13:37:28.000000000 +0200 @@ -2460,7 +2460,8 @@ xfs_dm_punch_hole( #endif error = xfs_change_file_space(ip, XFS_IOC_UNRESVSP, &bf, - (xfs_off_t)off, sys_cred, ATTR_DMI|ATTR_NOLOCK); + (xfs_off_t)off, sys_cred, + XFS_ATTR_DMI|XFS_ATTR_NOLOCK); /* * if punching to end of file, kill any blocks past EOF that @@ -2663,7 +2664,7 @@ xfs_dm_set_fileattr( dm_fileattr_t __user *statp) { dm_fileattr_t stat; - bhv_vattr_t vat; + struct iattr iattr; int error; /* Returns negative errors to DMAPI */ @@ -2674,52 +2675,52 @@ xfs_dm_set_fileattr( if (copy_from_user( &stat, statp, sizeof(stat))) return(-EFAULT); - vat.va_mask = 0; + iattr.ia_valid = 0; if (mask & DM_AT_MODE) { - vat.va_mask |= XFS_AT_MODE; - vat.va_mode = stat.fa_mode; + iattr.ia_valid |= ATTR_MODE; + iattr.ia_mode = stat.fa_mode; } if (mask & DM_AT_UID) { - vat.va_mask |= XFS_AT_UID; - vat.va_uid = stat.fa_uid; + iattr.ia_valid |= ATTR_UID; + iattr.ia_uid = stat.fa_uid; } if (mask & DM_AT_GID) { - vat.va_mask |= XFS_AT_GID; - vat.va_gid = stat.fa_gid; + iattr.ia_valid |= ATTR_GID; + iattr.ia_gid = stat.fa_gid; } if (mask & DM_AT_ATIME) { - vat.va_mask |= XFS_AT_ATIME; - vat.va_atime.tv_sec = stat.fa_atime; - vat.va_atime.tv_nsec = 0; + iattr.ia_valid |= ATTR_ATIME; + iattr.ia_atime.tv_sec = stat.fa_atime; + iattr.ia_atime.tv_nsec = 0; inode->i_atime.tv_sec = stat.fa_atime; } if (mask & DM_AT_MTIME) { - vat.va_mask |= XFS_AT_MTIME; - vat.va_mtime.tv_sec = stat.fa_mtime; - vat.va_mtime.tv_nsec = 0; + iattr.ia_valid |= ATTR_MTIME; + iattr.ia_mtime.tv_sec = stat.fa_mtime; + iattr.ia_mtime.tv_nsec = 0; } if (mask & DM_AT_CTIME) { - vat.va_mask |= XFS_AT_CTIME; - vat.va_ctime.tv_sec = stat.fa_ctime; - vat.va_ctime.tv_nsec = 0; + iattr.ia_valid |= ATTR_CTIME; + iattr.ia_ctime.tv_sec = stat.fa_ctime; + iattr.ia_ctime.tv_nsec = 0; } - /* DM_AT_DTIME only takes effect if DM_AT_CTIME is not specified. We - overload ctime to also act as dtime, i.e. DM_CONFIG_DTIME_OVERLOAD. - */ - + /* + * DM_AT_DTIME only takes effect if DM_AT_CTIME is not specified. We + * overload ctime to also act as dtime, i.e. DM_CONFIG_DTIME_OVERLOAD. + */ if ((mask & DM_AT_DTIME) && !(mask & DM_AT_CTIME)) { - vat.va_mask |= XFS_AT_CTIME; - vat.va_ctime.tv_sec = stat.fa_dtime; - vat.va_ctime.tv_nsec = 0; + iattr.ia_valid |= ATTR_CTIME; + iattr.ia_ctime.tv_sec = stat.fa_dtime; + iattr.ia_ctime.tv_nsec = 0; } if (mask & DM_AT_SIZE) { - vat.va_mask |= XFS_AT_SIZE; - vat.va_size = stat.fa_size; + iattr.ia_valid |= ATTR_SIZE; + iattr.ia_size = stat.fa_size; } - error = xfs_setattr(XFS_I(inode), &vat, ATTR_DMI, NULL); + error = xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); if (!error) vn_revalidate(vn_from_inode(inode)); /* update Linux inode flags */ return(-error); /* Return negative error to DMAPI */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-15 13:37:25.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-15 13:37:28.000000000 +0200 @@ -656,54 +656,20 @@ xfs_vn_getattr( STATIC int xfs_vn_setattr( struct dentry *dentry, - struct iattr *attr) + struct iattr *iattr) { struct inode *inode = dentry->d_inode; - unsigned int ia_valid = attr->ia_valid; - bhv_vattr_t vattr = { 0 }; - int flags = 0; int error; - if (ia_valid & ATTR_UID) { - vattr.va_mask |= XFS_AT_UID; - vattr.va_uid = attr->ia_uid; - } - if (ia_valid & ATTR_GID) { - vattr.va_mask |= XFS_AT_GID; - vattr.va_gid = attr->ia_gid; - } - if (ia_valid & ATTR_SIZE) { - vattr.va_mask |= XFS_AT_SIZE; - vattr.va_size = attr->ia_size; - } - if (ia_valid & ATTR_ATIME) { - vattr.va_mask |= XFS_AT_ATIME; - vattr.va_atime = attr->ia_atime; - inode->i_atime = attr->ia_atime; - } - if (ia_valid & ATTR_MTIME) { - vattr.va_mask |= XFS_AT_MTIME; - vattr.va_mtime = attr->ia_mtime; - } - if (ia_valid & ATTR_CTIME) { - vattr.va_mask |= XFS_AT_CTIME; - vattr.va_ctime = attr->ia_ctime; - } - if (ia_valid & ATTR_MODE) { - vattr.va_mask |= XFS_AT_MODE; - vattr.va_mode = attr->ia_mode; + if (iattr->ia_valid & ATTR_ATIME) + inode->i_atime = iattr->ia_atime; + + if (iattr->ia_valid & ATTR_MODE) { if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) inode->i_mode &= ~S_ISGID; } - if (ia_valid & (ATTR_MTIME_SET | ATTR_ATIME_SET)) - flags |= ATTR_UTIME; -#ifdef ATTR_NO_BLOCK - if ((ia_valid & ATTR_NO_BLOCK)) - flags |= ATTR_NONBLOCK; -#endif - - error = xfs_setattr(XFS_I(inode), &vattr, flags, NULL); + error = xfs_setattr(XFS_I(inode), iattr, 0, NULL); if (likely(!error)) vn_revalidate(vn_from_inode(inode)); return -error; @@ -747,18 +713,18 @@ xfs_vn_fallocate( xfs_ilock(ip, XFS_IOLOCK_EXCL); error = xfs_change_file_space(ip, XFS_IOC_RESVSP, &bf, - 0, NULL, ATTR_NOLOCK); + 0, NULL, XFS_ATTR_NOLOCK); if (!error && !(mode & FALLOC_FL_KEEP_SIZE) && offset + len > i_size_read(inode)) new_size = offset + len; /* Change file size if needed */ if (new_size) { - bhv_vattr_t va; + struct iattr iattr; - va.va_mask = XFS_AT_SIZE; - va.va_size = new_size; - error = xfs_setattr(ip, &va, ATTR_NOLOCK, NULL); + iattr.ia_valid = ATTR_SIZE; + iattr.ia_size = new_size; + error = xfs_setattr(ip, &iattr, XFS_ATTR_NOLOCK, NULL); } xfs_iunlock(ip, XFS_IOLOCK_EXCL); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-15 13:37:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-15 13:37:28.000000000 +0200 @@ -19,7 +19,6 @@ #define __XFS_VNODE_H__ struct file; -struct bhv_vattr; struct xfs_iomap; struct attrlist_cursor_kern; @@ -66,69 +65,6 @@ static inline struct inode *vn_to_inode( Prevent VM access to the pages until the operation completes. */ -/* - * Vnode attributes. va_mask indicates those attributes the caller - * wants to set or extract. - */ -typedef struct bhv_vattr { - int va_mask; /* bit-mask of attributes present */ - mode_t va_mode; /* file access mode and type */ - xfs_nlink_t va_nlink; /* number of references to file */ - uid_t va_uid; /* owner user id */ - gid_t va_gid; /* owner group id */ - xfs_ino_t va_nodeid; /* file id */ - xfs_off_t va_size; /* file size in bytes */ - u_long va_blocksize; /* blocksize preferred for i/o */ - struct timespec va_atime; /* time of last access */ - struct timespec va_mtime; /* time of last modification */ - struct timespec va_ctime; /* time file changed */ - u_int va_gen; /* generation number of file */ - xfs_dev_t va_rdev; /* device the special file represents */ - __int64_t va_nblocks; /* number of blocks allocated */ - u_long va_xflags; /* random extended file flags */ - u_long va_extsize; /* file extent size */ - u_long va_nextents; /* number of extents in file */ - u_long va_anextents; /* number of attr extents in file */ - prid_t va_projid; /* project id */ -} bhv_vattr_t; - -/* - * setattr or getattr attributes - */ -#define XFS_AT_TYPE 0x00000001 -#define XFS_AT_MODE 0x00000002 -#define XFS_AT_UID 0x00000004 -#define XFS_AT_GID 0x00000008 -#define XFS_AT_FSID 0x00000010 -#define XFS_AT_NODEID 0x00000020 -#define XFS_AT_NLINK 0x00000040 -#define XFS_AT_SIZE 0x00000080 -#define XFS_AT_ATIME 0x00000100 -#define XFS_AT_MTIME 0x00000200 -#define XFS_AT_CTIME 0x00000400 -#define XFS_AT_RDEV 0x00000800 -#define XFS_AT_BLKSIZE 0x00001000 -#define XFS_AT_NBLOCKS 0x00002000 -#define XFS_AT_VCODE 0x00004000 -#define XFS_AT_MAC 0x00008000 -#define XFS_AT_UPDATIME 0x00010000 -#define XFS_AT_UPDMTIME 0x00020000 -#define XFS_AT_UPDCTIME 0x00040000 -#define XFS_AT_ACL 0x00080000 -#define XFS_AT_CAP 0x00100000 -#define XFS_AT_INF 0x00200000 -#define XFS_AT_NEXTENTS 0x01000000 -#define XFS_AT_ANEXTENTS 0x02000000 -#define XFS_AT_SIZE_NOPERM 0x08000000 -#define XFS_AT_GENCOUNT 0x10000000 - -#define XFS_AT_TIMES (XFS_AT_ATIME|XFS_AT_MTIME|XFS_AT_CTIME) - -#define XFS_AT_UPDTIMES (XFS_AT_UPDATIME|XFS_AT_UPDMTIME|XFS_AT_UPDCTIME) - -#define XFS_AT_NOSET (XFS_AT_NLINK|XFS_AT_RDEV|XFS_AT_FSID|XFS_AT_NODEID|\ - XFS_AT_TYPE|XFS_AT_BLKSIZE|XFS_AT_NBLOCKS|XFS_AT_VCODE|\ - XFS_AT_NEXTENTS|XFS_AT_ANEXTENTS|XFS_AT_GENCOUNT) extern void vn_init(void); extern int vn_revalidate(bhv_vnode_t *); @@ -204,15 +140,6 @@ static inline void vn_atime_to_time_t(bh #define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \ PAGECACHE_TAG_DIRTY) -/* - * Flags to vop_setattr/getattr. - */ -#define ATTR_UTIME 0x01 /* non-default utime(2) request */ -#define ATTR_DMI 0x08 /* invocation from a DMI function */ -#define ATTR_LAZY 0x80 /* set/get attributes lazily */ -#define ATTR_NONBLOCK 0x100 /* return EAGAIN if operation would block */ -#define ATTR_NOLOCK 0x200 /* Don't grab any conflicting locks */ -#define ATTR_NOSIZETOK 0x400 /* Don't get the SIZE token */ /* * Tracking vnode activity. Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-15 13:37:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-15 13:37:28.000000000 +0200 @@ -75,19 +75,16 @@ xfs_open( return 0; } -/* - * xfs_setattr - */ int xfs_setattr( - xfs_inode_t *ip, - bhv_vattr_t *vap, + struct xfs_inode *ip, + struct iattr *iattr, int flags, cred_t *credp) { xfs_mount_t *mp = ip->i_mount; + int mask = iattr->ia_valid; xfs_trans_t *tp; - int mask; int code; uint lock_flags; uint commit_flags=0; @@ -103,30 +100,9 @@ xfs_setattr( if (mp->m_flags & XFS_MOUNT_RDONLY) return XFS_ERROR(EROFS); - /* - * Cannot set certain attributes. - */ - mask = vap->va_mask; - if (mask & XFS_AT_NOSET) { - return XFS_ERROR(EINVAL); - } - if (XFS_FORCED_SHUTDOWN(mp)) return XFS_ERROR(EIO); - /* - * Timestamps do not need to be logged and hence do not - * need to be done within a transaction. - */ - if (mask & XFS_AT_UPDTIMES) { - ASSERT((mask & ~XFS_AT_UPDTIMES) == 0); - timeflags = ((mask & XFS_AT_UPDATIME) ? XFS_ICHGTIME_ACC : 0) | - ((mask & XFS_AT_UPDCTIME) ? XFS_ICHGTIME_CHG : 0) | - ((mask & XFS_AT_UPDMTIME) ? XFS_ICHGTIME_MOD : 0); - xfs_ichgtime(ip, timeflags); - return 0; - } - olddquot1 = olddquot2 = NULL; udqp = gdqp = NULL; @@ -138,17 +114,17 @@ xfs_setattr( * If the IDs do change before we take the ilock, we're covered * because the i_*dquot fields will get updated anyway. */ - if (XFS_IS_QUOTA_ON(mp) && (mask & (XFS_AT_UID|XFS_AT_GID))) { + if (XFS_IS_QUOTA_ON(mp) && (mask & (ATTR_UID|ATTR_GID))) { uint qflags = 0; - if ((mask & XFS_AT_UID) && XFS_IS_UQUOTA_ON(mp)) { - uid = vap->va_uid; + if ((mask & ATTR_UID) && XFS_IS_UQUOTA_ON(mp)) { + uid = iattr->ia_uid; qflags |= XFS_QMOPT_UQUOTA; } else { uid = ip->i_d.di_uid; } - if ((mask & XFS_AT_GID) && XFS_IS_GQUOTA_ON(mp)) { - gid = vap->va_gid; + if ((mask & ATTR_GID) && XFS_IS_GQUOTA_ON(mp)) { + gid = iattr->ia_gid; qflags |= XFS_QMOPT_GQUOTA; } else { gid = ip->i_d.di_gid; @@ -173,10 +149,10 @@ xfs_setattr( */ tp = NULL; lock_flags = XFS_ILOCK_EXCL; - if (flags & ATTR_NOLOCK) + if (flags & XFS_ATTR_NOLOCK) need_iolock = 0; - if (!(mask & XFS_AT_SIZE)) { - if ((mask != (XFS_AT_CTIME|XFS_AT_ATIME|XFS_AT_MTIME)) || + if (!(mask & ATTR_SIZE)) { + if ((mask != (ATTR_CTIME|ATTR_ATIME|ATTR_MTIME)) || (mp->m_flags & XFS_MOUNT_WSYNC)) { tp = xfs_trans_alloc(mp, XFS_TRANS_SETATTR_NOT_SIZE); commit_flags = 0; @@ -189,10 +165,10 @@ xfs_setattr( } } else { if (DM_EVENT_ENABLED(ip, DM_EVENT_TRUNCATE) && - !(flags & ATTR_DMI)) { + !(flags & XFS_ATTR_DMI)) { int dmflags = AT_DELAY_FLAG(flags) | DM_SEM_FLAG_WR; code = XFS_SEND_DATA(mp, DM_EVENT_TRUNCATE, ip, - vap->va_size, 0, dmflags, NULL); + iattr->ia_size, 0, dmflags, NULL); if (code) { lock_flags = 0; goto error_return; @@ -212,7 +188,7 @@ xfs_setattr( * Only the owner or users with CAP_FOWNER * capability may do these things. */ - if (mask & (XFS_AT_MODE|XFS_AT_UID|XFS_AT_GID)) { + if (mask & (ATTR_MODE|ATTR_UID|ATTR_GID)) { /* * CAP_FOWNER overrides the following restrictions: * @@ -236,21 +212,21 @@ xfs_setattr( * IDs of the calling process shall match the group owner of * the file when setting the set-group-ID bit on that file */ - if (mask & XFS_AT_MODE) { + if (mask & ATTR_MODE) { mode_t m = 0; - if ((vap->va_mode & S_ISUID) && !file_owner) + if ((iattr->ia_mode & S_ISUID) && !file_owner) m |= S_ISUID; - if ((vap->va_mode & S_ISGID) && + if ((iattr->ia_mode & S_ISGID) && !in_group_p((gid_t)ip->i_d.di_gid)) m |= S_ISGID; #if 0 /* Linux allows this, Irix doesn't. */ - if ((vap->va_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode)) + if ((iattr->ia_mode & S_ISVTX) && !S_ISDIR(ip->i_d.di_mode)) m |= S_ISVTX; #endif if (m && !capable(CAP_FSETID)) - vap->va_mode &= ~m; + iattr->ia_mode &= ~m; } } @@ -261,7 +237,7 @@ xfs_setattr( * and can change the group id only to a group of which he * or she is a member. */ - if (mask & (XFS_AT_UID|XFS_AT_GID)) { + if (mask & (ATTR_UID|ATTR_GID)) { /* * These IDs could have changed since we last looked at them. * But, we're assured that if the ownership did change @@ -270,8 +246,8 @@ xfs_setattr( */ iuid = ip->i_d.di_uid; igid = ip->i_d.di_gid; - gid = (mask & XFS_AT_GID) ? vap->va_gid : igid; - uid = (mask & XFS_AT_UID) ? vap->va_uid : iuid; + gid = (mask & ATTR_GID) ? iattr->ia_gid : igid; + uid = (mask & ATTR_UID) ? iattr->ia_uid : iuid; /* * CAP_CHOWN overrides the following restrictions: @@ -308,13 +284,13 @@ xfs_setattr( /* * Truncate file. Must have write permission and not be a directory. */ - if (mask & XFS_AT_SIZE) { + if (mask & ATTR_SIZE) { /* Short circuit the truncate case for zero length files */ - if ((vap->va_size == 0) && - (ip->i_size == 0) && (ip->i_d.di_nextents == 0)) { + if (iattr->ia_size == 0 && + ip->i_size == 0 && ip->i_d.di_nextents == 0) { xfs_iunlock(ip, XFS_ILOCK_EXCL); lock_flags &= ~XFS_ILOCK_EXCL; - if (mask & XFS_AT_CTIME) + if (mask & ATTR_CTIME) xfs_ichgtime(ip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); code = 0; goto error_return; @@ -337,9 +313,9 @@ xfs_setattr( /* * Change file access or modified times. */ - if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) { + if (mask & (ATTR_ATIME|ATTR_MTIME)) { if (!file_owner) { - if ((flags & ATTR_UTIME) && + if ((mask & (ATTR_MTIME_SET|ATTR_ATIME_SET)) && !capable(CAP_FOWNER)) { code = XFS_ERROR(EPERM); goto error_return; @@ -349,23 +325,22 @@ xfs_setattr( /* * Now we can make the changes. Before we join the inode - * to the transaction, if XFS_AT_SIZE is set then take care of + * to the transaction, if ATTR_SIZE is set then take care of * the part of the truncation that must be done without the * inode lock. This needs to be done before joining the inode * to the transaction, because the inode cannot be unlocked * once it is a part of the transaction. */ - if (mask & XFS_AT_SIZE) { + if (mask & ATTR_SIZE) { code = 0; - if ((vap->va_size > ip->i_size) && - (flags & ATTR_NOSIZETOK) == 0) { + if (iattr->ia_size > ip->i_size) { /* * Do the first part of growing a file: zero any data * in the last block that is beyond the old EOF. We * need to do this before the inode is joined to the * transaction to modify the i_size. */ - code = xfs_zero_eof(ip, vap->va_size, ip->i_size); + code = xfs_zero_eof(ip, iattr->ia_size, ip->i_size); } xfs_iunlock(ip, XFS_ILOCK_EXCL); @@ -382,10 +357,10 @@ xfs_setattr( * not within the range we care about here. */ if (!code && - (ip->i_size != ip->i_d.di_size) && - (vap->va_size > ip->i_d.di_size)) { + ip->i_size != ip->i_d.di_size && + iattr->ia_size > ip->i_d.di_size) { code = xfs_flush_pages(ip, - ip->i_d.di_size, vap->va_size, + ip->i_d.di_size, iattr->ia_size, XFS_B_ASYNC, FI_NONE); } @@ -393,7 +368,7 @@ xfs_setattr( vn_iowait(ip); if (!code) - code = xfs_itruncate_data(ip, vap->va_size); + code = xfs_itruncate_data(ip, iattr->ia_size); if (code) { ASSERT(tp == NULL); lock_flags &= ~XFS_ILOCK_EXCL; @@ -422,31 +397,30 @@ xfs_setattr( /* * Truncate file. Must have write permission and not be a directory. */ - if (mask & XFS_AT_SIZE) { + if (mask & ATTR_SIZE) { /* * Only change the c/mtime if we are changing the size * or we are explicitly asked to change it. This handles * the semantic difference between truncate() and ftruncate() * as implemented in the VFS. */ - if (vap->va_size != ip->i_size || (mask & XFS_AT_CTIME)) + if (iattr->ia_size != ip->i_size || (mask & ATTR_CTIME)) timeflags |= XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG; - if (vap->va_size > ip->i_size) { - ip->i_d.di_size = vap->va_size; - ip->i_size = vap->va_size; - if (!(flags & ATTR_DMI)) + if (iattr->ia_size > ip->i_size) { + ip->i_d.di_size = iattr->ia_size; + ip->i_size = iattr->ia_size; + if (!(flags & XFS_ATTR_DMI)) xfs_ichgtime(ip, XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - } else if ((vap->va_size <= ip->i_size) || - ((vap->va_size == 0) && ip->i_d.di_nextents)) { + } else if (iattr->ia_size <= ip->i_size || + (iattr->ia_size == 0 && ip->i_d.di_nextents)) { /* * signal a sync transaction unless * we're truncating an already unlinked * file on a wsync filesystem */ - code = xfs_itruncate_finish(&tp, ip, - (xfs_fsize_t)vap->va_size, + code = xfs_itruncate_finish(&tp, ip, iattr->ia_size, XFS_DATA_FORK, ((ip->i_d.di_nlink != 0 || !(mp->m_flags & XFS_MOUNT_WSYNC)) @@ -468,9 +442,9 @@ xfs_setattr( /* * Change file access modes. */ - if (mask & XFS_AT_MODE) { + if (mask & ATTR_MODE) { ip->i_d.di_mode &= S_IFMT; - ip->i_d.di_mode |= vap->va_mode & ~S_IFMT; + ip->i_d.di_mode |= iattr->ia_mode & ~S_IFMT; xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); timeflags |= XFS_ICHGTIME_CHG; @@ -483,7 +457,7 @@ xfs_setattr( * and can change the group id only to a group of which he * or she is a member. */ - if (mask & (XFS_AT_UID|XFS_AT_GID)) { + if (mask & (ATTR_UID|ATTR_GID)) { /* * CAP_FSETID overrides the following restrictions: * @@ -501,7 +475,7 @@ xfs_setattr( */ if (iuid != uid) { if (XFS_IS_UQUOTA_ON(mp)) { - ASSERT(mask & XFS_AT_UID); + ASSERT(mask & ATTR_UID); ASSERT(udqp); olddquot1 = XFS_QM_DQVOPCHOWN(mp, tp, ip, &ip->i_udquot, udqp); @@ -511,7 +485,7 @@ xfs_setattr( if (igid != gid) { if (XFS_IS_GQUOTA_ON(mp)) { ASSERT(!XFS_IS_PQUOTA_ON(mp)); - ASSERT(mask & XFS_AT_GID); + ASSERT(mask & ATTR_GID); ASSERT(gdqp); olddquot2 = XFS_QM_DQVOPCHOWN(mp, tp, ip, &ip->i_gdquot, gdqp); @@ -527,31 +501,31 @@ xfs_setattr( /* * Change file access or modified times. */ - if (mask & (XFS_AT_ATIME|XFS_AT_MTIME)) { - if (mask & XFS_AT_ATIME) { - ip->i_d.di_atime.t_sec = vap->va_atime.tv_sec; - ip->i_d.di_atime.t_nsec = vap->va_atime.tv_nsec; + if (mask & (ATTR_ATIME|ATTR_MTIME)) { + if (mask & ATTR_ATIME) { + ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; + ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; ip->i_update_core = 1; timeflags &= ~XFS_ICHGTIME_ACC; } - if (mask & XFS_AT_MTIME) { - ip->i_d.di_mtime.t_sec = vap->va_mtime.tv_sec; - ip->i_d.di_mtime.t_nsec = vap->va_mtime.tv_nsec; + if (mask & ATTR_MTIME) { + ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; + ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; timeflags &= ~XFS_ICHGTIME_MOD; timeflags |= XFS_ICHGTIME_CHG; } - if (tp && (flags & ATTR_UTIME)) + if (tp && (mask & (ATTR_MTIME_SET|ATTR_ATIME_SET))) xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); } /* - * Change file inode change time only if XFS_AT_CTIME set + * Change file inode change time only if ATTR_CTIME set * AND we have been called by a DMI function. */ - if ( (flags & ATTR_DMI) && (mask & XFS_AT_CTIME) ) { - ip->i_d.di_ctime.t_sec = vap->va_ctime.tv_sec; - ip->i_d.di_ctime.t_nsec = vap->va_ctime.tv_nsec; + if ((flags & XFS_ATTR_DMI) && (mask & ATTR_CTIME)) { + ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; + ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; ip->i_update_core = 1; timeflags &= ~XFS_ICHGTIME_CHG; } @@ -560,7 +534,7 @@ xfs_setattr( * Send out timestamp changes that need to be set to the * current time. Not done when called by a DMI function. */ - if (timeflags && !(flags & ATTR_DMI)) + if (timeflags && !(flags & XFS_ATTR_DMI)) xfs_ichgtime(ip, timeflags); XFS_STATS_INC(xs_ig_attrchg); @@ -598,7 +572,7 @@ xfs_setattr( } if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && - !(flags & ATTR_DMI)) { + !(flags & XFS_ATTR_DMI)) { (void) XFS_SEND_NAMESP(mp, DM_EVENT_ATTRIBUTE, ip, DM_RIGHT_NULL, NULL, DM_RIGHT_NULL, NULL, NULL, 0, 0, AT_DELAY_FLAG(flags)); @@ -3033,7 +3007,7 @@ xfs_alloc_file_space( /* Generate a DMAPI event if needed. */ if (alloc_type != 0 && offset < ip->i_size && - (attr_flags&ATTR_DMI) == 0 && + (attr_flags & XFS_ATTR_DMI) == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { xfs_off_t end_dmi_offset; @@ -3147,7 +3121,7 @@ retry: allocatesize_fsb -= allocated_fsb; } dmapi_enospc_check: - if (error == ENOSPC && (attr_flags & ATTR_DMI) == 0 && + if (error == ENOSPC && (attr_flags & XFS_ATTR_DMI) == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_NOSPACE)) { error = XFS_SEND_NAMESP(mp, DM_EVENT_NOSPACE, ip, DM_RIGHT_NULL, @@ -3294,7 +3268,7 @@ xfs_free_file_space( end_dmi_offset = offset + len; endoffset_fsb = XFS_B_TO_FSBT(mp, end_dmi_offset); - if (offset < ip->i_size && (attr_flags & ATTR_DMI) == 0 && + if (offset < ip->i_size && (attr_flags & XFS_ATTR_DMI) == 0 && DM_EVENT_ENABLED(ip, DM_EVENT_WRITE)) { if (end_dmi_offset > ip->i_size) end_dmi_offset = ip->i_size; @@ -3305,7 +3279,7 @@ xfs_free_file_space( return error; } - if (attr_flags & ATTR_NOLOCK) + if (attr_flags & XFS_ATTR_NOLOCK) need_iolock = 0; if (need_iolock) { xfs_ilock(ip, XFS_IOLOCK_EXCL); @@ -3482,7 +3456,7 @@ xfs_change_file_space( xfs_off_t startoffset; xfs_off_t llen; xfs_trans_t *tp; - bhv_vattr_t va; + struct iattr iattr; xfs_itrace_entry(ip); @@ -3556,10 +3530,10 @@ xfs_change_file_space( break; } - va.va_mask = XFS_AT_SIZE; - va.va_size = startoffset; + iattr.ia_valid = ATTR_SIZE; + iattr.ia_size = startoffset; - error = xfs_setattr(ip, &va, attr_flags, credp); + error = xfs_setattr(ip, &iattr, attr_flags, credp); if (error) return error; @@ -3589,7 +3563,7 @@ xfs_change_file_space( xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_ihold(tp, ip); - if ((attr_flags & ATTR_DMI) == 0) { + if ((attr_flags & XFS_ATTR_DMI) == 0) { ip->i_d.di_mode &= ~S_ISUID; /* Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2008-07-15 13:37:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2008-07-15 13:37:28.000000000 +0200 @@ -2,9 +2,9 @@ #define _XFS_VNODEOPS_H 1 struct attrlist_cursor_kern; -struct bhv_vattr; struct cred; struct file; +struct iattr; struct inode; struct iovec; struct kiocb; @@ -15,8 +15,12 @@ struct xfs_iomap; int xfs_open(struct xfs_inode *ip); -int xfs_setattr(struct xfs_inode *ip, struct bhv_vattr *vap, int flags, +int xfs_setattr(struct xfs_inode *ip, struct iattr *vap, int flags, struct cred *credp); +#define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */ +#define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */ +#define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */ + int xfs_readlink(struct xfs_inode *ip, char *link); int xfs_fsync(struct xfs_inode *ip); int xfs_release(struct xfs_inode *ip); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-15 13:37:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-15 13:37:28.000000000 +0200 @@ -685,9 +685,9 @@ xfs_ioc_space( return -XFS_ERROR(EFAULT); if (filp->f_flags & (O_NDELAY|O_NONBLOCK)) - attr_flags |= ATTR_NONBLOCK; + attr_flags |= XFS_ATTR_NONBLOCK; if (ioflags & IO_INVIS) - attr_flags |= ATTR_DMI; + attr_flags |= XFS_ATTR_DMI; error = xfs_change_file_space(ip, cmd, &bf, filp->f_pos, NULL, attr_flags); Index: linux-2.6-xfs/fs/xfs/xfs_dmapi.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dmapi.h 2008-07-15 13:37:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dmapi.h 2008-07-15 13:37:28.000000000 +0200 @@ -166,6 +166,6 @@ typedef enum { #define FILP_DELAY_FLAG(filp) ((filp->f_flags&(O_NDELAY|O_NONBLOCK)) ? \ DM_FLAGS_NDELAY : 0) -#define AT_DELAY_FLAG(f) ((f&ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) +#define AT_DELAY_FLAG(f) ((f & XFS_ATTR_NONBLOCK) ? DM_FLAGS_NDELAY : 0) #endif /* __XFS_DMAPI_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_acl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-15 13:37:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-15 13:37:58.000000000 +0200 @@ -720,7 +720,7 @@ xfs_acl_setmode( xfs_acl_t *acl, int *basicperms) { - bhv_vattr_t va; + struct iattr iattr; xfs_acl_entry_t *ap; xfs_acl_entry_t *gap = NULL; int i, nomask = 1; @@ -734,25 +734,25 @@ xfs_acl_setmode( * Copy the u::, g::, o::, and m:: bits from the ACL into the * mode. The m:: bits take precedence over the g:: bits. */ - va.va_mask = XFS_AT_MODE; - va.va_mode = xfs_vtoi(vp)->i_d.di_mode; - va.va_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); + iattr.ia_valid = ATTR_MODE; + iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; + iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); ap = acl->acl_entry; for (i = 0; i < acl->acl_cnt; ++i) { switch (ap->ae_tag) { case ACL_USER_OBJ: - va.va_mode |= ap->ae_perm << 6; + iattr.ia_mode |= ap->ae_perm << 6; break; case ACL_GROUP_OBJ: gap = ap; break; case ACL_MASK: /* more than just standard modes */ nomask = 0; - va.va_mode |= ap->ae_perm << 3; + iattr.ia_mode |= ap->ae_perm << 3; *basicperms = 0; break; case ACL_OTHER: - va.va_mode |= ap->ae_perm; + iattr.ia_mode |= ap->ae_perm; break; default: /* more than just standard modes */ *basicperms = 0; @@ -763,9 +763,9 @@ xfs_acl_setmode( /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */ if (gap && nomask) - va.va_mode |= gap->ae_perm << 3; + iattr.ia_mode |= gap->ae_perm << 3; - return xfs_setattr(xfs_vtoi(vp), &va, 0, sys_cred); + return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred); } /* --G4iJoqBmSsgzjUCe Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=xfs-kill-vn_revalidate Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-15 13:37:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-15 13:39:08.000000000 +0200 @@ -2665,7 +2665,6 @@ xfs_dm_set_fileattr( { dm_fileattr_t stat; struct iattr iattr; - int error; /* Returns negative errors to DMAPI */ @@ -2720,10 +2719,7 @@ xfs_dm_set_fileattr( iattr.ia_size = stat.fa_size; } - error = xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); - if (!error) - vn_revalidate(vn_from_inode(inode)); /* update Linux inode flags */ - return(-error); /* Return negative error to DMAPI */ + return -xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_DMI, NULL); } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-15 13:37:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-15 13:39:08.000000000 +0200 @@ -920,6 +920,30 @@ xfs_set_diflags( ip->i_d.di_flags = di_flags; } +STATIC void +xfs_diflags_to_linux( + struct xfs_inode *ip) +{ + struct inode *inode = XFS_ITOV(ip); + unsigned int xflags = xfs_ip2xflags(ip); + + if (xflags & XFS_XFLAG_IMMUTABLE) + inode->i_flags |= S_IMMUTABLE; + else + inode->i_flags &= ~S_IMMUTABLE; + if (xflags & XFS_XFLAG_APPEND) + inode->i_flags |= S_APPEND; + else + inode->i_flags &= ~S_APPEND; + if (xflags & XFS_XFLAG_SYNC) + inode->i_flags |= S_SYNC; + else + inode->i_flags &= ~S_SYNC; + if (xflags & XFS_XFLAG_NOATIME) + inode->i_flags |= S_NOATIME; + else + inode->i_flags &= ~S_NOATIME; +} #define FSX_PROJID 1 #define FSX_EXTSIZE 2 @@ -1118,8 +1142,10 @@ xfs_ioctl_setattr( if (mask & FSX_EXTSIZE) ip->i_d.di_extsize = fa->fsx_extsize >> mp->m_sb.sb_blocklog; - if (mask & FSX_XFLAGS) + if (mask & FSX_XFLAGS) { xfs_set_diflags(ip, fa->fsx_xflags); + xfs_diflags_to_linux(ip); + } xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); xfs_ichgtime(ip, XFS_ICHGTIME_CHG); @@ -1157,7 +1183,6 @@ xfs_ioctl_setattr( (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); } - vn_revalidate(XFS_ITOV(ip)); /* update flags */ return 0; error_return: Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-15 13:37:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-15 13:39:08.000000000 +0200 @@ -658,21 +658,7 @@ xfs_vn_setattr( struct dentry *dentry, struct iattr *iattr) { - struct inode *inode = dentry->d_inode; - int error; - - if (iattr->ia_valid & ATTR_ATIME) - inode->i_atime = iattr->ia_atime; - - if (iattr->ia_valid & ATTR_MODE) { - if (!in_group_p(inode->i_gid) && !capable(CAP_FSETID)) - inode->i_mode &= ~S_ISGID; - } - - error = xfs_setattr(XFS_I(inode), iattr, 0, NULL); - if (likely(!error)) - vn_revalidate(vn_from_inode(inode)); - return -error; + return -xfs_setattr(XFS_I(dentry->d_inode), iattr, 0, NULL); } /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-15 13:37:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-15 13:39:08.000000000 +0200 @@ -177,7 +177,6 @@ EXPORT_SYMBOL(uuid_hash64); EXPORT_SYMBOL(uuid_is_nil); EXPORT_SYMBOL(uuid_table_remove); EXPORT_SYMBOL(vn_hold); -EXPORT_SYMBOL(vn_revalidate); #if defined(CONFIG_XFS_POSIX_ACL) EXPORT_SYMBOL(xfs_acl_vtoacl); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-15 13:37:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-15 13:39:08.000000000 +0200 @@ -82,56 +82,6 @@ vn_ioerror( xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l); } -/* - * Revalidate the Linux inode from the XFS inode. - * Note: i_size _not_ updated; we must hold the inode - * semaphore when doing that - callers responsibility. - */ -int -vn_revalidate( - bhv_vnode_t *vp) -{ - struct inode *inode = vn_to_inode(vp); - struct xfs_inode *ip = XFS_I(inode); - struct xfs_mount *mp = ip->i_mount; - unsigned long xflags; - - xfs_itrace_entry(ip); - - if (XFS_FORCED_SHUTDOWN(mp)) - return -EIO; - - xfs_ilock(ip, XFS_ILOCK_SHARED); - inode->i_mode = ip->i_d.di_mode; - inode->i_uid = ip->i_d.di_uid; - inode->i_gid = ip->i_d.di_gid; - inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; - inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; - inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; - inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; - - xflags = xfs_ip2xflags(ip); - if (xflags & XFS_XFLAG_IMMUTABLE) - inode->i_flags |= S_IMMUTABLE; - else - inode->i_flags &= ~S_IMMUTABLE; - if (xflags & XFS_XFLAG_APPEND) - inode->i_flags |= S_APPEND; - else - inode->i_flags &= ~S_APPEND; - if (xflags & XFS_XFLAG_SYNC) - inode->i_flags |= S_SYNC; - else - inode->i_flags &= ~S_SYNC; - if (xflags & XFS_XFLAG_NOATIME) - inode->i_flags |= S_NOATIME; - else - inode->i_flags &= ~S_NOATIME; - xfs_iunlock(ip, XFS_ILOCK_SHARED); - - xfs_iflags_clear(ip, XFS_IMODIFIED); - return 0; -} /* * Add a reference to a referenced vnode. Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-15 13:37:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-15 13:39:08.000000000 +0200 @@ -67,7 +67,6 @@ static inline struct inode *vn_to_inode( extern void vn_init(void); -extern int vn_revalidate(bhv_vnode_t *); /* * Yeah, these don't take vnode anymore at all, all this should be Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-15 13:37:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-15 13:39:08.000000000 +0200 @@ -83,6 +83,7 @@ xfs_setattr( cred_t *credp) { xfs_mount_t *mp = ip->i_mount; + struct inode *inode = XFS_ITOV(ip); int mask = iattr->ia_valid; xfs_trans_t *tp; int code; @@ -446,6 +447,9 @@ xfs_setattr( ip->i_d.di_mode &= S_IFMT; ip->i_d.di_mode |= iattr->ia_mode & ~S_IFMT; + inode->i_mode &= S_IFMT; + inode->i_mode |= iattr->ia_mode & ~S_IFMT; + xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); timeflags |= XFS_ICHGTIME_CHG; } @@ -481,6 +485,7 @@ xfs_setattr( &ip->i_udquot, udqp); } ip->i_d.di_uid = uid; + inode->i_uid = uid; } if (igid != gid) { if (XFS_IS_GQUOTA_ON(mp)) { @@ -491,6 +496,7 @@ xfs_setattr( &ip->i_gdquot, gdqp); } ip->i_d.di_gid = gid; + inode->i_gid = gid; } xfs_trans_log_inode (tp, ip, XFS_ILOG_CORE); @@ -503,12 +509,14 @@ xfs_setattr( */ if (mask & (ATTR_ATIME|ATTR_MTIME)) { if (mask & ATTR_ATIME) { + inode->i_atime = iattr->ia_atime; ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; ip->i_update_core = 1; timeflags &= ~XFS_ICHGTIME_ACC; } if (mask & ATTR_MTIME) { + inode->i_mtime = iattr->ia_mtime; ip->i_d.di_mtime.t_sec = iattr->ia_mtime.tv_sec; ip->i_d.di_mtime.t_nsec = iattr->ia_mtime.tv_nsec; timeflags &= ~XFS_ICHGTIME_MOD; @@ -524,6 +532,7 @@ xfs_setattr( */ if ((flags & XFS_ATTR_DMI) && (mask & ATTR_CTIME)) { + inode->i_ctime = iattr->ia_ctime; ip->i_d.di_ctime.t_sec = iattr->ia_ctime.tv_sec; ip->i_d.di_ctime.t_nsec = iattr->ia_ctime.tv_nsec; ip->i_update_core = 1; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-15 13:37:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-15 13:39:08.000000000 +0200 @@ -64,7 +64,7 @@ static int xfs_xattr_system_set(struct inode *inode, const char *name, const void *value, size_t size, int flags) { - int error, acl; + int acl; acl = xfs_decode_acl(name); if (acl < 0) @@ -75,10 +75,7 @@ xfs_xattr_system_set(struct inode *inode if (!value) return xfs_acl_vremove(inode, acl); - error = xfs_acl_vset(inode, (void *)value, size, acl); - if (!error) - vn_revalidate(inode); - return error; + return xfs_acl_vset(inode, (void *)value, size, acl); } static struct xattr_handler xfs_xattr_system_handler = { --G4iJoqBmSsgzjUCe-- From owner-xfs@oss.sgi.com Tue Jul 15 05:21:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 05:21:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6FCLk2f000833 for ; Tue, 15 Jul 2008 05:21:46 -0700 X-ASG-Debug-ID: 1216124573-603503110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EF01612E47BF; Tue, 15 Jul 2008 05:22:53 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id dClRQifMYCbAOIiQ; Tue, 15 Jul 2008 05:22:53 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KIjYQ-0003kz-5C; Tue, 15 Jul 2008 12:22:50 +0000 Date: Tue, 15 Jul 2008 08:22:50 -0400 From: Christoph Hellwig To: Nick Piggin Cc: Dave Chinner , Lachlan McIlroy , Mikael Abrahamsson , linux-kernel@vger.kernel.org, xfs@oss.sgi.com, linux-mm@kvack.org X-ASG-Orig-Subj: Re: xfs bug in 2.6.26-rc9 Subject: Re: xfs bug in 2.6.26-rc9 Message-ID: <20080715122250.GA15744@infradead.org> References: <487B019B.9090401@sgi.com> <20080714121332.GX29319@disturbed> <200807151617.58329.nickpiggin@yahoo.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200807151617.58329.nickpiggin@yahoo.com.au> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216124573 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56117 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16913 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs > It would be easily possible to do, yes. What happened to your plans to merge ->nopfn into ->fault? Beeing able to restart page based faults would be a logical fallout from that. From owner-xfs@oss.sgi.com Tue Jul 15 07:41:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 07:41:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6FEfi7g010401 for ; Tue, 15 Jul 2008 07:41:44 -0700 X-ASG-Debug-ID: 1216132970-76d003db0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from lucidpixels.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B19EE18D085D for ; Tue, 15 Jul 2008 07:42:51 -0700 (PDT) Received: from lucidpixels.com (lucidpixels.com [75.144.35.66]) by cuda.sgi.com with ESMTP id AebFe8EBiAaOxaWg for ; Tue, 15 Jul 2008 07:42:51 -0700 (PDT) Received: by lucidpixels.com (Postfix, from userid 1001) id B90FF32869; Tue, 15 Jul 2008 10:42:50 -0400 (EDT) Date: Tue, 15 Jul 2008 10:42:50 -0400 (EDT) From: Justin Piszcz To: Ben Martin cc: linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Benchmarks: Linux Kernel RAID vs a Hardware RAID setup Subject: Re: Benchmarks: Linux Kernel RAID vs a Hardware RAID setup In-Reply-To: <1216130769.5633.318.camel@sam.localdomain> Message-ID: References: <1216130769.5633.318.camel@sam.localdomain> User-Agent: Alpine 1.10 (DEB 962 2008-03-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Barracuda-Connect: lucidpixels.com[75.144.35.66] X-Barracuda-Start-Time: 1216132971 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56126 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16914 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: jpiszcz@lucidpixels.com Precedence: bulk X-list: xfs What were the commands used when creating the XFS filesystem (sunit,swidth)? Justin. On Wed, 16 Jul 2008, Ben Martin wrote: > Hi, > Apologies if posting this here is inappropriate but a recent article > of mine compares the Linux Kernel RAID code to an $800 hardware RAID > card and might be of interest to list members: > > http://www.linux.com/feature/140734 > > From owner-xfs@oss.sgi.com Tue Jul 15 08:26:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 08:26:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6FFQXbC018968 for ; Tue, 15 Jul 2008 08:26:34 -0700 X-ASG-Debug-ID: 1216135660-5c61029c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AD01312E52E3 for ; Tue, 15 Jul 2008 08:27:41 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 4j4OssHfxlbOrVOR for ; Tue, 15 Jul 2008 08:27:41 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 5E217AC3592; Tue, 15 Jul 2008 10:27:40 -0500 (CDT) Message-ID: <487CC1EB.6030100@sandeen.net> Date: Tue, 15 Jul 2008 10:27:39 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Martin Steigerwald CC: Timothy Shimmin , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Is it possible the check an frozen XFS filesytem to avoid downtime Subject: Re: Is it possible the check an frozen XFS filesytem to avoid downtime References: <200807141542.51613.ms@teamix.de> <487C1BAF.2030404@sgi.com> <200807150944.13277.ms@teamix.de> In-Reply-To: <200807150944.13277.ms@teamix.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216135661 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56129 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16915 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Martin Steigerwald wrote: > Okay... we recommended the customer to do it the safe way unmounting the > filesystem completely. He did and the filesystem appear to be intact *phew*. > XFS appeared to detect the in memory corruption early enough. > > Its a bit strange however, cause we now know that the server sports ECC RAM. > Well we will see what memtest86+ has to say about it. in-memory corruption could mean, but certainly does not absolutely mean, problematic memory. It could be, and usually is, a plain ol' bug (in xfs or elsewhere). -Eric From owner-xfs@oss.sgi.com Tue Jul 15 19:17:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 19:18:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=AWL,BAYES_20,HTML_MESSAGE, J_CHICKENPOX_12,J_CHICKENPOX_21,J_CHICKENPOX_56,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6G2HZM5010798 for ; Tue, 15 Jul 2008 19:17:38 -0700 X-ASG-Debug-ID: 1216174717-449000280000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rsbne02.RSBNE.LOCAL (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8D48018D9E10 for ; Tue, 15 Jul 2008 19:18:38 -0700 (PDT) Received: from rsbne02.RSBNE.LOCAL (robert87.lnk.telstra.net [203.45.17.90]) by cuda.sgi.com with ESMTP id 8FqwLCPnv7zYHQkW for ; Tue, 15 Jul 2008 19:18:38 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 X-ASG-Orig-Subj: Power loss causes bad magic number?? Subject: Power loss causes bad magic number?? Date: Wed, 16 Jul 2008 12:18:35 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Power loss causes bad magic number?? Thread-Index: Acjm6kAQk24GruXsSbqwAB9n89wwaw== From: "Stephen Porter" To: X-Barracuda-Connect: robert87.lnk.telstra.net[203.45.17.90] X-Barracuda-Start-Time: 1216174722 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3107 1.0000 -0.3033 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B, HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56171 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 3437 X-archive-position: 16916 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: stephenp@r-s.com.au Precedence: bulk X-list: xfs Hello, Hoping someone may be able to offer some advice/assistance. I lost power twice (within a few hours) to my machine which had a ~2.2TB XFS volume on it. The first time the machine (running Xubuntu 8.04) came back up ok, the second time the XFS volume will not mount. Is there any chance of recovering the data? /dev/sdc is seen by xubuntu as one ~2.2TB disk, and I put the XFS file system straight onto the disk. It's 4x750GB drives on a hardware raid controller (rocketraid 2320). Driver/module for rocket raid (rr232x) is loaded ok. In the system log I see: XFS: bad magic number XFS: SB validate failed I tried running xfs_check, the result of this was: xfs_check /dev/sdc xfs_check: unexpected XFS SB magic number 0x33c08ed0 xfs_check: size check failed xfs_check: read failed: Invalid argument xfs_check: data size check failed xfs_check: failed to alloc -225176656 bytes: Cannot allocate memory I looked at running xfs_repair, but the man page states that this will only work on a volume that has been unmounted cleanly... as I lost power the volume has not been unmounted cleanly, but I cannot mount it again to unmount it cleanly. Running xfs_repair gives the following: xfs_repair -n /dev/sdc Phase 1 - find and verify superblock... bad primary superblock - bad magic number !!! ...attempting to find secondary superblock... ...found candidate secondary superblock... unable to verify superblock, continuing... (the above appears a few times, until finally) ...Sorry, could not find valid secondary superblock Exiting now. I've seen it mentioned in other posts to the xfs archive to check that there is an xfs volume there, so I've also included the output of "dd if=/dev/sdc bs=512 count=1 iflag=direct 2> /dev/null | od -Ax -x" below: $ dd if=/dev/sdc bs=512 count=1 iflag=direct 2> /dev/null | od -Ax -x 000000 c033 d08e 00bc fb7c 0750 1f50 befc 7c1b 000010 1bbf 5006 b957 01e5 a4f3 bdcb 07be 04b1 000020 6e38 7c00 7509 8313 10c5 f4e2 18cd f58b 000030 c683 4910 1974 2c38 f674 b5a0 b407 8b07 000040 acf0 003c fc74 07bb b400 cd0e eb10 88f2 000050 104e 46e8 7300 fe2a 1046 7e80 0b04 0b74 000060 7e80 0c04 0574 b6a0 7507 80d2 0246 8306 000070 0846 8306 0a56 e800 0021 0573 b6a0 eb07 000080 81bc fe3e 557d 74aa 800b 107e 7400 a0c8 000090 07b7 a9eb fc8b 571e f58b bfcb 0005 568a 0000a0 b400 cd08 7213 8a23 24c1 983f de8a fc8a 0000b0 f743 8be3 86d1 b1d6 d206 42ee e2f7 5639 0000c0 770a 7223 3905 0846 1c73 01b8 bb02 7c00 0000d0 4e8b 8b02 0056 13cd 5173 744f 324e 8ae4 0000e0 0056 13cd e4eb 568a 6000 aabb b455 cd41 0000f0 7213 8136 55fb 75aa f630 01c1 2b74 6061 000100 006a 006a 76ff ff0a 0876 006a 0068 6a7c 000110 6a01 b410 8b42 cdf4 6113 7361 4f0e 0b74 000120 e432 568a cd00 eb13 61d6 c3f9 6e49 6176 000130 696c 2064 6170 7472 7469 6f69 206e 6174 000140 6c62 0065 7245 6f72 2072 6f6c 6461 6e69 000150 2067 706f 7265 7461 6e69 2067 7973 7473 000160 6d65 4d00 7369 6973 676e 6f20 6570 6172 000170 6974 676e 7320 7379 6574 006d 0000 0000 000180 0000 0000 0000 0000 0000 0000 0000 0000 * 0001b0 0000 0000 2c00 6344 089d 089e 0000 0100 0001c0 0001 fefd 3c3f 003f 0000 f3be 000e 0000 0001d0 3d01 fefd ffff f3fd 000e cbe5 0e40 0000 0001e0 0000 0000 0000 0000 0000 0000 0000 0000 0001f0 0000 0000 0000 0000 0000 0000 0000 aa55 000200 Any help greatly appreciated. Thanks, Stephen [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Jul 15 19:38:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 19:38:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21, J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6G2ctap012031 for ; Tue, 15 Jul 2008 19:38:55 -0700 X-ASG-Debug-ID: 1216176002-5e7a00050000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0630AE28C74 for ; Tue, 15 Jul 2008 19:40:02 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id Jp7wkW3YmNvSMGDH for ; Tue, 15 Jul 2008 19:40:02 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 637A6AC3592; Tue, 15 Jul 2008 21:40:01 -0500 (CDT) Message-ID: <487D5F80.1050909@sandeen.net> Date: Tue, 15 Jul 2008 21:40:00 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Stephen Porter CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Power loss causes bad magic number?? Subject: Re: Power loss causes bad magic number?? References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216176003 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56175 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16917 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Stephen Porter wrote: > Hello, > > Hoping someone may be able to offer some advice/assistance. > > I lost power twice (within a few hours) to my machine which had a ~2.2TB > XFS volume on it. The first time the machine (running Xubuntu 8.04) > came back up ok, the second time the XFS volume will not mount. Is > there any chance of recovering the data? /dev/sdc is seen by xubuntu as > one ~2.2TB disk, and I put the XFS file system straight onto the disk. > It's 4x750GB drives on a hardware raid controller (rocketraid 2320). > Driver/module for rocket raid (rr232x) is loaded ok. hm, not an in-kernel driver, I guess? > In the system log I see: > > XFS: bad magic number > > XFS: SB validate failed > > I tried running xfs_check, the result of this was: > > xfs_check /dev/sdc > xfs_check: unexpected XFS SB magic number 0x33c08ed0 > xfs_check: size check failed > xfs_check: read failed: Invalid argument > xfs_check: data size check failed > xfs_check: failed to alloc -225176656 bytes: Cannot allocate memory > > I looked at running xfs_repair, but the man page states that this will > only work on a volume that has been unmounted cleanly... as I lost power > the volume has not been unmounted cleanly, but I cannot mount it again > to unmount it cleanly. If you have to, you can zero the log w/ xfs_repair as a last resort. > Running xfs_repair gives the following: > > xfs_repair -n /dev/sdc > > Phase 1 - find and verify superblock... > > bad primary superblock - bad magic number !!! > > ...attempting to find secondary superblock... > > ...found candidate secondary superblock... unable to verify superblock, > continuing... I always wished it said where, and why it did not verify.... > (the above appears a few times, until finally) > > ...Sorry, could not find valid secondary superblock > > Exiting now. > > I've seen it mentioned in other posts to the xfs archive to check that > there is an xfs volume there, so I've also included the output of "dd > if=/dev/sdc bs=512 count=1 iflag=direct 2> /dev/null | od -Ax -x" below: > > $ dd if=/dev/sdc bs=512 count=1 iflag=direct 2> /dev/null | od -Ax -x > > 000000 c033 d08e 00bc fb7c 0750 1f50 befc 7c1b > 000010 1bbf 5006 b957 01e5 a4f3 bdcb 07be 04b1 Can you try piping it through "hexdump -C" instead, I'm more used to eyeballing that output :) You might also try looking a bit further: dd if=/dev/sdc bs=512 count=128 iflag=direct | hexdump -C | grep XFSB to see if maybe the raid card does something else at the front of your disk and the superblock is further in, and something got scrambled up? Just a longshot.... -Eric From owner-xfs@oss.sgi.com Tue Jul 15 21:13:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 15 Jul 2008 21:13:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_43, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6G4DIfd022356 for ; Tue, 15 Jul 2008 21:13:19 -0700 X-ASG-Debug-ID: 1216181664-6e6701510000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from hosted05.westnet.com.au (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4900D18DA483 for ; Tue, 15 Jul 2008 21:14:25 -0700 (PDT) Received: from hosted05.westnet.com.au (hosted05.westnet.com.au [203.10.1.219]) by cuda.sgi.com with ESMTP id WYkNppth0mz7yA2Z for ; Tue, 15 Jul 2008 21:14:25 -0700 (PDT) Received: from hosted05.westnet.com.au (hosted05.westnet.com.au [127.0.0.1]) by hosted05.westnet.com.au (Postfix) with SMTP id 04EDC2AB7F4; Wed, 16 Jul 2008 12:14:23 +0800 (WST) Received: from ferris.localdomain (unknown [124.148.101.210]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by hosted05.westnet.com.au (Postfix) with ESMTP id 7E9262AB131; Wed, 16 Jul 2008 12:14:21 +0800 (WST) Received: from [192.168.0.200] (sam [192.168.0.200]) by ferris.localdomain (8.14.2/8.13.8) with ESMTP id m6G4EG92010758; Wed, 16 Jul 2008 14:14:17 +1000 X-ASG-Orig-Subj: Re: Benchmarks: Linux Kernel RAID vs a Hardware RAID setup Subject: Re: Benchmarks: Linux Kernel RAID vs a Hardware RAID setup From: Ben Martin To: Justin Piszcz Cc: linux-raid@vger.kernel.org, xfs@oss.sgi.com, Ben Martin In-Reply-To: References: <1216130769.5633.318.camel@sam.localdomain> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-eqWGov+xheIdLAOn7Tit" Date: Wed, 16 Jul 2008 14:14:16 +1000 Message-Id: <1216181656.5633.380.camel@sam.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 (2.22.2-2.fc9) X-PMX-Branch: TNG-Outgoing X-Barracuda-Connect: hosted05.westnet.com.au[203.10.1.219] X-Barracuda-Start-Time: 1216181666 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56180 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16918 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: monkeyiq@users.sourceforge.net Precedence: bulk X-list: xfs --=-eqWGov+xheIdLAOn7Tit Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Tue, 2008-07-15 at 10:42 -0400, Justin Piszcz wrote: > What were the commands used when creating the XFS filesystem=20 > (sunit,swidth)? >=20 > Justin. I noticed that on the hardware card I had to use nobarrier to get decent file metadata performance (create,del etc). I have noticed also recently on an 32gb Mtron SSD that with barriers enabled with XFS on the SSD metadata performance was an order of magnitude slower. The below is a snippit from the hardware RAID testing config. The XFS creation and mounting args are identical for software RAID. #!/bin/bash RAIDLEVEL=3D6 CHUNK_SZ_KB=3D256 PARITY_DRIVE_COUNT=3D2 NON_PARITY_DRIVE_COUNT=3D4 DEVICE=3D/dev/disk/by-id/scsi-SAdaptec_1024ktmpraid6 ... run_bonnie() { fsdev=3D$1 mountopts=3D$2 N=3D256 mount -o "$mountopts" $DEVICE /mnt/tmpraid chown ben /mnt/tmpraid sync=20 sleep 1 sudo -u ben /usr/sbin/bonnie++ -q -m $fsdev -n $N -d \ /mnt/tmpraid >>/T/adaptec-raid ${RAIDLEVEL}-${CHUNK_SZ_KB}kb-chunks-bonnie.csv umount /mnt/tmpraid } ... fsdev=3Dhardxfsdefaultnb mkfs.xfs -f -l lazy-count=3D1 \ $DEVICE run_bonnie $fsdev "nobarrier" fsdev=3Dhardxfsalign mkfs.xfs -f -s size=3D4096 \ -d sunit=3D$(($CHUNK_SZ_KB*2)),swidth=3D$(($CHUNK_SZ_KB*2* $NON_PARITY_DRIVE_COUNT)) \ -l lazy-count=3D1 \ $DEVICE run_bonnie $fsdev "nobarrier" fsdev=3Dhardxfsdlalign mkfs.xfs -f -s size=3D4096 \ -d sunit=3D$(($CHUNK_SZ_KB*2)),swidth=3D$(($CHUNK_SZ_KB*2* $NON_PARITY_DRIVE_COUNT)) \ -l lazy-count=3D1,sunit=3D$((CHUNK_SZ_KB*2)),size=3D128m \ $DEVICE run_bonnie $fsdev "nobarrier" # run iozone on it. fsdev=3Dhardxfsalign mkfs.xfs -f -s size=3D4096 \ -d sunit=3D$(($CHUNK_SZ_KB*2)),swidth=3D$(($CHUNK_SZ_KB*2* $NON_PARITY_DRIVE_COUNT)) \ -l lazy-count=3D1 \ $DEVICE mount -o "nobarrier" $DEVICE /mnt/tmpraid chown ben /mnt/tmpraid sync=20 sleep 1 sudo -u ben iozone -a -g 4G -f /mnt/tmpraid/iozone_file \ >/T/adaptec-raid${RAIDLEVEL}-${CHUNK_SZ_KB}kb-chunks-iozone.txt umount /mnt/tmpraid >=20 > On Wed, 16 Jul 2008, Ben Martin wrote: >=20 > > Hi, > > Apologies if posting this here is inappropriate but a recent article > > of mine compares the Linux Kernel RAID code to an $800 hardware RAID > > card and might be of interest to list members: > > > > http://www.linux.com/feature/140734 > > > > --=-eqWGov+xheIdLAOn7Tit Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEABECAAYFAkh9dZgACgkQsIKOrI+5WvME7wCgqDwC00Tb5gQlucvYwDJYdPEO UDAAoKUZnIWfmI+qX4+O27Zvm7RISOyQ =/Dwo -----END PGP SIGNATURE----- --=-eqWGov+xheIdLAOn7Tit-- From owner-xfs@oss.sgi.com Wed Jul 16 00:01:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 00:01:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.1 required=5.0 tests=AWL,BAYES_50,HTML_MESSAGE, J_CHICKENPOX_21,J_CHICKENPOX_56 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6G71Awv002484 for ; Wed, 16 Jul 2008 00:01:11 -0700 X-ASG-Debug-ID: 1216191733-38bb00970000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rsbne02.RSBNE.LOCAL (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D72F7E29656 for ; Wed, 16 Jul 2008 00:02:13 -0700 (PDT) Received: from rsbne02.RSBNE.LOCAL (robert87.lnk.telstra.net [203.45.17.90]) by cuda.sgi.com with ESMTP id MuvSyyh7wWHFImgh for ; Wed, 16 Jul 2008 00:02:13 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 X-ASG-Orig-Subj: RE: Power loss causes bad magic number?? Subject: RE: Power loss causes bad magic number?? Date: Wed, 16 Jul 2008 17:01:56 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Power loss causes bad magic number?? Thread-Index: Acjm7T9OK33lk02qRr6kulOVRdhfWQAIByci References: <487D5F80.1050909@sandeen.net> From: "Stephen Porter" To: "Eric Sandeen" Cc: X-Barracuda-Connect: robert87.lnk.telstra.net[203.45.17.90] X-Barracuda-Start-Time: 1216191735 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56191 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 21378 X-archive-position: 16919 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: stephenp@r-s.com.au Precedence: bulk X-list: xfs Hi Eric, It's not an in-kernel driver, I need to rebuild it each time the kernel is updated. The output of the dd command follows: $ sudo dd if=/dev/sdc bs=512 count=128 iflag=direct | hexdump -C | grep XFSB 128+0 records in 128+0 records out 65536 bytes (66 kB) copied, 0.0241381 s, 2.7 MB/s I thought the XFSB marked the start of the superblock... and it not being there would be a Bad Thing?? without the "| grep XFSB" the output looks like: $ sudo dd if=/dev/sdc bs=512 count=128 iflag=direct | hexdump -C 00000000 33 c0 8e d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c |3.....|.P.P....|| 00000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04 |...PW...........| 00000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5 |8n.|.u..........| 00000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 07 8b |...It.8,t.......| 00000040 f0 ac 3c 00 74 fc bb 07 00 b4 0e cd 10 eb f2 88 |..<.t...........| 00000050 4e 10 e8 46 00 73 2a fe 46 10 80 7e 04 0b 74 0b |N..F.s*.F..~..t.| 00000060 80 7e 04 0c 74 05 a0 b6 07 75 d2 80 46 02 06 83 |.~..t....u..F...| 00000070 46 08 06 83 56 0a 00 e8 21 00 73 05 a0 b6 07 eb |F...V...!.s.....| 00000080 bc 81 3e fe 7d 55 aa 74 0b 80 7e 10 00 74 c8 a0 |..>.}U.t..~..t..| 00000090 b7 07 eb a9 8b fc 1e 57 8b f5 cb bf 05 00 8a 56 |.......W.......V| 000000a0 00 b4 08 cd 13 72 23 8a c1 24 3f 98 8a de 8a fc |.....r#..$?.....| 000000b0 43 f7 e3 8b d1 86 d6 b1 06 d2 ee 42 f7 e2 39 56 |C..........B..9V| 000000c0 0a 77 23 72 05 39 46 08 73 1c b8 01 02 bb 00 7c |.w#r.9F.s......|| 000000d0 8b 4e 02 8b 56 00 cd 13 73 51 4f 74 4e 32 e4 8a |.N..V...sQOtN2..| 000000e0 56 00 cd 13 eb e4 8a 56 00 60 bb aa 55 b4 41 cd |V......V.`..U.A.| 000000f0 13 72 36 81 fb 55 aa 75 30 f6 c1 01 74 2b 61 60 |.r6..U.u0...t+a`| 00000100 6a 00 6a 00 ff 76 0a ff 76 08 6a 00 68 00 7c 6a |j.j..v..v.j.h.|j| 00000110 01 6a 10 b4 42 8b f4 cd 13 61 61 73 0e 4f 74 0b |.j..B....aas.Ot.| 00000120 32 e4 8a 56 00 cd 13 eb d6 61 f9 c3 49 6e 76 61 |2..V.....a..Inva| 00000130 6c 69 64 20 70 61 72 74 69 74 69 6f 6e 20 74 61 |lid partition ta| 00000140 62 6c 65 00 45 72 72 6f 72 20 6c 6f 61 64 69 6e |ble.Error loadin| 00000150 67 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 |g operating syst| 00000160 65 6d 00 4d 69 73 73 69 6e 67 20 6f 70 65 72 61 |em.Missing opera| 00000170 74 69 6e 67 20 73 79 73 74 65 6d 00 00 00 00 00 |ting system.....| 00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 000001b0 00 00 00 00 00 2c 44 63 9d 08 9e 08 00 00 00 01 |.....,Dc........| 000001c0 01 00 fd fe 3f 3c 3f 00 00 00 be f3 0e 00 00 00 |....?.}U.t..~..t..| 00000090 b7 07 eb a9 8b fc 1e 57 8b f5 cb bf 05 00 8a 56 |.......W.......V| I don't know what this output should look like when it's "correct", but I get the feeling this isn't right. Regards, Stephen. Stephen Porter wrote: > Hello, > > Hoping someone may be able to offer some advice/assistance. > > I lost power twice (within a few hours) to my machine which had a ~2.2TB > XFS volume on it. The first time the machine (running Xubuntu 8.04) > came back up ok, the second time the XFS volume will not mount. Is > there any chance of recovering the data? /dev/sdc is seen by xubuntu as > one ~2.2TB disk, and I put the XFS file system straight onto the disk. > It's 4x750GB drives on a hardware raid controller (rocketraid 2320). > Driver/module for rocket raid (rr232x) is loaded ok. hm, not an in-kernel driver, I guess? > In the system log I see: > > XFS: bad magic number > > XFS: SB validate failed > > I tried running xfs_check, the result of this was: > > xfs_check /dev/sdc > xfs_check: unexpected XFS SB magic number 0x33c08ed0 > xfs_check: size check failed > xfs_check: read failed: Invalid argument > xfs_check: data size check failed > xfs_check: failed to alloc -225176656 bytes: Cannot allocate memory > > I looked at running xfs_repair, but the man page states that this will > only work on a volume that has been unmounted cleanly... as I lost power > the volume has not been unmounted cleanly, but I cannot mount it again > to unmount it cleanly. If you have to, you can zero the log w/ xfs_repair as a last resort. > Running xfs_repair gives the following: > > xfs_repair -n /dev/sdc > > Phase 1 - find and verify superblock... > > bad primary superblock - bad magic number !!! > > ...attempting to find secondary superblock... > > ...found candidate secondary superblock... unable to verify superblock, > continuing... I always wished it said where, and why it did not verify.... > (the above appears a few times, until finally) > > ...Sorry, could not find valid secondary superblock > > Exiting now. > > I've seen it mentioned in other posts to the xfs archive to check that > there is an xfs volume there, so I've also included the output of "dd > if=/dev/sdc bs=512 count=1 iflag=direct 2> /dev/null | od -Ax -x" below: > > $ dd if=/dev/sdc bs=512 count=1 iflag=direct 2> /dev/null | od -Ax -x > > 000000 c033 d08e 00bc fb7c 0750 1f50 befc 7c1b > 000010 1bbf 5006 b957 01e5 a4f3 bdcb 07be 04b1 Can you try piping it through "hexdump -C" instead, I'm more used to eyeballing that output :) You might also try looking a bit further: dd if=/dev/sdc bs=512 count=128 iflag=direct | hexdump -C | grep XFSB to see if maybe the raid card does something else at the front of your disk and the superblock is further in, and something got scrambled up? Just a longshot.... -Eric [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Wed Jul 16 00:34:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 00:34:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_56, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6G7YFA2010769 for ; Wed, 16 Jul 2008 00:34:15 -0700 X-ASG-Debug-ID: 1216193720-3a6902ca0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8570018DB3E0 for ; Wed, 16 Jul 2008 00:35:21 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id VMuWqaN7ZMpuBaGo for ; Wed, 16 Jul 2008 00:35:21 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8EAMBBfUh5LFxAZWdsb2JhbACSPRICHp1f X-IronPort-AV: E=Sophos;i="4.30,372,1212330600"; d="scan'208";a="150334639" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 16 Jul 2008 17:05:10 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KJ1XT-00042B-TG; Wed, 16 Jul 2008 17:35:03 +1000 Date: Wed, 16 Jul 2008 17:35:03 +1000 From: Dave Chinner To: Stephen Porter Cc: Eric Sandeen , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Power loss causes bad magic number?? Subject: Re: Power loss causes bad magic number?? Message-ID: <20080716073503.GE29319@disturbed> Mail-Followup-To: Stephen Porter , Eric Sandeen , xfs@oss.sgi.com References: <487D5F80.1050909@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216193722 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0202 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56194 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16920 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 16, 2008 at 05:01:56PM +1000, Stephen Porter wrote: > Hi Eric, > > It's not an in-kernel driver, I need to rebuild it each time the kernel is updated. > > The output of the dd command follows: > > $ sudo dd if=/dev/sdc bs=512 count=128 iflag=direct | hexdump -C | grep XFSB > 128+0 records in > 128+0 records out > 65536 bytes (66 kB) copied, 0.0241381 s, 2.7 MB/s > > I thought the XFSB marked the start of the superblock... and it not being there would be a Bad Thing?? > > without the "| grep XFSB" the output looks like: > > $ sudo dd if=/dev/sdc bs=512 count=128 iflag=direct | hexdump -C > 00000000 33 c0 8e d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c |3.....|.P.P....|| > 00000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04 |...PW...........| > 00000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5 |8n.|.u..........| > 00000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 07 8b |...It.8,t.......| > 00000040 f0 ac 3c 00 74 fc bb 07 00 b4 0e cd 10 eb f2 88 |..<.t...........| > 00000050 4e 10 e8 46 00 73 2a fe 46 10 80 7e 04 0b 74 0b |N..F.s*.F..~..t.| > 00000060 80 7e 04 0c 74 05 a0 b6 07 75 d2 80 46 02 06 83 |.~..t....u..F...| > 00000070 46 08 06 83 56 0a 00 e8 21 00 73 05 a0 b6 07 eb |F...V...!.s.....| > 00000080 bc 81 3e fe 7d 55 aa 74 0b 80 7e 10 00 74 c8 a0 |..>.}U.t..~..t..| > 00000090 b7 07 eb a9 8b fc 1e 57 8b f5 cb bf 05 00 8a 56 |.......W.......V| > 000000a0 00 b4 08 cd 13 72 23 8a c1 24 3f 98 8a de 8a fc |.....r#..$?.....| > 000000b0 43 f7 e3 8b d1 86 d6 b1 06 d2 ee 42 f7 e2 39 56 |C..........B..9V| > 000000c0 0a 77 23 72 05 39 46 08 73 1c b8 01 02 bb 00 7c |.w#r.9F.s......|| > 000000d0 8b 4e 02 8b 56 00 cd 13 73 51 4f 74 4e 32 e4 8a |.N..V...sQOtN2..| > 000000e0 56 00 cd 13 eb e4 8a 56 00 60 bb aa 55 b4 41 cd |V......V.`..U.A.| > 000000f0 13 72 36 81 fb 55 aa 75 30 f6 c1 01 74 2b 61 60 |.r6..U.u0...t+a`| > 00000100 6a 00 6a 00 ff 76 0a ff 76 08 6a 00 68 00 7c 6a |j.j..v..v.j.h.|j| > 00000110 01 6a 10 b4 42 8b f4 cd 13 61 61 73 0e 4f 74 0b |.j..B....aas.Ot.| > 00000120 32 e4 8a 56 00 cd 13 eb d6 61 f9 c3 49 6e 76 61 |2..V.....a..Inva| > 00000130 6c 69 64 20 70 61 72 74 69 74 69 6f 6e 20 74 61 |lid partition ta| > 00000140 62 6c 65 00 45 72 72 6f 72 20 6c 6f 61 64 69 6e |ble.Error loadin| > 00000150 67 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 |g operating syst| > 00000160 65 6d 00 4d 69 73 73 69 6e 67 20 6f 70 65 72 61 |em.Missing opera| > 00000170 74 69 6e 67 20 73 79 73 74 65 6d 00 00 00 00 00 |ting system.....| > 00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| That looks like a boot loader. > * > 000001b0 00 00 00 00 00 2c 44 63 9d 08 9e 08 00 00 00 01 |.....,Dc........| > 000001c0 01 00 fd fe 3f 3c 3f 00 00 00 be f3 0e 00 00 00 |....? 000001d0 01 3d fd fe ff ff fd f3 0e 00 e5 cb 40 0e 00 00 |.=..........@...| > 000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| > 000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.| > 00000200 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| And at 0x200 I'd expect to see an AGF header, not zeros. To me, that says that either XFS is inside a partition on the drive or someone ran a partitioning tool on /dev/sdc and overwrote the XFS filesystem headers... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 16 00:52:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 00:53:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_12, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6G7qrFh012166 for ; Wed, 16 Jul 2008 00:52:53 -0700 X-ASG-Debug-ID: 1216194838-7437016b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rproxy.teamix.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 08BF018DB303 for ; Wed, 16 Jul 2008 00:53:58 -0700 (PDT) Received: from rproxy.teamix.net (postman.teamix.net [194.150.191.120]) by cuda.sgi.com with ESMTP id yKp7LQsAbbZ4rtzj for ; Wed, 16 Jul 2008 00:53:58 -0700 (PDT) Received: from nb27steigerwald.qs.de (unknown [212.204.70.254]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rproxy.teamix.net (Postfix) with ESMTP id 626D98145; Wed, 16 Jul 2008 09:53:57 +0200 (CEST) From: Martin Steigerwald Organization: team(ix) GmbH To: Eric Sandeen X-ASG-Orig-Subj: Re: Is it possible the check an frozen XFS filesytem to avoid downtime Subject: Re: Is it possible the check an frozen XFS filesytem to avoid downtime Date: Wed, 16 Jul 2008 09:53:56 +0200 User-Agent: KMail/1.9.9 Cc: Timothy Shimmin , xfs@oss.sgi.com References: <200807141542.51613.ms@teamix.de> <200807150944.13277.ms@teamix.de> <487CC1EB.6030100@sandeen.net> In-Reply-To: <487CC1EB.6030100@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807160953.56503.ms@teamix.de> X-Barracuda-Connect: postman.teamix.net[194.150.191.120] X-Barracuda-Start-Time: 1216194841 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56196 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16921 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ms@teamix.de Precedence: bulk X-list: xfs Am Dienstag, 15. Juli 2008 17:27:39 schrieb Eric Sandeen: > Martin Steigerwald wrote: > > Okay... we recommended the customer to do it the safe way unmounting the > > filesystem completely. He did and the filesystem appear to be intact > > *phew*. XFS appeared to detect the in memory corruption early enough. > > > > Its a bit strange however, cause we now know that the server sports ECC > > RAM. Well we will see what memtest86+ has to say about it. > > in-memory corruption could mean, but certainly does not absolutely mean, > problematic memory. It could be, and usually is, a plain ol' bug (in > xfs or elsewhere). Thanks. Yes, I thought about this, too. But then the machine ran over one year without any visible issues. And it happened only on one server, not on the other. It happened on the server that does NFS tough... could be an NFS related issue then. The other one does MySQL with the database stored on a XFS volume, too. But there haven't been any visible issues. Well we will see whether it happens again on the server that has taken over and is now doing both MySQL and NFS. If it does, I think we will update to one of the lastest Debian Etch backport kernels (2.6.24 or even 2.6.25) on one of the servers and see whether that helps. -- Martin Steigerwald - team(ix) GmbH - http://www.teamix.de gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90 From owner-xfs@oss.sgi.com Wed Jul 16 01:16:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 01:16:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=1.0 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6G8GqLu014550 for ; Wed, 16 Jul 2008 01:16:53 -0700 X-ASG-Debug-ID: 1216196278-38ba038c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rsbne02.RSBNE.LOCAL (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 13ED612E59D9 for ; Wed, 16 Jul 2008 01:17:59 -0700 (PDT) Received: from rsbne02.RSBNE.LOCAL (robert87.lnk.telstra.net [203.45.17.90]) by cuda.sgi.com with ESMTP id dFwQ3o9mJBpHubVp for ; Wed, 16 Jul 2008 01:17:59 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 MIME-Version: 1.0 X-ASG-Orig-Subj: RE: Power loss causes bad magic number?? Subject: RE: Power loss causes bad magic number?? Date: Wed, 16 Jul 2008 18:17:37 +1000 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Power loss causes bad magic number?? Thread-Index: AcjnFn45xIyZpPgfSQGKyoVirjQ2BwAAi30X References: <487D5F80.1050909@sandeen.net> <20080716073503.GE29319@disturbed> From: "Stephen Porter" To: "Dave Chinner" Cc: , X-Barracuda-Connect: robert87.lnk.telstra.net[203.45.17.90] X-Barracuda-Start-Time: 1216196280 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0012 1.0000 -2.0130 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56197 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1093 X-archive-position: 16922 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: stephenp@r-s.com.au Precedence: bulk X-list: xfs -----Original Message----- From: Dave Chinner [mailto:david@fromorbit.com] > That looks like a boot loader. That's what I thought, but again, this isn't a boot volume, could running xfs_repair without the -n have done this? > And at 0x200 I'd expect to see an AGF header, not zeros. To > me, that says that either XFS is inside a partition on the drive > or someone ran a partitioning tool on /dev/sdc and overwrote the > XFS filesystem headers... relevant line from /etc/fstab: /dev/sdc /home/username/Data xfs defaults 0 2 the raid management tool is reporting everythings ok... any idea what could have caused this? .... Ok, my apologies, I've just done an ls of /dev/sd* and the devices have been remapped (any idea what would have caused that?), sdc is no longer sdc, it is now sda, the boot devices are now detected as sdb and sdc (2 mirrored physical disks, used to be sda and sdb). How was the machine able to boot? I'm more confused than ever now, but the data is all there. Sorry for wasting everyones time. Regards, Stephen. [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Wed Jul 16 01:54:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 01:54:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6G8s74A017765 for ; Wed, 16 Jul 2008 01:54:09 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA18783; Wed, 16 Jul 2008 18:55:10 +1000 Message-ID: <487DB76E.3070300@sgi.com> Date: Wed, 16 Jul 2008 18:55:10 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Martin Steigerwald CC: xfs@oss.sgi.com Subject: Re: Is it possible the check an frozen XFS filesytem to avoid downtime References: <200807141542.51613.ms@teamix.de> <487C1BAF.2030404@sgi.com> <200807150944.13277.ms@teamix.de> In-Reply-To: <200807150944.13277.ms@teamix.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16923 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Martin Steigerwald wrote: > Am Dienstag, 15. Juli 2008 05:38:23 schrieb Timothy Shimmin: >> Hi Martin, > > Hi Tim, > >> Martin Steigerwald wrote: >>> Hi! >>> >>> We seen in-memory corruption on two XFS filesystem on a server heartbeat >>> cluster of one of our customers: >>> >>> >>> XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1563 of file >>> fs/xfs/xfs_alloc.c. Caller 0xffffffff8824eb5d >>> >>> Call Trace: >>> [] :xfs:xfs_free_ag_extent+0x1a6/0x6b5 >>> [] :xfs:xfs_free_extent+0xa9/0xc9 >>> [] :xfs:xfs_bmap_finish+0xf0/0x169 >>> [] :xfs:xfs_itruncate_finish+0x180/0x2c1 >>> [] :xfs:xfs_setattr+0x841/0xe59 >>> [] sock_common_recvmsg+0x30/0x45 >>> [] :xfs:xfs_vn_setattr+0x121/0x144 >>> [] notify_change+0x156/0x2ef >>> [] :nfsd:nfsd_setattr+0x334/0x4b1 >>> [] :nfsd:nfsd3_proc_setattr+0xa2/0xae >>> [] :nfsd:nfsd_dispatch+0xdd/0x19e >>> [] :sunrpc:svc_process+0x3cb/0x6d9 >>> [] __down_read+0x12/0x9a >>> [] :nfsd:nfsd+0x192/0x2b0 >>> [] child_rip+0xa/0x12 >>> [] :nfsd:nfsd+0x0/0x2b0 >>> [] child_rip+0x0/0x12 >>> >>> xfs_force_shutdown(dm-1,0x8) called from line 4261 of file >>> fs/xfs/xfs_bmap.c. Return address = 0xffffffff88258673 >>> Filesystem "dm-1": Corruption of in-memory data detected. Shutting down >>> filesystem: dm-1 >>> Please umount the filesystem, and rectify the problem(s) >>> >>> on >>> >>> Linux version 2.6.21-1-amd64 (Debian 2.6.21-4~bpo.1) >>> (nobse@backports.org) (gcc version 4.1.2 20061115 (prerelease) (Debian >>> 4.1.1-21)) #1 SMP Tue Jun 5 07:43:32 UTC 2007 >>> >>> >>> We plan to do a takeover so that the server which appears to have memory >>> errors can be memtested. >>> >>> After the takeover we would like to make sure that the XFS filesystems >>> are intact. Is it possible to do so without taking the filesystem >>> completely offline? >>> >>> I thought about mounting read only and it might be the best choice >>> available, but then it will *fail* write accesses. I would prefer if >>> these are just stalled. >>> >>> I tried xfs_freeze -f on my laptop home directory, but then did not >>> machine to get it check via xfs_check or xfs_repair -nd... is it possible >>> at all? >>> >>> Ciao, >> When I last tried (and I don't think Barry has done anything to it to >> change things) it wouldn't work. >> However, I think it could/should be changed to make it work. > > Okay... we recommended the customer to do it the safe way unmounting the > filesystem completely. He did and the filesystem appear to be intact *phew*. > XFS appeared to detect the in memory corruption early enough. > > Its a bit strange however, cause we now know that the server sports ECC RAM. > Well we will see what memtest86+ has to say about it. > >> My notes from the SGI bug: >> >> 958642: running xfs_check and "xfs_repair -n" on a frozen xfs filesystem >> >>> We've been asked a few times about the possibility of running xfs_check >>> or xfs_repair -n on a frozen filesystem. >>> And a while back I looked into what some of the hinderances were. >>> And now I've forgotten ;-)) >>> >>> I think there are hinderances for libxfs_init (check_open()) and >>> for having a dirty log. >>> >>> For libxfs_init, I found that I couldn't run the tools without error'ing >>> out. I think I found out that I needed the INACTIVE flag, >>> without READONLY/DANGEROUSLY, like xfs_logprint does. >>> >>> ---------------------------------------- >>> Date: Thu, 19 Oct 2006 11:24:06 +1000 >>> From: Timothy Shimmin >>> To: lachlan@sgi.com >>> cc: xfs-dev@sgi.com >>> It means if I do _not_ want to be fatal then I need to set INACTIVE but >>> not set READONLY or DANGEROUSLY - which is what logprint does. >>> > > I think that there should be different options for readonly / frozen fs > checking and dangerous repair... since I think readonly checks are a > different thing than repairing a mounted filesystem and hoping that the > running XFS will not choke upon the filesystem that xfs_repair changes under > its hood. > > I expected a "-r" for read only in xfs_check and xfs_repair, well but for > xfs_repair this option is already taken for specifying the realtime volume. > > Ciao, My comments mentioned above were for the c flags used in libxfs and the commands. I was curious to know why logprint was able to continue printing and doing its stuff but repair and check couldn't and would exit. What actual _command_ options/flags we use is a different matter and I probably confused the issue by using the term flags. Looking at the code: #define LIBXFS_ISREADONLY 0x0002 /* disallow all mounted filesystems */ #define LIBXFS_ISINACTIVE 0x0004 /* allow mounted only if mounted ro */ #define LIBXFS_DANGEROUSLY 0x0008 /* repairing a device mounted ro */ -n No modify mode. Specifies that xfs_repair should not modify the filesystem but should only scan the filesystem and indicate what repairs would have been made. -d Repair dangerously. Allow xfs_repair to repair an XFS filesystem mounted read only. This is typically done on a root fileystem from single user mode, immediately followed by a reboot. if (no_modify) /* -n */ args->isreadonly = (LIBXFS_ISREADONLY | LIBXFS_ISINACTIVE); else if (dangerously) /* -d */ args->isreadonly = (LIBXFS_DANGEROUSLY | LIBXFS_ISINACTIVE); The comment for LIBXFS_ISINACTIVE seems a bit misleading as I believe it will allow things to continue on a filesystem which is not marked as readonly as xfs_logprint does. Looking at: init.c: if (!readonly && !inactive && platform_check_ismounted(path, *blockfile, NULL, 1)) return 0; if (inactive && check_isactive(path, *blockfile, ((readonly|dangerously)?1:0))) return 0; static int check_isactive(char *name, char *block, int fatal) { .... return platform_check_iswritable(name, block, &st, fatal); } Okay, so this is why it worked fine for just ISINACTIVE but not when either ISREADONLY or DANGEROUSLY are set. Yes, it would be nice for the commands to detect that the filesystem is frozen and then allow things to proceed in a non modifying mode. --Tim From owner-xfs@oss.sgi.com Wed Jul 16 05:59:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 05:59:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6GCxDRT008059 for ; Wed, 16 Jul 2008 05:59:14 -0700 X-ASG-Debug-ID: 1216213218-5c4001a50000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from static223.banetele-cust.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 2529D1BB96E1 for ; Wed, 16 Jul 2008 06:00:19 -0700 (PDT) Received: from static223.banetele-cust.com (static223.banetele-cust.com [195.204.140.223]) by cuda.sgi.com with SMTP id YouBoxFlK2rpjkgt for ; Wed, 16 Jul 2008 06:00:19 -0700 (PDT) Message-ID: <487DEE60.1010578@mail.mx.knology.net> Date: Wed, 16 Jul 2008 12:49:36 GMT From: Tonya Oconnell User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: X-ASG-Orig-Subj: Cute little teenie boppers doing naughty things Subject: Cute little teenie boppers doing naughty things Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Barracuda-Connect: static223.banetele-cust.com[195.204.140.223] X-Barracuda-Start-Time: 1216213221 X-Barracuda-Bayes: INNOCENT GLOBAL 0.4919 1.0000 0.0000 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.00 X-Barracuda-Spam-Status: No, SCORE=0.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56214 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16924 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: saracain03@knology.net Precedence: bulk X-list: xfs petite and perfect http://kunazere28678.blogspot.com From owner-xfs@oss.sgi.com Wed Jul 16 14:57:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 14:57:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6GLvstZ017541 for ; Wed, 16 Jul 2008 14:57:55 -0700 X-ASG-Debug-ID: 1216245541-0c1e01fe0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from elf.torek.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2B1852FB719 for ; Wed, 16 Jul 2008 14:59:01 -0700 (PDT) Received: from elf.torek.net (mail.torek.net [67.40.109.61]) by cuda.sgi.com with ESMTP id uev6Ddo3eSMI71mL for ; Wed, 16 Jul 2008 14:59:01 -0700 (PDT) Received: from elf.torek.net (localhost [127.0.0.1]) by elf.torek.net (8.11.6/8.11.2) with ESMTP id m6GLwtE00281; Wed, 16 Jul 2008 15:58:56 -0600 (MDT) Message-Id: <200807162158.m6GLwtE00281@elf.torek.net> From: Chris Torek To: Dave Chinner cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: question about xfs_fsync on linux Subject: Re: question about xfs_fsync on linux In-Reply-To: Your message of "Tue, 15 Jul 2008 12:48:30 +1000." <20080715024830.GZ29319@disturbed> Date: Wed, 16 Jul 2008 15:58:55 -0600 X-Barracuda-Connect: mail.torek.net[67.40.109.61] X-Barracuda-Start-Time: 1216245542 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2045 1.0000 -0.8039 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.80 X-Barracuda-Spam-Status: No, SCORE=-0.80 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56246 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16925 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: chris.torek@windriver.com Precedence: bulk X-list: xfs >Well, you are pretty much on your own, then. Really, we cannot help >diagnose problems on old kernels with a random set of backported >patches in them. Definitely understood. I just wanted to ask that original question, really. I had assumed that the file system itself had to start any dirty-page writes, having missed the top level filemap_fdatawrite() call. We finally got a test case and did a bunch of analysis, and it turns out that the DB software is missing an fsync() call. Of course XFS won't fsync the file if you don't *ask* it to! As long as I am sending mail, there is something else I am curious about though. While this is not XFS specific, I wonder if there is any desire to have different background write frequencies on different file systems. By default, mm/page-writeback.c will start writebacks after a 30-second delay. One can tune this to any other number (via /proc/sys/vm/dirty_{expire,writeback}_centisecs), but this affects the entire system. It might be useful to be able to tune this per-FS instead. (On the other hand, perhaps if one really wants one's data journaled, one should just use a data-journaling file system....) Chris From owner-xfs@oss.sgi.com Wed Jul 16 17:21:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 17:21:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6H0Lsbm031141 for ; Wed, 16 Jul 2008 17:21:55 -0700 X-ASG-Debug-ID: 1216254181-2f60033e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DADB22FC092 for ; Wed, 16 Jul 2008 17:23:02 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Ns1sWhdv5q7AhdVj for ; Wed, 16 Jul 2008 17:23:02 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiMEAEstfkh5LFxAZWdsb2JhbACSRhICHp1p X-IronPort-AV: E=Sophos;i="4.31,199,1215354600"; d="scan'208";a="150896921" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 17 Jul 2008 09:53:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KJHGn-0001O2-OF; Thu, 17 Jul 2008 10:22:53 +1000 Date: Thu, 17 Jul 2008 10:22:53 +1000 From: Dave Chinner To: Chris Torek Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: question about xfs_fsync on linux Subject: Re: question about xfs_fsync on linux Message-ID: <20080717002253.GF29319@disturbed> Mail-Followup-To: Chris Torek , xfs@oss.sgi.com References: <20080715024830.GZ29319@disturbed> <200807162158.m6GLwtE00281@elf.torek.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <200807162158.m6GLwtE00281@elf.torek.net> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216254182 X-Barracuda-Bayes: INNOCENT GLOBAL 0.2762 1.0000 -0.4527 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.45 X-Barracuda-Spam-Status: No, SCORE=-0.45 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56256 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16926 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 16, 2008 at 03:58:55PM -0600, Chris Torek wrote: > >Well, you are pretty much on your own, then. Really, we cannot help > >diagnose problems on old kernels with a random set of backported > >patches in them. > > Definitely understood. I just wanted to ask that original > question, really. I had assumed that the file system itself > had to start any dirty-page writes, having missed the top level > filemap_fdatawrite() call. > > We finally got a test case and did a bunch of analysis, and it > turns out that the DB software is missing an fsync() call. Of > course XFS won't fsync the file if you don't *ask* it to! Yes, that would help ;) Thanks for following up and letting us know you found the problem. > As long as I am sending mail, there is something else I am curious > about though. While this is not XFS specific, I wonder if there > is any desire to have different background write frequencies on > different file systems. By default, mm/page-writeback.c will start > writebacks after a 30-second delay. One can tune this to any other > number (via /proc/sys/vm/dirty_{expire,writeback}_centisecs), but > this affects the entire system. It might be useful to be able > to tune this per-FS instead. Wouldn't be too difficult, but really if you have data that needs to go to disk quickly from a given application then the application should be triggering the flush. e.g. Ñ–ssuing posix_fadvise(fd, ...., POSIX_FADV_DONTNEED) will trigger an immediate async flush of the file.... > (On the other hand, perhaps if one really wants one's data journaled, > one should just use a data-journaling file system....) Or use the sync mount option..... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 16 22:21:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 22:21:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6H5LC60022141 for ; Wed, 16 Jul 2008 22:21:13 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA13265; Thu, 17 Jul 2008 15:22:12 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id AB26958C4C3F; Thu, 17 Jul 2008 15:22:12 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL 984030 - incorrect delta in xfs_bmap_add_extent_unwritten_real Message-Id: <20080717052212.AB26958C4C3F@chook.melbourne.sgi.com> Date: Thu, 17 Jul 2008 15:22:12 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16927 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs A bug was found in xfs_bmap_add_extent_unwritten_real(). In a particular case, the delta param which is supposed to describe the region where extents have changed was not updated appropriately. Date: Thu Jul 17 15:20:34 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: olaf@sgi.com,lachlan@sgi.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31663a fs/xfs/xfs_bmap.c - 1.395 - changed - A bug was found in xfs_bmap_add_extent_unwritten_real(). In a particular case, the delta param which is supposed to describe the region where extents have changed was not updated appropriately. From owner-xfs@oss.sgi.com Wed Jul 16 22:43:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 16 Jul 2008 22:43:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6H5hH8l023844 for ; Wed, 16 Jul 2008 22:43:18 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA13972; Thu, 17 Jul 2008 15:44:20 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id C4B1358C4C3F; Thu, 17 Jul 2008 15:44:19 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL TAKE 983806 - fix use after free with external logs or real-time devices Message-Id: <20080717054419.C4B1358C4C3F@chook.melbourne.sgi.com> Date: Thu, 17 Jul 2008 15:44:19 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16928 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs fix use after free with external logs or real-time devices Date: Thu Jul 17 15:43:06 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-alloc Inspected by: hch Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31666a fs/xfs/linux-2.6/xfs_super.c - 1.435 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.435&r2=text&tr2=1.434&f=h - fix use after free with external logs or real-time devices From owner-xfs@oss.sgi.com Thu Jul 17 06:35:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 06:35:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6HDZ1xK014401 for ; Thu, 17 Jul 2008 06:35:02 -0700 X-ASG-Debug-ID: 1216301768-0f6c029a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8E1C9B00783 for ; Thu, 17 Jul 2008 06:36:08 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id dRBzPhDoQzCnFElQ for ; Thu, 17 Jul 2008 06:36:08 -0700 (PDT) Received: from funky.thebarn.com (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6HDa5eb048672; Thu, 17 Jul 2008 08:36:07 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <487F4AC5.3000806@thebarn.com> Date: Thu, 17 Jul 2008 08:36:05 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Stephen Porter CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Power loss causes bad magic number?? Subject: Re: Power loss causes bad magic number?? References: <487D5F80.1050909@sandeen.net> <20080716073503.GE29319@disturbed> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7734/Thu Jul 17 06:02:31 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1216301769 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56307 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 16929 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Stephen Porter wrote: > > -----Original Message----- > From: Dave Chinner [mailto:david@fromorbit.com] > > >> That looks like a boot loader. >> > > That's what I thought, but again, this isn't a boot volume, could running xfs_repair without the -n have done this? > > >> And at 0x200 I'd expect to see an AGF header, not zeros. To >> me, that says that either XFS is inside a partition on the drive >> or someone ran a partitioning tool on /dev/sdc and overwrote the >> XFS filesystem headers... >> > > relevant line from /etc/fstab: > > /dev/sdc /home/username/Data xfs defaults 0 2 > > the raid management tool is reporting everythings ok... any idea what could have caused this? > > .... > > Ok, my apologies, I've just done an ls of /dev/sd* and the devices have been remapped (any idea what would have caused that?), sdc is no longer sdc, it is now sda, the boot devices are now detected as sdb and sdc (2 mirrored physical disks, used to be sda and sdb). How was the machine able to boot? I'm more confused than ever now, but the data is all there. > Heh welcome to the world of linux's poor device name handling. Did you make some sort of change to the hardware? added drives, moved cards around, etc? Anything that changes the order that drives are discovered will affect the sd[a-...] naming. Mount by label or mount by uuid may be your friend in this case. > Sorry for wasting everyones time. > > Regards, > > Stephen. > > > > > [[HTML alternate version deleted]] > > From owner-xfs@oss.sgi.com Thu Jul 17 10:45:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 10:46:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,J_CHICKENPOX_23, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6HHja2L007064 for ; Thu, 17 Jul 2008 10:45:36 -0700 X-ASG-Debug-ID: 1216316803-39af00cb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from qw-out-1920.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 866F618EFFF9 for ; Thu, 17 Jul 2008 10:46:43 -0700 (PDT) Received: from qw-out-1920.google.com (qw-out-1920.google.com [74.125.92.145]) by cuda.sgi.com with ESMTP id UR3y4aBZEO7jPE3H for ; Thu, 17 Jul 2008 10:46:43 -0700 (PDT) Received: by qw-out-1920.google.com with SMTP id 5so16397qwc.32 for ; Thu, 17 Jul 2008 10:46:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:mime-version:content-type:content-transfer-encoding :content-disposition; bh=hDLiep+ttpyijn/H9zlZ9qpofgdzmMHNdCBAAFWySjM=; b=VCXwyLq6AFcl7XV9ubClZ3J/H5WLibaGDuSqUoGu0xAgkCuMF+NQlqtYjHP+a21oWf RKF+WhgYUv6D6HI6rQx97nW4QylJiYsrscc35b1e83UI+5n95hYB7p/YHd0dowcJmzLs e4pMuuGaHg7hhQ0lq1vjJRfx1pudFm8/Y1+WE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:mime-version:content-type :content-transfer-encoding:content-disposition; b=DrOzkoGwLdRe8eIYLJCiUhsXHF9ZixCr82wIVJk5BDRU/cqzurxgpkPervC05pBIC1 SmJMb64iF9wcIgLsIkyUX6GWAzw5debgKl9XoTsdtbOk/+NzhKyw+fkYioVdQMDYPvTC I94QL2D5XbRvzJJX6P23ceAItwRc+pboHc0Rw= Received: by 10.142.47.13 with SMTP id u13mr733460wfu.170.1216316802882; Thu, 17 Jul 2008 10:46:42 -0700 (PDT) Received: by 10.142.43.13 with HTTP; Thu, 17 Jul 2008 10:46:42 -0700 (PDT) Message-ID: <19f34abd0807171046j425bebc6m8d8eb80a641e0e5b@mail.gmail.com> Date: Thu, 17 Jul 2008 19:46:42 +0200 From: "Vegard Nossum" To: "Tim Shimmin" , xfs@oss.sgi.com X-ASG-Orig-Subj: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Subject: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Cc: linux-kernel@vger.kernel.org, "Johannes Weiner" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: qw-out-1920.google.com[74.125.92.145] X-Barracuda-Start-Time: 1216316804 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0204 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56323 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16930 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vegard.nossum@gmail.com Precedence: bulk X-list: xfs Hi, I got this with an intentionally corrupted filesystem: Filesystem "loop1": Disabling barriers, not supported by the underlying device XFS mounting filesystem loop1 Ending clean XFS mount for filesystem: loop1 Device loop1 - bad inode magic/vsn daddr 9680 #30 (magic=4946) ------------[ cut here ]------------ kernel BUG at fs/xfs/support/debug.c:54! invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC Pid: 12849, comm: grep Not tainted (2.6.26-03414-g33af79d #43) EIP: 0060:[] EFLAGS: 00210246 CPU: 1 EIP is at cmn_err+0x99/0xa0 EAX: ed75e000 EBX: c089047c ECX: ed75e000 EDX: 00000000 ESI: 00000000 EDI: 00200286 EBP: ed75fbbc ESP: ed75fba4 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Process grep (pid: 12849, ti=ed75e000 task=f1ee9fe0 task.ti=ed75e000) Stack: c0855099 c0846a0d c0d0e8c0 00004946 df92a8f0 0000001e ed75fc2c c03540d4 00000000 c089047c ed75fbfc 000025d0 00000000 0000001e 00004946 ed75fc54 00000000 df92a8f0 df92abd8 000025d0 00000000 00000000 706f6f6c 00000031 Call Trace: [] ? xfs_imap_to_bp+0x164/0x250 [] ? trace_hardirqs_on_caller+0x116/0x170 [] ? xfs_itobp+0x90/0x180 [] ? xfs_iread+0xa1/0x280 [] ? xfs_iget_core+0x1c6/0x6e0 [] ? xfs_iget+0xfa/0x170 [] ? xfs_lookup+0xb6/0xc0 [] ? xfs_vn_lookup+0x4a/0x90 [] ? do_lookup+0x160/0x1b0 [] ? __link_path_walk+0x208/0xdc0 [] ? up_read+0x16/0x30 [] ? xfs_iunlock+0xee/0x110 [] ? xfs_vn_follow_link+0x3f/0x80 [] ? __link_path_walk+0x8f7/0xdc0 [] ? trace_hardirqs_off+0xb/0x10 [] ? path_walk+0x54/0xb0 [] ? do_path_lookup+0x85/0x230 [] ? __user_walk_fd+0x38/0x50 [] ? vfs_stat_fd+0x21/0x50 [] ? put_lock_stats+0xd/0x30 [] ? mntput_no_expire+0x1d/0x110 [] ? vfs_stat+0x11/0x20 [] ? sys_stat64+0x14/0x30 [] ? fput+0x1f/0x30 [] ? trace_hardirqs_on_thunk+0xc/0x10 [] ? trace_hardirqs_on_caller+0x116/0x170 [] ? trace_hardirqs_on_thunk+0xc/0x10 [] ? sysenter_past_esp+0x78/0xc5 ======================= Code: 04 e8 00 eb 3d 00 89 fa b8 40 4a 92 c0 e8 70 d0 3d 00 85 f6 74 15 83 c4 0c 5b 5e 5f 5d c3 8d 74 26 00 c6 81 c0 e8 d0 c0 00 eb bc <0f> 0b eb fe 90 90 90 55 b9 04 00 00 00 89 e5 57 89 c7 31 c0 f3 EIP: [] cmn_err+0x99/0xa0 SS:ESP 0068:ed75fba4 Kernel panic - not syncing: Fatal exception Vegard -- "The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036 From owner-xfs@oss.sgi.com Thu Jul 17 12:17:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 12:17:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_23 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6HJHrBV013946 for ; Thu, 17 Jul 2008 12:17:53 -0700 X-ASG-Debug-ID: 1216322340-5e1402100000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from el-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C8B0BE527CA for ; Thu, 17 Jul 2008 12:19:00 -0700 (PDT) Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.183]) by cuda.sgi.com with ESMTP id oouXlBravPODVDSN for ; Thu, 17 Jul 2008 12:19:00 -0700 (PDT) Received: by el-out-1112.google.com with SMTP id v27so28843ele.23 for ; Thu, 17 Jul 2008 12:18:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=d6FpDOvYwQWKa+3q8jGua9ydDXvJDibYsouf7LA1u+0=; b=x2N6NOuRHz+uPScD37/8gy16oSu55h3KR9HI7lMbgZm7YxaJnYrwAY7JbiMF7y4Izi lpbf2Wffb4uv6s2HaU99g1ehD4pg/BXZyEBk8W6PbVBw0dVEhOanbxlpZSSjfmz6xjd7 aj3qLf7qRICSMc5kx3bl+cdSoPkCYW8IRo42Y= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=H+7+ouXpd3XsZ1mTreAADYl/mf22KmSWWM5gFEntbHSzok0/tG9fqbHl9qSTUGlNzO 2j/4pkeBMDtG7IbaPVJMdI2lbA/UAYHw3t/D3A6s1tyJGLjVjL4LOM4FcAX0TzHLul2u OkbVVyBXqnE3Wg5T46hSdD0Um9Bey+pojwtm4= Received: by 10.143.30.10 with SMTP id h10mr785787wfj.7.1216322339290; Thu, 17 Jul 2008 12:18:59 -0700 (PDT) Received: by 10.142.43.13 with HTTP; Thu, 17 Jul 2008 12:18:59 -0700 (PDT) Message-ID: <19f34abd0807171218u3de86ddbt506b0b4fa0548406@mail.gmail.com> Date: Thu, 17 Jul 2008 21:18:59 +0200 From: "Vegard Nossum" To: "Eric Sandeen" X-ASG-Orig-Subj: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Subject: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Cc: "Tim Shimmin" , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, "Johannes Weiner" In-Reply-To: <487F980F.7070708@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <19f34abd0807171046j425bebc6m8d8eb80a641e0e5b@mail.gmail.com> <487F980F.7070708@redhat.com> X-Barracuda-Connect: el-out-1112.google.com[209.85.162.183] X-Barracuda-Start-Time: 1216322340 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.52 X-Barracuda-Spam-Status: No, SCORE=-0.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M, BSF_SC1_TG172a X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56330 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M 1.00 BSF_SC1_TG172a Custom Rule TG172a X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16931 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vegard.nossum@gmail.com Precedence: bulk X-list: xfs On Thu, Jul 17, 2008 at 9:05 PM, Eric Sandeen wrote: >> Hi, >> >> I got this with an intentionally corrupted filesystem: >> >> Filesystem "loop1": Disabling barriers, not supported by the underlying device >> XFS mounting filesystem loop1 >> Ending clean XFS mount for filesystem: loop1 >> Device loop1 - bad inode magic/vsn daddr 9680 #30 (magic=4946) >> ------------[ cut here ]------------ >> kernel BUG at fs/xfs/support/debug.c:54! > > running a debug XFS will turn all sorts of tests into panics that would > not otherwise crash and burn that way. > > I think normally when testing intentionally corrupted filesystems, you > expect corruptions to be handled gracefully. But in xfs's flavor of > debug, I'm not sure it's quite as true. > > Perhaps the debug variant should not BUG() on disk corruption either, > but it'd probably be more relevent to test this on a non-debug build. > > Does this corrupted fs survive better on non-debug xfs? Thanks, you are right. I have adjusted my configuration, but I am still able to produce this: BUG: unable to handle kernel paging request at b62a66e0 IP: [] xfs_alloc_fix_freelist+0x28/0x490 *pde = 00000000 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC Pid: 4174, comm: rm Not tainted (2.6.26-03414-g33af79d #44) EIP: 0060:[] EFLAGS: 00210296 CPU: 0 EIP is at xfs_alloc_fix_freelist+0x28/0x490 EAX: f63e8830 EBX: f490a000 ECX: f48e8000 EDX: b62a66e0 ESI: 00000000 EDI: f48e9d8c EBP: f48e9d6c ESP: f48e9ccc DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Process rm (pid: 4174, ti=f48e8000 task=f63d5fa0 task.ti=f48e8000) Stack: 00000000 f63e8ac0 f63d5fa0 f63d64cc 00000002 00000000 f63d5fa0 f63e8830 b62a66e0 f490a000 f73a3e10 c0b57c78 f49f2be0 c0ce8048 f49f24c0 00200046 00000002 f48e9d20 c015908e f48e9d20 c01590cd f48e9d50 00200246 f63d6010 Call Trace: [] ? get_lock_stats+0x1e/0x50 [] ? put_lock_stats+0xd/0x30 [] ? xfs_free_extent+0x63/0xd0 [] ? down_read+0x5b/0x80 [] ? xfs_free_extent+0x80/0xd0 [] ? kmem_zone_alloc+0x7a/0xc0 [] ? kmem_zone_alloc+0x7a/0xc0 [] ? xfs_bmap_finish+0x13a/0x180 [] ? xfs_itruncate_finish+0x1b8/0x400 [] ? xfs_inactive+0x3bb/0x4e0 [] ? xfs_fs_clear_inode+0x8a/0xe0 [] ? clear_inode+0x7c/0x160 [] ? generic_delete_inode+0x10e/0x120 [] ? generic_drop_inode+0x127/0x180 [] ? iput+0x47/0x50 [] ? do_unlinkat+0xec/0x170 [] ? trace_hardirqs_on_thunk+0xc/0x10 [] ? restore_nocheck_notrace+0x0/0xe [] ? trace_hardirqs_on_thunk+0xc/0x10 [] ? trace_hardirqs_on_caller+0x116/0x170 [] ? sys_unlinkat+0x23/0x50 [] ? sysenter_past_esp+0x78/0xc5 ======================= Code: 8d 76 00 55 89 e5 57 89 c7 56 53 81 ec 94 00 00 00 8b 1f 89 95 70 ff ff ff 8b 57 0c 8b 40 04 89 5d 84 89 55 80 89 85 7c ff ff ff <80> 3a 00 0f 84 e7 02 00 00 c7 45 f0 00 00 00 00 8b 55 80 80 7a EIP: [] xfs_alloc_fix_freelist+0x28/0x490 SS:ESP 0068:f48e9ccc Kernel panic - not syncing: Fatal exception (Full log at http://folk.uio.no/vegardno/linux/log-1216322418.txt has some more details.) Vegard -- "The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036 From owner-xfs@oss.sgi.com Thu Jul 17 12:28:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 12:28:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6HJSWTM019655 for ; Thu, 17 Jul 2008 12:28:32 -0700 X-ASG-Debug-ID: 1216322979-53fe02b80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from el-out-1112.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 89073E52A7B for ; Thu, 17 Jul 2008 12:29:40 -0700 (PDT) Received: from el-out-1112.google.com (el-out-1112.google.com [209.85.162.177]) by cuda.sgi.com with ESMTP id DIrDT6QTGCC0ZO0C for ; Thu, 17 Jul 2008 12:29:40 -0700 (PDT) Received: by el-out-1112.google.com with SMTP id v27so30663ele.23 for ; Thu, 17 Jul 2008 12:29:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=v7NM7f6/wCaQkyUqCh5dFCNT6UXgeSF+cgAEc/k9NK4=; b=kDY5wJRnc1LCfosRgvbo7pAta4I70aIKLJVDbVFI2lb+u9S7K5ADgGp5xTXDjLchFd 1ZJ7JEpPzvWy92CXmKhKeBwm+neIlR/ms9wW0ZstA2b3Rf7+XvtY/RErH1uN6WjOXaE4 iKsLy2cqm5F01+QJt37Hgyp+Jw0jQJP8RIldM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=X04TWe+iQLeoo8CCdBeL5nfsbiGbkaEqWHa+H6w4Gtaf6oubIXr/hG8S6uO90Coea7 CFSkjCAhD86QjteYVthxdMsgZWMKyfT2kG9E4e/OEyc+6bUhwVkvNLA+q6dgul1kRF8l ToHPMpGJdJtgIvtQZvdaIIV+6bTIB3fvsPpv0= Received: by 10.143.1.12 with SMTP id d12mr765912wfi.297.1216322979197; Thu, 17 Jul 2008 12:29:39 -0700 (PDT) Received: by 10.142.43.13 with HTTP; Thu, 17 Jul 2008 12:29:39 -0700 (PDT) Message-ID: <19f34abd0807171229p724cc44ese3cb064a65fbd2c0@mail.gmail.com> Date: Thu, 17 Jul 2008 21:29:39 +0200 From: "Vegard Nossum" To: "Eric Sandeen" X-ASG-Orig-Subj: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Subject: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Cc: "Tim Shimmin" , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, "Johannes Weiner" In-Reply-To: <19f34abd0807171218u3de86ddbt506b0b4fa0548406@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <19f34abd0807171046j425bebc6m8d8eb80a641e0e5b@mail.gmail.com> <487F980F.7070708@redhat.com> <19f34abd0807171218u3de86ddbt506b0b4fa0548406@mail.gmail.com> X-Barracuda-Connect: el-out-1112.google.com[209.85.162.177] X-Barracuda-Start-Time: 1216322980 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56330 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16932 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vegard.nossum@gmail.com Precedence: bulk X-list: xfs On Thu, Jul 17, 2008 at 9:18 PM, Vegard Nossum wrote: > Thanks, you are right. I have adjusted my configuration, but I am > still able to produce this: > > BUG: unable to handle kernel paging request at b62a66e0 > IP: [] xfs_alloc_fix_freelist+0x28/0x490 FWIW, this is fs/xfs/xfs_alloc.c:1817: if (!pag->pagf_init) { Vegard -- "The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036 From owner-xfs@oss.sgi.com Thu Jul 17 14:51:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 14:51:52 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6HLpng0029889 for ; Thu, 17 Jul 2008 14:51:50 -0700 X-ASG-Debug-ID: 1216331575-194f00f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rsbne02.RSBNE.LOCAL (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8FF49E5396A for ; Thu, 17 Jul 2008 14:52:56 -0700 (PDT) Received: from rsbne02.RSBNE.LOCAL (robert87.lnk.telstra.net [203.45.17.90]) by cuda.sgi.com with ESMTP id sRsQCCJk2ypeaA8Y for ; Thu, 17 Jul 2008 14:52:56 -0700 (PDT) X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-ASG-Orig-Subj: RE: Power loss causes bad magic number?? Subject: RE: Power loss causes bad magic number?? Date: Fri, 18 Jul 2008 07:52:43 +1000 Message-ID: In-Reply-To: <487F4AC5.3000806@thebarn.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: Power loss causes bad magic number?? Thread-Index: AcjoEhIMdqIsd+uCTw6sTnpWMVzIUAAP8H7Q References: <487D5F80.1050909@sandeen.net> <20080716073503.GE29319@disturbed> <487F4AC5.3000806@thebarn.com> From: "Stephen Porter" To: "Russell Cattelan" Cc: X-Barracuda-Connect: robert87.lnk.telstra.net[203.45.17.90] X-Barracuda-Start-Time: 1216331577 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0408 1.0000 -1.7578 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.76 X-Barracuda-Spam-Status: No, SCORE=-1.76 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56339 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m6HLpog0029891 X-archive-position: 16933 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: stephenp@r-s.com.au Precedence: bulk X-list: xfs -----Original Message----- From: Russell Cattelan [mailto:cattelan@thebarn.com] Sent: Thursday, 17 July 2008 11:36 PM To: Stephen Porter Cc: xfs@oss.sgi.com Subject: Re: Power loss causes bad magic number?? > Heh welcome to the world of linux's poor device name handling. Hehe, gee thanks! :) > Did you make some sort of change to the hardware? added drives, moved > cards around, etc? > Anything that changes the order that drives are discovered will affect > the sd[a-...] naming. No changes were made to the hardware, though as I mentioned originally I did loose power twice within a few hours, and it was the 2nd time the issue appeared. Having said that, after "fixing" the issue (updating the fstab entry) I have since installed a few updates, and it broke again (remapped back to sdc). :/ > Mount by label or mount by uuid may be your friend in this case. I think this is going to be my only option (unless I want to keep updating fstab entries each time _something_ updates on the box). Time to visit google again. I realise this is now way off topic, but is there a "preferred method" with regards to mounting by labels or uuid? Thanks. Stephen. From owner-xfs@oss.sgi.com Thu Jul 17 15:39:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 15:39:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6HMdAHk001328 for ; Thu, 17 Jul 2008 15:39:10 -0700 X-ASG-Debug-ID: 1216334415-362d03dc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5FDF718F2D52; Thu, 17 Jul 2008 15:40:16 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 4OIdGGs7c9phqKOs; Thu, 17 Jul 2008 15:40:16 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjwBADBmf0h5LFxAiGdsb2JhbACSPQEBAQ8gngk X-IronPort-AV: E=Sophos;i="4.31,205,1215354600"; d="scan'208";a="151816808" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 18 Jul 2008 08:10:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KJc8y-0001AY-QI; Fri, 18 Jul 2008 08:40:12 +1000 Date: Fri, 18 Jul 2008 08:40:12 +1000 From: Dave Chinner To: Vegard Nossum Cc: Eric Sandeen , Tim Shimmin , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, Johannes Weiner X-ASG-Orig-Subj: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Subject: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Message-ID: <20080717224012.GH29319@disturbed> Mail-Followup-To: Vegard Nossum , Eric Sandeen , Tim Shimmin , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, Johannes Weiner References: <19f34abd0807171046j425bebc6m8d8eb80a641e0e5b@mail.gmail.com> <487F980F.7070708@redhat.com> <19f34abd0807171218u3de86ddbt506b0b4fa0548406@mail.gmail.com> <19f34abd0807171229p724cc44ese3cb064a65fbd2c0@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19f34abd0807171229p724cc44ese3cb064a65fbd2c0@mail.gmail.com> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216334418 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0009 1.0000 -2.0155 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56342 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16934 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Jul 17, 2008 at 09:29:39PM +0200, Vegard Nossum wrote: > On Thu, Jul 17, 2008 at 9:18 PM, Vegard Nossum wrote: > > Thanks, you are right. I have adjusted my configuration, but I am > > still able to produce this: > > > > BUG: unable to handle kernel paging request at b62a66e0 > > IP: [] xfs_alloc_fix_freelist+0x28/0x490 > > FWIW, this is fs/xfs/xfs_alloc.c:1817: > > if (!pag->pagf_init) { Which kind of implies that we've got a bogus fsbno that we're using as the basis of allocation..... What is the corruption you are inducing? Can you produce a xfs_metadump image of the filesystem and put it up somewhere that we can access it? I suspect that we are not validating the block numbers coming out of the various btrees as landing inside the filesystem.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 17 23:23:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 23:23:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6I6NG4q008572 for ; Thu, 17 Jul 2008 23:23:19 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA14389; Fri, 18 Jul 2008 16:24:19 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id B444058C4C3F; Fri, 18 Jul 2008 16:24:19 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 984564 - split out xfs value-add from xfs_setattr Message-Id: <20080718062419.B444058C4C3F@chook.melbourne.sgi.com> Date: Fri, 18 Jul 2008 16:24:19 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16935 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs xfs_setattr currently doesn't just handle the attributes set through ->setattr but also addition XFS-specific attributes: project id, inode flags and extent size hint. Having these in a single function makes it more complicated and forces to have us a bhv_vattr intermediate structure eating up stackspace. This patch adds a new xfs_ioctl_setattr helper for the XFS ioctls that set these attributes and remove the code to set them through xfs_setattr. Signed-off-by: Christoph Hellwig Date: Fri Jul 18 16:22:14 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31677a fs/xfs/xfs_vnodeops.c - 1.763 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.763&r2=text&tr2=1.762&f=h fs/xfs/linux-2.6/xfs_ioctl.c - 1.168 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ioctl.c.diff?r1=text&tr1=1.168&r2=text&tr2=1.167&f=h fs/xfs/linux-2.6/xfs_vnode.h - 1.151 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.151&r2=text&tr2=1.150&f=h From owner-xfs@oss.sgi.com Thu Jul 17 23:30:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 23:30:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6I6U0KK009311 for ; Thu, 17 Jul 2008 23:30:03 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA14619; Fri, 18 Jul 2008 16:31:04 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id 0BCDF58C4C3F; Fri, 18 Jul 2008 16:31:04 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 984565 - simplify xfs_setattr with iattr directly Message-Id: <20080718063104.0BCDF58C4C3F@chook.melbourne.sgi.com> Date: Fri, 18 Jul 2008 16:31:04 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16936 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Now that xfs_setattr is only used for attributes set from ->setattr it can be switched to take struct iattr directly and thus simplify the implementation greatly. Also rename the ATTR_ flags to XFS_ATTR_ to not conflict with the ATTR_ flags used by the VFS. Signed-off-by: Christoph Hellwig Date: Fri Jul 18 16:29:44 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31678a fs/xfs/xfs_vnodeops.c - 1.764 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.764&r2=text&tr2=1.763&f=h fs/xfs/xfs_dmapi.h - 1.63 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dmapi.h.diff?r1=text&tr1=1.63&r2=text&tr2=1.62&f=h fs/xfs/xfs_acl.c - 1.75 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.c.diff?r1=text&tr1=1.75&r2=text&tr2=1.74&f=h fs/xfs/linux-2.6/xfs_ioctl.c - 1.169 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ioctl.c.diff?r1=text&tr1=1.169&r2=text&tr2=1.168&f=h fs/xfs/linux-2.6/xfs_vnode.h - 1.152 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.152&r2=text&tr2=1.151&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.292 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.292&r2=text&tr2=1.291&f=h fs/xfs/dmapi/xfs_dm.c - 1.74 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.74&r2=text&tr2=1.73&f=h fs/xfs/xfs_vnodeops.h - 1.19 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.h.diff?r1=text&tr1=1.19&r2=text&tr2=1.18&f=h From owner-xfs@oss.sgi.com Thu Jul 17 23:36:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 17 Jul 2008 23:36:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6I6aUGW010223 for ; Thu, 17 Jul 2008 23:36:32 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA14721; Fri, 18 Jul 2008 16:37:34 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id 7AC6458C4C3F; Fri, 18 Jul 2008 16:37:34 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 984566 - kill vn_revalidate - set inode fields in setattr explicitly Message-Id: <20080718063734.7AC6458C4C3F@chook.melbourne.sgi.com> Date: Fri, 18 Jul 2008 16:37:34 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16937 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Remove vn_revalidate calls in xfs. These days most of the attributes in struct inode are properly kept in sync by XFS. This patch removes the need for vn_revalidate completely by: - keeping inode.i_flags uptodate after any flags are updated in xfs_ioctl_setattr - keeping i_mode, i_uid and i_gid uptodate in xfs_setattr Signed-off-by: Christoph Hellwig Date: Fri Jul 18 16:36:39 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: hch@lst.de The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31679a fs/xfs/xfs_vnodeops.c - 1.765 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.765&r2=text&tr2=1.764&f=h - remove vn_revalidate calls in xfs. fs/xfs/linux-2.6/xfs_ioctl.c - 1.170 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ioctl.c.diff?r1=text&tr1=1.170&r2=text&tr2=1.169&f=h - remove vn_revalidate calls in xfs. fs/xfs/linux-2.6/xfs_vnode.c - 1.157 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.157&r2=text&tr2=1.156&f=h - remove vn_revalidate calls in xfs. fs/xfs/linux-2.6/xfs_vnode.h - 1.153 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.153&r2=text&tr2=1.152&f=h - remove vn_revalidate calls in xfs. fs/xfs/linux-2.6/xfs_iops.c - 1.293 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.293&r2=text&tr2=1.292&f=h - remove vn_revalidate calls in xfs. fs/xfs/linux-2.6/xfs_ksyms.c - 1.86 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.86&r2=text&tr2=1.85&f=h - remove vn_revalidate calls in xfs. fs/xfs/dmapi/xfs_dm.c - 1.75 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.75&r2=text&tr2=1.74&f=h - remove vn_revalidate calls in xfs. fs/xfs/linux-2.6/xfs_xattr.c - 1.3 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_xattr.c.diff?r1=text&tr1=1.3&r2=text&tr2=1.2&f=h - remove vn_revalidate calls in xfs. From owner-xfs@oss.sgi.com Fri Jul 18 04:16:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jul 2008 04:16:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6IBGN6n006211 for ; Fri, 18 Jul 2008 04:16:27 -0700 X-ASG-Debug-ID: 1216379851-4f1e00f50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp-out04.alice-dsl.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B8CC7304858 for ; Fri, 18 Jul 2008 04:17:31 -0700 (PDT) Received: from smtp-out04.alice-dsl.net (smtp-out04.alice-dsl.net [88.44.63.6]) by cuda.sgi.com with ESMTP id dbgL12MSjelldPmd for ; Fri, 18 Jul 2008 04:17:31 -0700 (PDT) Received: from out.alice-dsl.de ([192.168.125.61]) by smtp-out04.alice-dsl.net with Microsoft SMTPSVC(6.0.3790.1830); Fri, 18 Jul 2008 13:17:27 +0200 Received: from basil.firstfloor.org ([92.224.155.117]) by out.alice-dsl.de with Microsoft SMTPSVC(6.0.3790.1830); Fri, 18 Jul 2008 13:17:19 +0200 Received: by basil.firstfloor.org (Postfix, from userid 1000) id 59C7D1B4412; Fri, 18 Jul 2008 13:17:21 +0200 (CEST) To: "Stephen Porter" Cc: "Russell Cattelan" , X-ASG-Orig-Subj: Re: Power loss causes bad magic number?? Subject: Re: Power loss causes bad magic number?? From: Andi Kleen References: <487D5F80.1050909@sandeen.net> <20080716073503.GE29319@disturbed> <487F4AC5.3000806@thebarn.com> Date: Fri, 18 Jul 2008 13:17:21 +0200 In-Reply-To: (Stephen Porter's message of "Fri, 18 Jul 2008 07:52:43 +1000") Message-ID: <87zlofqw5a.fsf@basil.nowhere.org> User-Agent: Gnus/5.1008 (Gnus v5.10.8) Emacs/21.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-OriginalArrivalTime: 18 Jul 2008 11:17:19.0486 (UTC) FILETIME=[D7B071E0:01C8E8C7] X-Barracuda-Connect: smtp-out04.alice-dsl.net[88.44.63.6] X-Barracuda-Start-Time: 1216379852 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0219 1.0000 -1.8791 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.88 X-Barracuda-Spam-Status: No, SCORE=-1.88 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56391 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16938 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: andi@firstfloor.org Precedence: bulk X-list: xfs "Stephen Porter" writes: > > I think this is going to be my only option (unless I want to keep > updating fstab entries each time _something_ updates on the box). Time > to visit google again. I realise this is now way off topic, but is > there a "preferred method" with regards to mounting by labels or uuid? Modern distributions generall give you several other options using udev. e.g. common is using /dev/disk/by-path/ (which should be stable) Drawback is that this always requires a initrd for mounting / -Andi From owner-xfs@oss.sgi.com Fri Jul 18 07:54:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jul 2008 07:54:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6IEsm5d026219 for ; Fri, 18 Jul 2008 07:54:49 -0700 X-ASG-Debug-ID: 1216392953-6a0900760000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtprelay01.ispgateway.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 41A2F18F63A9 for ; Fri, 18 Jul 2008 07:55:54 -0700 (PDT) Received: from smtprelay01.ispgateway.de (smtprelay01.ispgateway.de [80.67.18.13]) by cuda.sgi.com with ESMTP id G4XLEFkjgTOALKL1 for ; Fri, 18 Jul 2008 07:55:54 -0700 (PDT) Received: from [62.43.225.238] (helo=[192.168.30.191]) by smtprelay01.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KJrNA-0000ps-QO for xfs@oss.sgi.com; Fri, 18 Jul 2008 16:55:53 +0200 Message-ID: <4880AEF8.2080906@cape-horn-eng.com> Date: Fri, 18 Jul 2008 16:55:52 +0200 From: Richard Ems User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: XFS internal error xfs_btree_check_lblock Subject: XFS internal error xfs_btree_check_lblock X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Df-Sender: 337294 X-Barracuda-Connect: smtprelay01.ispgateway.de[80.67.18.13] X-Barracuda-Start-Time: 1216392955 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56406 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16939 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Richard.Ems@cape-horn-eng.com Precedence: bulk X-list: xfs Hi, this FS error occurred on an openSUSE 10.3 64 bit, with all openSUSE updates. xfsprogs is xfsprogs-2.9.4-17.1 . The filesystem with the error is our /home, on an Areca ARC-1220 RAID Controller, 6 Hitachi 1TB disks on RAID 5. The controller reports all disks are fine, no errors. The system had an uptime of 74 days, and had no problems with any FS before. First errors logged on /var/log/messages start at today 11:16 : Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 2 times Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 10 Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 11 Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 20 times Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 12 Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 13 Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: 13 and this continues up to 11:58 where we got Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. Caller 0xffffffff88306053 Jul 18 11:58:37 c3m kernel: Jul 18 11:58:37 c3m kernel: Call Trace: Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_btree_check_lblock+0xf4/0xfe Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_bmbt_lookup+0x16e/0x44b Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_bmap_add_extent_delay_real+0x3f7/0xf16 Jul 18 11:58:37 c3m kernel: [] __up_read+0x13/0x8a Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_bmap_btalloc+0x5d7/0x693 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_bmap_add_extent+0x21c/0x3ad Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_btree_init_cursor+0x37/0x168 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_bmapi+0xa98/0x108f Jul 18 11:58:37 c3m kernel: [] cfq_set_request+0x2e7/0x345 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_trans_reserve+0xdd/0x1b0 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_iomap_write_allocate+0x255/0x3ce Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_iomap+0x2a3/0x33b Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_map_blocks+0x35/0x66 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_submit_ioend+0xb2/0xc4 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_page_state_convert+0x2b3/0x556 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_vm_writepage+0xa7/0xe0 Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 Jul 18 11:58:37 c3m kernel: [] write_cache_pages+0x184/0x2cd Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_acceptable+0x0/0xca Jul 18 11:58:37 c3m kernel: [] do_writepages+0x20/0x2d Jul 18 11:58:37 c3m kernel: [] __filemap_fdatawrite_range+0x5b/0x6e Jul 18 11:58:37 c3m kernel: [] __dentry_open+0x101/0x1aa Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_sync+0x5b/0xa5 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_commit+0x57/0x7a Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd3_proc_commit+0xc5/0xd2 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_dispatch+0xdd/0x19e Jul 18 11:58:37 c3m kernel: [] :sunrpc:svc_process+0x3e1/0x726 Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 Jul 18 11:58:37 c3m kernel: Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller 0xffffffff88321fd2 Jul 18 11:58:37 c3m kernel: Jul 18 11:58:37 c3m kernel: Call Trace: Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_trans_cancel+0x5c/0xf2 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_iomap_write_allocate+0x3a8/0x3ce Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_iomap+0x2a3/0x33b Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_map_blocks+0x35/0x66 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_submit_ioend+0xb2/0xc4 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_page_state_convert+0x2b3/0x556 Jul 18 11:58:37 c3m kernel: [] :xfs:xfs_vm_writepage+0xa7/0xe0 Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 Jul 18 11:58:37 c3m kernel: [] write_cache_pages+0x184/0x2cd Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_acceptable+0x0/0xca Jul 18 11:58:37 c3m kernel: [] do_writepages+0x20/0x2d Jul 18 11:58:37 c3m kernel: [] __filemap_fdatawrite_range+0x5b/0x6e Jul 18 11:58:37 c3m kernel: [] __dentry_open+0x101/0x1aa Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_sync+0x5b/0xa5 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_commit+0x57/0x7a Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd3_proc_commit+0xc5/0xd2 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_dispatch+0xdd/0x19e Jul 18 11:58:37 c3m kernel: [] :sunrpc:svc_process+0x3e1/0x726 Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 Jul 18 11:58:37 c3m kernel: Jul 18 11:58:37 c3m kernel: xfs_force_shutdown(sdc1,0x8) called from line 1133 of file fs/xfs/xfs_trans.c. Return address = 0xffffffff8832ea7c Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": Corruption of in-memory data detected. Shutting down filesystem: sdc1 Jul 18 11:58:37 c3m kernel: Please umount the filesystem, and rectify the problem(s) Jul 18 11:58:37 c3m kernel: nfsd: non-standard errno: -117 It was impossible for me to xfs_check (out of memory) or repair without rebooting. After rebooting only "xfs_repair -L" worked and repaired the FS, but short time later it failed again and it continues failing after each repair. What's happening here? Any help would be very appreciated! Many thanks, Richard # grep -i "xfs internal error" /var/log/messages | wc -l 182 # grep -i "xfs internal error" /var/log/messages Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. Caller 0xffffffff88306053 Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller 0xffffffff88321fd2 Jul 18 12:39:51 c3m kernel: Filesystem "sdc1": XFS internal error xlog_recover_do_inode_trans(1) at line 2310 of file fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e Jul 18 12:41:32 c3m kernel: Filesystem "sdc1": XFS internal error xlog_recover_do_inode_trans(1) at line 2310 of file fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e Jul 18 12:44:15 c3m kernel: Filesystem "sdc1": XFS internal error xlog_recover_do_inode_trans(1) at line 2310 of file fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e Jul 18 12:57:35 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:35 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:39 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:39 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:39 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:39 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:40 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:42 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:45 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:46 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:47 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:47 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:48 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:49 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:53 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:15 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d7451 Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:09:32 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:09:32 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:18:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 13:18:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc Jul 18 16:21:48 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:48 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:49 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller 0xffffffff882d8451 Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller 0xffffffff88304f9e -- Richard Ems mail: Richard.Ems@Cape-Horn-Eng.com Cape Horn Engineering S.L. C/ Dr. J.J. Dómine 1, 5º piso 46011 Valencia Tel : +34 96 3242923 / Fax 924 -- Richard Ems mail: Richard.Ems@Cape-Horn-Eng.com Cape Horn Engineering S.L. C/ Dr. J.J. Dómine 1, 5º piso 46011 Valencia Tel : +34 96 3242923 / Fax 924 From owner-xfs@oss.sgi.com Fri Jul 18 20:07:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 18 Jul 2008 20:08:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6J37U3B019076 for ; Fri, 18 Jul 2008 20:07:32 -0700 Received: from [134.15.251.3] (melb-sw-corp-251-3.corp.sgi.com [134.15.251.3]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA07961; Sat, 19 Jul 2008 13:08:25 +1000 Message-ID: <48815AA6.3080102@sgi.com> Date: Sat, 19 Jul 2008 13:08:22 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Richard Ems CC: xfs@oss.sgi.com, "Bill O'Donnell" Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> In-Reply-To: <4880AEF8.2080906@cape-horn-eng.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16940 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Hi Richard, this looks like XFS b-tree corruption of some sort. We have some patches that should help here. The patches are being back-ported to SLES10 and should also apply to OpenSUSE. We should have something ready early next week. Cheers -- Mark Richard Ems wrote: > Hi, > > this FS error occurred on an openSUSE 10.3 64 bit, with all openSUSE > updates. xfsprogs is xfsprogs-2.9.4-17.1 . > > The filesystem with the error is our /home, on an Areca ARC-1220 RAID > Controller, 6 Hitachi 1TB disks on RAID 5. > > The controller reports all disks are fine, no errors. > > The system had an uptime of 74 days, and had no problems with any FS > before. > > > First errors logged on /var/log/messages start at today 11:16 : > > Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in > inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 lastx: f > Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 2 times > Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in > inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 > lastx: 10 > Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times > Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in > inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 > lastx: 11 > Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 20 times > Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in > inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 > lastx: 12 > Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times > Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in > inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 > lastx: 13 > Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero in > inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 > lastx: 13 > > > and this continues up to 11:58 where we got > > > Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff88306053 > Jul 18 11:58:37 c3m kernel: > Jul 18 11:58:37 c3m kernel: Call Trace: > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_btree_check_lblock+0xf4/0xfe > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_bmbt_lookup+0x16e/0x44b > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_bmap_add_extent_delay_real+0x3f7/0xf16 > Jul 18 11:58:37 c3m kernel: [] __up_read+0x13/0x8a > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_bmap_btalloc+0x5d7/0x693 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_bmap_add_extent+0x21c/0x3ad > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_btree_init_cursor+0x37/0x168 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_bmapi+0xa98/0x108f > Jul 18 11:58:37 c3m kernel: [] > cfq_set_request+0x2e7/0x345 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_trans_reserve+0xdd/0x1b0 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_iomap_write_allocate+0x255/0x3ce > Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_iomap+0x2a3/0x33b > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_map_blocks+0x35/0x66 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_submit_ioend+0xb2/0xc4 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_page_state_convert+0x2b3/0x556 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_vm_writepage+0xa7/0xe0 > Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 > Jul 18 11:58:37 c3m kernel: [] > write_cache_pages+0x184/0x2cd > Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd_acceptable+0x0/0xca > Jul 18 11:58:37 c3m kernel: [] do_writepages+0x20/0x2d > Jul 18 11:58:37 c3m kernel: [] > __filemap_fdatawrite_range+0x5b/0x6e > Jul 18 11:58:37 c3m kernel: [] __dentry_open+0x101/0x1aa > Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_sync+0x5b/0xa5 > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd_commit+0x57/0x7a > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd3_proc_commit+0xc5/0xd2 > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd_dispatch+0xdd/0x19e > Jul 18 11:58:37 c3m kernel: [] > :sunrpc:svc_process+0x3e1/0x726 > Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a > Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 > Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 > Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 > Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 > Jul 18 11:58:37 c3m kernel: > Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller > 0xffffffff88321fd2 > Jul 18 11:58:37 c3m kernel: > Jul 18 11:58:37 c3m kernel: Call Trace: > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_trans_cancel+0x5c/0xf2 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_iomap_write_allocate+0x3a8/0x3ce > Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_iomap+0x2a3/0x33b > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_map_blocks+0x35/0x66 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_submit_ioend+0xb2/0xc4 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_page_state_convert+0x2b3/0x556 > Jul 18 11:58:37 c3m kernel: [] > :xfs:xfs_vm_writepage+0xa7/0xe0 > Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 > Jul 18 11:58:37 c3m kernel: [] > write_cache_pages+0x184/0x2cd > Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd_acceptable+0x0/0xca > Jul 18 11:58:37 c3m kernel: [] do_writepages+0x20/0x2d > Jul 18 11:58:37 c3m kernel: [] > __filemap_fdatawrite_range+0x5b/0x6e > Jul 18 11:58:37 c3m kernel: [] __dentry_open+0x101/0x1aa > Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd_sync+0x5b/0xa5 > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd_commit+0x57/0x7a > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd3_proc_commit+0xc5/0xd2 > Jul 18 11:58:37 c3m kernel: [] > :nfsd:nfsd_dispatch+0xdd/0x19e > Jul 18 11:58:37 c3m kernel: [] > :sunrpc:svc_process+0x3e1/0x726 > Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a > Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 > Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 > Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 > Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 > Jul 18 11:58:37 c3m kernel: > Jul 18 11:58:37 c3m kernel: xfs_force_shutdown(sdc1,0x8) called from > line 1133 of file fs/xfs/xfs_trans.c. Return address = 0xffffffff8832ea7c > Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": Corruption of in-memory > data detected. Shutting down filesystem: sdc1 > Jul 18 11:58:37 c3m kernel: Please umount the filesystem, and rectify > the problem(s) > Jul 18 11:58:37 c3m kernel: nfsd: non-standard errno: -117 > > > > It was impossible for me to xfs_check (out of memory) or repair without > rebooting. > After rebooting only "xfs_repair -L" worked and repaired the FS, but > short time > later it failed again and it continues failing after each repair. > > What's happening here? > > Any help would be very appreciated! > > Many thanks, Richard > > > > # grep -i "xfs internal error" /var/log/messages | wc -l > 182 > > # grep -i "xfs internal error" /var/log/messages > Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff88306053 > Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller > 0xffffffff88321fd2 > Jul 18 12:39:51 c3m kernel: Filesystem "sdc1": XFS internal error > xlog_recover_do_inode_trans(1) at line 2310 of file > fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e > Jul 18 12:41:32 c3m kernel: Filesystem "sdc1": XFS internal error > xlog_recover_do_inode_trans(1) at line 2310 of file > fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e > Jul 18 12:44:15 c3m kernel: Filesystem "sdc1": XFS internal error > xlog_recover_do_inode_trans(1) at line 2310 of file > fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e > Jul 18 12:57:35 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:35 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:36 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:37 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:38 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:39 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:39 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:39 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:39 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:40 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:40 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:42 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:45 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:46 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:47 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:47 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:48 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:49 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:53 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:57:54 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:15 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d7451 > Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 12:58:16 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:43 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:44 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:45 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:02:46 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882ff9bc > Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:09:31 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:09:32 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:09:32 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:18:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 13:18:06 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff882fc9bc > Jul 18 16:21:48 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:48 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:49 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:50 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:51 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:52 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:53 c3m kernel: XFS internal error XFS_WANT_CORRUPTED_GOTO > at line 4522 of file fs/xfs/xfs_bmap.c. Caller 0xffffffff883009bc > Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. Caller > 0xffffffff882d8451 > Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error > xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller > 0xffffffff88304f9e > > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Sat Jul 19 06:14:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jul 2008 06:14:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_23 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6JDEtbG006630 for ; Sat, 19 Jul 2008 06:14:56 -0700 X-ASG-Debug-ID: 1216473363-5c6700ff0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rv-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 34D7C30934C for ; Sat, 19 Jul 2008 06:16:03 -0700 (PDT) Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.241]) by cuda.sgi.com with ESMTP id GuACr5iSH5l8XjL9 for ; Sat, 19 Jul 2008 06:16:03 -0700 (PDT) Received: by rv-out-0708.google.com with SMTP id f25so501550rvb.32 for ; Sat, 19 Jul 2008 06:16:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=aeIjjKclQuf8QOaULXd36fIKnMLR6CW/dsNILxKZz3k=; b=I64xQEbqaTVnSHZeGtAL76QSlGTNfrRUqYZPwGHaB1Dyimv0FwSffPJu6KA08MxCwb T0ZsQwowYPqG34qmaF2FhfZrkD6oIQBs7B8Hz55CYoyY1SRdwl4R3yxUwKpH5WprX6qc NO1lqqfk518/rBu6e3quXTgSOPle1OS9m/7UY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ruHj6t1eG+yyDFTVI01b/4MrZn80Klq/bQj0b/n4qkrlynH9a4SOlGxXqkH9w8HKTd WV5CLjbLNgVmzedf0nqVMBI7lTufZHDc9KWCTuBz2sY8g7lkPTEsItb1M69LOHrq3zxe NgjwckH/oxNl47CEIGfzyxnUJAj2mMhbKpuGs= Received: by 10.141.197.21 with SMTP id z21mr335025rvp.72.1216473363189; Sat, 19 Jul 2008 06:16:03 -0700 (PDT) Received: by 10.141.145.9 with HTTP; Sat, 19 Jul 2008 06:16:03 -0700 (PDT) Message-ID: <19f34abd0807190616p47e7b0c8wf2f1004f09e6a592@mail.gmail.com> Date: Sat, 19 Jul 2008 15:16:03 +0200 From: "Vegard Nossum" To: "Vegard Nossum" , "Eric Sandeen" , "Tim Shimmin" , xfs@oss.sgi.com, linux-kernel@vger.kernel.org, "Johannes Weiner" X-ASG-Orig-Subj: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! Subject: Re: latest -git: kernel BUG at fs/xfs/support/debug.c:54! In-Reply-To: <20080717224012.GH29319@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <19f34abd0807171046j425bebc6m8d8eb80a641e0e5b@mail.gmail.com> <487F980F.7070708@redhat.com> <19f34abd0807171218u3de86ddbt506b0b4fa0548406@mail.gmail.com> <19f34abd0807171229p724cc44ese3cb064a65fbd2c0@mail.gmail.com> <20080717224012.GH29319@disturbed> X-Barracuda-Connect: rv-out-0708.google.com[209.85.198.241] X-Barracuda-Start-Time: 1216473364 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56490 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16941 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: vegard.nossum@gmail.com Precedence: bulk X-list: xfs On Fri, Jul 18, 2008 at 12:40 AM, Dave Chinner wrote: > On Thu, Jul 17, 2008 at 09:29:39PM +0200, Vegard Nossum wrote: >> On Thu, Jul 17, 2008 at 9:18 PM, Vegard Nossum wrote: >> > Thanks, you are right. I have adjusted my configuration, but I am >> > still able to produce this: >> > >> > BUG: unable to handle kernel paging request at b62a66e0 >> > IP: [] xfs_alloc_fix_freelist+0x28/0x490 >> >> FWIW, this is fs/xfs/xfs_alloc.c:1817: >> >> if (!pag->pagf_init) { > > Which kind of implies that we've got a bogus fsbno > that we're using as the basis of allocation..... > > What is the corruption you are inducing? Can you produce > a xfs_metadump image of the filesystem and put it up somewhere > that we can access it? > > I suspect that we are not validating the block numbers coming > out of the various btrees as landing inside the filesystem.... The method of corruption is quite crude (but efficient); just flip a number of bits at random before mounting. I got a different crash (NULL pointer) now, and I have a reproducible case with a full disk image (it's only about 11M compressed, no private/sensitive data). See http://userweb.kernel.org/~vegard/bugs/20080719-xfs/ The way to reproduce: mount -o loop disk.xfs_idestroy_fork.bin /mnt rm -rf /mnt/* And it should give something like this: BUG: unable to handle kernel NULL pointer dereference at 00000008 IP: [] xfs_idestroy_fork+0x1f/0xe0 *pde = 00000000 Oops: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC Pid: 3966, comm: rm Not tainted (2.6.26-03421-g253a722 #49) EIP: 0060:[] EFLAGS: 00210202 CPU: 1 EIP is at xfs_idestroy_fork+0x1f/0xe0 EAX: f5402a00 EBX: 00000000 ECX: f5ff0da0 EDX: 00000001 ESI: 00000001 EDI: f5402a00 EBP: f5fe5e7c ESP: f5fe5e70 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 Process rm (pid: 3966, ti=f5fe4000 task=f5f1cfb0 task.ti=f5fe4000) Stack: f5402a00 00000000 f5fe5ecc f5fe5ea4 c035f729 00000000 00000004 00000002 f79e4180 f5ff0cd0 f5402a00 f5ff0520 00000001 f5fe5ee0 c035f91e 00000000 00000000 00000000 00000001 f79e4180 f5f1cfb0 00000000 c01590ae f5ff0a40 Call Trace: [] ? xfs_inactive_attrs+0xe9/0x100 [] ? xfs_inactive+0x1de/0x4e0 [] ? get_lock_stats+0x1e/0x50 [] ? put_lock_stats+0xd/0x30 [] ? xfs_fs_clear_inode+0x8a/0xe0 [] ? clear_inode+0x7c/0x160 [] ? generic_delete_inode+0x10e/0x120 [] ? generic_drop_inode+0x127/0x180 [] ? iput+0x47/0x50 [] ? do_unlinkat+0xec/0x170 [] ? trace_hardirqs_on_thunk+0xc/0x10 [] ? trace_hardirqs_on_caller+0x116/0x170 [] ? sys_unlinkat+0x23/0x50 [] ? sysenter_past_esp+0x78/0xc5 ======================= Code: c9 c3 8d 76 00 8d bc 27 00 00 00 00 55 89 e5 83 ec 0c 85 d2 89 1c 24 8d 58 38 89 74 24 04 89 d6 89 7c 24 08 89 c7 74 03 8b 58 34 <8b> 43 08 85 c0 74 10 0f bf 53 0c e8 c1 11 02 00 c7 43 08 00 00 EIP: [] xfs_idestroy_fork+0x1f/0xe0 SS:ESP 0068:f5fe5e70 ---[ end trace 9a7a5b8ebfdbeebf ]--- Vegard -- "The animistic metaphor of the bug that maliciously sneaked in while the programmer was not looking is intellectually dishonest as it disguises that the error is the programmer's own creation." -- E. W. Dijkstra, EWD1036 From owner-xfs@oss.sgi.com Sat Jul 19 09:34:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jul 2008 09:35:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6JGYruj022930 for ; Sat, 19 Jul 2008 09:34:53 -0700 X-ASG-Debug-ID: 1216485362-4fb4030b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C51B23080E3 for ; Sat, 19 Jul 2008 09:36:02 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id PWtXntGSKDLmr9tM for ; Sat, 19 Jul 2008 09:36:02 -0700 (PDT) Received: by sandeen.net (Postfix, from userid 48) id A9B8AAC3592; Sat, 19 Jul 2008 11:36:01 -0500 (CDT) Received: from 209.191.209.36 (SquirrelMail authenticated user sandeen) by sandeen.net with HTTP; Sat, 19 Jul 2008 11:36:01 -0500 (CDT) Message-ID: <63536.209.191.209.36.1216485361.squirrel@sandeen.net> In-Reply-To: <48815AA6.3080102@sgi.com> References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> Date: Sat, 19 Jul 2008 11:36:01 -0500 (CDT) X-ASG-Orig-Subj: Re: XFS internal error xfs_btree_check_lblock Subject: Re: XFS internal error xfs_btree_check_lblock From: sandeen@sandeen.net To: markgw@sgi.com Cc: "Richard Ems" , xfs@oss.sgi.com, "Bill O'Donnell" User-Agent: SquirrelMail/1.4.8-4.0.1.el4.centos MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216485362 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.47 X-Barracuda-Spam-Status: No, SCORE=-1.47 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=NO_REAL_NAME X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56503 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.55 NO_REAL_NAME From: does not include a real name X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16942 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs > Hi Richard, > > this looks like XFS b-tree corruption of some sort. We have some patches > that should help here. The patches are being back-ported to SLES10 and > should also apply to OpenSUSE. We should have something ready early next > week. (oops this time to the list) Mark, are these corruptions that are already fixed upstream? Any pointers to the commits if so, or bugs/reviews if not? Thanks, -Eric From owner-xfs@oss.sgi.com Sat Jul 19 19:01:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jul 2008 19:01:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.1 required=5.0 tests=BAYES_50, RCVD_IN_BL_SPAMCOP_NET,RDNS_NONE,SUBJ_FORWARDED autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6K21rn7001171 for ; Sat, 19 Jul 2008 19:01:53 -0700 X-ASG-Debug-ID: 1216519372-624602c30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ironport2.grupoeulen.cl (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DAC611905989; Sat, 19 Jul 2008 19:02:54 -0700 (PDT) Received: from ironport2.grupoeulen.cl (201-236-78-85.static.tie.cl [201.236.78.85]) by cuda.sgi.com with ESMTP id MMcFF5xtjAvncIMs; Sat, 19 Jul 2008 19:02:54 -0700 (PDT) X-IronPort-AV: E=Sophos;i="4.31,216,1215403200"; d="scan'208";a="7063224" Received: from stdm004.eulen.cl ([192.168.9.6]) by ironport2.grupoeulen.cl with ESMTP; 19 Jul 2008 17:14:17 -0400 Received: from ubbi.com.br ([201.13.97.162]) by stdm004.eulen.cl with Microsoft SMTPSVC(6.0.3790.3959); Sat, 19 Jul 2008 15:39:09 -0400 Message-ID: <4115-220087619193319418@ubbi.com.br> X-EM-Version: 6, 0, 0, 4 X-EM-Registration: #00F06206106618006920 X-Priority: 3 Reply-To: tvdw@bol.com.br To: "undisclosed" From: "Maria Ap." X-ASG-Orig-Subj: Fw: TV pela Internet Subject: Fw: TV pela Internet Date: Sat, 19 Jul 2008 16:33:19 -0300 MIME-Version: 1.0 Content-type: text/plain; charset="windows-1252" X-OriginalArrivalTime: 19 Jul 2008 19:39:10.0417 (UTC) FILETIME=[1D9DA410:01C8E9D7] X-Barracuda-Connect: 201-236-78-85.static.tie.cl[201.236.78.85] X-Barracuda-Start-Time: 1216519381 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5022 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56540 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by oss.sgi.com id m6K21sn7001176 X-archive-position: 16943 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: mardapp@ubbi.com.br Precedence: bulk X-list: xfs Segue e-mail recebido. Vamos divulgar galera! Assistir TV Digital pelo computador SEM PAGAR NADA e SEM BAIXAR NENHUM PROGRAMA. É possível? Agora é! www.pctv.4d2.net - é o site TV Digital Web. Quem não gostaria de ver algum programa ou ouvir uma rádio enquanto trabalha ou diverte-se no computador? É só acessar, o site é www.pctv.4d2.net Diversos canais da TV Aberta e até mesmo da TV A CABO. É possível assistir em Tempo Real sem pagar nada, com apenas 1 clique. Também inclui diversas Rádios online. A TV Digital agora está acessível aos computadores gratuitamente. Vamos divulgar ao maior número de pessoas, mandem aos seus amigos, parentes, etc. Abraços! From owner-xfs@oss.sgi.com Sat Jul 19 20:03:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 19 Jul 2008 20:03:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.1 required=5.0 tests=BAYES_50,HTML_MESSAGE, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6K33S0R004934 for ; Sat, 19 Jul 2008 20:03:29 -0700 X-ASG-Debug-ID: 1216523063-0db800150000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from D108.worldwebleaders.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 316E51905A7D for ; Sat, 19 Jul 2008 20:04:26 -0700 (PDT) Received: from D108.worldwebleaders.com ([69.50.195.208]) by cuda.sgi.com with ESMTP id w0MD6lxw2h9JCg6H for ; Sat, 19 Jul 2008 20:04:26 -0700 (PDT) Received: from mail pickup service by D108.worldwebleaders.com with Microsoft SMTPSVC; Sat, 19 Jul 2008 20:03:52 -0700 thread-index: AcjqFTwsaZhe53eJS0ibEZQzEyE9Yg== Thread-Topic: free job posting + resume access From: To: X-ASG-Orig-Subj: free job posting + resume access Subject: free job posting + resume access Date: Sat, 19 Jul 2008 20:03:51 -0700 Message-ID: <2BC15C506BA14CE8A27AD737CF1614D3@D108> MIME-Version: 1.0 X-Mailer: Microsoft CDO for Windows 2000 Importance: high Priority: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4133 X-OriginalArrivalTime: 20 Jul 2008 03:03:52.0418 (UTC) FILETIME=[3D53E420:01C8EA15] X-Barracuda-Connect: UNKNOWN[69.50.195.208] X-Barracuda-Start-Time: 1216523077 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.58 X-Barracuda-Spam-Status: No, SCORE=0.58 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE, HTML_TAG_EXIST_MARQUEE, MARKETING_SUBJECT, NO_REAL_NAME, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56544 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.55 NO_REAL_NAME From: does not include a real name 1.35 HTML_TAG_EXIST_MARQUEE BODY: HTML has "marquee" tag 0.00 HTML_MESSAGE BODY: HTML included in message 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 1317 X-archive-position: 16944 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hr@amitjobs.co.in Precedence: bulk X-list: xfs Amitjobs.com Jobseekers : Post your resume free and see your resume in our home page. Tariff For Job Posting No. of jobs Features Job Validity Account Validity Charges 01 Free resume access 45 days 2 days Free 01 Free resume access 45 days 6 months Rs.240/- only 05 Free resume access 45 days 6 months Rs.1200/- only 10 Free resume access + Home page link. 45 days 6 months Rs.2400/- only 20 Free resume access + Home page link. 45 days 6 months Rs.4800/- only 50 Free resume access + Home page link. 45 days 6 months Rs.12000/- only 100 Free resume access + Home page link. 45 days 1 year Rs.24000/- only 500 Free resume access + Home page link + Company banner + Some pages 45 days 1 year Rs 01 lakh only 1000 Free resume access + Home page link + Company banner + Some pages 45 days 1 year Rs 1.5 lakh only Post your jobs today otherwise you are missing something very big. Banner advtertisement in just Rs 2K- per month and 20K - per year. How to post your jobs ? (1) Vist : www.amitjobs.com or www.amitjobs.co.in (2) Click on Employers login then click on register now. (3) Then follow the instructions. From, Amit Sharma Ph : +91-9818425715. Email : ceo@amitjobs.co.in [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Sun Jul 20 05:00:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:00:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KC0XS0018159 for ; Sun, 20 Jul 2008 05:00:34 -0700 X-ASG-Debug-ID: 1216555302-7e8003610000-ps1ADW X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ty.sabi.co.UK (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2DA7130B029 for ; Sun, 20 Jul 2008 05:01:42 -0700 (PDT) Received: from ty.sabi.co.UK (82-69-39-138.dsl.in-addr.zen.co.uk [82.69.39.138]) by cuda.sgi.com with ESMTP id ZltZ95sromzZbo1G for ; Sun, 20 Jul 2008 05:01:42 -0700 (PDT) Received: from from [127.0.0.1] (helo=tree.ty.sabi.co.uk) by ty.sabi.co.UK with esmtp(Exim 4.68 #1) id 1KJuYV-0003A0-2A for ; Fri, 18 Jul 2008 19:19:47 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18560.57006.898336.560030@tree.ty.sabi.co.uk> Date: Fri, 18 Jul 2008 19:19:26 +0100 X-Face: SMJE]JPYVBO-9UR%/8d'mG.F!@.,l@c[f'[%S8'BZIcbQc3/">GrXDwb#;fTRGNmHr^JFb SAptvwWc,0+z+~p~"Gdr4H$(|N(yF(wwCM2bW0~U?HPEE^fkPGx^u[*[yV.gyB!hDOli}EF[\cW*S H&spRGFL}{`bj1TaD^l/"[ msn( /TH#THs{Hpj>)]f> X-ASG-Orig-Subj: RE: Power loss causes bad magic number?? Subject: RE: Power loss causes bad magic number?? In-Reply-To: References: <487D5F80.1050909@sandeen.net> <20080716073503.GE29319@disturbed> X-Mailer: VM 7.17 under 21.5 (beta28) XEmacs Lucid From: pg_xf2@xf2.for.sabi.co.UK (Peter Grandi) X-Disclaimer: This message contains only personal opinions X-Barracuda-Connect: 82-69-39-138.dsl.in-addr.zen.co.uk[82.69.39.138] X-Barracuda-Start-Time: 1216555303 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.70 X-Barracuda-Spam-Status: No, SCORE=-1.70 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=FROM_HAS_ULINE_NUMS, RDNS_DYNAMIC X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56579 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.22 FROM_HAS_ULINE_NUMS From: contains an underline and numbers/letters 0.10 RDNS_DYNAMIC Delivered to trusted network by host with dynamic-looking rDNS X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16945 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: pg_xf2@xf2.for.sabi.co.UK Precedence: bulk X-list: xfs [ ... ] > [ ... ] ls of /dev/sd* and the devices have been remapped (any > idea what would have caused that?), sdc is no longer sdc, it > is now sda, the boot devices are now detected as sdb and sdc > (2 mirrored physical disks, used to be sda and sdb). A BIOS or OS upgrade or just about anything might change the names of any device because there isn't any well defined enumeration order for devices. Therefore the only safe option is the same as used by XFS or MD: to give a unique name/token, but to all storage volumes. The most useful scheme would be to give unique names to container volumes like hard drives and then position based letters/numbers for partitions (because for partitions the ordering is well defined), but no current GNU/Linux distro supports that. Probably you should then investigate the 'LABEL=' and 'UUID=' options of '/etc/fstab'. > How was the machine able to boot? [ ... ] Depends a bit on which booter you have installed; for example LILO nowadays uses MS-DOS volume IDs to identify hard drives. GRUB does not, and therefore I have stopped using it, as the frequent drive reordering that I suffer has made it almost unusable. Also, the BIOS (used for booting) and Linux can and will number drives in a different order, so the BIOS boot drive may well be not '/dev/sda' or '/dev/hda'. From owner-xfs@oss.sgi.com Sun Jul 20 05:18:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:18:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCInvU019355 for ; Sun, 20 Jul 2008 05:18:49 -0700 X-ASG-Debug-ID: 1216556397-172601e10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6C1BEE63FE5 for ; Sun, 20 Jul 2008 05:19:57 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id AuCeePSjt5UmH7vR for ; Sun, 20 Jul 2008 05:19:57 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBALvHgkh5LFxAiGdsb2JhbACSQgEBAQ8gmjc X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153552232" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 21:49:55 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKXtK-0006cT-IA for xfs@oss.sgi.com; Sun, 20 Jul 2008 22:19:54 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals Subject: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals Date: Sun, 20 Jul 2008 22:19:50 +1000 Message-Id: <1216556394-17529-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216556398 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56580 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16946 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs The list of all inodes on a mount is superfluous. We can traverse all inodes now by walking the per-AG inode radix trees without needing a separate list. This enables us to remove a bunch of complex list traversal code and remove another two pointers from the xfs_inode. Also, by replacing the sync traversal with an ascending inode number traversal, we will issue better inode I/O patterns for writeback triggered by xfssyncd or unmount. Diffstat for the change: xfs/quota/xfs_qm_syscalls.c | 120 ++++++-------- xfs/xfs_iget.c | 42 ----- xfs/xfs_inode.c | 39 ---- xfs/xfs_inode.h | 11 - xfs/xfs_mount.c | 7 xfs/xfs_mount.h | 1 xfs/xfs_vfsops.c | 366 ++++++++++++-------------------------------- xfs/xfs_vnodeops.c | 42 ++--- 8 files changed, 176 insertions(+), 452 deletions(-) From owner-xfs@oss.sgi.com Sun Jul 20 05:18:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:19:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCIsdF019391 for ; Sun, 20 Jul 2008 05:18:54 -0700 X-ASG-Debug-ID: 1216556402-172501d50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 55A5DE63FEC for ; Sun, 20 Jul 2008 05:20:02 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id xBJ6qUBVhzeADmFR for ; Sun, 20 Jul 2008 05:20:02 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBALvHgkh5LFxAiGdsb2JhbACSQgEBAQ8gmjc X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153552236" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 21:49:55 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKXtK-0006cs-QK; Sun, 20 Jul 2008 22:19:54 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 3/4] XFS: Traverse inode trees when releasing dquots Subject: [PATCH 3/4] XFS: Traverse inode trees when releasing dquots Date: Sun, 20 Jul 2008 22:19:53 +1000 Message-Id: <1216556394-17529-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216556394-17529-1-git-send-email-david@fromorbit.com> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216556403 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56580 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16950 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Make releasing all inode dquots traverse the per-ag inode radix trees rather than the mount inode list. This removes another user of the mount inode list. Signed-off-by: Dave Chinner --- fs/xfs/quota/xfs_qm_syscalls.c | 120 ++++++++++++++++++---------------------- 1 files changed, 53 insertions(+), 67 deletions(-) diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index adfb872..c43b6d4 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -1022,101 +1022,87 @@ xfs_qm_export_flags( /* - * Go thru all the inodes in the file system, releasing their dquots. - * Note that the mount structure gets modified to indicate that quotas are off - * AFTER this, in the case of quotaoff. This also gets called from - * xfs_rootumount. + * Release all the dquots on the inodes in an AG. */ -void -xfs_qm_dqrele_all_inodes( - struct xfs_mount *mp, - uint flags) +STATIC void +xfs_qm_dqrele_inodes_ag( + xfs_mount_t *mp, + int ag, + uint flags) { - xfs_inode_t *ip, *topino; - uint ireclaims; - bhv_vnode_t *vp; - boolean_t vnode_refd; - - ASSERT(mp->m_quotainfo); + xfs_inode_t *ip = NULL; + bhv_vnode_t *vp = NULL; + xfs_perag_t *pag = &mp->m_perag[ag]; + int first_index = 0; + int nr_found; - XFS_MOUNT_ILOCK(mp); -again: - ip = mp->m_inodes; - if (ip == NULL) { - XFS_MOUNT_IUNLOCK(mp); + if (!pag->pag_ici_init) return; - } do { - /* Skip markers inserted by xfs_sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; + boolean_t vnode_refd = B_FALSE; + + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); + break; } + + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); + /* Root inode, rbmip and rsumip have associated blocks */ - if (ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { - ASSERT(ip->i_udquot == NULL); - ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; - continue; - } vp = XFS_ITOV_NULL(ip); - if (!vp) { + if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } - vnode_refd = B_FALSE; if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; vp = vn_grab(vp); + read_unlock(&pag->pag_ici_lock); if (!vp) - goto again; - - XFS_MOUNT_IUNLOCK(mp); - /* XXX restart limit ? */ - xfs_ilock(ip, XFS_ILOCK_EXCL); + continue; vnode_refd = B_TRUE; + xfs_ilock(ip, XFS_ILOCK_EXCL); } else { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; - XFS_MOUNT_IUNLOCK(mp); + read_unlock(&pag->pag_ici_lock); } - - /* - * We don't keep the mountlock across the dqrele() call, - * since it can take a while.. - */ if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) { xfs_qm_dqrele(ip->i_udquot); ip->i_udquot = NULL; } - if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && ip->i_gdquot) { + if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && + ip->i_gdquot) { xfs_qm_dqrele(ip->i_gdquot); ip->i_gdquot = NULL; } xfs_iunlock(ip, XFS_ILOCK_EXCL); - /* - * Wait until we've dropped the ilock and mountlock to - * do the vn_rele. Or be condemned to an eternity in the - * inactive code in hell. - */ if (vnode_refd) - IRELE(ip); - XFS_MOUNT_ILOCK(mp); - /* - * If an inode was inserted or removed, we gotta - * start over again. - */ - if (topino != mp->m_inodes || mp->m_ireclaims != ireclaims) { - /* XXX use a sentinel */ - goto again; - } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + VN_RELE(vp); + } while (nr_found); +} - XFS_MOUNT_IUNLOCK(mp); +/* + * Go thru all the inodes in the file system, releasing their dquots. + * Note that the mount structure gets modified to indicate that quotas are off + * AFTER this, in the case of quotaoff. This also gets called from + * xfs_rootumount. + */ +void +xfs_qm_dqrele_all_inodes( + struct xfs_mount *mp, + uint flags) +{ + int i; + + ASSERT(mp->m_quotainfo); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_qm_dqrele_inodes_ag(mp, i, flags); + } } /*------------------------------------------------------------------------*/ -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 05:18:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:18:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCIoaL019364 for ; Sun, 20 Jul 2008 05:18:50 -0700 X-ASG-Debug-ID: 1216556397-172601e10001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AB4C2E63FE5 for ; Sun, 20 Jul 2008 05:19:58 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id L4XU2inWBfzAzsJY for ; Sun, 20 Jul 2008 05:19:58 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBALvHgkh5LFxAiGdsb2JhbACSQgEBAQ8gmjc X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153552228" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 21:49:55 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKXtK-0006cf-Kh; Sun, 20 Jul 2008 22:19:54 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Subject: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Date: Sun, 20 Jul 2008 22:19:51 +1000 Message-Id: <1216556394-17529-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216556394-17529-1-git-send-email-david@fromorbit.com> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216556399 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56580 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16947 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs xfs_iflush_all() walks the m_inodes list to find inodes that need reclaiming. We already have such a list - the m_del_inodes list. Replace xfs_iflush_all() with a call to xfs_finish_reclaim_all() and clean up xfs_finish_reclaim_all() to handle the different flush modes now needed. Originally based on a patch from Christoph Hellwig. Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.c | 39 --------------------------------------- fs/xfs/xfs_inode.h | 3 +-- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_vfsops.c | 8 +++----- fs/xfs/xfs_vnodeops.c | 42 ++++++++++++++++++------------------------ 5 files changed, 23 insertions(+), 71 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 20b6f87..ae19b05 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3456,45 +3456,6 @@ corrupt_out: return XFS_ERROR(EFSCORRUPTED); } - -/* - * Flush all inactive inodes in mp. - */ -void -xfs_iflush_all( - xfs_mount_t *mp) -{ - xfs_inode_t *ip; - bhv_vnode_t *vp; - - again: - XFS_MOUNT_ILOCK(mp); - ip = mp->m_inodes; - if (ip == NULL) - goto out; - - do { - /* Make sure we skip markers inserted by sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = XFS_ITOV_NULL(ip); - if (!vp) { - XFS_MOUNT_IUNLOCK(mp); - xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); - goto again; - } - - ASSERT(vn_count(vp) == 0); - - ip = ip->i_mnext; - } while (ip != mp->m_inodes); - out: - XFS_MOUNT_IUNLOCK(mp); -} - #ifdef XFS_ILOCK_TRACE ktrace_t *xfs_ilock_trace_buf; diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 17a04b6..7ce41d3 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -480,7 +480,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint); void xfs_ifunlock(xfs_inode_t *); void xfs_ireclaim(xfs_inode_t *); int xfs_finish_reclaim(xfs_inode_t *, int, int); -int xfs_finish_reclaim_all(struct xfs_mount *, int); +int xfs_finish_reclaim_all(struct xfs_mount *, int, int); /* * xfs_inode.c prototypes. @@ -518,7 +518,6 @@ void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); -void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); void xfs_lock_inodes(xfs_inode_t **, int, uint); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6c5d132..0c23f6a 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1268,7 +1268,7 @@ xfs_unmountfs(xfs_mount_t *mp) * need to force the log first. */ xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); - xfs_iflush_all(mp); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING); diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 4a9a433..9d72646 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -65,7 +65,7 @@ xfs_quiesce_fs( int count = 0, pincount; xfs_flush_buftarg(mp->m_ddev_targp, 0); - xfs_finish_reclaim_all(mp, 0); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); /* This loop must run at least twice. * The first instance of the loop will flush @@ -653,10 +653,8 @@ xfs_syncsub( xfs_log_force(mp, (xfs_lsn_t)0, log_flags); if (flags & (SYNC_ATTR|SYNC_DELWRI)) { - if (flags & SYNC_BDFLUSH) - xfs_finish_reclaim_all(mp, 1); - else - error = xfs_sync_inodes(mp, flags, bypassed); + xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); + error = xfs_sync_inodes(mp, flags, bypassed); } /* diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index b792a12..2af1be3 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2985,36 +2985,30 @@ xfs_finish_reclaim( } int -xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) +xfs_finish_reclaim_all( + xfs_mount_t *mp, + int noblock, + int mode) { - int purged; xfs_inode_t *ip, *n; - int done = 0; - while (!done) { - purged = 0; - XFS_MOUNT_ILOCK(mp); - list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { - if (noblock) { - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) - continue; - if (xfs_ipincount(ip) || - !xfs_iflock_nowait(ip)) { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - continue; - } +restart: + XFS_MOUNT_ILOCK(mp); + list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { + if (noblock) { + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) + continue; + if (xfs_ipincount(ip) || + !xfs_iflock_nowait(ip)) { + xfs_iunlock(ip, XFS_ILOCK_EXCL); + continue; } - XFS_MOUNT_IUNLOCK(mp); - if (xfs_finish_reclaim(ip, noblock, - XFS_IFLUSH_DELWRI_ELSE_ASYNC)) - delay(1); - purged = 1; - break; } - - done = !purged; + XFS_MOUNT_IUNLOCK(mp); + if (xfs_finish_reclaim(ip, noblock, mode)) + delay(1); + goto restart; } - XFS_MOUNT_IUNLOCK(mp); return 0; } -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 05:18:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:19:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCIrSw019379 for ; Sun, 20 Jul 2008 05:18:53 -0700 X-ASG-Debug-ID: 1216556397-172601e10002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9DC04E63FE9 for ; Sun, 20 Jul 2008 05:20:01 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id rj9DBmSdTWe2h8HK for ; Sun, 20 Jul 2008 05:20:01 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBALvHgkh5LFxAiGdsb2JhbACSQgEBAQ8gmjc X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153552231" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 21:49:55 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKXtK-0006cx-Ru; Sun, 20 Jul 2008 22:19:54 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 4/4] XFS: remove the mount inode list Subject: [PATCH 4/4] XFS: remove the mount inode list Date: Sun, 20 Jul 2008 22:19:54 +1000 Message-Id: <1216556394-17529-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216556394-17529-1-git-send-email-david@fromorbit.com> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216556402 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56580 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16948 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Now we've removed all users of the mount inode list, we can kill it. This reduces the size of the xfs_inode by 2 pointers. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 42 +----------------------------------------- fs/xfs/xfs_inode.h | 8 -------- fs/xfs/xfs_mount.c | 5 ----- fs/xfs/xfs_mount.h | 1 - 4 files changed, 1 insertions(+), 55 deletions(-) diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index b07604b..f16ca6c 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -76,7 +76,6 @@ xfs_iget_core( { struct inode *old_inode; xfs_inode_t *ip; - xfs_inode_t *iq; int error; unsigned long first_index, mask; xfs_perag_t *pag; @@ -260,24 +259,6 @@ finish_inode: write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); - - /* - * Link ip to its mount and thread it on the mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - if ((iq = mp->m_inodes)) { - ASSERT(iq->i_mprev->i_mnext == iq); - ip->i_mprev = iq->i_mprev; - iq->i_mprev->i_mnext = ip; - iq->i_mprev = ip; - ip->i_mnext = iq; - } else { - ip->i_mnext = ip; - ip->i_mprev = ip; - } - mp->m_inodes = ip; - - XFS_MOUNT_IUNLOCK(mp); xfs_put_perag(mp, pag); return_ip: @@ -490,36 +471,15 @@ xfs_iextract( { xfs_mount_t *mp = ip->i_mount; xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); - xfs_inode_t *iq; write_lock(&pag->pag_ici_lock); radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino)); write_unlock(&pag->pag_ici_lock); xfs_put_perag(mp, pag); - /* - * Remove from mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - ASSERT((ip->i_mnext != NULL) && (ip->i_mprev != NULL)); - iq = ip->i_mnext; - iq->i_mprev = ip->i_mprev; - ip->i_mprev->i_mnext = iq; - - /* - * Fix up the head pointer if it points to the inode being deleted. - */ - if (mp->m_inodes == ip) { - if (ip == iq) { - mp->m_inodes = NULL; - } else { - mp->m_inodes = iq; - } - } - /* Deal with the deleted inodes list */ + XFS_MOUNT_ILOCK(mp); list_del_init(&ip->i_reclaim); - mp->m_ireclaims++; XFS_MOUNT_IUNLOCK(mp); } diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 7ce41d3..c440b1d 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -192,16 +192,8 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; -typedef struct { - struct xfs_inode *ip_mnext; /* next inode in mount list */ - struct xfs_inode *ip_mprev; /* ptr to prev inode */ - struct xfs_mount *ip_mount; /* fs mount struct ptr */ -} xfs_iptr_t; - typedef struct xfs_inode { /* Inode linking and identification information. */ - struct xfs_inode *i_mnext; /* next inode in mount list */ - struct xfs_inode *i_mprev; /* ptr to prev inode */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ bhv_vnode_t *i_vnode; /* vnode backpointer */ diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 0c23f6a..364c075 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1314,11 +1314,6 @@ xfs_unmountfs(xfs_mount_t *mp) xfs_freesb(mp); - /* - * All inodes from this mount point should be freed. - */ - ASSERT(mp->m_inodes == NULL); - if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) uuid_table_remove(&mp->m_sb.sb_uuid); diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 6482005..4f257d7 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -247,7 +247,6 @@ typedef struct xfs_mount { xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ spinlock_t m_agirotor_lock;/* .. and lock protecting it */ xfs_agnumber_t m_maxagi; /* highest inode alloc group */ - struct xfs_inode *m_inodes; /* active inode list */ struct list_head m_del_inodes; /* inodes to reclaim */ mutex_t m_ilock; /* inode list mutex */ uint m_ireclaims; /* count of calls to reclaim*/ -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 05:18:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:19:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCItVZ019400 for ; Sun, 20 Jul 2008 05:18:55 -0700 X-ASG-Debug-ID: 1216556398-563f00890000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 146BF30AF9A for ; Sun, 20 Jul 2008 05:19:59 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 3Dv4ijOOD0aX752G for ; Sun, 20 Jul 2008 05:19:59 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBALvHgkh5LFxAiGdsb2JhbACSQgEBAQ8gmjc X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153552230" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 21:49:55 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKXtK-0006ck-O8; Sun, 20 Jul 2008 22:19:54 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Date: Sun, 20 Jul 2008 22:19:52 +1000 Message-Id: <1216556394-17529-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216556394-17529-1-git-send-email-david@fromorbit.com> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216556403 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56580 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16949 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Update xfs_sync_inodes to walk the inode radix tree cache to find dirty inodes. This removes a huge bunch of nasty, messy code for traversing the mount inode list safely and removes another user of the mount inode list. Signed-off-by: Dave Chinner --- fs/xfs/xfs_vfsops.c | 358 ++++++++++++++------------------------------------- 1 files changed, 99 insertions(+), 259 deletions(-) diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 9d72646..0ff9812 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -271,356 +271,196 @@ xfs_sync( } /* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * + * Sync all the inodes in the given AG according to the + * direction given by the flags. */ -int -xfs_sync_inodes( +STATIC int +xfs_sync_inodes_ag( xfs_mount_t *mp, + int ag, int flags, - int *bypassed) + int *bypassed) { xfs_inode_t *ip = NULL; bhv_vnode_t *vp = NULL; - int error; - int last_error; - uint64_t fflag; - uint lock_flags; - uint base_lock_flags; - boolean_t mount_locked; - boolean_t vnode_refed; - int preempt; - xfs_iptr_t *ipointer; -#ifdef DEBUG - boolean_t ipointer_in = B_FALSE; - -#define IPOINTER_SET ipointer_in = B_TRUE -#define IPOINTER_CLR ipointer_in = B_FALSE -#else -#define IPOINTER_SET -#define IPOINTER_CLR -#endif - - -/* Insert a marker record into the inode list after inode ip. The list - * must be locked when this is called. After the call the list will no - * longer be locked. - */ -#define IPOINTER_INSERT(ip, mp) { \ - ASSERT(ipointer_in == B_FALSE); \ - ipointer->ip_mnext = ip->i_mnext; \ - ipointer->ip_mprev = ip; \ - ip->i_mnext = (xfs_inode_t *)ipointer; \ - ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ - preempt = 0; \ - XFS_MOUNT_IUNLOCK(mp); \ - mount_locked = B_FALSE; \ - IPOINTER_SET; \ - } - -/* Remove the marker from the inode list. If the marker was the only item - * in the list then there are no remaining inodes and we should zero out - * the whole list. If we are the current head of the list then move the head - * past us. - */ -#define IPOINTER_REMOVE(ip, mp) { \ - ASSERT(ipointer_in == B_TRUE); \ - if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ - ip = ipointer->ip_mnext; \ - ip->i_mprev = ipointer->ip_mprev; \ - ipointer->ip_mprev->i_mnext = ip; \ - if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ - mp->m_inodes = ip; \ - } \ - } else { \ - ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ - mp->m_inodes = NULL; \ - ip = NULL; \ - } \ - IPOINTER_CLR; \ - } - -#define XFS_PREEMPT_MASK 0x7f - - ASSERT(!(flags & SYNC_BDFLUSH)); - - if (bypassed) - *bypassed = 0; - if (mp->m_flags & XFS_MOUNT_RDONLY) - return 0; - error = 0; - last_error = 0; - preempt = 0; - - /* Allocate a reference marker */ - ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); + xfs_perag_t *pag = &mp->m_perag[ag]; + boolean_t vnode_refed = B_FALSE; + int nr_found; + int first_index = 0; + int error = 0; + int last_error = 0; + int fflag = XFS_B_ASYNC; + int lock_flags = XFS_ILOCK_SHARED; - fflag = XFS_B_ASYNC; /* default is don't wait */ if (flags & SYNC_DELWRI) fflag = XFS_B_DELWRI; if (flags & SYNC_WAIT) fflag = 0; /* synchronous overrides all */ - base_lock_flags = XFS_ILOCK_SHARED; if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { /* * We need the I/O lock if we're going to call any of * the flush/inval routines. */ - base_lock_flags |= XFS_IOLOCK_SHARED; + lock_flags |= XFS_IOLOCK_SHARED; } - XFS_MOUNT_ILOCK(mp); - - ip = mp->m_inodes; - - mount_locked = B_TRUE; - vnode_refed = B_FALSE; - - IPOINTER_CLR; + if (!pag->pag_ici_init) + return 0; do { - ASSERT(ipointer_in == B_FALSE); - ASSERT(vnode_refed == B_FALSE); - - lock_flags = base_lock_flags; + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); - /* - * There were no inodes in the list, just break out - * of the loop. - */ - if (ip == NULL) { + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); break; } - /* - * We found another sync thread marker - skip it - */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = XFS_ITOV_NULL(ip); + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); /* - * If the vnode is gone then this is being torn down, - * call reclaim if it is flushed, else let regular flush - * code deal with it later in the loop. + * skip inodes in reclaim. Let xfs_syncsub do that for + * us so we don't need to worry. */ - - if (vp == NULL) { - /* Skip ones already in reclaim */ - if (ip->i_flags & XFS_IRECLAIM) { - ip = ip->i_mnext; - continue; - } - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ip = ip->i_mnext; - } else if ((xfs_ipincount(ip) == 0) && - xfs_iflock_nowait(ip)) { - IPOINTER_INSERT(ip, mp); - - xfs_finish_reclaim(ip, 1, - XFS_IFLUSH_DELWRI_ELSE_ASYNC); - - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - } else { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - ip = ip->i_mnext; - } + vp = XFS_ITOV_NULL(ip); + if (!vp) { + read_unlock(&pag->pag_ici_lock); continue; } + /* bad inodes are dealt with elsewhere */ if (VN_BAD(vp)) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } + /* nothing to sync during shutdown */ if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { - XFS_MOUNT_IUNLOCK(mp); - kmem_free(ipointer); + read_unlock(&pag->pag_ici_lock); return 0; } /* - * Try to lock without sleeping. We're out of order with - * the inode list lock here, so if we fail we need to drop - * the mount lock and try again. If we're called from - * bdflush() here, then don't bother. - * - * The inode lock here actually coordinates with the - * almost spurious inode lock in xfs_ireclaim() to prevent - * the vnode we handle here without a reference from - * being freed while we reference it. If we lock the inode - * while it's on the mount list here, then the spurious inode - * lock in xfs_ireclaim() after the inode is pulled from - * the mount list will sleep until we release it here. - * This keeps the vnode from being freed while we reference - * it. + * The inode lock here actually coordinates with the almost + * spurious inode lock in xfs_ireclaim() to prevent the vnode + * we handle here without a reference from being freed while we + * reference it. If we lock the inode while it's on the mount + * list here, then the spurious inode lock in xfs_ireclaim() + * after the inode is pulled from the mount list will sleep + * until we release it here. This keeps the vnode from being + * freed while we reference it. */ if (xfs_ilock_nowait(ip, lock_flags) == 0) { - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - vp = vn_grab(vp); - if (vp == NULL) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); + if (!vp) continue; - } - - IPOINTER_INSERT(ip, mp); xfs_ilock(ip, lock_flags); ASSERT(vp == XFS_ITOV(ip)); ASSERT(ip->i_mount == mp); vnode_refed = B_TRUE; + } else { + /* safe to unlock here as we have a reference */ + read_unlock(&pag->pag_ici_lock); } - - /* From here on in the loop we may have a marker record - * in the inode list. - */ - /* * If we have to flush data or wait for I/O completion * we need to drop the ilock that we currently hold. * If we need to drop the lock, insert a marker if we * have not already done so. */ - if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || - ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } + if (flags & SYNC_CLOSE) { xfs_iunlock(ip, XFS_ILOCK_SHARED); - - if (flags & SYNC_CLOSE) { - /* Shutdown case. Flush and invalidate. */ - if (XFS_FORCED_SHUTDOWN(mp)) - xfs_tosspages(ip, 0, -1, - FI_REMAPF); - else - error = xfs_flushinval_pages(ip, - 0, -1, FI_REMAPF); - } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { - error = xfs_flush_pages(ip, 0, - -1, fflag, FI_NONE); - } - - /* - * When freezing, we need to wait ensure all I/O (including direct - * I/O) is complete to ensure no further data modification can take - * place after this point - */ + if (XFS_FORCED_SHUTDOWN(mp)) + xfs_tosspages(ip, 0, -1, FI_REMAPF); + else + error = xfs_flushinval_pages(ip, 0, -1, + FI_REMAPF); + /* wait for I/O on freeze */ if (flags & SYNC_IOWAIT) vn_iowait(ip); xfs_ilock(ip, XFS_ILOCK_SHARED); } - if ((flags & SYNC_ATTR) && - (ip->i_update_core || - (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { - if (mount_locked) - IPOINTER_INSERT(ip, mp); + if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { + xfs_iunlock(ip, XFS_ILOCK_SHARED); + error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE); + if (flags & SYNC_IOWAIT) + vn_iowait(ip); + xfs_ilock(ip, XFS_ILOCK_SHARED); + } + if ((flags & SYNC_ATTR) && !xfs_inode_clean(ip)) { if (flags & SYNC_WAIT) { xfs_iflock(ip); - error = xfs_iflush(ip, XFS_IFLUSH_SYNC); - - /* - * If we can't acquire the flush lock, then the inode - * is already being flushed so don't bother waiting. - * - * If we can lock it then do a delwri flush so we can - * combine multiple inode flushes in each disk write. - */ + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_SYNC); + else + xfs_ifunlock(ip); } else if (xfs_iflock_nowait(ip)) { - error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + else + xfs_ifunlock(ip); } else if (bypassed) { (*bypassed)++; } } - if (lock_flags != 0) { + if (lock_flags) xfs_iunlock(ip, lock_flags); - } if (vnode_refed) { - /* - * If we had to take a reference on the vnode - * above, then wait until after we've unlocked - * the inode to release the reference. This is - * because we can be already holding the inode - * lock when IRELE() calls xfs_inactive(). - * - * Make sure to drop the mount lock before calling - * IRELE() so that we don't trip over ourselves if - * we have to go for the mount lock again in the - * inactive code. - */ - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - - IRELE(ip); - + VN_RELE(vp); vnode_refed = B_FALSE; } - if (error) { + if (error) last_error = error; - } - /* * bail out if the filesystem is corrupted. */ - if (error == EFSCORRUPTED) { - if (!mount_locked) { - XFS_MOUNT_ILOCK(mp); - IPOINTER_REMOVE(ip, mp); - } - XFS_MOUNT_IUNLOCK(mp); - ASSERT(ipointer_in == B_FALSE); - kmem_free(ipointer); + if (error == EFSCORRUPTED) return XFS_ERROR(error); - } - /* Let other threads have a chance at the mount lock - * if we have looped many times without dropping the - * lock. - */ - if ((++preempt & XFS_PREEMPT_MASK) == 0) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - } + } while (nr_found); - if (mount_locked == B_FALSE) { - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - continue; - } + return last_error; +} - ASSERT(ipointer_in == B_FALSE); - ip = ip->i_mnext; +int +xfs_sync_inodes( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + int error; + int last_error; + int i; + + if (bypassed) + *bypassed = 0; + if (mp->m_flags & XFS_MOUNT_RDONLY) + return 0; + error = 0; + last_error = 0; - } while (ip != mp->m_inodes); - XFS_MOUNT_IUNLOCK(mp); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + error = xfs_sync_inodes_ag(mp, i, flags, bypassed); + if (error) + last_error = error; + if (error == EFSCORRUPTED) + break; + } - ASSERT(ipointer_in == B_FALSE); - kmem_free(ipointer); return XFS_ERROR(last_error); } -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 05:42:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:42:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41, J_CHICKENPOX_62,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCgkIF022222 for ; Sun, 20 Jul 2008 05:42:46 -0700 X-ASG-Debug-ID: 1216557830-552e03430002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 824461905F6A for ; Sun, 20 Jul 2008 05:43:54 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id m5SOTrWCkLTjEdSe for ; Sun, 20 Jul 2008 05:43:54 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBANHOgkh5LFxAiGdsb2JhbACSQgEBAQ8gmkA X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153563807" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 22:13:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKYGT-0007ij-6Y; Sun, 20 Jul 2008 22:43:49 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 3/3] XFS: Kill shouty XFS_ITOV() macro Subject: [PATCH 3/3] XFS: Kill shouty XFS_ITOV() macro Date: Sun, 20 Jul 2008 22:43:48 +1000 Message-Id: <1216557828-29056-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216557828-29056-1-git-send-email-david@fromorbit.com> References: <1216557828-29056-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216557835 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56581 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16952 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Replace XFS_ITOV() with the new VFS_I() inline. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_ioctl.c | 4 ++-- fs/xfs/linux-2.6/xfs_iops.c | 2 +- fs/xfs/linux-2.6/xfs_linux.h | 2 +- fs/xfs/linux-2.6/xfs_super.c | 2 +- fs/xfs/quota/xfs_dquot.c | 2 +- fs/xfs/xfs_bmap.c | 2 +- fs/xfs/xfs_dfrag.c | 4 ++-- fs/xfs/xfs_inode.c | 4 ++-- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_utils.h | 4 ++-- fs/xfs/xfs_vfsops.c | 8 ++++---- fs/xfs/xfs_vnodeops.c | 10 +++++----- 13 files changed, 23 insertions(+), 24 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index bae2e91..b6c0450 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c @@ -247,7 +247,7 @@ xfs_vget_fsop_handlereq( xfs_iunlock(ip, XFS_ILOCK_SHARED); - *inode = XFS_ITOV(ip); + *inode = VFS_I(ip); return 0; } @@ -1162,7 +1162,7 @@ xfs_ioctl_setattr( (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); } - vn_revalidate(XFS_ITOV(ip)); /* update flags */ + vn_revalidate(VFS_I(ip)); /* update flags */ return 0; error_return: diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 5825ab4..7cdbd60 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -101,7 +101,7 @@ xfs_ichgtime( xfs_inode_t *ip, int flags) { - struct inode *inode = vn_to_inode(XFS_ITOV(ip)); + struct inode *inode = VFS_I(ip); timespec_t tv; nanotime(&tv); diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index 4d45d93..a9cd6e4 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h @@ -180,7 +180,7 @@ #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) #define xfs_stack_trace() dump_stack() #define xfs_itruncate_data(ip, off) \ - (-vmtruncate(vn_to_inode(XFS_ITOV(ip)), (off))) + (-vmtruncate(vn_to_inode(VFS_I(ip)), (off))) /* Move the kernel do_div definition off to one side */ diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index a507762..74add64 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -1132,7 +1132,7 @@ void xfs_flush_device( xfs_inode_t *ip) { - struct inode *inode = vn_to_inode(XFS_ITOV(ip)); + struct inode *inode = VFS_I(ip); igrab(inode); xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_device_work); diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index fc9f3fb..68adc5f 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c @@ -431,7 +431,7 @@ xfs_qm_dqalloc( * when it unlocks the inode. Since we want to keep the quota * inode around, we bump the vnode ref count now. */ - VN_HOLD(XFS_ITOV(quotip)); + VN_HOLD(VFS_I(quotip)); xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL); nmaps = 1; diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 3c4beb3..2f46b67 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c @@ -4000,7 +4000,7 @@ xfs_bmap_add_attrfork( ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; } ASSERT(ip->i_d.di_anextents == 0); - VN_HOLD(XFS_ITOV(ip)); + VN_HOLD(VFS_I(ip)); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); switch (ip->i_d.di_format) { diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 2211e88..9e75101 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c @@ -150,8 +150,8 @@ xfs_swap_extents( } sbp = &sxp->sx_stat; - vp = XFS_ITOV(ip); - tvp = XFS_ITOV(tip); + vp = VFS_I(ip); + tvp = VFS_I(tip); /* Lock in i_ino order */ if (ip->i_ino < tip->i_ino) { diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ae19b05..92a054c 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1077,7 +1077,7 @@ xfs_ialloc( } ASSERT(ip != NULL); - vp = XFS_ITOV(ip); + vp = VFS_I(ip); ip->i_d.di_mode = (__uint16_t)mode; ip->i_d.di_onlink = 0; ip->i_d.di_nlink = nlink; @@ -1408,7 +1408,7 @@ xfs_itruncate_start( (flags == XFS_ITRUNC_MAYBE)); mp = ip->i_mount; - vp = XFS_ITOV(ip); + vp = VFS_I(ip); /* wait for the completion of any pending DIOs */ if (new_size < ip->i_size) diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 4d966a4..440b443 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -271,7 +271,6 @@ static inline struct inode *VFS_I(struct xfs_inode *ip) { return vn_to_inode(ip->i_vnode); } -#define XFS_ITOV(ip) VFS_I(ip) /* * i_flags helper functions diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 9a3ef9d..4feda54 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -72,7 +72,7 @@ xfs_bulkstat_one_iget( ASSERT(ip != NULL); ASSERT(ip->i_blkno != (xfs_daddr_t)0); - vp = XFS_ITOV(ip); + vp = VFS_I(ip); dic = &ip->i_d; /* xfs_iget returns the following without needing diff --git a/fs/xfs/xfs_utils.h b/fs/xfs/xfs_utils.h index f316cb8..7b533df 100644 --- a/fs/xfs/xfs_utils.h +++ b/fs/xfs/xfs_utils.h @@ -18,8 +18,8 @@ #ifndef __XFS_UTILS_H__ #define __XFS_UTILS_H__ -#define IRELE(ip) VN_RELE(XFS_ITOV(ip)) -#define IHOLD(ip) VN_HOLD(XFS_ITOV(ip)) +#define IRELE(ip) VN_RELE(VFS_I(ip)) +#define IHOLD(ip) VN_HOLD(VFS_I(ip)) extern int xfs_truncate_file(xfs_mount_t *, xfs_inode_t *); extern int xfs_dir_ialloc(xfs_trans_t **, xfs_inode_t *, mode_t, xfs_nlink_t, diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index a184e36..8bf6bb8 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -128,7 +128,7 @@ xfs_unmount_flush( xfs_inode_t *rip = mp->m_rootip; xfs_inode_t *rbmip; xfs_inode_t *rsumip = NULL; - bhv_vnode_t *rvp = XFS_ITOV(rip); + bhv_vnode_t *rvp = VFS_I(rip); int error; xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); @@ -146,7 +146,7 @@ xfs_unmount_flush( if (error == EFSCORRUPTED) goto fscorrupt_out; - ASSERT(vn_count(XFS_ITOV(rbmip)) == 1); + ASSERT(vn_count(VFS_I(rbmip)) == 1); rsumip = mp->m_rsumip; xfs_ilock(rsumip, XFS_ILOCK_EXCL); @@ -157,7 +157,7 @@ xfs_unmount_flush( if (error == EFSCORRUPTED) goto fscorrupt_out; - ASSERT(vn_count(XFS_ITOV(rsumip)) == 1); + ASSERT(vn_count(VFS_I(rsumip)) == 1); } /* @@ -360,7 +360,7 @@ xfs_sync_inodes_ag( continue; xfs_ilock(ip, lock_flags); - ASSERT(vp == XFS_ITOV(ip)); + ASSERT(vp == VFS_I(ip)); ASSERT(ip->i_mount == mp); vnode_refed = B_TRUE; diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 5d1b254..cca2871 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -705,7 +705,7 @@ xfs_fsync( return XFS_ERROR(EIO); /* capture size updates in I/O completion before writing the inode. */ - error = filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping); + error = filemap_fdatawait(vn_to_inode(VFS_I(ip))->i_mapping); if (error) return XFS_ERROR(error); @@ -1151,7 +1151,7 @@ int xfs_release( xfs_inode_t *ip) { - bhv_vnode_t *vp = XFS_ITOV(ip); + bhv_vnode_t *vp = VFS_I(ip); xfs_mount_t *mp = ip->i_mount; int error; @@ -1218,7 +1218,7 @@ int xfs_inactive( xfs_inode_t *ip) { - bhv_vnode_t *vp = XFS_ITOV(ip); + bhv_vnode_t *vp = VFS_I(ip); xfs_bmap_free_t free_list; xfs_fsblock_t first_block; int committed; @@ -2864,7 +2864,7 @@ int xfs_reclaim( xfs_inode_t *ip) { - bhv_vnode_t *vp = XFS_ITOV(ip); + bhv_vnode_t *vp = VFS_I(ip); xfs_itrace_entry(ip); @@ -3326,7 +3326,7 @@ xfs_free_file_space( xfs_trans_t *tp; int need_iolock = 1; - vp = XFS_ITOV(ip); + vp = VFS_I(ip); mp = ip->i_mount; xfs_itrace_entry(ip); -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 05:42:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:42:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCgksu022219 for ; Sun, 20 Jul 2008 05:42:46 -0700 X-ASG-Debug-ID: 1216557833-2e0c00ff0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7885FE6A57A for ; Sun, 20 Jul 2008 05:43:54 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 0lLg3GIIyPnfzIBp for ; Sun, 20 Jul 2008 05:43:54 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBANHOgkh5LFxAiGdsb2JhbACSQgEBAQ8gmkA X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153563809" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 22:13:50 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKYGT-0007ie-2x; Sun, 20 Jul 2008 22:43:49 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 1/3] XFS: Avoid directly referencing the VFS inode. Subject: [PATCH 1/3] XFS: Avoid directly referencing the VFS inode. Date: Sun, 20 Jul 2008 22:43:46 +1000 Message-Id: <1216557828-29056-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216557828-29056-1-git-send-email-david@fromorbit.com> References: <1216557828-29056-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216557835 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56582 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16953 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs In several places we directly convert from the XFS inode to the linux (VFS) inode by a simple deference of ip->i_vnode. We should not do this - a helper function should be used to extract the VFS inode from the XFS inode. Introduce the function VFS_I() to extract the VFS inode from the XFS inode. The name was chosen to match XFS_I() which is used to extract the XFS inode from the VFS inode. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_export.c | 6 +++--- fs/xfs/linux-2.6/xfs_fs_subr.c | 6 +++--- fs/xfs/linux-2.6/xfs_iops.c | 14 +++++++------- fs/xfs/linux-2.6/xfs_iops.h | 6 ------ fs/xfs/linux-2.6/xfs_lrw.c | 2 +- fs/xfs/linux-2.6/xfs_super.c | 4 ++-- fs/xfs/xfs_iget.c | 7 ++++--- fs/xfs/xfs_inode.h | 22 +++++++++++++++++++--- fs/xfs/xfs_utils.c | 4 ++-- 9 files changed, 41 insertions(+), 30 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 987fe84..d3880b7 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c @@ -139,7 +139,7 @@ xfs_nfs_get_inode( } xfs_iunlock(ip, XFS_ILOCK_SHARED); - return ip->i_vnode; + return VFS_I(ip); } STATIC struct dentry * @@ -219,9 +219,9 @@ xfs_fs_get_parent( if (unlikely(error)) return ERR_PTR(-error); - parent = d_alloc_anon(cip->i_vnode); + parent = d_alloc_anon(VFS_I(cip)); if (unlikely(!parent)) { - iput(cip->i_vnode); + iput(VFS_I(cip)); return ERR_PTR(-ENOMEM); } return parent; diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c index 1eefe61..36caa6d 100644 --- a/fs/xfs/linux-2.6/xfs_fs_subr.c +++ b/fs/xfs/linux-2.6/xfs_fs_subr.c @@ -31,7 +31,7 @@ xfs_tosspages( xfs_off_t last, int fiopt) { - struct address_space *mapping = ip->i_vnode->i_mapping; + struct address_space *mapping = VFS_I(ip)->i_mapping; if (mapping->nrpages) truncate_inode_pages(mapping, first); @@ -44,7 +44,7 @@ xfs_flushinval_pages( xfs_off_t last, int fiopt) { - struct address_space *mapping = ip->i_vnode->i_mapping; + struct address_space *mapping = VFS_I(ip)->i_mapping; int ret = 0; if (mapping->nrpages) { @@ -64,7 +64,7 @@ xfs_flush_pages( uint64_t flags, int fiopt) { - struct address_space *mapping = ip->i_vnode->i_mapping; + struct address_space *mapping = VFS_I(ip)->i_mapping; int ret = 0; int ret2; diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index f3267fc..5825ab4 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -62,7 +62,7 @@ void xfs_synchronize_atime( xfs_inode_t *ip) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); if (inode) { ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; @@ -79,7 +79,7 @@ void xfs_mark_inode_dirty_sync( xfs_inode_t *ip) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); if (inode) mark_inode_dirty_sync(inode); @@ -299,7 +299,7 @@ xfs_vn_mknod( if (unlikely(error)) goto out_free_acl; - inode = ip->i_vnode; + inode = VFS_I(ip); error = xfs_init_security(inode, dir); if (unlikely(error)) @@ -366,7 +366,7 @@ xfs_vn_lookup( return NULL; } - return d_splice_alias(cip->i_vnode, dentry); + return d_splice_alias(VFS_I(cip), dentry); } STATIC struct dentry * @@ -399,12 +399,12 @@ xfs_vn_ci_lookup( /* if exact match, just splice and exit */ if (!ci_name.name) - return d_splice_alias(ip->i_vnode, dentry); + return d_splice_alias(VFS_I(ip), dentry); /* else case-insensitive match... */ dname.name = ci_name.name; dname.len = ci_name.len; - dentry = d_add_ci(ip->i_vnode, dentry, &dname); + dentry = d_add_ci(VFS_I(ip), dentry, &dname); kmem_free(ci_name.name); return dentry; } @@ -478,7 +478,7 @@ xfs_vn_symlink( if (unlikely(error)) goto out; - inode = cip->i_vnode; + inode = VFS_I(cip); error = xfs_init_security(inode, dir); if (unlikely(error)) diff --git a/fs/xfs/linux-2.6/xfs_iops.h b/fs/xfs/linux-2.6/xfs_iops.h index d97ba93..fdda404 100644 --- a/fs/xfs/linux-2.6/xfs_iops.h +++ b/fs/xfs/linux-2.6/xfs_iops.h @@ -33,10 +33,4 @@ struct xfs_inode; extern void xfs_ichgtime(struct xfs_inode *, int); extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); -#define xfs_vtoi(vp) \ - ((struct xfs_inode *)vn_to_inode(vp)->i_private) - -#define XFS_I(inode) \ - ((struct xfs_inode *)(inode)->i_private) - #endif /* __XFS_IOPS_H__ */ diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 5e3b575..d00c155 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c @@ -137,7 +137,7 @@ xfs_iozero( struct address_space *mapping; int status; - mapping = ip->i_vnode->i_mapping; + mapping = VFS_I(ip)->i_mapping; do { unsigned offset, bytes; void *fsdata; diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 6d9c8c7..a507762 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -1107,7 +1107,7 @@ void xfs_flush_inode( xfs_inode_t *ip) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); igrab(inode); xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inode_work); @@ -1826,7 +1826,7 @@ xfs_fs_fill_super( sb->s_time_gran = 1; set_posix_acl_flag(sb); - root = igrab(mp->m_rootip->i_vnode); + root = igrab(VFS_I(mp->m_rootip)); if (!root) { error = ENOENT; goto fail_unmount; diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index f16ca6c..81047be 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -392,10 +392,11 @@ xfs_iput(xfs_inode_t *ip, * Special iput for brand-new inodes that are still locked */ void -xfs_iput_new(xfs_inode_t *ip, - uint lock_flags) +xfs_iput_new( + xfs_inode_t *ip, + uint lock_flags) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); xfs_itrace_entry(ip); diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index c440b1d..7726d41 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -255,6 +255,25 @@ typedef struct xfs_inode { #define XFS_ISIZE(ip) (((ip)->i_d.di_mode & S_IFMT) == S_IFREG) ? \ (ip)->i_size : (ip)->i_d.di_size; +/* Convert from vfs inode to xfs inode */ +static inline struct xfs_inode *XFS_I(struct inode *inode) +{ + return (struct xfs_inode *)inode->i_private; +} + +static inline struct xfs_inode *xfs_vtoi(bhv_vnode_t *vp) +{ + return XFS_I(vn_to_inode(vp)); +} + +/* convert from xfs inode to vfs inode */ +static inline struct inode *VFS_I(struct xfs_inode *ip) +{ + return vn_to_inode(ip->i_vnode); +} +#define XFS_ITOV(ip) VFS_I(ip) +#define XFS_ITOV_NULL(ip) VFS_I(ip) + /* * i_flags helper functions */ @@ -431,9 +450,6 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) #define XFS_ITRUNC_DEFINITE 0x1 #define XFS_ITRUNC_MAYBE 0x2 -#define XFS_ITOV(ip) ((ip)->i_vnode) -#define XFS_ITOV_NULL(ip) ((ip)->i_vnode) - /* * For multiple groups support: if S_ISGID bit is set in the parent * directory, group of new file is set to that of the parent, and diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c index 98e5f11..35d4d41 100644 --- a/fs/xfs/xfs_utils.c +++ b/fs/xfs/xfs_utils.c @@ -237,7 +237,7 @@ xfs_droplink( ASSERT (ip->i_d.di_nlink > 0); ip->i_d.di_nlink--; - drop_nlink(ip->i_vnode); + drop_nlink(VFS_I(ip)); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); error = 0; @@ -301,7 +301,7 @@ xfs_bumplink( ASSERT(ip->i_d.di_nlink > 0); ip->i_d.di_nlink++; - inc_nlink(ip->i_vnode); + inc_nlink(VFS_I(ip)); if ((ip->i_d.di_version == XFS_DINODE_VERSION_1) && (ip->i_d.di_nlink > XFS_MAXLINK_1)) { /* -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 05:42:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:42:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCghqn022200 for ; Sun, 20 Jul 2008 05:42:44 -0700 X-ASG-Debug-ID: 1216557830-552e03430000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D8EBF1905F6A for ; Sun, 20 Jul 2008 05:43:51 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id lOxy4l9qH8oj2ODl for ; Sun, 20 Jul 2008 05:43:51 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBANHOgkh5LFxAiGdsb2JhbACSQgEBAQ8gmkA X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153563805" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 22:13:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKYGT-0007ib-1F for xfs@oss.sgi.com; Sun, 20 Jul 2008 22:43:49 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/3] XFS: sanitise VFS inode extraction Subject: [PATCH 0/3] XFS: sanitise VFS inode extraction Date: Sun, 20 Jul 2008 22:43:45 +1000 Message-Id: <1216557828-29056-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216557832 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56581 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16954 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Getting the VFS inode from the XFS inode is done in a variety of ways right now - direct deference or one of two XFS_ITOV macros. This should be consiÑ•tent throughout the code - this patch series does that in a way that is consistent with the opposite XFS_I() conversion. We now use VFS_I() to extract the VFS inode from the XFS inode. Diffstat: xfs/linux-2.6/xfs_export.c | 6 +++--- xfs/linux-2.6/xfs_fs_subr.c | 6 +++--- xfs/linux-2.6/xfs_ioctl.c | 4 ++-- xfs/linux-2.6/xfs_iops.c | 16 ++++++++-------- xfs/linux-2.6/xfs_iops.h | 6 ------ xfs/linux-2.6/xfs_linux.h | 2 +- xfs/linux-2.6/xfs_lrw.c | 2 +- xfs/linux-2.6/xfs_super.c | 6 +++--- xfs/linux-2.6/xfs_vnode.c | 2 +- xfs/quota/xfs_dquot.c | 2 +- xfs/quota/xfs_qm_syscalls.c | 2 +- xfs/xfs_bmap.c | 2 +- xfs/xfs_dfrag.c | 4 ++-- xfs/xfs_iget.c | 7 ++++--- xfs/xfs_inode.c | 4 ++-- xfs/xfs_inode.h | 24 +++++++++++++++++++----- xfs/xfs_itable.c | 2 +- xfs/xfs_utils.c | 4 ++-- xfs/xfs_utils.h | 4 ++-- xfs/xfs_vfsops.c | 10 +++++----- xfs/xfs_vnodeops.c | 12 ++++++------ 21 files changed, 68 insertions(+), 59 deletions(-) From owner-xfs@oss.sgi.com Sun Jul 20 05:42:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:42:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCgiLL022209 for ; Sun, 20 Jul 2008 05:42:45 -0700 X-ASG-Debug-ID: 1216557830-552e03430001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EFCBF1905F6A for ; Sun, 20 Jul 2008 05:43:53 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Kpro4YwLDYdxFtOD for ; Sun, 20 Jul 2008 05:43:53 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBANHOgkh5LFxAiGdsb2JhbACSQgEBAQ8gmkA X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153563806" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 22:13:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKYGT-0007ig-4k; Sun, 20 Jul 2008 22:43:49 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 2/3] XFS: kill shouty XFS_ITOV_NULL macro Subject: [PATCH 2/3] XFS: kill shouty XFS_ITOV_NULL macro Date: Sun, 20 Jul 2008 22:43:47 +1000 Message-Id: <1216557828-29056-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216557828-29056-1-git-send-email-david@fromorbit.com> References: <1216557828-29056-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216557833 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56581 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16951 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Replace XFS_ITOV_NULL() with the new VFS_I() inline. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_vnode.c | 2 +- fs/xfs/quota/xfs_qm_syscalls.c | 2 +- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_vfsops.c | 2 +- fs/xfs/xfs_vnodeops.c | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index bc7afe0..ffd6003 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c @@ -158,7 +158,7 @@ vn_hold( */ static inline int xfs_icount(struct xfs_inode *ip) { - bhv_vnode_t *vp = XFS_ITOV_NULL(ip); + bhv_vnode_t *vp = VFS_I(ip); if (vp) return vn_count(vp); diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index c43b6d4..8407f32 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -1054,7 +1054,7 @@ xfs_qm_dqrele_inodes_ag( first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); /* Root inode, rbmip and rsumip have associated blocks */ - vp = XFS_ITOV_NULL(ip); + vp = VFS_I(ip); if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_gdquot == NULL); diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 7726d41..4d966a4 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -272,7 +272,6 @@ static inline struct inode *VFS_I(struct xfs_inode *ip) return vn_to_inode(ip->i_vnode); } #define XFS_ITOV(ip) VFS_I(ip) -#define XFS_ITOV_NULL(ip) VFS_I(ip) /* * i_flags helper functions diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 0ff9812..a184e36 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -325,7 +325,7 @@ xfs_sync_inodes_ag( * skip inodes in reclaim. Let xfs_syncsub do that for * us so we don't need to worry. */ - vp = XFS_ITOV_NULL(ip); + vp = VFS_I(ip); if (!vp) { read_unlock(&pag->pag_ici_lock); continue; diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 2af1be3..5d1b254 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2924,7 +2924,7 @@ xfs_finish_reclaim( int sync_mode) { xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); - bhv_vnode_t *vp = XFS_ITOV_NULL(ip); + bhv_vnode_t *vp = VFS_I(ip); if (vp && VN_BAD(vp)) goto reclaim; -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 05:45:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 05:45:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6KCjZhA023659 for ; Sun, 20 Jul 2008 05:45:35 -0700 X-ASG-Debug-ID: 1216558003-552e035b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id ED6791905FAF for ; Sun, 20 Jul 2008 05:46:44 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id L39pJfmddagKfHAG for ; Sun, 20 Jul 2008 05:46:44 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AloBANHOgkh5LFxAiGdsb2JhbACSQgEBAQ8gmkA X-IronPort-AV: E=Sophos;i="4.31,218,1215354600"; d="scan'208";a="153564686" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 20 Jul 2008 22:16:43 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKYJG-0000JF-OD; Sun, 20 Jul 2008 22:46:42 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH] XFS: remove i_gen from incore inode Subject: [PATCH] XFS: remove i_gen from incore inode Date: Sun, 20 Jul 2008 22:46:42 +1000 Message-Id: <1216558002-838-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216558004 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56581 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16955 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs i_gen is incremented in directory operations when the directory is changed. It is never read or otherwise used so it should be removed to help reduce the size of the struct xfs_inode. Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_rename.c | 12 ++---------- fs/xfs/xfs_vnodeops.c | 29 ++--------------------------- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 440b443..316c374 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -223,7 +223,6 @@ typedef struct xfs_inode { unsigned short i_flags; /* see defined flags below */ unsigned char i_update_core; /* timestamps/size is dirty */ unsigned char i_update_size; /* di_size field is dirty */ - unsigned int i_gen; /* generation count */ unsigned int i_delayed_blks; /* count of delay alloc blks */ xfs_icdinode_t i_d; /* most of ondisk inode */ diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c index d700dac..02f0e8f 100644 --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c @@ -367,19 +367,11 @@ xfs_rename( &first_block, &free_list, spaceres); if (error) goto abort_return; - xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Update the generation counts on all the directory inodes - * that we're modifying. - */ - src_dp->i_gen++; + xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE); - - if (new_parent) { - target_dp->i_gen++; + if (new_parent) xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE); - } /* * If this is a synchronous mount, make sure that the diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index cca2871..36bf85c 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -1619,8 +1619,6 @@ xfs_create( xfs_trans_set_sync(tp); } - dp->i_gen++; - /* * Attach the dquot(s) to the inodes and modify them incore. * These ids of the inode couldn't have changed since the new @@ -2050,13 +2048,6 @@ xfs_remove( } xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Bump the in memory generation count on the parent - * directory so that other can know that it has changed. - */ - dp->i_gen++; - xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); - if (is_dir) { /* * Drop the link from ip's "..". @@ -2074,8 +2065,8 @@ xfs_remove( } else { /* * When removing a non-directory we need to log the parent - * inode here for the i_gen update. For a directory this is - * done implicitly by the xfs_droplink call for the ".." entry. + * inode here. For a directory this is done implicitly + * by the xfs_droplink call for the ".." entry. */ xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); } @@ -2244,7 +2235,6 @@ xfs_link( if (error) goto abort_return; xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - tdp->i_gen++; xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); error = xfs_bumplink(tp, sip); @@ -2421,18 +2411,10 @@ xfs_mkdir( } xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Bump the in memory version number of the parent directory - * so that other processes accessing it will recognize that - * the directory has changed. - */ - dp->i_gen++; - error = xfs_dir_init(tp, cdp, dp); if (error) goto error2; - cdp->i_gen = 1; error = xfs_bumplink(tp, dp); if (error) goto error2; @@ -2719,13 +2701,6 @@ xfs_symlink( xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); /* - * Bump the in memory version number of the parent directory - * so that other processes accessing it will recognize that - * the directory has changed. - */ - dp->i_gen++; - - /* * If this is a synchronous mount, make sure that the * symlink transaction goes to disk before returning to * the user. -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 21:52:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 21:52:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6L4pxmm011839 for ; Sun, 20 Jul 2008 21:52:02 -0700 X-ASG-Debug-ID: 1216615983-770901260000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D1DFDE6A561 for ; Sun, 20 Jul 2008 21:53:04 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id BIWAJzv3HdbSKixK for ; Sun, 20 Jul 2008 21:53:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AowCAISzg0h5LFxAiGdsb2JhbACSRwEBAQ8gmh4 X-IronPort-AV: E=Sophos;i="4.31,221,1215354600"; d="scan'208";a="154039401" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 14:22:41 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKnO3-0005zf-8x; Mon, 21 Jul 2008 14:52:39 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Subject: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Date: Mon, 21 Jul 2008 14:52:39 +1000 Message-Id: <1216615959-23010-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216615988 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56642 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16956 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs If we allow incore extent tree allocations to recurse into the filesystem under memory pressure, new delayed allocations through xfs_iomap_write_delay() can deadlock on themselves if memory reclaim tries to write back dirty pages from that inode. It will deadlock in xfs_iomap_write_allocate() trying to take the ilock we already hold. This can also show up as complex ABBA deadlocks when multiple threeads are triggering memory reclaim when trying to allocate extents. The main cause of this is the fact that delayed allocation is not done in a transaction, so KM_NOFS is not automatically added to the allocations to prevent this recursion. Mark all allocations done for the incore inode extent tree as KM_NOFS to ensure they never recurse back into the filesystem. Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.c | 16 +++++++++------- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index bedc661..20b6f87 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3707,7 +3707,8 @@ xfs_iext_add_indirect_multi( * (all extents past */ if (nex2) { byte_diff = nex2 * sizeof(xfs_bmbt_rec_t); - nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, KM_SLEEP); + nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, + KM_SLEEP|KM_NOFS); memmove(nex2_ep, &erp->er_extbuf[idx], byte_diff); erp->er_extcount -= nex2; xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, -nex2); @@ -4008,7 +4009,7 @@ xfs_iext_realloc_direct( kmem_realloc(ifp->if_u1.if_extents, rnew_size, ifp->if_real_bytes, - KM_SLEEP); + KM_SLEEP|KM_NOFS); } if (rnew_size > ifp->if_real_bytes) { memset(&ifp->if_u1.if_extents[ifp->if_bytes / @@ -4067,7 +4068,7 @@ xfs_iext_inline_to_direct( xfs_ifork_t *ifp, /* inode fork pointer */ int new_size) /* number of extents in file */ { - ifp->if_u1.if_extents = kmem_alloc(new_size, KM_SLEEP); + ifp->if_u1.if_extents = kmem_alloc(new_size, KM_SLEEP|KM_NOFS); memset(ifp->if_u1.if_extents, 0, new_size); if (ifp->if_bytes) { memcpy(ifp->if_u1.if_extents, ifp->if_u2.if_inline_ext, @@ -4099,7 +4100,7 @@ xfs_iext_realloc_indirect( } else { ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *) kmem_realloc(ifp->if_u1.if_ext_irec, - new_size, size, KM_SLEEP); + new_size, size, KM_SLEEP|KM_NOFS); } } @@ -4342,10 +4343,11 @@ xfs_iext_irec_init( ASSERT(nextents <= XFS_LINEAR_EXTS); erp = (xfs_ext_irec_t *) - kmem_alloc(sizeof(xfs_ext_irec_t), KM_SLEEP); + kmem_alloc(sizeof(xfs_ext_irec_t), KM_SLEEP|KM_NOFS); if (nextents == 0) { - ifp->if_u1.if_extents = kmem_alloc(XFS_IEXT_BUFSZ, KM_SLEEP); + ifp->if_u1.if_extents = kmem_alloc(XFS_IEXT_BUFSZ, + KM_SLEEP|KM_NOFS); } else if (!ifp->if_real_bytes) { xfs_iext_inline_to_direct(ifp, XFS_IEXT_BUFSZ); } else if (ifp->if_real_bytes < XFS_IEXT_BUFSZ) { @@ -4393,7 +4395,7 @@ xfs_iext_irec_new( /* Initialize new extent record */ erp = ifp->if_u1.if_ext_irec; - erp[erp_idx].er_extbuf = kmem_alloc(XFS_IEXT_BUFSZ, KM_SLEEP); + erp[erp_idx].er_extbuf = kmem_alloc(XFS_IEXT_BUFSZ, KM_SLEEP|KM_NOFS); ifp->if_real_bytes = nlists * XFS_IEXT_BUFSZ; memset(erp[erp_idx].er_extbuf, 0, XFS_IEXT_BUFSZ); erp[erp_idx].er_extcount = 0; -- 1.5.6 From owner-xfs@oss.sgi.com Sun Jul 20 22:57:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 20 Jul 2008 22:57:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6L5vWfY016349 for ; Sun, 20 Jul 2008 22:57:32 -0700 X-ASG-Debug-ID: 1216619920-0919022c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BBB8D139FF65 for ; Sun, 20 Jul 2008 22:58:40 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id zDH5Je9iwK271TVJ for ; Sun, 20 Jul 2008 22:58:40 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AowCAJLBg0h5LFxAiGdsb2JhbACSRwEBAQ8gmgo X-IronPort-AV: E=Sophos;i="4.31,221,1215354600"; d="scan'208";a="154080059" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 15:28:38 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKoPt-0007gP-Il for xfs@oss.sgi.com; Mon, 21 Jul 2008 15:58:37 +1000 Date: Mon, 21 Jul 2008 15:58:37 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Subject: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Message-ID: <20080721055837.GA6761@disturbed> Mail-Followup-To: xfs@oss.sgi.com References: <1216615959-23010-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216615959-23010-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216619921 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.47 X-Barracuda-Spam-Status: No, SCORE=-0.47 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M, BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56647 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16957 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 02:52:39PM +1000, Dave Chinner wrote: > If we allow incore extent tree allocations to recurse into the > filesystem under memory pressure, new delayed allocations through > xfs_iomap_write_delay() can deadlock on themselves if memory reclaim > tries to write back dirty pages from that inode. > > It will deadlock in xfs_iomap_write_allocate() trying to take the > ilock we already hold. This can also show up as complex ABBA > deadlocks when multiple threeads are triggering memory reclaim when > trying to allocate extents. > > The main cause of this is the fact that delayed allocation is > not done in a transaction, so KM_NOFS is not automatically > added to the allocations to prevent this recursion. > > Mark all allocations done for the incore inode extent tree as > KM_NOFS to ensure they never recurse back into the filesystem. BTW, if you are wondering what this fixes, it's this hang: http://oss.sgi.com/archives/xfs/2008-07/msg00091.html And the stack traces look like: > Call Trace: > [<8048190c>] schedule+0x810/0x97c > [<80483240>] __down_read+0xc4/0xec > [<8013d860>] down_read+0x10/0x1c > [<802cad44>] xfs_ilock+0x8c/0xa4 > [<802cac88>] xfs_ilock_map_shared+0x38/0x4c > [<802d27f8>] xfs_iomap+0xd8/0x4dc > [<802fe90c>] xfs_bmap+0x30/0x3c > [<802f3cfc>] xfs_map_blocks+0x50/0x84 > [<802f52a4>] xfs_page_state_convert+0x56c/0x840 > [<802f565c>] xfs_vm_writepage+0xe4/0x140 > [<80153cf4>] pageout+0x150/0x1e8 > [<80154144>] shrink_page_list+0x2b8/0x504 > [<8015455c>] shrink_inactive_list+0xc0/0x304 > [<80154da8>] shrink_zone+0x100/0x148 > [<80154e6c>] shrink_zones+0x7c/0xac > [<80154f94>] try_to_free_pages+0xf8/0x200 > [<8014f24c>] __alloc_pages+0x1a4/0x300 > [<80168a18>] kmem_getpages+0x58/0x138 > [<80169b1c>] cache_grow+0xd4/0x1c4 > [<80169db0>] cache_alloc_refill+0x1a4/0x210 > [<8016a2a0>] __kmalloc+0x98/0xc8 > [<802f3644>] kmem_alloc+0x94/0x130 > [<802d10d0>] xfs_iext_irec_new+0xb0/0x11c > [<802d0134>] xfs_iext_add+0x1fc/0x254 > [<802cfedc>] xfs_iext_insert+0x34/0x90 > [<802a70c4>] xfs_bmap_add_extent_hole_delay+0x5dc/0x6fc > [<802a3f0c>] xfs_bmap_add_extent+0x204/0x4e4 > [<802ace5c>] xfs_bmapi+0xa98/0x13e4 > [<802d3dc8>] xfs_iomap_write_delay+0x36c/0x4b8 > [<802d2aa0>] xfs_iomap+0x380/0x4dc > [<802fe90c>] xfs_bmap+0x30/0x3c > [<802f58b8>] __xfs_get_blocks+0xb0/0x300 > [<802f5b30>] xfs_get_blocks+0x28/0x34 > [<801718e0>] __block_prepare_write+0x208/0x548 > [<8017267c>] block_prepare_write+0x34/0x64 > [<802f5d6c>] xfs_vm_prepare_write+0x24/0x30 > [<8014bdf0>] generic_file_buffered_write+0x280/0x650 > [<802fe518>] xfs_write+0x768/0xaac > [<802f8c80>] xfs_file_aio_write+0x88/0x94 > [<8016d8d4>] do_sync_write+0xcc/0x124 > [<8016d9e4>] vfs_write+0xb8/0x1a0 > [<8016dd10>] sys_pwrite64+0x6c/0xa8 > [<8010c180>] stack_done+0x20/0x3c Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 00:51:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 00:51:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6L7pRIZ031303 for ; Mon, 21 Jul 2008 00:51:30 -0700 X-ASG-Debug-ID: 1216626756-435c02290000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5066A13A199E for ; Mon, 21 Jul 2008 00:52:36 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id knfEORUNb6U89Vaa for ; Mon, 21 Jul 2008 00:52:36 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKqCB-0004Ay-HF; Mon, 21 Jul 2008 07:52:35 +0000 Date: Mon, 21 Jul 2008 03:52:35 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Subject: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Message-ID: <20080721075235.GA6692@infradead.org> References: <1216615959-23010-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216615959-23010-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216626757 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56654 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16958 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 02:52:39PM +1000, Dave Chinner wrote: > If we allow incore extent tree allocations to recurse into the > filesystem under memory pressure, new delayed allocations through > xfs_iomap_write_delay() can deadlock on themselves if memory reclaim > tries to write back dirty pages from that inode. > > It will deadlock in xfs_iomap_write_allocate() trying to take the > ilock we already hold. This can also show up as complex ABBA > deadlocks when multiple threeads are triggering memory reclaim when > trying to allocate extents. > > The main cause of this is the fact that delayed allocation is > not done in a transaction, so KM_NOFS is not automatically > added to the allocations to prevent this recursion. > > Mark all allocations done for the incore inode extent tree as > KM_NOFS to ensure they never recurse back into the filesystem. Looks good. Note that KM_NOFS alone already means a allocation that can't fail, so no need to or it to KM_SLEEP. And long term we should try to look into allowing these to fail, allocations that aren't allowed to fail but can't recurse back into the fs still have a chance to deadlock. From owner-xfs@oss.sgi.com Mon Jul 21 00:53:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 00:53:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6L7reX9031745 for ; Mon, 21 Jul 2008 00:53:40 -0700 X-ASG-Debug-ID: 1216626889-3e20002c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5A4292C31A7 for ; Mon, 21 Jul 2008 00:54:49 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id GZKmbCy72I0wBnPH for ; Mon, 21 Jul 2008 00:54:49 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKqEL-0004Dl-G3; Mon, 21 Jul 2008 07:54:49 +0000 Date: Mon, 21 Jul 2008 03:54:49 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: remove i_gen from incore inode Subject: Re: [PATCH] XFS: remove i_gen from incore inode Message-ID: <20080721075449.GB6692@infradead.org> References: <1216558002-838-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216558002-838-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216626890 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56654 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16959 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote: > i_gen is incremented in directory operations when the > directory is changed. It is never read or otherwise used > so it should be removed to help reduce the size of the > struct xfs_inode. It also removes a xfs_trans_log_inode in xfs_remove, which looks fine to me from a quick glance, but this should be verified and documented. Otherwise looks good. From owner-xfs@oss.sgi.com Mon Jul 21 00:57:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 00:57:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6L7vHwK032352 for ; Mon, 21 Jul 2008 00:57:17 -0700 X-ASG-Debug-ID: 1216627106-3d89006b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0C36430D0A3 for ; Mon, 21 Jul 2008 00:58:26 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id WaE7jaiPylHxP3xR for ; Mon, 21 Jul 2008 00:58:26 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKqHq-0004fz-5A; Mon, 21 Jul 2008 07:58:26 +0000 Date: Mon, 21 Jul 2008 03:58:26 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Subject: Re: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Message-ID: <20080721075826.GC6692@infradead.org> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-2-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216556394-17529-2-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216627107 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56654 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16960 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Sun, Jul 20, 2008 at 10:19:51PM +1000, Dave Chinner wrote: > xfs_iflush_all() walks the m_inodes list to find inodes that > need reclaiming. We already have such a list - the m_del_inodes > list. Replace xfs_iflush_all() with a call to xfs_finish_reclaim_all() > and clean up xfs_finish_reclaim_all() to handle the different flush > modes now needed. > > > > Originally based on a patch from Christoph Hellwig. Unlike my original patch is also now calls xfs_finish_reclaim_all unconditonal in xfs_syncsub. This looks harmless but useless in the context of this patch, and actually useful for your next patches. The xfs_finish_reclaim_all in xfs_quiesce_fs changes from XFS_IFLUSH_DELWRI_ELSE_ASYNC to XFS_IFLUSH_ASYNC, which needs an explanation. Otherwiase this looks good to me, should have submitted the original patch long time ago.. > > Signed-off-by: Dave Chinner > --- > fs/xfs/xfs_inode.c | 39 --------------------------------------- > fs/xfs/xfs_inode.h | 3 +-- > fs/xfs/xfs_mount.c | 2 +- > fs/xfs/xfs_vfsops.c | 8 +++----- > fs/xfs/xfs_vnodeops.c | 42 ++++++++++++++++++------------------------ > 5 files changed, 23 insertions(+), 71 deletions(-) > > diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c > index 20b6f87..ae19b05 100644 > --- a/fs/xfs/xfs_inode.c > +++ b/fs/xfs/xfs_inode.c > @@ -3456,45 +3456,6 @@ corrupt_out: > return XFS_ERROR(EFSCORRUPTED); > } > > - > -/* > - * Flush all inactive inodes in mp. > - */ > -void > -xfs_iflush_all( > - xfs_mount_t *mp) > -{ > - xfs_inode_t *ip; > - bhv_vnode_t *vp; > - > - again: > - XFS_MOUNT_ILOCK(mp); > - ip = mp->m_inodes; > - if (ip == NULL) > - goto out; > - > - do { > - /* Make sure we skip markers inserted by sync */ > - if (ip->i_mount == NULL) { > - ip = ip->i_mnext; > - continue; > - } > - > - vp = XFS_ITOV_NULL(ip); > - if (!vp) { > - XFS_MOUNT_IUNLOCK(mp); > - xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); > - goto again; > - } > - > - ASSERT(vn_count(vp) == 0); > - > - ip = ip->i_mnext; > - } while (ip != mp->m_inodes); > - out: > - XFS_MOUNT_IUNLOCK(mp); > -} > - > #ifdef XFS_ILOCK_TRACE > ktrace_t *xfs_ilock_trace_buf; > > diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h > index 17a04b6..7ce41d3 100644 > --- a/fs/xfs/xfs_inode.h > +++ b/fs/xfs/xfs_inode.h > @@ -480,7 +480,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint); > void xfs_ifunlock(xfs_inode_t *); > void xfs_ireclaim(xfs_inode_t *); > int xfs_finish_reclaim(xfs_inode_t *, int, int); > -int xfs_finish_reclaim_all(struct xfs_mount *, int); > +int xfs_finish_reclaim_all(struct xfs_mount *, int, int); > > /* > * xfs_inode.c prototypes. > @@ -518,7 +518,6 @@ void xfs_ipin(xfs_inode_t *); > void xfs_iunpin(xfs_inode_t *); > int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); > int xfs_iflush(xfs_inode_t *, uint); > -void xfs_iflush_all(struct xfs_mount *); > void xfs_ichgtime(xfs_inode_t *, int); > xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); > void xfs_lock_inodes(xfs_inode_t **, int, uint); > diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c > index 6c5d132..0c23f6a 100644 > --- a/fs/xfs/xfs_mount.c > +++ b/fs/xfs/xfs_mount.c > @@ -1268,7 +1268,7 @@ xfs_unmountfs(xfs_mount_t *mp) > * need to force the log first. > */ > xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); > - xfs_iflush_all(mp); > + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); > > XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING); > > diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c > index 4a9a433..9d72646 100644 > --- a/fs/xfs/xfs_vfsops.c > +++ b/fs/xfs/xfs_vfsops.c > @@ -65,7 +65,7 @@ xfs_quiesce_fs( > int count = 0, pincount; > > xfs_flush_buftarg(mp->m_ddev_targp, 0); > - xfs_finish_reclaim_all(mp, 0); > + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); > > /* This loop must run at least twice. > * The first instance of the loop will flush > @@ -653,10 +653,8 @@ xfs_syncsub( > xfs_log_force(mp, (xfs_lsn_t)0, log_flags); > > if (flags & (SYNC_ATTR|SYNC_DELWRI)) { > - if (flags & SYNC_BDFLUSH) > - xfs_finish_reclaim_all(mp, 1); > - else > - error = xfs_sync_inodes(mp, flags, bypassed); > + xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); > + error = xfs_sync_inodes(mp, flags, bypassed); > } > > /* > diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c > index b792a12..2af1be3 100644 > --- a/fs/xfs/xfs_vnodeops.c > +++ b/fs/xfs/xfs_vnodeops.c > @@ -2985,36 +2985,30 @@ xfs_finish_reclaim( > } > > int > -xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) > +xfs_finish_reclaim_all( > + xfs_mount_t *mp, > + int noblock, > + int mode) > { > - int purged; > xfs_inode_t *ip, *n; > - int done = 0; > > - while (!done) { > - purged = 0; > - XFS_MOUNT_ILOCK(mp); > - list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { > - if (noblock) { > - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) > - continue; > - if (xfs_ipincount(ip) || > - !xfs_iflock_nowait(ip)) { > - xfs_iunlock(ip, XFS_ILOCK_EXCL); > - continue; > - } > +restart: > + XFS_MOUNT_ILOCK(mp); > + list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { > + if (noblock) { > + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) > + continue; > + if (xfs_ipincount(ip) || > + !xfs_iflock_nowait(ip)) { > + xfs_iunlock(ip, XFS_ILOCK_EXCL); > + continue; > } > - XFS_MOUNT_IUNLOCK(mp); > - if (xfs_finish_reclaim(ip, noblock, > - XFS_IFLUSH_DELWRI_ELSE_ASYNC)) > - delay(1); > - purged = 1; > - break; > } > - > - done = !purged; > + XFS_MOUNT_IUNLOCK(mp); > + if (xfs_finish_reclaim(ip, noblock, mode)) > + delay(1); > + goto restart; > } > - > XFS_MOUNT_IUNLOCK(mp); > return 0; > } > -- > 1.5.6 > > ---end quoted text--- From owner-xfs@oss.sgi.com Mon Jul 21 01:00:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 01:00:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6L80MeA000955 for ; Mon, 21 Jul 2008 01:00:22 -0700 X-ASG-Debug-ID: 1216627291-250c00220000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5CD64E716C9 for ; Mon, 21 Jul 2008 01:01:32 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id zVQQTSLRVtJfBKYT for ; Mon, 21 Jul 2008 01:01:32 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKqKp-0008Ln-Or; Mon, 21 Jul 2008 08:01:31 +0000 Date: Mon, 21 Jul 2008 04:01:31 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/3] XFS: sanitise VFS inode extraction Subject: Re: [PATCH 0/3] XFS: sanitise VFS inode extraction Message-ID: <20080721080131.GD6692@infradead.org> References: <1216557828-29056-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216557828-29056-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216627292 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56653 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16961 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Sun, Jul 20, 2008 at 10:43:45PM +1000, Dave Chinner wrote: > Getting the VFS inode from the XFS inode is done in a variety of > ways right now - direct deference or one of two XFS_ITOV macros. > This should be consi??tent throughout the code - this patch > series does that in a way that is consistent with the opposite > XFS_I() conversion. We now use VFS_I() to extract the VFS inode > from the XFS inode. All three patches looks good to me, but please kill the vn_to_inode useage in VFS_I - vn_to_inode and inode_to_vn are not needed anymore at all nowdays and will go away completely real soon. From owner-xfs@oss.sgi.com Mon Jul 21 02:32:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 02:32:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6L9WWpE006963 for ; Mon, 21 Jul 2008 02:32:33 -0700 X-ASG-Debug-ID: 1216632821-3e1f03c00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtprelay11.ispgateway.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 864D930D269; Mon, 21 Jul 2008 02:33:41 -0700 (PDT) Received: from smtprelay11.ispgateway.de (smtprelay11.ispgateway.de [80.67.29.28]) by cuda.sgi.com with ESMTP id xU24Es5eoBHbXHni; Mon, 21 Jul 2008 02:33:41 -0700 (PDT) Received: from [62.43.225.238] (helo=[192.168.30.191]) by smtprelay11.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KKrm0-0004jB-10; Mon, 21 Jul 2008 11:33:40 +0200 Message-ID: <488457F3.2050405@cape-horn-eng.com> Date: Mon, 21 Jul 2008 11:33:39 +0200 From: Richard Ems User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: xfs@oss.sgi.com, "Bill O'Donnell" X-ASG-Orig-Subj: Re: XFS internal error xfs_btree_check_lblock Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> In-Reply-To: <48815AA6.3080102@sgi.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Df-Sender: 337294 X-Barracuda-Connect: smtprelay11.ispgateway.de[80.67.29.28] X-Barracuda-Start-Time: 1216632822 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56659 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16962 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Richard.Ems@cape-horn-eng.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > Hi Richard, > > this looks like XFS b-tree corruption of some sort. We have some patches > that should help here. The patches are being back-ported to SLES10 and > should also apply to OpenSUSE. We should have something ready early next > week. Thanks Mark. The most annoying thing is that, after many repairs, it's working again! But my big question is ... for how long? How stable is the filesystem now? Should I better recreate it? WHY did this happen? Why did the FS fail again after some repairs? 8( Where can I get more info about these patches? Is there a developer mailing list? Or some webpage to follow the development progress? Thanks, Richard -- Richard Ems mail: Richard.Ems@Cape-Horn-Eng.com Cape Horn Engineering S.L. C/ Dr. J.J. Dómine 1, 5º piso 46011 Valencia Tel : +34 96 3242923 / Fax 924 From owner-xfs@oss.sgi.com Mon Jul 21 03:58:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 03:58:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LAwHLV012496 for ; Mon, 21 Jul 2008 03:58:18 -0700 X-ASG-Debug-ID: 1216637964-7de9029d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C612711E98E3 for ; Mon, 21 Jul 2008 03:59:24 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id krTIAOBxqgHMn8Bz for ; Mon, 21 Jul 2008 03:59:24 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAOYHhEh5LFxAiGdsb2JhbACSSAEBAQ8gmkY X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154258517" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 20:29:22 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKt6u-0000wk-Ng; Mon, 21 Jul 2008 20:59:20 +1000 Date: Mon, 21 Jul 2008 20:59:15 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Subject: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation Message-ID: <20080721105915.GB6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216615959-23010-1-git-send-email-david@fromorbit.com> <20080721075235.GA6692@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080721075235.GA6692@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216637966 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56665 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16963 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 03:52:35AM -0400, Christoph Hellwig wrote: > On Mon, Jul 21, 2008 at 02:52:39PM +1000, Dave Chinner wrote: > > If we allow incore extent tree allocations to recurse into the > > filesystem under memory pressure, new delayed allocations through > > xfs_iomap_write_delay() can deadlock on themselves if memory reclaim > > tries to write back dirty pages from that inode. > > > > It will deadlock in xfs_iomap_write_allocate() trying to take the > > ilock we already hold. This can also show up as complex ABBA > > deadlocks when multiple threeads are triggering memory reclaim when > > trying to allocate extents. > > > > The main cause of this is the fact that delayed allocation is > > not done in a transaction, so KM_NOFS is not automatically > > added to the allocations to prevent this recursion. > > > > Mark all allocations done for the incore inode extent tree as > > KM_NOFS to ensure they never recurse back into the filesystem. > > Looks good. Note that KM_NOFS alone already means a allocation > that can't fail, so no need to or it to KM_SLEEP. Right. I'll update the patch and resend it. > And long term we should try to look into allowing these to fail, > allocations that aren't allowed to fail but can't recurse back into > the fs still have a chance to deadlock. We need dirty transaction rollback capabilities before we can do that. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 04:02:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:02:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LB26TK013037 for ; Mon, 21 Jul 2008 04:02:07 -0700 X-ASG-Debug-ID: 1216638194-1f4001e90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1B831190FA17 for ; Mon, 21 Jul 2008 04:03:15 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id t8fVYwIM9Dhn5jWR for ; Mon, 21 Jul 2008 04:03:15 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAOYHhEh5LFxAiGdsb2JhbACSSAEBAQ8gmkY X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154260938" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 20:33:13 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtAf-0001fD-0w; Mon, 21 Jul 2008 21:03:13 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation V2 Subject: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation V2 Date: Mon, 21 Jul 2008 21:03:12 +1000 Message-Id: <1216638192-6292-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216638196 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56666 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16964 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs If we allow incore extent tree allocations to recurse into the filesystem under memory pressure, new delayed allocations through xfs_iomap_write_delay() can deadlock on themselves if memory reclaim tries to write back dirty pages from that inode. It will deadlock in xfs_iomap_write_allocate() trying to take the ilock we already hold. This can also show up as complex ABBA deadlocks when multiple threads are triggering memory reclaim when trying to allocate extents. The main cause of this is the fact that delayed allocation is not done in a transaction, so KM_NOFS is not automatically added to the allocations to prevent this recursion. Mark all allocations done for the incore inode extent tree as KM_NOFS to ensure they never recurse back into the filesystem. Version 2: o KM_NOFS implies KM_SLEEP, so just use KM_NOFS Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.c | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index bedc661..89b8638 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3707,7 +3707,7 @@ xfs_iext_add_indirect_multi( * (all extents past */ if (nex2) { byte_diff = nex2 * sizeof(xfs_bmbt_rec_t); - nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, KM_SLEEP); + nex2_ep = (xfs_bmbt_rec_t *) kmem_alloc(byte_diff, KM_NOFS); memmove(nex2_ep, &erp->er_extbuf[idx], byte_diff); erp->er_extcount -= nex2; xfs_iext_irec_update_extoffs(ifp, erp_idx + 1, -nex2); @@ -4007,8 +4007,7 @@ xfs_iext_realloc_direct( ifp->if_u1.if_extents = kmem_realloc(ifp->if_u1.if_extents, rnew_size, - ifp->if_real_bytes, - KM_SLEEP); + ifp->if_real_bytes, KM_NOFS); } if (rnew_size > ifp->if_real_bytes) { memset(&ifp->if_u1.if_extents[ifp->if_bytes / @@ -4067,7 +4066,7 @@ xfs_iext_inline_to_direct( xfs_ifork_t *ifp, /* inode fork pointer */ int new_size) /* number of extents in file */ { - ifp->if_u1.if_extents = kmem_alloc(new_size, KM_SLEEP); + ifp->if_u1.if_extents = kmem_alloc(new_size, KM_NOFS); memset(ifp->if_u1.if_extents, 0, new_size); if (ifp->if_bytes) { memcpy(ifp->if_u1.if_extents, ifp->if_u2.if_inline_ext, @@ -4099,7 +4098,7 @@ xfs_iext_realloc_indirect( } else { ifp->if_u1.if_ext_irec = (xfs_ext_irec_t *) kmem_realloc(ifp->if_u1.if_ext_irec, - new_size, size, KM_SLEEP); + new_size, size, KM_NOFS); } } @@ -4341,11 +4340,10 @@ xfs_iext_irec_init( nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); ASSERT(nextents <= XFS_LINEAR_EXTS); - erp = (xfs_ext_irec_t *) - kmem_alloc(sizeof(xfs_ext_irec_t), KM_SLEEP); + erp = kmem_alloc(sizeof(xfs_ext_irec_t), KM_NOFS); if (nextents == 0) { - ifp->if_u1.if_extents = kmem_alloc(XFS_IEXT_BUFSZ, KM_SLEEP); + ifp->if_u1.if_extents = kmem_alloc(XFS_IEXT_BUFSZ, KM_NOFS); } else if (!ifp->if_real_bytes) { xfs_iext_inline_to_direct(ifp, XFS_IEXT_BUFSZ); } else if (ifp->if_real_bytes < XFS_IEXT_BUFSZ) { @@ -4393,7 +4391,7 @@ xfs_iext_irec_new( /* Initialize new extent record */ erp = ifp->if_u1.if_ext_irec; - erp[erp_idx].er_extbuf = kmem_alloc(XFS_IEXT_BUFSZ, KM_SLEEP); + erp[erp_idx].er_extbuf = kmem_alloc(XFS_IEXT_BUFSZ, KM_NOFS); ifp->if_real_bytes = nlists * XFS_IEXT_BUFSZ; memset(erp[erp_idx].er_extbuf, 0, XFS_IEXT_BUFSZ); erp[erp_idx].er_extcount = 0; -- 1.5.6 From owner-xfs@oss.sgi.com Mon Jul 21 04:07:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:07:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LB78mJ013599 for ; Mon, 21 Jul 2008 04:07:08 -0700 X-ASG-Debug-ID: 1216638497-160e02ee0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 772D6190FA6A for ; Mon, 21 Jul 2008 04:08:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ZlSH7QIn8UIB8htE for ; Mon, 21 Jul 2008 04:08:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAO8KhEh5LFxAiGdsb2JhbACSSAEBAQ8gmkA X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154263537" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 20:38:15 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtFX-0001nS-3T; Mon, 21 Jul 2008 21:08:15 +1000 Date: Mon, 21 Jul 2008 21:08:14 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: remove i_gen from incore inode Subject: Re: [PATCH] XFS: remove i_gen from incore inode Message-ID: <20080721110814.GC6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216558002-838-1-git-send-email-david@fromorbit.com> <20080721075449.GB6692@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080721075449.GB6692@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216638498 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56666 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16965 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 03:54:49AM -0400, Christoph Hellwig wrote: > On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote: > > i_gen is incremented in directory operations when the > > directory is changed. It is never read or otherwise used > > so it should be removed to help reduce the size of the > > struct xfs_inode. > > It also removes a xfs_trans_log_inode in xfs_remove, which looks > fine to me from a quick glance, but this should be verified and > documented. If you note in the very next if/else statement the directory inode gets logged - either by dropping the link or directly. IOWs, we were logging the directory inode twice with the same value (XFS_ILOG_CORE). So I don't think thereÅ›s any problem here. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 04:32:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:32:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBVxMK020701 for ; Mon, 21 Jul 2008 04:32:00 -0700 X-ASG-Debug-ID: 1216639985-078103c20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2AB2E12E8066 for ; Mon, 21 Jul 2008 04:33:05 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id FKZh9EbP8F6ZIp6V for ; Mon, 21 Jul 2008 04:33:05 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAOwOhEh5LFxAiGdsb2JhbACSSAEBAQ8gmjs X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154277196" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 21:03:04 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtdW-00046v-TC; Mon, 21 Jul 2008 21:33:02 +1000 Date: Mon, 21 Jul 2008 21:33:02 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Subject: Re: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Message-ID: <20080721113302.GD6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-2-git-send-email-david@fromorbit.com> <20080721075826.GC6692@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080721075826.GC6692@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216639989 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56667 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16966 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 03:58:26AM -0400, Christoph Hellwig wrote: > On Sun, Jul 20, 2008 at 10:19:51PM +1000, Dave Chinner wrote: > > xfs_iflush_all() walks the m_inodes list to find inodes that > > need reclaiming. We already have such a list - the m_del_inodes > > list. Replace xfs_iflush_all() with a call to xfs_finish_reclaim_all() > > and clean up xfs_finish_reclaim_all() to handle the different flush > > modes now needed. > > > > > > > > Originally based on a patch from Christoph Hellwig. > > Unlike my original patch is also now calls xfs_finish_reclaim_all > unconditonal in xfs_syncsub. This looks harmless but useless in the > context of this patch, and actually useful for your next patches. It's not really harmless - it reclaims inodes faster as reclaim is now triggered by means other than xfssyncd. I'm not sure I should perturb the reclaim behaviour right now (wasn't my intent) so I'll change it back to the original code. It doesn't affect the other patches in any material way... > The xfs_finish_reclaim_all in xfs_quiesce_fs changes from > XFS_IFLUSH_DELWRI_ELSE_ASYNC to XFS_IFLUSH_ASYNC, which needs an > explanation. Ah - that slipped through from the original patches - this change was much later in the original series I wrote. It doesn't make much sense to make this change until the inode writeback clustering gets optimised. Fixed patch is below. Cheers, Dave. -- Dave Chinner david@fromorbit.com XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 xfs_iflush_all() walks the m_inodes list to find inodes that need reclaiming. We already have such a list - the m_del_inodes list. Replace xfs_iflush_all() with a call to xfs_finish_reclaim_all() and clean up xfs_finish_reclaim_all() to handle the different flush modes now needed. Originally based on a patch from Christoph Hellwig. Signed-off-by: Dave Chinner --- Version 2 o revert xfs_syncsub() inode reclaim behaviour back to original code o xfs_quiesce_fs() should use XFS_IFLUSH_DELWRI_ELSE_ASYNC, not XFS_IFLUSH_ASYNC, to prevent change of behaviour. fs/xfs/xfs_inode.c | 39 --------------------------------------- fs/xfs/xfs_inode.h | 3 +-- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_vfsops.c | 4 ++-- fs/xfs/xfs_vnodeops.c | 42 ++++++++++++++++++------------------------ 5 files changed, 22 insertions(+), 68 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 20b6f87..ae19b05 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3456,45 +3456,6 @@ corrupt_out: return XFS_ERROR(EFSCORRUPTED); } - -/* - * Flush all inactive inodes in mp. - */ -void -xfs_iflush_all( - xfs_mount_t *mp) -{ - xfs_inode_t *ip; - bhv_vnode_t *vp; - - again: - XFS_MOUNT_ILOCK(mp); - ip = mp->m_inodes; - if (ip == NULL) - goto out; - - do { - /* Make sure we skip markers inserted by sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = XFS_ITOV_NULL(ip); - if (!vp) { - XFS_MOUNT_IUNLOCK(mp); - xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); - goto again; - } - - ASSERT(vn_count(vp) == 0); - - ip = ip->i_mnext; - } while (ip != mp->m_inodes); - out: - XFS_MOUNT_IUNLOCK(mp); -} - #ifdef XFS_ILOCK_TRACE ktrace_t *xfs_ilock_trace_buf; diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 17a04b6..7ce41d3 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -480,7 +480,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint); void xfs_ifunlock(xfs_inode_t *); void xfs_ireclaim(xfs_inode_t *); int xfs_finish_reclaim(xfs_inode_t *, int, int); -int xfs_finish_reclaim_all(struct xfs_mount *, int); +int xfs_finish_reclaim_all(struct xfs_mount *, int, int); /* * xfs_inode.c prototypes. @@ -518,7 +518,6 @@ void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); -void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); void xfs_lock_inodes(xfs_inode_t **, int, uint); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6c5d132..0c23f6a 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1268,7 +1268,7 @@ xfs_unmountfs(xfs_mount_t *mp) * need to force the log first. */ xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); - xfs_iflush_all(mp); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING); diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 4a9a433..ab3f004 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -65,7 +65,7 @@ xfs_quiesce_fs( int count = 0, pincount; xfs_flush_buftarg(mp->m_ddev_targp, 0); - xfs_finish_reclaim_all(mp, 0); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC); /* This loop must run at least twice. * The first instance of the loop will flush @@ -654,7 +654,7 @@ xfs_syncsub( if (flags & (SYNC_ATTR|SYNC_DELWRI)) { if (flags & SYNC_BDFLUSH) - xfs_finish_reclaim_all(mp, 1); + xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); else error = xfs_sync_inodes(mp, flags, bypassed); } diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index b792a12..2af1be3 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2985,36 +2985,30 @@ xfs_finish_reclaim( } int -xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) +xfs_finish_reclaim_all( + xfs_mount_t *mp, + int noblock, + int mode) { - int purged; xfs_inode_t *ip, *n; - int done = 0; - while (!done) { - purged = 0; - XFS_MOUNT_ILOCK(mp); - list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { - if (noblock) { - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) - continue; - if (xfs_ipincount(ip) || - !xfs_iflock_nowait(ip)) { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - continue; - } +restart: + XFS_MOUNT_ILOCK(mp); + list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { + if (noblock) { + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) + continue; + if (xfs_ipincount(ip) || + !xfs_iflock_nowait(ip)) { + xfs_iunlock(ip, XFS_ILOCK_EXCL); + continue; } - XFS_MOUNT_IUNLOCK(mp); - if (xfs_finish_reclaim(ip, noblock, - XFS_IFLUSH_DELWRI_ELSE_ASYNC)) - delay(1); - purged = 1; - break; } - - done = !purged; + XFS_MOUNT_IUNLOCK(mp); + if (xfs_finish_reclaim(ip, noblock, mode)) + delay(1); + goto restart; } - XFS_MOUNT_IUNLOCK(mp); return 0; } From owner-xfs@oss.sgi.com Mon Jul 21 04:45:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:46:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41, J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBjtnT021642 for ; Mon, 21 Jul 2008 04:45:55 -0700 X-ASG-Debug-ID: 1216640820-397203b00002-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 91EA830D989 for ; Mon, 21 Jul 2008 04:47:03 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id dUCkEfkeE6SEjbWv for ; Mon, 21 Jul 2008 04:47:03 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAG8ShEh5LFxAiGdsb2JhbACSSAEBAQ8gmkE X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154283825" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 21:17:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtr1-0005GE-7b; Mon, 21 Jul 2008 21:46:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 3/3] XFS: Kill shouty XFS_ITOV() macro Subject: [PATCH 3/3] XFS: Kill shouty XFS_ITOV() macro Date: Mon, 21 Jul 2008 21:46:59 +1000 Message-Id: <1216640819-19924-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216640819-19924-1-git-send-email-david@fromorbit.com> References: <1216640819-19924-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216640824 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16969 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Replace XFS_ITOV() with the new VFS_I() inline. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_ioctl.c | 4 ++-- fs/xfs/linux-2.6/xfs_iops.c | 2 +- fs/xfs/linux-2.6/xfs_linux.h | 2 +- fs/xfs/linux-2.6/xfs_super.c | 2 +- fs/xfs/quota/xfs_dquot.c | 2 +- fs/xfs/xfs_bmap.c | 2 +- fs/xfs/xfs_dfrag.c | 4 ++-- fs/xfs/xfs_inode.c | 4 ++-- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_itable.c | 2 +- fs/xfs/xfs_utils.h | 4 ++-- fs/xfs/xfs_vfsops.c | 8 ++++---- fs/xfs/xfs_vnodeops.c | 10 +++++----- 13 files changed, 23 insertions(+), 24 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_ioctl.c b/fs/xfs/linux-2.6/xfs_ioctl.c index bae2e91..b6c0450 100644 --- a/fs/xfs/linux-2.6/xfs_ioctl.c +++ b/fs/xfs/linux-2.6/xfs_ioctl.c @@ -247,7 +247,7 @@ xfs_vget_fsop_handlereq( xfs_iunlock(ip, XFS_ILOCK_SHARED); - *inode = XFS_ITOV(ip); + *inode = VFS_I(ip); return 0; } @@ -1162,7 +1162,7 @@ xfs_ioctl_setattr( (mask & FSX_NONBLOCK) ? DM_FLAGS_NDELAY : 0); } - vn_revalidate(XFS_ITOV(ip)); /* update flags */ + vn_revalidate(VFS_I(ip)); /* update flags */ return 0; error_return: diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index 5825ab4..7cdbd60 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -101,7 +101,7 @@ xfs_ichgtime( xfs_inode_t *ip, int flags) { - struct inode *inode = vn_to_inode(XFS_ITOV(ip)); + struct inode *inode = VFS_I(ip); timespec_t tv; nanotime(&tv); diff --git a/fs/xfs/linux-2.6/xfs_linux.h b/fs/xfs/linux-2.6/xfs_linux.h index 4d45d93..a9cd6e4 100644 --- a/fs/xfs/linux-2.6/xfs_linux.h +++ b/fs/xfs/linux-2.6/xfs_linux.h @@ -180,7 +180,7 @@ #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) #define xfs_stack_trace() dump_stack() #define xfs_itruncate_data(ip, off) \ - (-vmtruncate(vn_to_inode(XFS_ITOV(ip)), (off))) + (-vmtruncate(vn_to_inode(VFS_I(ip)), (off))) /* Move the kernel do_div definition off to one side */ diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index a507762..74add64 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -1132,7 +1132,7 @@ void xfs_flush_device( xfs_inode_t *ip) { - struct inode *inode = vn_to_inode(XFS_ITOV(ip)); + struct inode *inode = VFS_I(ip); igrab(inode); xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_device_work); diff --git a/fs/xfs/quota/xfs_dquot.c b/fs/xfs/quota/xfs_dquot.c index fc9f3fb..68adc5f 100644 --- a/fs/xfs/quota/xfs_dquot.c +++ b/fs/xfs/quota/xfs_dquot.c @@ -431,7 +431,7 @@ xfs_qm_dqalloc( * when it unlocks the inode. Since we want to keep the quota * inode around, we bump the vnode ref count now. */ - VN_HOLD(XFS_ITOV(quotip)); + VN_HOLD(VFS_I(quotip)); xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL); nmaps = 1; diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c index 3c4beb3..2f46b67 100644 --- a/fs/xfs/xfs_bmap.c +++ b/fs/xfs/xfs_bmap.c @@ -4000,7 +4000,7 @@ xfs_bmap_add_attrfork( ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; } ASSERT(ip->i_d.di_anextents == 0); - VN_HOLD(XFS_ITOV(ip)); + VN_HOLD(VFS_I(ip)); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); switch (ip->i_d.di_format) { diff --git a/fs/xfs/xfs_dfrag.c b/fs/xfs/xfs_dfrag.c index 2211e88..9e75101 100644 --- a/fs/xfs/xfs_dfrag.c +++ b/fs/xfs/xfs_dfrag.c @@ -150,8 +150,8 @@ xfs_swap_extents( } sbp = &sxp->sx_stat; - vp = XFS_ITOV(ip); - tvp = XFS_ITOV(tip); + vp = VFS_I(ip); + tvp = VFS_I(tip); /* Lock in i_ino order */ if (ip->i_ino < tip->i_ino) { diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index ae19b05..92a054c 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -1077,7 +1077,7 @@ xfs_ialloc( } ASSERT(ip != NULL); - vp = XFS_ITOV(ip); + vp = VFS_I(ip); ip->i_d.di_mode = (__uint16_t)mode; ip->i_d.di_onlink = 0; ip->i_d.di_nlink = nlink; @@ -1408,7 +1408,7 @@ xfs_itruncate_start( (flags == XFS_ITRUNC_MAYBE)); mp = ip->i_mount; - vp = XFS_ITOV(ip); + vp = VFS_I(ip); /* wait for the completion of any pending DIOs */ if (new_size < ip->i_size) diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 5dd4796..ebaea3b 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -271,7 +271,6 @@ static inline struct inode *VFS_I(struct xfs_inode *ip) { return (struct inode *)ip->i_vnode; } -#define XFS_ITOV(ip) VFS_I(ip) /* * i_flags helper functions diff --git a/fs/xfs/xfs_itable.c b/fs/xfs/xfs_itable.c index 9a3ef9d..4feda54 100644 --- a/fs/xfs/xfs_itable.c +++ b/fs/xfs/xfs_itable.c @@ -72,7 +72,7 @@ xfs_bulkstat_one_iget( ASSERT(ip != NULL); ASSERT(ip->i_blkno != (xfs_daddr_t)0); - vp = XFS_ITOV(ip); + vp = VFS_I(ip); dic = &ip->i_d; /* xfs_iget returns the following without needing diff --git a/fs/xfs/xfs_utils.h b/fs/xfs/xfs_utils.h index f316cb8..7b533df 100644 --- a/fs/xfs/xfs_utils.h +++ b/fs/xfs/xfs_utils.h @@ -18,8 +18,8 @@ #ifndef __XFS_UTILS_H__ #define __XFS_UTILS_H__ -#define IRELE(ip) VN_RELE(XFS_ITOV(ip)) -#define IHOLD(ip) VN_HOLD(XFS_ITOV(ip)) +#define IRELE(ip) VN_RELE(VFS_I(ip)) +#define IHOLD(ip) VN_HOLD(VFS_I(ip)) extern int xfs_truncate_file(xfs_mount_t *, xfs_inode_t *); extern int xfs_dir_ialloc(xfs_trans_t **, xfs_inode_t *, mode_t, xfs_nlink_t, diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index ff6a916..fe02272 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -128,7 +128,7 @@ xfs_unmount_flush( xfs_inode_t *rip = mp->m_rootip; xfs_inode_t *rbmip; xfs_inode_t *rsumip = NULL; - bhv_vnode_t *rvp = XFS_ITOV(rip); + bhv_vnode_t *rvp = VFS_I(rip); int error; xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); @@ -146,7 +146,7 @@ xfs_unmount_flush( if (error == EFSCORRUPTED) goto fscorrupt_out; - ASSERT(vn_count(XFS_ITOV(rbmip)) == 1); + ASSERT(vn_count(VFS_I(rbmip)) == 1); rsumip = mp->m_rsumip; xfs_ilock(rsumip, XFS_ILOCK_EXCL); @@ -157,7 +157,7 @@ xfs_unmount_flush( if (error == EFSCORRUPTED) goto fscorrupt_out; - ASSERT(vn_count(XFS_ITOV(rsumip)) == 1); + ASSERT(vn_count(VFS_I(rsumip)) == 1); } /* @@ -360,7 +360,7 @@ xfs_sync_inodes_ag( continue; xfs_ilock(ip, lock_flags); - ASSERT(vp == XFS_ITOV(ip)); + ASSERT(vp == VFS_I(ip)); ASSERT(ip->i_mount == mp); vnode_refed = B_TRUE; diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 5d1b254..cca2871 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -705,7 +705,7 @@ xfs_fsync( return XFS_ERROR(EIO); /* capture size updates in I/O completion before writing the inode. */ - error = filemap_fdatawait(vn_to_inode(XFS_ITOV(ip))->i_mapping); + error = filemap_fdatawait(vn_to_inode(VFS_I(ip))->i_mapping); if (error) return XFS_ERROR(error); @@ -1151,7 +1151,7 @@ int xfs_release( xfs_inode_t *ip) { - bhv_vnode_t *vp = XFS_ITOV(ip); + bhv_vnode_t *vp = VFS_I(ip); xfs_mount_t *mp = ip->i_mount; int error; @@ -1218,7 +1218,7 @@ int xfs_inactive( xfs_inode_t *ip) { - bhv_vnode_t *vp = XFS_ITOV(ip); + bhv_vnode_t *vp = VFS_I(ip); xfs_bmap_free_t free_list; xfs_fsblock_t first_block; int committed; @@ -2864,7 +2864,7 @@ int xfs_reclaim( xfs_inode_t *ip) { - bhv_vnode_t *vp = XFS_ITOV(ip); + bhv_vnode_t *vp = VFS_I(ip); xfs_itrace_entry(ip); @@ -3326,7 +3326,7 @@ xfs_free_file_space( xfs_trans_t *tp; int need_iolock = 1; - vp = XFS_ITOV(ip); + vp = VFS_I(ip); mp = ip->i_mount; xfs_itrace_entry(ip); -- 1.5.6 From owner-xfs@oss.sgi.com Mon Jul 21 04:45:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:45:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBjqHG021620 for ; Mon, 21 Jul 2008 04:45:52 -0700 X-ASG-Debug-ID: 1216640820-397203b00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2008C30D986 for ; Mon, 21 Jul 2008 04:47:01 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id wEuGa0OHuxKqohpZ for ; Mon, 21 Jul 2008 04:47:01 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAG8ShEh5LFxAiGdsb2JhbACSSAEBAQ8gmkE X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154283823" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 21:17:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtr1-0005G7-2G for xfs@oss.sgi.com; Mon, 21 Jul 2008 21:46:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/3] XFS: sanitise VFS inode extraction V2 Subject: [PATCH 0/3] XFS: sanitise VFS inode extraction V2 Date: Mon, 21 Jul 2008 21:46:56 +1000 Message-Id: <1216640819-19924-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216640822 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16967 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Getting the VFS inode from the XFS inode is done in a variety of ways right now - direct deference or one of two XFS_ITOV macros. This should be consistent throughout the code - this patch series does that in a way that is consistent with the opposite XFS_I() conversion. We now use VFS_I() to extract the VFS inode from the XFS inode. Version 2: o don't use vn_to_inode() and inode_to_vn() functions as they are not needed o rediff patches 2 and 3 against the change patch. From owner-xfs@oss.sgi.com Mon Jul 21 04:45:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:46:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBjt02021652 for ; Mon, 21 Jul 2008 04:45:56 -0700 X-ASG-Debug-ID: 1216640823-32f9033b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D7818190FD02 for ; Mon, 21 Jul 2008 04:47:03 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id b9TbsnNIPqEHwOQB for ; Mon, 21 Jul 2008 04:47:03 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAG8ShEh5LFxAiGdsb2JhbACSSAEBAQ8gmkE X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154283826" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 21:17:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtr1-0005G9-4B; Mon, 21 Jul 2008 21:46:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 1/3] XFS: Avoid directly referencing the VFS inode V2 Subject: [PATCH 1/3] XFS: Avoid directly referencing the VFS inode V2 Date: Mon, 21 Jul 2008 21:46:57 +1000 Message-Id: <1216640819-19924-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216640819-19924-1-git-send-email-david@fromorbit.com> References: <1216640819-19924-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216640824 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56668 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16970 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs In several places we directly convert from the XFS inode to the linux (VFS) inode by a simple deference of ip->i_vnode. We should not do this - a helper function should be used to extract the VFS inode from the XFS inode. Introduce the function VFS_I() to extract the VFS inode from the XFS inode. The name was chosen to match XFS_I() which is used to extract the XFS inode from the VFS inode. Version 2: o don't use vn_to_inode() and inode_to_vn() functions as they are not needed Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_export.c | 6 +++--- fs/xfs/linux-2.6/xfs_fs_subr.c | 6 +++--- fs/xfs/linux-2.6/xfs_iops.c | 14 +++++++------- fs/xfs/linux-2.6/xfs_iops.h | 6 ------ fs/xfs/linux-2.6/xfs_lrw.c | 2 +- fs/xfs/linux-2.6/xfs_super.c | 4 ++-- fs/xfs/xfs_iget.c | 7 ++++--- fs/xfs/xfs_inode.h | 22 +++++++++++++++++++--- fs/xfs/xfs_utils.c | 4 ++-- 9 files changed, 41 insertions(+), 30 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_export.c b/fs/xfs/linux-2.6/xfs_export.c index 987fe84..d3880b7 100644 --- a/fs/xfs/linux-2.6/xfs_export.c +++ b/fs/xfs/linux-2.6/xfs_export.c @@ -139,7 +139,7 @@ xfs_nfs_get_inode( } xfs_iunlock(ip, XFS_ILOCK_SHARED); - return ip->i_vnode; + return VFS_I(ip); } STATIC struct dentry * @@ -219,9 +219,9 @@ xfs_fs_get_parent( if (unlikely(error)) return ERR_PTR(-error); - parent = d_alloc_anon(cip->i_vnode); + parent = d_alloc_anon(VFS_I(cip)); if (unlikely(!parent)) { - iput(cip->i_vnode); + iput(VFS_I(cip)); return ERR_PTR(-ENOMEM); } return parent; diff --git a/fs/xfs/linux-2.6/xfs_fs_subr.c b/fs/xfs/linux-2.6/xfs_fs_subr.c index 1eefe61..36caa6d 100644 --- a/fs/xfs/linux-2.6/xfs_fs_subr.c +++ b/fs/xfs/linux-2.6/xfs_fs_subr.c @@ -31,7 +31,7 @@ xfs_tosspages( xfs_off_t last, int fiopt) { - struct address_space *mapping = ip->i_vnode->i_mapping; + struct address_space *mapping = VFS_I(ip)->i_mapping; if (mapping->nrpages) truncate_inode_pages(mapping, first); @@ -44,7 +44,7 @@ xfs_flushinval_pages( xfs_off_t last, int fiopt) { - struct address_space *mapping = ip->i_vnode->i_mapping; + struct address_space *mapping = VFS_I(ip)->i_mapping; int ret = 0; if (mapping->nrpages) { @@ -64,7 +64,7 @@ xfs_flush_pages( uint64_t flags, int fiopt) { - struct address_space *mapping = ip->i_vnode->i_mapping; + struct address_space *mapping = VFS_I(ip)->i_mapping; int ret = 0; int ret2; diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c index f3267fc..5825ab4 100644 --- a/fs/xfs/linux-2.6/xfs_iops.c +++ b/fs/xfs/linux-2.6/xfs_iops.c @@ -62,7 +62,7 @@ void xfs_synchronize_atime( xfs_inode_t *ip) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); if (inode) { ip->i_d.di_atime.t_sec = (__int32_t)inode->i_atime.tv_sec; @@ -79,7 +79,7 @@ void xfs_mark_inode_dirty_sync( xfs_inode_t *ip) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); if (inode) mark_inode_dirty_sync(inode); @@ -299,7 +299,7 @@ xfs_vn_mknod( if (unlikely(error)) goto out_free_acl; - inode = ip->i_vnode; + inode = VFS_I(ip); error = xfs_init_security(inode, dir); if (unlikely(error)) @@ -366,7 +366,7 @@ xfs_vn_lookup( return NULL; } - return d_splice_alias(cip->i_vnode, dentry); + return d_splice_alias(VFS_I(cip), dentry); } STATIC struct dentry * @@ -399,12 +399,12 @@ xfs_vn_ci_lookup( /* if exact match, just splice and exit */ if (!ci_name.name) - return d_splice_alias(ip->i_vnode, dentry); + return d_splice_alias(VFS_I(ip), dentry); /* else case-insensitive match... */ dname.name = ci_name.name; dname.len = ci_name.len; - dentry = d_add_ci(ip->i_vnode, dentry, &dname); + dentry = d_add_ci(VFS_I(ip), dentry, &dname); kmem_free(ci_name.name); return dentry; } @@ -478,7 +478,7 @@ xfs_vn_symlink( if (unlikely(error)) goto out; - inode = cip->i_vnode; + inode = VFS_I(cip); error = xfs_init_security(inode, dir); if (unlikely(error)) diff --git a/fs/xfs/linux-2.6/xfs_iops.h b/fs/xfs/linux-2.6/xfs_iops.h index d97ba93..fdda404 100644 --- a/fs/xfs/linux-2.6/xfs_iops.h +++ b/fs/xfs/linux-2.6/xfs_iops.h @@ -33,10 +33,4 @@ struct xfs_inode; extern void xfs_ichgtime(struct xfs_inode *, int); extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); -#define xfs_vtoi(vp) \ - ((struct xfs_inode *)vn_to_inode(vp)->i_private) - -#define XFS_I(inode) \ - ((struct xfs_inode *)(inode)->i_private) - #endif /* __XFS_IOPS_H__ */ diff --git a/fs/xfs/linux-2.6/xfs_lrw.c b/fs/xfs/linux-2.6/xfs_lrw.c index 5e3b575..d00c155 100644 --- a/fs/xfs/linux-2.6/xfs_lrw.c +++ b/fs/xfs/linux-2.6/xfs_lrw.c @@ -137,7 +137,7 @@ xfs_iozero( struct address_space *mapping; int status; - mapping = ip->i_vnode->i_mapping; + mapping = VFS_I(ip)->i_mapping; do { unsigned offset, bytes; void *fsdata; diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c index 6d9c8c7..a507762 100644 --- a/fs/xfs/linux-2.6/xfs_super.c +++ b/fs/xfs/linux-2.6/xfs_super.c @@ -1107,7 +1107,7 @@ void xfs_flush_inode( xfs_inode_t *ip) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); igrab(inode); xfs_syncd_queue_work(ip->i_mount, inode, xfs_flush_inode_work); @@ -1826,7 +1826,7 @@ xfs_fs_fill_super( sb->s_time_gran = 1; set_posix_acl_flag(sb); - root = igrab(mp->m_rootip->i_vnode); + root = igrab(VFS_I(mp->m_rootip)); if (!root) { error = ENOENT; goto fail_unmount; diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index f16ca6c..81047be 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -392,10 +392,11 @@ xfs_iput(xfs_inode_t *ip, * Special iput for brand-new inodes that are still locked */ void -xfs_iput_new(xfs_inode_t *ip, - uint lock_flags) +xfs_iput_new( + xfs_inode_t *ip, + uint lock_flags) { - struct inode *inode = ip->i_vnode; + struct inode *inode = VFS_I(ip); xfs_itrace_entry(ip); diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index c440b1d..acb87d7 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -255,6 +255,25 @@ typedef struct xfs_inode { #define XFS_ISIZE(ip) (((ip)->i_d.di_mode & S_IFMT) == S_IFREG) ? \ (ip)->i_size : (ip)->i_d.di_size; +/* Convert from vfs inode to xfs inode */ +static inline struct xfs_inode *XFS_I(struct inode *inode) +{ + return (struct xfs_inode *)inode->i_private; +} + +static inline struct xfs_inode *xfs_vtoi(bhv_vnode_t *vp) +{ + return XFS_I((struct inode *)vp); +} + +/* convert from xfs inode to vfs inode */ +static inline struct inode *VFS_I(struct xfs_inode *ip) +{ + return (struct inode *)ip->i_vnode; +} +#define XFS_ITOV(ip) VFS_I(ip) +#define XFS_ITOV_NULL(ip) VFS_I(ip) + /* * i_flags helper functions */ @@ -431,9 +450,6 @@ xfs_iflags_test_and_clear(xfs_inode_t *ip, unsigned short flags) #define XFS_ITRUNC_DEFINITE 0x1 #define XFS_ITRUNC_MAYBE 0x2 -#define XFS_ITOV(ip) ((ip)->i_vnode) -#define XFS_ITOV_NULL(ip) ((ip)->i_vnode) - /* * For multiple groups support: if S_ISGID bit is set in the parent * directory, group of new file is set to that of the parent, and diff --git a/fs/xfs/xfs_utils.c b/fs/xfs/xfs_utils.c index 98e5f11..35d4d41 100644 --- a/fs/xfs/xfs_utils.c +++ b/fs/xfs/xfs_utils.c @@ -237,7 +237,7 @@ xfs_droplink( ASSERT (ip->i_d.di_nlink > 0); ip->i_d.di_nlink--; - drop_nlink(ip->i_vnode); + drop_nlink(VFS_I(ip)); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); error = 0; @@ -301,7 +301,7 @@ xfs_bumplink( ASSERT(ip->i_d.di_nlink > 0); ip->i_d.di_nlink++; - inc_nlink(ip->i_vnode); + inc_nlink(VFS_I(ip)); if ((ip->i_d.di_version == XFS_DINODE_VERSION_1) && (ip->i_d.di_nlink > XFS_MAXLINK_1)) { /* -- 1.5.6 From owner-xfs@oss.sgi.com Mon Jul 21 04:45:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:45:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBjrdL021629 for ; Mon, 21 Jul 2008 04:45:53 -0700 X-ASG-Debug-ID: 1216640820-397203b00001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 19EF030D986 for ; Mon, 21 Jul 2008 04:47:02 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 5WVyFvzBtqUNLRRX for ; Mon, 21 Jul 2008 04:47:02 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAG8ShEh5LFxAiGdsb2JhbACSSAEBAQ8gmkE X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154283824" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 21:17:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtr1-0005GB-5i; Mon, 21 Jul 2008 21:46:59 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 2/3] XFS: kill shouty XFS_ITOV_NULL macro Subject: [PATCH 2/3] XFS: kill shouty XFS_ITOV_NULL macro Date: Mon, 21 Jul 2008 21:46:58 +1000 Message-Id: <1216640819-19924-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216640819-19924-1-git-send-email-david@fromorbit.com> References: <1216640819-19924-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216640823 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16968 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Replace XFS_ITOV_NULL() with the new VFS_I() inline. Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_vnode.c | 2 +- fs/xfs/quota/xfs_qm_syscalls.c | 2 +- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_vfsops.c | 2 +- fs/xfs/xfs_vnodeops.c | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_vnode.c b/fs/xfs/linux-2.6/xfs_vnode.c index bc7afe0..ffd6003 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.c +++ b/fs/xfs/linux-2.6/xfs_vnode.c @@ -158,7 +158,7 @@ vn_hold( */ static inline int xfs_icount(struct xfs_inode *ip) { - bhv_vnode_t *vp = XFS_ITOV_NULL(ip); + bhv_vnode_t *vp = VFS_I(ip); if (vp) return vn_count(vp); diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index c43b6d4..8407f32 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -1054,7 +1054,7 @@ xfs_qm_dqrele_inodes_ag( first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); /* Root inode, rbmip and rsumip have associated blocks */ - vp = XFS_ITOV_NULL(ip); + vp = VFS_I(ip); if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_gdquot == NULL); diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index acb87d7..5dd4796 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -272,7 +272,6 @@ static inline struct inode *VFS_I(struct xfs_inode *ip) return (struct inode *)ip->i_vnode; } #define XFS_ITOV(ip) VFS_I(ip) -#define XFS_ITOV_NULL(ip) VFS_I(ip) /* * i_flags helper functions diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 8d8ea72..ff6a916 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -325,7 +325,7 @@ xfs_sync_inodes_ag( * skip inodes in reclaim. Let xfs_syncsub do that for * us so we don't need to worry. */ - vp = XFS_ITOV_NULL(ip); + vp = VFS_I(ip); if (!vp) { read_unlock(&pag->pag_ici_lock); continue; diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 2af1be3..5d1b254 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2924,7 +2924,7 @@ xfs_finish_reclaim( int sync_mode) { xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); - bhv_vnode_t *vp = XFS_ITOV_NULL(ip); + bhv_vnode_t *vp = VFS_I(ip); if (vp && VN_BAD(vp)) goto reclaim; -- 1.5.6 From owner-xfs@oss.sgi.com Mon Jul 21 04:51:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:51:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBp4tI023206 for ; Mon, 21 Jul 2008 04:51:05 -0700 X-ASG-Debug-ID: 1216641132-0231007f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 28792190F946 for ; Mon, 21 Jul 2008 04:52:13 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id AHu878E1aMsDZoEF for ; Mon, 21 Jul 2008 04:52:13 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAG8ShEh5LFxAiGdsb2JhbACSSAEBAQ8gmkE X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154286327" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 21:22:11 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKtw2-0005uz-UF; Mon, 21 Jul 2008 21:52:10 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH] XFS: Kill xfs_vtoi() Subject: [PATCH] XFS: Kill xfs_vtoi() Date: Mon, 21 Jul 2008 21:52:10 +1000 Message-Id: <1216641130-22725-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216641134 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56670 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16971 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs xfs_vtoi() is redundant and only unsed in small sections of code. Replace them with widely used XFS_I() inline and kill xfs_vtoi(). Signed-off-by: Dave Chinner --- fs/xfs/linux-2.6/xfs_aops.c | 3 +-- fs/xfs/linux-2.6/xfs_vnode.h | 4 ++-- fs/xfs/xfs_acl.c | 16 ++++++++-------- fs/xfs/xfs_inode.h | 5 ----- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 0b211cb..2ebbc7c 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c @@ -73,7 +73,6 @@ xfs_page_trace( unsigned long pgoff) { xfs_inode_t *ip; - bhv_vnode_t *vp = vn_from_inode(inode); loff_t isize = i_size_read(inode); loff_t offset = page_offset(page); int delalloc = -1, unmapped = -1, unwritten = -1; @@ -81,7 +80,7 @@ xfs_page_trace( if (page_has_buffers(page)) xfs_count_page_state(page, &delalloc, &unmapped, &unwritten); - ip = xfs_vtoi(vp); + ip = XFS_I(inode); if (!ip->i_rwtrace) return; diff --git a/fs/xfs/linux-2.6/xfs_vnode.h b/fs/xfs/linux-2.6/xfs_vnode.h index 96e4a7b..953100a 100644 --- a/fs/xfs/linux-2.6/xfs_vnode.h +++ b/fs/xfs/linux-2.6/xfs_vnode.h @@ -90,9 +90,9 @@ extern bhv_vnode_t *vn_hold(bhv_vnode_t *); #if defined(XFS_INODE_TRACE) #define VN_HOLD(vp) \ ((void)vn_hold(vp), \ - xfs_itrace_hold(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address)) + xfs_itrace_hold(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address)) #define VN_RELE(vp) \ - (xfs_itrace_rele(xfs_vtoi(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ + (xfs_itrace_rele(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ iput(vn_to_inode(vp))) #else #define VN_HOLD(vp) ((void)vn_hold(vp)) diff --git a/fs/xfs/xfs_acl.c b/fs/xfs/xfs_acl.c index 3e4648a..fdeca54 100644 --- a/fs/xfs/xfs_acl.c +++ b/fs/xfs/xfs_acl.c @@ -239,7 +239,7 @@ xfs_acl_vget( goto out; } if (kind == _ACL_TYPE_ACCESS) - xfs_acl_sync_mode(xfs_vtoi(vp)->i_d.di_mode, xfs_acl); + xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, xfs_acl); error = -posix_acl_xfs_to_xattr(xfs_acl, ext_acl, size); } out: @@ -259,7 +259,7 @@ xfs_acl_vremove( VN_HOLD(vp); error = xfs_acl_allow_set(vp, kind); if (!error) { - error = xfs_attr_remove(xfs_vtoi(vp), + error = xfs_attr_remove(XFS_I(vp), kind == _ACL_TYPE_DEFAULT? SGI_ACL_DEFAULT: SGI_ACL_FILE, ATTR_ROOT); @@ -372,7 +372,7 @@ xfs_acl_allow_set( return ENOTDIR; if (vp->i_sb->s_flags & MS_RDONLY) return EROFS; - if (xfs_vtoi(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER)) + if (XFS_I(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER)) return EPERM; return 0; } @@ -576,7 +576,7 @@ xfs_acl_get_attr( ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1); flags |= ATTR_ROOT; - *error = xfs_attr_get(xfs_vtoi(vp), + *error = xfs_attr_get(XFS_I(vp), kind == _ACL_TYPE_ACCESS ? SGI_ACL_FILE : SGI_ACL_DEFAULT, (char *)aclp, &len, flags); @@ -615,7 +615,7 @@ xfs_acl_set_attr( INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm); } INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt); - *error = xfs_attr_set(xfs_vtoi(vp), + *error = xfs_attr_set(XFS_I(vp), kind == _ACL_TYPE_ACCESS ? SGI_ACL_FILE: SGI_ACL_DEFAULT, (char *)newacl, len, ATTR_ROOT); @@ -639,7 +639,7 @@ xfs_acl_vtoacl( if (error) access_acl->acl_cnt = XFS_ACL_NOT_PRESENT; else /* We have a good ACL and the file mode, synchronize. */ - xfs_acl_sync_mode(xfs_vtoi(vp)->i_d.di_mode, access_acl); + xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, access_acl); } if (default_acl) { @@ -734,7 +734,7 @@ xfs_acl_setmode( * mode. The m:: bits take precedence over the g:: bits. */ iattr.ia_valid = ATTR_MODE; - iattr.ia_mode = xfs_vtoi(vp)->i_d.di_mode; + iattr.ia_mode = XFS_I(vp)->i_d.di_mode; iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); ap = acl->acl_entry; for (i = 0; i < acl->acl_cnt; ++i) { @@ -764,7 +764,7 @@ xfs_acl_setmode( if (gap && nomask) iattr.ia_mode |= gap->ae_perm << 3; - return xfs_setattr(xfs_vtoi(vp), &iattr, 0, sys_cred); + return xfs_setattr(XFS_I(vp), &iattr, 0, sys_cred); } /* diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index ebaea3b..87efb75 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -261,11 +261,6 @@ static inline struct xfs_inode *XFS_I(struct inode *inode) return (struct xfs_inode *)inode->i_private; } -static inline struct xfs_inode *xfs_vtoi(bhv_vnode_t *vp) -{ - return XFS_I((struct inode *)vp); -} - /* convert from xfs inode to vfs inode */ static inline struct inode *VFS_I(struct xfs_inode *ip) { -- 1.5.6 From owner-xfs@oss.sgi.com Mon Jul 21 04:51:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:51:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBpJoH023296 for ; Mon, 21 Jul 2008 04:51:21 -0700 X-ASG-Debug-ID: 1216641148-61b1016d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 83B5C12E7E85 for ; Mon, 21 Jul 2008 04:52:29 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id zNFJgnJXvLqGFbC4 for ; Mon, 21 Jul 2008 04:52:29 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKtwK-0003h4-Ix; Mon, 21 Jul 2008 11:52:28 +0000 Date: Mon, 21 Jul 2008 07:52:28 -0400 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: remove i_gen from incore inode Subject: Re: [PATCH] XFS: remove i_gen from incore inode Message-ID: <20080721115228.GA14077@infradead.org> References: <1216558002-838-1-git-send-email-david@fromorbit.com> <20080721075449.GB6692@infradead.org> <20080721110814.GC6761@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080721110814.GC6761@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216641149 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.86 X-Barracuda-Spam-Status: No, SCORE=0.86 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RATWARE_EFROM X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 2.88 RATWARE_EFROM Bulk email fingerprint (envfrom) found X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16972 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 09:08:14PM +1000, Dave Chinner wrote: > On Mon, Jul 21, 2008 at 03:54:49AM -0400, Christoph Hellwig wrote: > > On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote: > > > i_gen is incremented in directory operations when the > > > directory is changed. It is never read or otherwise used > > > so it should be removed to help reduce the size of the > > > struct xfs_inode. > > > > It also removes a xfs_trans_log_inode in xfs_remove, which looks > > fine to me from a quick glance, but this should be verified and > > documented. > > If you note in the very next if/else statement the directory inode > gets logged - either by dropping the link or directly. IOWs, we > were logging the directory inode twice with the same value > (XFS_ILOG_CORE). So I don't think there??s any problem here. Indeed. The patch looks good but a little description like the one above in the commit message would be nice. From owner-xfs@oss.sgi.com Mon Jul 21 04:53:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:53:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBrbW5023979 for ; Mon, 21 Jul 2008 04:53:38 -0700 X-ASG-Debug-ID: 1216641287-151400310000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BDC37190FB5A for ; Mon, 21 Jul 2008 04:54:47 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id usGh8UXnW8MvDrFh for ; Mon, 21 Jul 2008 04:54:47 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKtyZ-0003rr-G1; Mon, 21 Jul 2008 11:54:47 +0000 Date: Mon, 21 Jul 2008 07:54:47 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation V2 Subject: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation V2 Message-ID: <20080721115447.GA14346@infradead.org> References: <1216638192-6292-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216638192-6292-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216641287 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56670 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16973 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs Looks good. From owner-xfs@oss.sgi.com Mon Jul 21 04:53:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:53:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBrtrW024164 for ; Mon, 21 Jul 2008 04:53:55 -0700 X-ASG-Debug-ID: 1216641304-3e3803cd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 560E030D9D3 for ; Mon, 21 Jul 2008 04:55:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id JehFUPA2hSg8BQ8w for ; Mon, 21 Jul 2008 04:55:05 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKtyq-0004GL-Jt; Mon, 21 Jul 2008 11:55:04 +0000 Date: Mon, 21 Jul 2008 07:55:04 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/3] XFS: sanitise VFS inode extraction V2 Subject: Re: [PATCH 0/3] XFS: sanitise VFS inode extraction V2 Message-ID: <20080721115504.GB14346@infradead.org> References: <1216640819-19924-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216640819-19924-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216641305 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16974 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 09:46:56PM +1000, Dave Chinner wrote: > Getting the VFS inode from the XFS inode is done in a variety of > ways right now - direct deference or one of two XFS_ITOV macros. > This should be consistent throughout the code - this patch > series does that in a way that is consistent with the opposite > XFS_I() conversion. We now use VFS_I() to extract the VFS inode > from the XFS inode. > > Version 2: > o don't use vn_to_inode() and inode_to_vn() functions as they > are not needed > o rediff patches 2 and 3 against the change patch. ACK for all three patches. From owner-xfs@oss.sgi.com Mon Jul 21 04:55:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 04:55:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LBtKi2024790 for ; Mon, 21 Jul 2008 04:55:20 -0700 X-ASG-Debug-ID: 1216641389-6b4801260000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 33A5312E81A3 for ; Mon, 21 Jul 2008 04:56:29 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id GJx4zcemjwxiFIHa for ; Mon, 21 Jul 2008 04:56:29 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKu0D-00054I-GU; Mon, 21 Jul 2008 11:56:29 +0000 Date: Mon, 21 Jul 2008 07:56:29 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: Kill xfs_vtoi() Subject: Re: [PATCH] XFS: Kill xfs_vtoi() Message-ID: <20080721115629.GC14346@infradead.org> References: <1216641130-22725-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216641130-22725-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216641390 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16975 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 09:52:10PM +1000, Dave Chinner wrote: > xfs_vtoi() is redundant and only unsed in small sections > of code. Replace them with widely used XFS_I() inline and > kill xfs_vtoi(). Looks good. As it creates conflict for more than half of my pending patches it would be nice if we could get it merged ASAP so that I can rediff them. From owner-xfs@oss.sgi.com Mon Jul 21 05:04:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 05:04:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LC4C9R025665 for ; Mon, 21 Jul 2008 05:04:12 -0700 X-ASG-Debug-ID: 1216641921-6b49019d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3D23812E8084 for ; Mon, 21 Jul 2008 05:05:21 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id xq9YAkEJBUrLGKld for ; Mon, 21 Jul 2008 05:05:21 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KKu8n-0000Xy-I0; Mon, 21 Jul 2008 12:05:21 +0000 Date: Mon, 21 Jul 2008 08:05:21 -0400 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: remove i_gen from incore inode Subject: Re: [PATCH] XFS: remove i_gen from incore inode Message-ID: <20080721120521.GA28727@infradead.org> References: <1216558002-838-1-git-send-email-david@fromorbit.com> <20080721075449.GB6692@infradead.org> <20080721110814.GC6761@disturbed> <20080721115228.GA14077@infradead.org> <20080721120440.GE6761@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080721120440.GE6761@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216641922 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.86 X-Barracuda-Spam-Status: No, SCORE=0.86 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RATWARE_EFROM X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56671 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 2.88 RATWARE_EFROM Bulk email fingerprint (envfrom) found X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16977 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs Looks good. From owner-xfs@oss.sgi.com Mon Jul 21 05:03:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 05:03:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LC3a37025559 for ; Mon, 21 Jul 2008 05:03:36 -0700 X-ASG-Debug-ID: 1216641884-6b4601b20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D1F7E12E8233 for ; Mon, 21 Jul 2008 05:04:44 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id wrApXEwF8WMbWeQ9 for ; Mon, 21 Jul 2008 05:04:44 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAPUVhEh5LFxAiGdsb2JhbACSSAEBAQ8gmkc X-IronPort-AV: E=Sophos;i="4.31,223,1215354600"; d="scan'208";a="154292349" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 21 Jul 2008 21:34:43 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KKu88-0006ET-Vl; Mon, 21 Jul 2008 22:04:40 +1000 Date: Mon, 21 Jul 2008 22:04:40 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] XFS: remove i_gen from incore inode Subject: Re: [PATCH] XFS: remove i_gen from incore inode Message-ID: <20080721120440.GE6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216558002-838-1-git-send-email-david@fromorbit.com> <20080721075449.GB6692@infradead.org> <20080721110814.GC6761@disturbed> <20080721115228.GA14077@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080721115228.GA14077@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216641885 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56669 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16976 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 07:52:28AM -0400, Christoph Hellwig wrote: > On Mon, Jul 21, 2008 at 09:08:14PM +1000, Dave Chinner wrote: > > On Mon, Jul 21, 2008 at 03:54:49AM -0400, Christoph Hellwig wrote: > > > On Sun, Jul 20, 2008 at 10:46:42PM +1000, Dave Chinner wrote: > > > > i_gen is incremented in directory operations when the > > > > directory is changed. It is never read or otherwise used > > > > so it should be removed to help reduce the size of the > > > > struct xfs_inode. > > > > > > It also removes a xfs_trans_log_inode in xfs_remove, which looks > > > fine to me from a quick glance, but this should be verified and > > > documented. > > > > If you note in the very next if/else statement the directory inode > > gets logged - either by dropping the link or directly. IOWs, we > > were logging the directory inode twice with the same value > > (XFS_ILOG_CORE). So I don't think there??s any problem here. > > Indeed. The patch looks good but a little description like the one above > in the commit message would be nice. Updated patch below. Cheers, Dave. -- Dave Chinner david@fromorbit.com XFS: remove i_gen from incore inode i_gen is incremented in directory operations when the directory is changed. It is never read or otherwise used so it should be removed to help reduce the size of the struct xfs_inode. The patch also removes a duplicate logging of the directory inode core. We only need to do this once per transaction so kill the one associated with the i_gen increment. Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.h | 1 - fs/xfs/xfs_rename.c | 12 ++---------- fs/xfs/xfs_vnodeops.c | 29 ++--------------------------- 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 440b443..316c374 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -223,7 +223,6 @@ typedef struct xfs_inode { unsigned short i_flags; /* see defined flags below */ unsigned char i_update_core; /* timestamps/size is dirty */ unsigned char i_update_size; /* di_size field is dirty */ - unsigned int i_gen; /* generation count */ unsigned int i_delayed_blks; /* count of delay alloc blks */ xfs_icdinode_t i_d; /* most of ondisk inode */ diff --git a/fs/xfs/xfs_rename.c b/fs/xfs/xfs_rename.c index d700dac..02f0e8f 100644 --- a/fs/xfs/xfs_rename.c +++ b/fs/xfs/xfs_rename.c @@ -367,19 +367,11 @@ xfs_rename( &first_block, &free_list, spaceres); if (error) goto abort_return; - xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Update the generation counts on all the directory inodes - * that we're modifying. - */ - src_dp->i_gen++; + xfs_ichgtime(src_dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); xfs_trans_log_inode(tp, src_dp, XFS_ILOG_CORE); - - if (new_parent) { - target_dp->i_gen++; + if (new_parent) xfs_trans_log_inode(tp, target_dp, XFS_ILOG_CORE); - } /* * If this is a synchronous mount, make sure that the diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index 94ec74b..426c574 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -1798,8 +1798,6 @@ xfs_create( xfs_trans_set_sync(tp); } - dp->i_gen++; - /* * Attach the dquot(s) to the inodes and modify them incore. * These ids of the inode couldn't have changed since the new @@ -2229,13 +2227,6 @@ xfs_remove( } xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Bump the in memory generation count on the parent - * directory so that other can know that it has changed. - */ - dp->i_gen++; - xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); - if (is_dir) { /* * Drop the link from ip's "..". @@ -2253,8 +2244,8 @@ xfs_remove( } else { /* * When removing a non-directory we need to log the parent - * inode here for the i_gen update. For a directory this is - * done implicitly by the xfs_droplink call for the ".." entry. + * inode here. For a directory this is done implicitly + * by the xfs_droplink call for the ".." entry. */ xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); } @@ -2423,7 +2414,6 @@ xfs_link( if (error) goto abort_return; xfs_ichgtime(tdp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - tdp->i_gen++; xfs_trans_log_inode(tp, tdp, XFS_ILOG_CORE); error = xfs_bumplink(tp, sip); @@ -2600,18 +2590,10 @@ xfs_mkdir( } xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - /* - * Bump the in memory version number of the parent directory - * so that other processes accessing it will recognize that - * the directory has changed. - */ - dp->i_gen++; - error = xfs_dir_init(tp, cdp, dp); if (error) goto error2; - cdp->i_gen = 1; error = xfs_bumplink(tp, dp); if (error) goto error2; @@ -2898,13 +2880,6 @@ xfs_symlink( xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); /* - * Bump the in memory version number of the parent directory - * so that other processes accessing it will recognize that - * the directory has changed. - */ - dp->i_gen++; - - /* * If this is a synchronous mount, make sure that the * symlink transaction goes to disk before returning to * the user. From owner-xfs@oss.sgi.com Mon Jul 21 05:17:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 05:17:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LCHTVs027097 for ; Mon, 21 Jul 2008 05:17:30 -0700 X-ASG-Debug-ID: 1216642716-0b7a00660000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4BA2112E8370 for ; Mon, 21 Jul 2008 05:18:36 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ycCbN6Cm28cUCToG for ; Mon, 21 Jul 2008 05:18:36 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6LCIQNg012255 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Mon, 21 Jul 2008 14:18:26 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6LCIQ5A012252 for xfs@oss.sgi.com; Mon, 21 Jul 2008 14:18:26 +0200 Date: Mon, 21 Jul 2008 14:18:26 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/4] don't leak m_fsname/m_rtname/m_logname Subject: Re: [PATCH 1/4] don't leak m_fsname/m_rtname/m_logname Message-ID: <20080721121826.GA12214@lst.de> References: <20080525190736.GA13372@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190736.GA13372@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216642718 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56671 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16978 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Sun, May 25, 2008 at 09:07:36PM +0200, Christoph Hellwig wrote: > Add a helper to free the m_fsname/m_rtname/m_logname allocations and use > it properly for all mount failure cases. Also switch the allocations > for these to kstrdup while we're at it. ping. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-22 19:30:25.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-22 19:30:44.000000000 +0200 > @@ -1079,6 +1079,15 @@ xfssyncd( > } > > STATIC void > +xfs_free_fsname( > + struct xfs_mount *mp) > +{ > + kfree(mp->m_fsname); > + kfree(mp->m_rtname); > + kfree(mp->m_logname); > +} > + > +STATIC void > xfs_fs_put_super( > struct super_block *sb) > { > @@ -1139,6 +1148,7 @@ xfs_fs_put_super( > xfs_close_devices(mp); > xfs_qmops_put(mp); > xfs_dmops_put(mp); > + xfs_free_fsname(mp); > kfree(mp); > } > > @@ -1408,6 +1418,8 @@ xfs_start_flags( > struct xfs_mount_args *ap, > struct xfs_mount *mp) > { > + int error; > + > /* Values are in BBs */ > if ((ap->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { > /* > @@ -1440,17 +1452,27 @@ xfs_start_flags( > ap->logbufsize); > return XFS_ERROR(EINVAL); > } > + > + error = ENOMEM; > + > mp->m_logbsize = ap->logbufsize; > mp->m_fsname_len = strlen(ap->fsname) + 1; > - mp->m_fsname = kmem_alloc(mp->m_fsname_len, KM_SLEEP); > - strcpy(mp->m_fsname, ap->fsname); > + > + mp->m_fsname = kstrdup(ap->fsname, GFP_KERNEL); > + if (!mp->m_fsname) > + goto out; > + > if (ap->rtname[0]) { > - mp->m_rtname = kmem_alloc(strlen(ap->rtname) + 1, KM_SLEEP); > - strcpy(mp->m_rtname, ap->rtname); > + mp->m_rtname = kstrdup(ap->rtname, GFP_KERNEL); > + if (!mp->m_rtname) > + goto out_free_fsname; > + > } > + > if (ap->logname[0]) { > - mp->m_logname = kmem_alloc(strlen(ap->logname) + 1, KM_SLEEP); > - strcpy(mp->m_logname, ap->logname); > + mp->m_logname = kstrdup(ap->logname, GFP_KERNEL); > + if (!mp->m_logname) > + goto out_free_rtname; > } > > if (ap->flags & XFSMNT_WSYNC) > @@ -1523,6 +1545,14 @@ xfs_start_flags( > if (ap->flags & XFSMNT_DMAPI) > mp->m_flags |= XFS_MOUNT_DMAPI; > return 0; > + > + > + out_free_rtname: > + kfree(mp->m_rtname); > + out_free_fsname: > + kfree(mp->m_fsname); > + out: > + return error; > } > > /* > @@ -1683,10 +1713,10 @@ xfs_fs_fill_super( > */ > error = xfs_start_flags(args, mp); > if (error) > - goto out_destroy_counters; > + goto out_free_fsname; > error = xfs_readsb(mp, flags); > if (error) > - goto out_destroy_counters; > + goto out_free_fsname; > error = xfs_finish_flags(args, mp); > if (error) > goto out_free_sb; > @@ -1748,7 +1778,8 @@ xfs_fs_fill_super( > xfs_filestream_unmount(mp); > out_free_sb: > xfs_freesb(mp); > - out_destroy_counters: > + out_free_fsname: > + xfs_free_fsname(mp); > xfs_icsb_destroy_counters(mp); > xfs_close_devices(mp); > out_put_qmops: > @@ -1784,7 +1815,7 @@ xfs_fs_fill_super( > IRELE(mp->m_rootip); > > xfs_unmountfs(mp); > - goto out_destroy_counters; > + goto out_free_fsname; > } > > STATIC int > Index: linux-2.6-xfs/fs/xfs/xfs_mount.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-05-22 19:31:25.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-05-22 19:31:29.000000000 +0200 > @@ -146,13 +146,6 @@ xfs_mount_free( > mutex_destroy(&mp->m_growlock); > if (mp->m_quotainfo) > XFS_QM_DONE(mp); > - > - if (mp->m_fsname != NULL) > - kmem_free(mp->m_fsname); > - if (mp->m_rtname != NULL) > - kmem_free(mp->m_rtname); > - if (mp->m_logname != NULL) > - kmem_free(mp->m_logname); > } > > /* ---end quoted text--- From owner-xfs@oss.sgi.com Mon Jul 21 05:20:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 05:20:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LCKit4027528 for ; Mon, 21 Jul 2008 05:20:44 -0700 X-ASG-Debug-ID: 1216642913-1a5301390000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from web63903.mail.re1.yahoo.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 6194730DB22 for ; Mon, 21 Jul 2008 05:21:53 -0700 (PDT) Received: from web63903.mail.re1.yahoo.com (web63903.mail.re1.yahoo.com [69.147.97.118]) by cuda.sgi.com with SMTP id 8SlZzQE3K5O8PdVc for ; Mon, 21 Jul 2008 05:21:53 -0700 (PDT) Received: (qmail 59176 invoked by uid 60001); 21 Jul 2008 12:21:53 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type:Message-ID; b=F6dOfPWdN/n7EVB0XEJIQdyNIXHzBGJ76O6SyxvqSgjD8OggyjhEZoWu5Uo3PuXz4QRzZpDnxMa//HrdlLDV6pnInk/kmphdAk2LRWvxZ8YBGGyvjinG/k8AKNuy9SLXZAv2UzitzpD+xx9qGcCBWB3pQYFe1Nsk0SGTGqg10kY=; Received: from [88.249.213.131] by web63903.mail.re1.yahoo.com via HTTP; Mon, 21 Jul 2008 05:21:52 PDT X-Mailer: YahooMailWebService/0.7.218 Date: Mon, 21 Jul 2008 05:21:52 -0700 (PDT) From: Jack Brown X-ASG-Orig-Subj: XFS_WANT_CORRUPTED_GOTO followed by "Attempt to access beyond end of device" Subject: XFS_WANT_CORRUPTED_GOTO followed by "Attempt to access beyond end of device" To: xfs@oss.sgi.com MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="0-794145701-1216642912=:53207" Message-ID: <37662.53207.qm@web63903.mail.re1.yahoo.com> X-Barracuda-Connect: web63903.mail.re1.yahoo.com[69.147.97.118] X-Barracuda-Start-Time: 1216642914 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56671 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16979 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: zidibik@yahoo.com Precedence: bulk X-list: xfs --0-794145701-1216642912=:53207 Content-Type: text/plain; charset=us-ascii dear list, i tried to give as much details as possible about an incident I had with xfs below. executive summary: A happily working xfs partition failed, and refuse to be repaired, after a series of setfacl executions. here's the full story: i'm running a gentoo machine with 2.6.20-xen-r6 kernel, xfsprogs-2.9.7. i have a ~300 gb xfs partition on software raid1, mounted to /var, in a server that is mainly used as a samba fileserver and a mail server, also being home to 3 hvm guests os (windows). guest oses live on a separate hard disk. all three disks are SATA and are connected to: Intel Corporation 631xESB/632xESB/3100 Chipset SATA IDE Controller (rev 09) anyway, i recently implemented acls for our samba users. after some recursive setfacl commands, my trying to rm -rf a ~20 gb directory failed. (Jul 20 ~01:00): rm: FATAL: cannot ensure `' (returned to via ..) is safe: Input/output error dmesg showed: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4533 of file fs/xfs/xfs_bmap.c. Filesystem "md5": XFS internal error xfs_trans_cancel at line 1138 of file fs/xfs/xfs_trans.c. xfs_force_shutdown(md5,0x8) called from line 1139 of file fs/xfs/xfs_trans.c. Return address = 0xee2a9a28 Filesystem "md5": Corruption of in-memory data detected. Shutting down filesystem: md5 Please umount the filesystem, and rectify the problem(s) and that's when I looked at /var/log/messages (it logs dmesg output) I saw the first xfs-related error to be: Jul 19 19:46:52 canavar XFS internal error XFS_WANT_CORRUPTED_GOTO at line 4533 of file fs/xfs/xfs_bmap.c. Caller 0xee27d8c6 < stack addresses removed > which probably started when I was executing setfacl commands. after rm failing, xfs stopped all operations. /var being rendered read-only, i cold rebooted. upon reboot, I saw i/o errors related to incorrect partition size, as such: Jul 20 02:23:38 canavar attempt to access beyond end of device Jul 20 02:23:38 canavar md5: rw=0, want=405021982988992520, limit=603529728 and kernel refused to mount the filesystem. xfs_repair refused to run as well because the file system log was yet to be replayed. I then ran xfs_repair -L which started repairing things but hung in the middle of repairs in phase 3. I ctrl+c'd my way out of it and was at least able to mount my partition. most of the data seemed undamaged, but same things happen when i try to rm -rf that directory (it's officially haunted :)). after copying some important stuff out, i retried the xfs_repair, this time it hung around phase 4. (for this run, i have the repairlog attached). # ps uax | grep xfs_repair root 2022 0.4 57.1 653488 599572 pts/0 Sl 12:32 0:03 xfs_repair -L /dev/md5 -v I had taken xfs_metadump sometime between, when it was hanging in phase 3. it's a bzipped 67 mb file. if somebody can provide a place to upload it, i can send it over. If anyone will be interested in further data i can provide it, i'm keeping the cripped file system in case it may be of any use to you. best regards, jack --0-794145701-1216642912=:53207 Content-Type: application/octet-stream; name="repairlog.scrubbed" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="repairlog.scrubbed" UGhhc2UgMSAtIGZpbmQgYW5kIHZlcmlmeSBzdXBlcmJsb2NrLi4uCiAgICAg ICAgLSBibG9jayBjYWNoZSBzaXplIHNldCB0byA5MzE4NCBlbnRyaWVzClBo YXNlIDIgLSB1c2luZyBpbnRlcm5hbCBsb2cKICAgICAgICAtIHplcm8gbG9n Li4uCnplcm9fbG9nOiBoZWFkIGJsb2NrIDIgdGFpbCBibG9jayAyCiAgICAg ICAgLSBzY2FuIGZpbGVzeXN0ZW0gZnJlZXNwYWNlIGFuZCBpbm9kZSBtYXBz Li4uCiAgICAgICAgLSBmb3VuZCByb290IGlub2RlIGNodW5rClBoYXNlIDMg LSBmb3IgZWFjaCBBRy4uLgogICAgICAgIC0gc2NhbiBhbmQgY2xlYXIgYWdp IHVubGlua2VkIGxpc3RzLi4uCiAgICAgICAgLSBwcm9jZXNzIGtub3duIGlu b2RlcyBhbmQgcGVyZm9ybSBpbm9kZSBkaXNjb3ZlcnkuLi4KICAgICAgICAt IGFnbm8gPSAwCmIzOTExYjkwOiBCYWRuZXNzIGluIGtleSBsb29rdXAgKGxl bmd0aCkKYnA9KGJubyAwLCBsZW4gNTEyIGJ5dGVzKSBrZXk9KGJubyAwLCBs ZW4gNDA5NiBieXRlcykKYmFkIGJtYXAgYnRyZWUgcHRyIDB4ZDQwMDQ0MDAw MDAwMDAwIGluIGlubyA2ODIzODQ0CmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUg NjgyMzg0NApjbGVhcmVkIGlub2RlIDY4MjM4NDQKYmFkIG1hZ2ljICMgMHg1 ODQ2NTM0MiBpbiBpbm9kZSA2MTYzNzEzMCAoZGF0YSBmb3JrKSBibWJ0IGJs b2NrIDAKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSA2MTYzNzEzMApjbGVhcmVk IGlub2RlIDYxNjM3MTMwCmJhZCBtYWdpYyAjIDB4NTg0NjUzNDIgaW4gaW5v ZGUgMTA4Mzc3ODU1IChkYXRhIGZvcmspIGJtYnQgYmxvY2sgMApiYWQgZGF0 YSBmb3JrIGluIGlub2RlIDEwODM3Nzg1NQpjbGVhcmVkIGlub2RlIDEwODM3 Nzg1NQpiYWQgYm1hcCBidHJlZSBwdHIgMHg4ZTIwMDBjMDAwMDAwMDAwIGlu IGlubyAxNTY4NTE4MjMKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSAxNTY4NTE4 MjMKY2xlYXJlZCBpbm9kZSAxNTY4NTE4MjMKYmFkIG1hZ2ljICMgMHg1ODQ2 NTM0MiBpbiBpbm9kZSAxNjkzNzE2NDAgKGRhdGEgZm9yaykgYm1idCBibG9j ayAwCmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTY5MzcxNjQwCmNsZWFyZWQg aW5vZGUgMTY5MzcxNjQwCmJhZCBibWFwIGJ0cmVlIHB0ciAweGRhYzAxYjAw MDAwMDAwMDAgaW4gaW5vIDE5NjIyNjg2NwpiYWQgZGF0YSBmb3JrIGluIGlu b2RlIDE5NjIyNjg2NwpjbGVhcmVkIGlub2RlIDE5NjIyNjg2NwpiYWQgYm1h cCBidHJlZSBwdHIgMHg1MDYxNmU2ZTZmNzQ2MSBpbiBpbm8gMTk2MjI2ODcx CmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTk2MjI2ODcxCmNsZWFyZWQgaW5v ZGUgMTk2MjI2ODcxCmJhZCBibWFwIGJ0cmVlIHB0ciAweGFjMDAwOTAwMDAw MDAwMDAgaW4gaW5vIDE5NjIyNjg3OApiYWQgZGF0YSBmb3JrIGluIGlub2Rl IDE5NjIyNjg3OApjbGVhcmVkIGlub2RlIDE5NjIyNjg3OApiYWQgYm1hcCBi dHJlZSBwdHIgMHg1MDYxNmU2ZTZmNzQ2MSBpbiBpbm8gMTk2MjI2ODgwCmJh ZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTk2MjI2ODgwCmNsZWFyZWQgaW5vZGUg MTk2MjI2ODgwCmJhZCBibWFwIGJ0cmVlIHB0ciAweGQxNDAwMDQwMDAwMDAw MDAgaW4gaW5vIDE5NjIyNjkwNQpiYWQgZGF0YSBmb3JrIGluIGlub2RlIDE5 NjIyNjkwNQpjbGVhcmVkIGlub2RlIDE5NjIyNjkwNQpiYWQgYm1hcCBidHJl ZSBwdHIgMHhmZTAwMDA4MDAwMDAwMDAwIGluIGlubyAyMjY3NDk2MzIKYmFk IGRhdGEgZm9yayBpbiBpbm9kZSAyMjY3NDk2MzIKY2xlYXJlZCBpbm9kZSAy MjY3NDk2MzIKICAgICAgICAtIGFnbm8gPSAxCmJhZCBibWFwIGJ0cmVlIHB0 ciAweGM5MDAwMWMwMDAwMDAwMDAgaW4gaW5vIDUzOTM0OTg5MQpiYWQgZGF0 YSBmb3JrIGluIGlub2RlIDUzOTM0OTg5MQpjbGVhcmVkIGlub2RlIDUzOTM0 OTg5MQpiYWQgYm1hcCBidHJlZSBwdHIgMHg2MTgwMDEwMDAwMDAwMDAwIGlu IGlubyA1MzkzNTMwMTAKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSA1MzkzNTMw MTAKY2xlYXJlZCBpbm9kZSA1MzkzNTMwMTAKYmFkIGJtYXAgYnRyZWUgcHRy IDB4NDAyMDAwODAwMDAwMDAwMCBpbiBpbm8gNTM5MzUzMDI2CmJhZCBkYXRh IGZvcmsgaW4gaW5vZGUgNTM5MzUzMDI2CmNsZWFyZWQgaW5vZGUgNTM5MzUz MDI2CmJhZCBibWFwIGJ0cmVlIHB0ciAweDIyODAwMTAwMDAwMDAwMDAgaW4g aW5vIDUzOTM1MzAzNgpiYWQgZGF0YSBmb3JrIGluIGlub2RlIDUzOTM1MzAz NgpjbGVhcmVkIGlub2RlIDUzOTM1MzAzNgpiYWQgYm1hcCBidHJlZSBwdHIg MHgyZTgwMDEwMDAwMDAwMDAwIGluIGlubyA1MzkzNTMwMzcKYmFkIGRhdGEg Zm9yayBpbiBpbm9kZSA1MzkzNTMwMzcKY2xlYXJlZCBpbm9kZSA1MzkzNTMw MzcKYmFkIGJtYXAgYnRyZWUgcHRyIDB4YTdjMDAwYzAwMDAwMDAwMCBpbiBp bm8gNTM5MzUzNDE3CmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgNTM5MzUzNDE3 CmNsZWFyZWQgaW5vZGUgNTM5MzUzNDE3CmJhZCBibWFwIGJ0cmVlIHB0ciAw eGU4MDA0NDAwMDAwMDAwMCBpbiBpbm8gNTM5MzU0MzI5CmJhZCBkYXRhIGZv cmsgaW4gaW5vZGUgNTM5MzU0MzI5CmNsZWFyZWQgaW5vZGUgNTM5MzU0MzI5 CmJhZCBibWFwIGJ0cmVlIHB0ciAweGM2MDAxODAwMDAwMDAwMCBpbiBpbm8g NTM5MzU2Njk5CmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgNTM5MzU2Njk5CmNs ZWFyZWQgaW5vZGUgNTM5MzU2Njk5CmJhZCBibWFwIGJ0cmVlIHB0ciAweGYx NDAwMWMwMDAwMDAwMDAgaW4gaW5vIDUzOTM1ODIyMwpiYWQgZGF0YSBmb3Jr IGluIGlub2RlIDUzOTM1ODIyMwpjbGVhcmVkIGlub2RlIDUzOTM1ODIyMwpi YWQgYm1hcCBidHJlZSBwdHIgMHhmMzIwMDA0MDAwMDAwMDAwIGluIGlubyA1 MzkzNjYyODAKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSA1MzkzNjYyODAKY2xl YXJlZCBpbm9kZSA1MzkzNjYyODAKYmFkIGJtYXAgYnRyZWUgcHRyIDB4ZDc4 MDAwYzAwMDAwMDAwMCBpbiBpbm8gNTM5MzcyMzYyCmJhZCBkYXRhIGZvcmsg aW4gaW5vZGUgNTM5MzcyMzYyCmNsZWFyZWQgaW5vZGUgNTM5MzcyMzYyCmJh ZCBtYWdpYyAjIDB4NTg0NjUzNDIgaW4gaW5vZGUgNTM5MzcyNjY1IChkYXRh IGZvcmspIGJtYnQgYmxvY2sgMApiYWQgZGF0YSBmb3JrIGluIGlub2RlIDUz OTM3MjY2NQpjbGVhcmVkIGlub2RlIDUzOTM3MjY2NQpiYWQgbWFnaWMgIyAw eDU4NDY1MzQyIGluIGlub2RlIDUzOTY0OTU3NSAoZGF0YSBmb3JrKSBibWJ0 IGJsb2NrIDAKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSA1Mzk2NDk1NzUKY2xl YXJlZCBpbm9kZSA1Mzk2NDk1NzUKYmFkIGJtYXAgYnRyZWUgcHRyIDB4ZDY4 MDA0ODAwMDAwMDAwMCBpbiBpbm8gNTM5NjQ5NTg5CmJhZCBkYXRhIGZvcmsg aW4gaW5vZGUgNTM5NjQ5NTg5CmNsZWFyZWQgaW5vZGUgNTM5NjQ5NTg5CmJh ZCBtYWdpYyAjIDB4NTg0NjUzNDIgaW4gaW5vZGUgNTQyMzc1NTY4IChkYXRh IGZvcmspIGJtYnQgYmxvY2sgMApiYWQgZGF0YSBmb3JrIGluIGlub2RlIDU0 MjM3NTU2OApjbGVhcmVkIGlub2RlIDU0MjM3NTU2OApiYWQgYm1hcCBidHJl ZSBwdHIgMHgxNGIwMDAwMDAwNGZlNCBpbiBpbm8gNTQ3MTg5MjA2CmJhZCBk YXRhIGZvcmsgaW4gaW5vZGUgNTQ3MTg5MjA2CmNsZWFyZWQgaW5vZGUgNTQ3 MTg5MjA2CmJhZCBtYWdpYyAjIDB4NTg0NjUzNDIgaW4gaW5vZGUgNTU1Mzc5 ODE1IChkYXRhIGZvcmspIGJtYnQgYmxvY2sgMApiYWQgZGF0YSBmb3JrIGlu IGlub2RlIDU1NTM3OTgxNQpjbGVhcmVkIGlub2RlIDU1NTM3OTgxNQpiYWQg bWFnaWMgIyAweDU4NDY1MzQyIGluIGlub2RlIDU1OTY1MDIwOSAoZGF0YSBm b3JrKSBibWJ0IGJsb2NrIDAKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSA1NTk2 NTAyMDkKY2xlYXJlZCBpbm9kZSA1NTk2NTAyMDkKYmFkIG1hZ2ljICMgMHg1 ODQ2NTM0MiBpbiBpbm9kZSA1NzI1NzQ0OTMgKGRhdGEgZm9yaykgYm1idCBi bG9jayAwCmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgNTcyNTc0NDkzCmNsZWFy ZWQgaW5vZGUgNTcyNTc0NDkzCmJhZCBibWFwIGJ0cmVlIHB0ciAweDE0MDAw MDIwMDAwMDAwMCBpbiBpbm8gNTcyNjEzNDU2CmJhZCBkYXRhIGZvcmsgaW4g aW5vZGUgNTcyNjEzNDU2CmNsZWFyZWQgaW5vZGUgNTcyNjEzNDU2CmJhZCBi bWFwIGJ0cmVlIHB0ciAweDNmMDAwMDAxMDAwMDAwMDAgaW4gaW5vIDYxOTYz NTM2MApiYWQgZGF0YSBmb3JrIGluIGlub2RlIDYxOTYzNTM2MApjbGVhcmVk IGlub2RlIDYxOTYzNTM2MApiYWQgbWFnaWMgIyAweDU4NDY1MzQyIGluIGlu b2RlIDY3MDI4NzM4MSAoZGF0YSBmb3JrKSBibWJ0IGJsb2NrIDAKYmFkIGRh dGEgZm9yayBpbiBpbm9kZSA2NzAyODczODEKY2xlYXJlZCBpbm9kZSA2NzAy ODczODEKICAgICAgICAtIGFnbm8gPSAyCmJhZCBibWFwIGJ0cmVlIHB0ciAw eGFkYzAwMWMwMDAwMDAwMDAgaW4gaW5vIDEwODAwOTE0NjAKYmFkIGRhdGEg Zm9yayBpbiBpbm9kZSAxMDgwMDkxNDYwCmNsZWFyZWQgaW5vZGUgMTA4MDA5 MTQ2MApiYWQgYm1hcCBidHJlZSBwdHIgMHhkNTQwMDBjMDAwMDAwMDAwIGlu IGlubyAxMDgwMDkxNDY5CmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTA4MDA5 MTQ2OQpjbGVhcmVkIGlub2RlIDEwODAwOTE0NjkKYmFkIGJtYXAgYnRyZWUg cHRyIDB4YTcwMDAxMDAwMDAwMDAwMCBpbiBpbm8gMTA4MDA5MTQ3OQpiYWQg ZGF0YSBmb3JrIGluIGlub2RlIDEwODAwOTE0NzkKY2xlYXJlZCBpbm9kZSAx MDgwMDkxNDc5CmJhZCBibWFwIGJ0cmVlIHB0ciAweDM1NDAwMTgwMDAwMDAw MDAgaW4gaW5vIDEwODAwOTE0ODcKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSAx MDgwMDkxNDg3CmNsZWFyZWQgaW5vZGUgMTA4MDA5MTQ4NwpiYWQgYm1hcCBi dHJlZSBwdHIgMHhjOGMwMDBjMDAwMDAwMDAwIGluIGlubyAxMDgzNjQyODE3 CmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTA4MzY0MjgxNwpjbGVhcmVkIGlu b2RlIDEwODM2NDI4MTcKYmFkIGJtYXAgYnRyZWUgcHRyIDB4NzFhMDAwYzAw MDAwMDAwMCBpbiBpbm8gMTA4MzY0MjgxOApiYWQgZGF0YSBmb3JrIGluIGlu b2RlIDEwODM2NDI4MTgKY2xlYXJlZCBpbm9kZSAxMDgzNjQyODE4CmJhZCBi bWFwIGJ0cmVlIHB0ciAweDdmZTAwMGMwMDAwMDAwMDAgaW4gaW5vIDEwODM2 NDI4MjEKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSAxMDgzNjQyODIxCmNsZWFy ZWQgaW5vZGUgMTA4MzY0MjgyMQpiYWQgYm1hcCBidHJlZSBwdHIgMHg1ZGUw MDIwMDAwMDAwMDAwIGluIGlubyAxMDgzNzgzMTIyCmJhZCBkYXRhIGZvcmsg aW4gaW5vZGUgMTA4Mzc4MzEyMgpjbGVhcmVkIGlub2RlIDEwODM3ODMxMjIK YmFkIGJtYXAgYnRyZWUgcHRyIDB4NmMwMDE4MDAwMDAwMDAwIGluIGlubyAx MDgzNzgzMTIzCmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTA4Mzc4MzEyMwpj bGVhcmVkIGlub2RlIDEwODM3ODMxMjMKYmFkIGJtYXAgYnRyZWUgcHRyIDB4 ZTY2MDA0NDAwMDAwMDAwMCBpbiBpbm8gMTA4NTQ3NTc4OQpiYWQgZGF0YSBm b3JrIGluIGlub2RlIDEwODU0NzU3ODkKY2xlYXJlZCBpbm9kZSAxMDg1NDc1 Nzg5CmJhZCBibWFwIGJ0cmVlIHB0ciAweDY1ODAwMmMwMDAwMDAwMDAgaW4g aW5vIDEwODU2NDc5NDcKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSAxMDg1NjQ3 OTQ3CmNsZWFyZWQgaW5vZGUgMTA4NTY0Nzk0NwpiYWQgYm1hcCBidHJlZSBw dHIgMHhiN2EwMDBjMDAwMDAwMDAwIGluIGlubyAxMDg1NjQ3OTYzCmJhZCBk YXRhIGZvcmsgaW4gaW5vZGUgMTA4NTY0Nzk2MwpjbGVhcmVkIGlub2RlIDEw ODU2NDc5NjMKYmFkIG1hZ2ljICMgMHg1ODQ2NTM0MiBpbiBpbm9kZSAxMDg1 NjQ3OTY0IChkYXRhIGZvcmspIGJtYnQgYmxvY2sgMApiYWQgZGF0YSBmb3Jr IGluIGlub2RlIDEwODU2NDc5NjQKY2xlYXJlZCBpbm9kZSAxMDg1NjQ3OTY0 CmJhZCBtYWdpYyAjIDB4NTg0NjUzNDIgaW4gaW5vZGUgMTEyMjgxNDU4MSAo ZGF0YSBmb3JrKSBibWJ0IGJsb2NrIDAKYmFkIGRhdGEgZm9yayBpbiBpbm9k ZSAxMTIyODE0NTgxCmNsZWFyZWQgaW5vZGUgMTEyMjgxNDU4MQpiYWQgbWFn aWMgIyAweDU4NDY1MzQyIGluIGlub2RlIDExMjI4NTM0NjkgKGRhdGEgZm9y aykgYm1idCBibG9jayAwCmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTEyMjg1 MzQ2OQpjbGVhcmVkIGlub2RlIDExMjI4NTM0NjkKYmFkIG1hZ2ljICMgMHg1 ODQ2NTM0MiBpbiBpbm9kZSAxMTIzNDYyMzkyIChkYXRhIGZvcmspIGJtYnQg YmxvY2sgMApiYWQgZGF0YSBmb3JrIGluIGlub2RlIDExMjM0NjIzOTIKY2xl YXJlZCBpbm9kZSAxMTIzNDYyMzkyCmJhZCBtYWdpYyAjIDB4NTg0NjUzNDIg aW4gaW5vZGUgMTEyNDA5ODgyNyAoZGF0YSBmb3JrKSBibWJ0IGJsb2NrIDAK YmFkIGRhdGEgZm9yayBpbiBpbm9kZSAxMTI0MDk4ODI3CmNsZWFyZWQgaW5v ZGUgMTEyNDA5ODgyNwpiYWQgbWFnaWMgIyAweDU4NDY1MzQyIGluIGlub2Rl IDExNDE3MTkyNDcgKGRhdGEgZm9yaykgYm1idCBibG9jayAwCmJhZCBkYXRh IGZvcmsgaW4gaW5vZGUgMTE0MTcxOTI0NwpjbGVhcmVkIGlub2RlIDExNDE3 MTkyNDcKYmFkIGJtYXAgYnRyZWUgcHRyIDB4ZDkyMDAwNDAwMDAwMDAwMCBp biBpbm8gMTI1NTk4Njg1OApiYWQgZGF0YSBmb3JrIGluIGlub2RlIDEyNTU5 ODY4NTgKY2xlYXJlZCBpbm9kZSAxMjU1OTg2ODU4CmJhZCBibWFwIGJ0cmVl IHB0ciAweDVmMDAwMDAxMDAwMDAwMDAgaW4gaW5vIDEyNTYzNTI0MTkKYmFk IGRhdGEgZm9yayBpbiBpbm9kZSAxMjU2MzUyNDE5CmNsZWFyZWQgaW5vZGUg MTI1NjM1MjQxOQpiYWQgYm1hcCBidHJlZSBwdHIgMHhhYzgwMTNiMDAwMDAw MDAwIGluIGlubyAxMzQwNTUxMzkyCmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUg MTM0MDU1MTM5MgpjbGVhcmVkIGlub2RlIDEzNDA1NTEzOTIKYmFkIGJtYXAg YnRyZWUgcHRyIDB4Y2NhMDAwMDEwMDAwMDAwMCBpbiBpbm8gMTM2MDQ4ODI1 NApiYWQgZGF0YSBmb3JrIGluIGlub2RlIDEzNjA0ODgyNTQKY2xlYXJlZCBp bm9kZSAxMzYwNDg4MjU0CiAgICAgICAgLSBhZ25vID0gMwpiYWQgYm1hcCBi dHJlZSBwdHIgMHhjMjgwMDBjMDAwMDAwMDAwIGluIGlubyAxNjE3NTY3NDcw CmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTYxNzU2NzQ3MApjbGVhcmVkIGlu b2RlIDE2MTc1Njc0NzAKYmFkIGJtYXAgYnRyZWUgcHRyIDB4YjUwMDAyMDAw MDAwMDAwMCBpbiBpbm8gMTYxNzU2NzUwNwpiYWQgZGF0YSBmb3JrIGluIGlu b2RlIDE2MTc1Njc1MDcKY2xlYXJlZCBpbm9kZSAxNjE3NTY3NTA3CmJhZCBi bWFwIGJ0cmVlIHB0ciAweGM3YTAwMWMwMDAwMDAwMDAgaW4gaW5vIDE2MjM3 NTM3NzEKYmFkIGRhdGEgZm9yayBpbiBpbm9kZSAxNjIzNzUzNzcxCmNsZWFy ZWQgaW5vZGUgMTYyMzc1Mzc3MQpiYWQgYm1hcCBidHJlZSBwdHIgMHgyNTQw MDA4MDAwMDAwMDAwIGluIGlubyAxNjI2Mzk2ODA0CmJhZCBkYXRhIGZvcmsg aW4gaW5vZGUgMTYyNjM5NjgwNApjbGVhcmVkIGlub2RlIDE2MjYzOTY4MDQK YmFkIG1hZ2ljICMgMHg1ODQ2NTM0MiBpbiBpbm9kZSAxNjI4NjI5MzcwIChk YXRhIGZvcmspIGJtYnQgYmxvY2sgMApiYWQgZGF0YSBmb3JrIGluIGlub2Rl IDE2Mjg2MjkzNzAKY2xlYXJlZCBpbm9kZSAxNjI4NjI5MzcwCmJhZCBibWFw IGJ0cmVlIHB0ciAweDk4MDAxODAwMDAwMDAwMCBpbiBpbm8gMTYyODY5NTA4 NQpiYWQgZGF0YSBmb3JrIGluIGlub2RlIDE2Mjg2OTUwODUKY2xlYXJlZCBp bm9kZSAxNjI4Njk1MDg1CmJhZCBibWFwIGJ0cmVlIHB0ciAweDM4YTAwMTAw MDAwMDAwMDAgaW4gaW5vIDE2Mjg2OTUwODcKYmFkIGRhdGEgZm9yayBpbiBp bm9kZSAxNjI4Njk1MDg3CmNsZWFyZWQgaW5vZGUgMTYyODY5NTA4NwpiYWQg bWFnaWMgIyAweDU4NDY1MzQyIGluIGlub2RlIDE2Mjg2OTUxMDcgKGRhdGEg Zm9yaykgYm1idCBibG9jayAwCmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTYy ODY5NTEwNwpjbGVhcmVkIGlub2RlIDE2Mjg2OTUxMDcKYmFkIG1hZ2ljICMg MHg1ODQ2NTM0MiBpbiBpbm9kZSAxNjMxOTIwNTYwIChkYXRhIGZvcmspIGJt YnQgYmxvY2sgMApiYWQgZGF0YSBmb3JrIGluIGlub2RlIDE2MzE5MjA1NjAK Y2xlYXJlZCBpbm9kZSAxNjMxOTIwNTYwCmJhZCBibWFwIGJ0cmVlIHB0ciAw eGE5YzAwMGMwMDAwMDAwMDAgaW4gaW5vIDE3NDQzMjk4MzQKYmFkIGRhdGEg Zm9yayBpbiBpbm9kZSAxNzQ0MzI5ODM0CmNsZWFyZWQgaW5vZGUgMTc0NDMy OTgzNApiYWQgYm1hcCBidHJlZSBwdHIgMHhjMDgwMjNiZTAwMDAwMDAwIGlu IGlubyAxODk3NjM2NjUzCmJhZCBkYXRhIGZvcmsgaW4gaW5vZGUgMTg5NzYz NjY1MwpjbGVhcmVkIGlub2RlIDE4OTc2MzY2NTMKYmFkIGJtYXAgYnRyZWUg cHRyIDB4MWRlMDE4MzMwMDAwMDAwMCBpbiBpbm8gMTkwNTExOTY3OQpiYWQg ZGF0YSBmb3JrIGluIGlub2RlIDE5MDUxMTk2NzkKY2xlYXJlZCBpbm9kZSAx OTA1MTE5Njc5CiAgICAgICAgLSBwcm9jZXNzIG5ld2x5IGRpc2NvdmVyZWQg aW5vZGVzLi4uClBoYXNlIDQgLSBjaGVjayBmb3IgZHVwbGljYXRlIGJsb2Nr cy4uLgogICAgICAgIC0gc2V0dGluZyB1cCBkdXBsaWNhdGUgZXh0ZW50IGxp c3QuLi4KICAgICAgICAtIGNoZWNrIGZvciBpbm9kZXMgY2xhaW1pbmcgZHVw bGljYXRlIGJsb2Nrcy4uLgogICAgICAgIC0gYWdubyA9IDAKZW50cnkgInNj cnViYmVkLjAiIGF0IGJsb2NrIDAgb2Zmc2V0IDM0MDAgaW4gZGlyZWN0b3J5 IGlub2RlIDExNzQ1MCByZWZlcmVuY2VzIGZyZWUgaW5vZGUgNjgyMzg0NAoJ Y2xlYXJpbmcgaW5vZGUgbnVtYmVyIGluIGVudHJ5IGF0IG9mZnNldCAzNDAw Li4uCmVudHJ5ICJzY3J1YmJlZC4xIiBpbiBzaG9ydGZvcm0gZGlyZWN0b3J5 IDExMzYwMDggcmVmZXJlbmNlcyBmcmVlIGlub2RlIDE1Njg1MTgyMwpqdW5r aW5nIGVudHJ5ICJzY3J1YmJlZC4xIiBpbiBkaXJlY3RvcnkgaW5vZGUgMTEz NjAwOAplbnRyeSAic2NydWJiZWQuMiIgaW4gc2hvcnRmb3JtIGRpcmVjdG9y eSAxMTM2MDQ4IHJlZmVyZW5jZXMgZnJlZSBpbm9kZSAxOTYyMjY4NjcKanVu a2luZyBlbnRyeSAic2NydWJiZWQuMiIgaW4gZGlyZWN0b3J5IGlub2RlIDEx MzYwNDgKZW50cnkgInNjcnViYmVkLjMiIGluIHNob3J0Zm9ybSBkaXJlY3Rv cnkgMTEzNjA0OCByZWZlcmVuY2VzIGZyZWUgaW5vZGUgMTk2MjI2OTA1Cmp1 bmtpbmcgZW50cnkgInNjcnViYmVkLjMiIGluIGRpcmVjdG9yeSBpbm9kZSAx MTM2MDQ4CmVudHJ5ICJzY3J1YmJlZC40IiBpbiBzaG9ydGZvcm0gZGlyZWN0 b3J5IDExMzYwNDggcmVmZXJlbmNlcyBmcmVlIGlub2RlIDE5NjIyNjg3OApq dW5raW5nIGVudHJ5ICJzY3J1YmJlZC40IiBpbiBkaXJlY3RvcnkgaW5vZGUg MTEzNjA0OAplbnRyeSAic2NydWJiZWQuNSIgaW4gc2hvcnRmb3JtIGRpcmVj dG9yeSAxMTM2MDQ4IHJlZmVyZW5jZXMgZnJlZSBpbm9kZSAxOTYyMjY4NzEK anVua2luZyBlbnRyeSAic2NydWJiZWQuNSIgaW4gZGlyZWN0b3J5IGlub2Rl IDExMzYwNDgKZW50cnkgInNjcnViYmVkLjYiIGluIHNob3J0Zm9ybSBkaXJl Y3RvcnkgMTEzNjA1NSByZWZlcmVuY2VzIGZyZWUgaW5vZGUgMTk2MjI2ODgw Cmp1bmtpbmcgZW50cnkgInNjcnViYmVkLjYiIGluIGRpcmVjdG9yeSBpbm9k ZSAxMTM2MDU1CmVudHJ5ICJzY3J1YmJlZC43IiBpbiBzaG9ydGZvcm0gZGly ZWN0b3J5IDExMzYwNTUgcmVmZXJlbmNlcyBmcmVlIGlub2RlIDE2OTM3MTY0 MApqdW5raW5nIGVudHJ5ICJzY3J1YmJlZC43IiBpbiBkaXJlY3RvcnkgaW5v ZGUgMTEzNjA1NQplbnRyeSAic2NydWJiZWQuOCIgYXQgYmxvY2sgMCBvZmZz ZXQgMzA0IGluIGRpcmVjdG9yeSBpbm9kZSA0NTcyMDIxIHJlZmVyZW5jZXMg ZnJlZSBpbm9kZSA1NDIzNzU1NjgKCWNsZWFyaW5nIGlub2RlIG51bWJlciBp biBlbnRyeSBhdCBvZmZzZXQgMzA0Li4uCmVudHJ5ICJzY3J1YmJlZC45IiBp biBzaG9ydGZvcm0gZGlyZWN0b3J5IDUwNzEwNTUgcmVmZXJlbmNlcyBmcmVl IGlub2RlIDIyNjc0OTYzMgpqdW5raW5nIGVudHJ5ICJzY3J1YmJlZC45IiBp biBkaXJlY3RvcnkgaW5vZGUgNTA3MTA1NQplbnRyeSAic2NydWJiZWQuMTAi IGF0IGJsb2NrIDAgb2Zmc2V0IDM1NTIgaW4gZGlyZWN0b3J5IGlub2RlIDE1 Mjg4NTY0IHJlZmVyZW5jZXMgZnJlZSBpbm9kZSA1NTUzNzk4MTUKCWNsZWFy aW5nIGlub2RlIG51bWJlciBpbiBlbnRyeSBhdCBvZmZzZXQgMzU1Mi4uLgpl bnRyeSAic2NydWJiZWQuMTEiIGF0IGJsb2NrIDAgb2Zmc2V0IDMyIGluIGRp cmVjdG9yeSBpbm9kZSAxNzA1MTYwNCByZWZlcmVuY2VzIGZyZWUgaW5vZGUg MTEyMzQ2MjM5MgoJY2xlYXJpbmcgaW5vZGUgbnVtYmVyIGluIGVudHJ5IGF0 IG9mZnNldCAzMi4uLgpubyAuLiBlbnRyeSBmb3IgZGlyZWN0b3J5IDE3MDUx NjA0CmVudHJ5ICJzY3J1YmJlZC4xMCIgYXQgYmxvY2sgMCBvZmZzZXQgOTc2 IGluIGRpcmVjdG9yeSBpbm9kZSAxNzI0MzU5MyByZWZlcmVuY2VzIGZyZWUg aW5vZGUgMTEyNDA5ODgyNwoJY2xlYXJpbmcgaW5vZGUgbnVtYmVyIGluIGVu dHJ5IGF0IG9mZnNldCA5NzYuLi4KZW50cnkgInNjcnViYmVkLjExIiBhdCBi bG9jayAwIG9mZnNldCAzMiBpbiBkaXJlY3RvcnkgaW5vZGUgODMwNzY4Mjgg cmVmZXJlbmNlcyBmcmVlIGlub2RlIDYxOTYzNTM2MAoJY2xlYXJpbmcgaW5v ZGUgbnVtYmVyIGluIGVudHJ5IGF0IG9mZnNldCAzMi4uLgpubyAuLiBlbnRy eSBmb3IgZGlyZWN0b3J5IDgzMDc2ODI4Cg== --0-794145701-1216642912=:53207-- From owner-xfs@oss.sgi.com Mon Jul 21 09:05:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 09:06:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LG5sl0014219 for ; Mon, 21 Jul 2008 09:05:54 -0700 X-ASG-Debug-ID: 1216656418-67a303730000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4069830EDF4; Mon, 21 Jul 2008 09:06:59 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id FVTuL1tRPMxMAlzp; Mon, 21 Jul 2008 09:06:59 -0700 (PDT) Received: from Russell-Cattelans-MacBook.local (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6LG6nSq068062; Mon, 21 Jul 2008 11:06:52 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <4884B419.6080603@thebarn.com> Date: Mon, 21 Jul 2008 11:06:49 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: markgw@sgi.com CC: Richard Ems , xfs@oss.sgi.com, "Bill O'Donnell" X-ASG-Orig-Subj: Re: XFS internal error xfs_btree_check_lblock Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> In-Reply-To: <48815AA6.3080102@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7766/Mon Jul 21 09:08:59 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1216656421 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56684 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 16980 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > Hi Richard, > > this looks like XFS b-tree corruption of some sort. We have some patches > that should help here. The patches are being back-ported to SLES10 and > should also apply to OpenSUSE. We should have something ready early next > week. > If the patches are for current XFS can we post them here? / reviewed? Not sure why the backport to sles10 should hold them up if they are ready? > Cheers > -- Mark > > Richard Ems wrote: >> Hi, >> >> this FS error occurred on an openSUSE 10.3 64 bit, with all openSUSE >> updates. xfsprogs is xfsprogs-2.9.4-17.1 . >> >> The filesystem with the error is our /home, on an Areca ARC-1220 RAID >> Controller, 6 Hitachi 1TB disks on RAID 5. >> >> The controller reports all disks are fine, no errors. >> >> The system had an uptime of 74 days, and had no problems with any FS >> before. >> >> >> First errors logged on /var/log/messages start at today 11:16 : >> >> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >> lastx: f >> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 2 times >> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >> lastx: 10 >> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >> lastx: 11 >> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 20 times >> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >> lastx: 12 >> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >> lastx: 13 >> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >> lastx: 13 >> >> >> and this continues up to 11:58 where we got >> >> >> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff88306053 >> Jul 18 11:58:37 c3m kernel: >> Jul 18 11:58:37 c3m kernel: Call Trace: >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_btree_check_lblock+0xf4/0xfe >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_bmbt_lookup+0x16e/0x44b >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_bmap_add_extent_delay_real+0x3f7/0xf16 >> Jul 18 11:58:37 c3m kernel: [] __up_read+0x13/0x8a >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_bmap_btalloc+0x5d7/0x693 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_bmap_add_extent+0x21c/0x3ad >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_btree_init_cursor+0x37/0x168 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_bmapi+0xa98/0x108f >> Jul 18 11:58:37 c3m kernel: [] >> cfq_set_request+0x2e7/0x345 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_trans_reserve+0xdd/0x1b0 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_iomap_write_allocate+0x255/0x3ce >> Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_iomap+0x2a3/0x33b >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_map_blocks+0x35/0x66 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_submit_ioend+0xb2/0xc4 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_page_state_convert+0x2b3/0x556 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_vm_writepage+0xa7/0xe0 >> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >> Jul 18 11:58:37 c3m kernel: [] >> write_cache_pages+0x184/0x2cd >> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_acceptable+0x0/0xca >> Jul 18 11:58:37 c3m kernel: [] >> do_writepages+0x20/0x2d >> Jul 18 11:58:37 c3m kernel: [] >> __filemap_fdatawrite_range+0x5b/0x6e >> Jul 18 11:58:37 c3m kernel: [] >> __dentry_open+0x101/0x1aa >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_sync+0x5b/0xa5 >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_commit+0x57/0x7a >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_dispatch+0xdd/0x19e >> Jul 18 11:58:37 c3m kernel: [] >> :sunrpc:svc_process+0x3e1/0x726 >> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 >> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >> Jul 18 11:58:37 c3m kernel: >> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >> 0xffffffff88321fd2 >> Jul 18 11:58:37 c3m kernel: >> Jul 18 11:58:37 c3m kernel: Call Trace: >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_trans_cancel+0x5c/0xf2 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_iomap_write_allocate+0x3a8/0x3ce >> Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_iomap+0x2a3/0x33b >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_map_blocks+0x35/0x66 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_submit_ioend+0xb2/0xc4 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_page_state_convert+0x2b3/0x556 >> Jul 18 11:58:37 c3m kernel: [] >> :xfs:xfs_vm_writepage+0xa7/0xe0 >> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >> Jul 18 11:58:37 c3m kernel: [] >> write_cache_pages+0x184/0x2cd >> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_acceptable+0x0/0xca >> Jul 18 11:58:37 c3m kernel: [] >> do_writepages+0x20/0x2d >> Jul 18 11:58:37 c3m kernel: [] >> __filemap_fdatawrite_range+0x5b/0x6e >> Jul 18 11:58:37 c3m kernel: [] >> __dentry_open+0x101/0x1aa >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_sync+0x5b/0xa5 >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_commit+0x57/0x7a >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >> Jul 18 11:58:37 c3m kernel: [] >> :nfsd:nfsd_dispatch+0xdd/0x19e >> Jul 18 11:58:37 c3m kernel: [] >> :sunrpc:svc_process+0x3e1/0x726 >> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 >> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >> Jul 18 11:58:37 c3m kernel: >> Jul 18 11:58:37 c3m kernel: xfs_force_shutdown(sdc1,0x8) called from >> line 1133 of file fs/xfs/xfs_trans.c. Return address = >> 0xffffffff8832ea7c >> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": Corruption of >> in-memory data detected. Shutting down filesystem: sdc1 >> Jul 18 11:58:37 c3m kernel: Please umount the filesystem, and rectify >> the problem(s) >> Jul 18 11:58:37 c3m kernel: nfsd: non-standard errno: -117 >> >> >> >> It was impossible for me to xfs_check (out of memory) or repair >> without rebooting. >> After rebooting only "xfs_repair -L" worked and repaired the FS, but >> short time >> later it failed again and it continues failing after each repair. >> >> What's happening here? >> >> Any help would be very appreciated! >> >> Many thanks, Richard >> >> >> >> # grep -i "xfs internal error" /var/log/messages | wc -l >> 182 >> >> # grep -i "xfs internal error" /var/log/messages >> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff88306053 >> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >> 0xffffffff88321fd2 >> Jul 18 12:39:51 c3m kernel: Filesystem "sdc1": XFS internal error >> xlog_recover_do_inode_trans(1) at line 2310 of file >> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >> Jul 18 12:41:32 c3m kernel: Filesystem "sdc1": XFS internal error >> xlog_recover_do_inode_trans(1) at line 2310 of file >> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >> Jul 18 12:44:15 c3m kernel: Filesystem "sdc1": XFS internal error >> xlog_recover_do_inode_trans(1) at line 2310 of file >> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >> Jul 18 12:57:35 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:35 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:36 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:36 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:36 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:36 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:37 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:37 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:37 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:37 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:37 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:37 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:38 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:38 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:38 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:38 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:39 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:39 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:39 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:39 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:40 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:40 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:40 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:40 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:40 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:40 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:42 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:45 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:46 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:47 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:47 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:48 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:49 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:51 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:51 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:53 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:53 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:53 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:54 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:54 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:54 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:54 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:57:54 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:15 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d7451 >> Jul 18 12:58:16 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:16 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:16 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 12:58:16 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:43 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:44 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:45 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:02:46 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882ff9bc >> Jul 18 13:09:31 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:09:31 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:09:31 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:09:31 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:09:31 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:09:31 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:09:32 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:09:32 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:18:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 13:18:06 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff882fc9bc >> Jul 18 16:21:48 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:48 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:49 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:50 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:51 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:51 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:51 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:52 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:53 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:53 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:53 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:53 c3m kernel: XFS internal error >> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >> Caller 0xffffffff883009bc >> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >> Caller 0xffffffff882d8451 >> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >> 0xffffffff88304f9e >> >> >> > From owner-xfs@oss.sgi.com Mon Jul 21 09:10:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 09:10:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LGAEYC014722 for ; Mon, 21 Jul 2008 09:10:14 -0700 X-ASG-Debug-ID: 1216656683-028d00d40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A8B79E74400 for ; Mon, 21 Jul 2008 09:11:23 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id y6dk3nrqGtKO2n2p for ; Mon, 21 Jul 2008 09:11:23 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 6281DAC6272; Mon, 21 Jul 2008 11:11:21 -0500 (CDT) Message-ID: <4884B527.1030104@sandeen.net> Date: Mon, 21 Jul 2008 11:11:19 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Richard Ems CC: markgw@sgi.com, xfs@oss.sgi.com, "Bill O'Donnell" X-ASG-Orig-Subj: Re: XFS internal error xfs_btree_check_lblock Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <488457F3.2050405@cape-horn-eng.com> In-Reply-To: <488457F3.2050405@cape-horn-eng.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216656683 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56685 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16981 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Richard Ems wrote: > Mark Goodwin wrote: >> Hi Richard, >> >> this looks like XFS b-tree corruption of some sort. We have some patches >> that should help here. The patches are being back-ported to SLES10 and >> should also apply to OpenSUSE. We should have something ready early next >> week. > > Thanks Mark. The most annoying thing is that, after many repairs, it's > working again! But my big question is ... for how long? How stable is > the filesystem now? Should I better recreate it? WHY did this happen? > Why did the FS fail again after some repairs? 8( > > Where can I get more info about these patches? Is there a developer > mailing list? Or some webpage to follow the development progress? This *is* the developer mailing list, and I am honestly a bit frustrated that said bugs & patches are not being aired & reviewed in public, honestly. -Eric From owner-xfs@oss.sgi.com Mon Jul 21 13:16:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 13:16:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LKG5xI002823 for ; Mon, 21 Jul 2008 13:16:06 -0700 X-ASG-Debug-ID: 1216671434-724603220000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C7F73E76693 for ; Mon, 21 Jul 2008 13:17:14 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by cuda.sgi.com with ESMTP id 8tXVXkuzZL9kSpel for ; Mon, 21 Jul 2008 13:17:14 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so413015and.75 for ; Mon, 21 Jul 2008 13:17:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=/vW1sKkXk6yX/JYHJv0Iqlou60fhyWIlJuDmowaaD3k=; b=Ls3r4yFqDfqev6KYJsEnv9tR524896UOTp0B+MqnOqFRdILAGVeDN3YxngA+Yk5KMu sEOdJThsdMidKy4d9v26WLom462EOpa9pMBTVUX8xObbid5GKzB9+3c1MF/5MMgDe/Qe CtJh7KcKhEwPCamywAM9VYuloO7lcmw1GTp9w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=exvvP3rqzVPA+HvFqIR6X8VO26aepAMaROpdRuT/Cke6hb69bI4vZC7DeHfdzQs2Ns geJpHR9ALQeQYNg4l4Wq2aptFAdDQHtwP8QQbnOljHvQq7oCzJbcBoOlnZ4k2vvhpFm0 BhaFQrJeMy0sDbUDS5lqJkDoTLjhpSHdKoZXs= Received: by 10.100.120.15 with SMTP id s15mr1968328anc.66.1216671434238; Mon, 21 Jul 2008 13:17:14 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Mon, 21 Jul 2008 13:17:14 -0700 (PDT) Message-ID: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> Date: Mon, 21 Jul 2008 22:17:14 +0200 From: "Richard Hartmann" To: xfs@oss.sgi.com X-ASG-Orig-Subj: xfsrestore over ssh? Subject: xfsrestore over ssh? MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: an-out-0708.google.com[209.85.132.249] X-Barracuda-Start-Time: 1216671435 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56699 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16982 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs Hi all, I am unable to find the correct command to restore a xfs dump over ssh. I don't care on which of the two boxes I need to run the command, if anyone could tell me either way, that would be hugely appreciated! Thanks in advance, Richard From owner-xfs@oss.sgi.com Mon Jul 21 13:32:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 13:32:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from relay.sgi.com (relay2.corp.sgi.com [192.26.58.22]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LKWYqx004114 for ; Mon, 21 Jul 2008 13:32:34 -0700 Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay2.corp.sgi.com (Postfix) with ESMTP id 8C7F8304086 for ; Mon, 21 Jul 2008 13:33:41 -0700 (PDT) Received: from [128.162.233.117] (augusta.americas.sgi.com [128.162.233.117]) by estes.americas.sgi.com (Postfix) with ESMTP id 388B770001C8; Mon, 21 Jul 2008 15:33:41 -0500 (CDT) Message-ID: <4884F2A5.5050507@sgi.com> Date: Mon, 21 Jul 2008 15:33:41 -0500 From: Bill Kendall User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: Richard Hartmann Cc: xfs@oss.sgi.com Subject: Re: xfsrestore over ssh? References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> In-Reply-To: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16983 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: wkendall@sgi.com Precedence: bulk X-list: xfs On 07/21/2008 03:17 PM, Richard Hartmann wrote: > Hi all, > > I am unable to find the correct command to restore a xfs dump > over ssh. I don't care on which of the two boxes I need to run > the command, if anyone could tell me either way, that would > be hugely appreciated! > > > Thanks in advance, > Richard > Something like this should work. Run it from the host that has the dump file and ssh to the box that needs to have restore. % cat dumpfile | ssh root@host xfsrestore - /restore/here Bill From owner-xfs@oss.sgi.com Mon Jul 21 15:58:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 15:58:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LMwPCx014387 for ; Mon, 21 Jul 2008 15:58:26 -0700 X-ASG-Debug-ID: 1216681174-527003c30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 56E12310A0C for ; Mon, 21 Jul 2008 15:59:34 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id fBG2FG0oBEVQJOS9 for ; Mon, 21 Jul 2008 15:59:34 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApEBAO+vhEh5LFxAiGdsb2JhbACSRwEBAQ8gnFY X-IronPort-AV: E=Sophos;i="4.31,225,1215354600"; d="scan'208";a="154584452" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Jul 2008 08:29:32 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KL4Lr-0004rB-5C; Tue, 22 Jul 2008 08:59:31 +1000 Date: Tue, 22 Jul 2008 08:59:31 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/4] don't leak m_fsname/m_rtname/m_logname Subject: Re: [PATCH 1/4] don't leak m_fsname/m_rtname/m_logname Message-ID: <20080721225931.GF6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080525190736.GA13372@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190736.GA13372@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216681175 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56709 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16984 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sun, May 25, 2008 at 09:07:37PM +0200, Christoph Hellwig wrote: > Add a helper to free the m_fsname/m_rtname/m_logname allocations and use > it properly for all mount failure cases. Also switch the allocations > for these to kstrdup while we're at it. Looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 16:11:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 16:11:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LNBEu2015520 for ; Mon, 21 Jul 2008 16:11:15 -0700 X-ASG-Debug-ID: 1216681944-5c3a03050000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 28F9E1915296 for ; Mon, 21 Jul 2008 16:12:24 -0700 (PDT) Received: from mx1.suse.de (mail.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id I79PWGhBGpxm6FD7 for ; Mon, 21 Jul 2008 16:12:24 -0700 (PDT) X-ASG-Whitelist: Client X-ASG-Whitelist: Barracuda Reputation Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 7928C418D4; Tue, 22 Jul 2008 01:12:23 +0200 (CEST) From: Neil Brown To: "Mr. James W. Laferriere" Date: Tue, 22 Jul 2008 09:12:15 +1000 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18565.6095.988483.628391@notabene.brown> Cc: linux-raid maillist Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: INFO: task pdflush:393 blocked for more than 120 seconds. & Call traces ... (fwd) Subject: Re: INFO: task pdflush:393 blocked for more than 120 seconds. & Call traces ... (fwd) In-Reply-To: message from Mr. James W. Laferriere on Monday July 21 References: X-Mailer: VM 7.19 under Emacs 21.4.1 X-face: [Gw_3E*Gng}4rRrKRYotwlE?.2|**#s9D INFO: task pdflush:393 blocked for more than 120 seconds. > "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. > pdflush D c8209f80 4748 393 2 > f75e5e58 00000046 f7f7ad50 c8209f80 f7f7a8a0 f75e5e24 c014fc57 00000000 > f7f7a8a0 e5d0dd00 c8209f80 f75e4000 c0819e00 c8209f80 f7f7aaf4 f75e5e44 > 00000286 f75e5e80 f510de30 f75e5e58 c0142233 f510de00 f75e5e80 f510de30 > Call Trace: > [] ? mark_held_locks+0x67/0x80 > [] ? add_wait_queue+0x33/0x50 > [] xfs_buf_wait_unpin+0xb5/0xe0 > [] ? default_wake_function+0x0/0x10 > [] ? default_wake_function+0x0/0x10 > [] xfs_buf_iorequest+0x4b/0x80 > [] xfs_bdstrat_cb+0x3e/0x50 > [] xfs_bwrite+0x5c/0xe0 > [] xfs_syncsub+0x121/0x2b0 > [] ? lock_super+0x1b/0x20 > [] ? lock_super+0x1b/0x20 > [] xfs_sync+0x48/0x70 > [] xfs_fs_write_super+0x23/0x30 > [] sync_supers+0xaf/0xc0 Looks a lot like an XFS problem to me. Or at least, XFS people would be able to interpret this stack the best. > [] wb_kupdate+0x29/0x100 > [] ? __pdflush+0xcc/0x1a0 > [] __pdflush+0xd2/0x1a0 > [] ? pdflush+0x0/0x40 > [] pdflush+0x31/0x40 > [] ? wb_kupdate+0x0/0x100 > [] ? pdflush+0x0/0x40 > [] kthread+0x5c/0xa0 > [] ? kthread+0x0/0xa0 > [] kernel_thread_helper+0x7/0x10 > ======================= > 2 locks held by pdflush/393: > #0: (&type->s_umount_key#17){----}, at: [] sync_supers+0x52/0xc0 > #1: (&type->s_lock_key#7){--..}, at: [] lock_super+0x1b/0x20 > > ...snip... Repeats of above message ad-infintum . Hmm... I guess I clipped a bit too much for our XFS friends to know the context. bonnie is being run on an XFS filesystem on md/raid6. and it gets this warning a lot and essentially hangs. NeilBrown From owner-xfs@oss.sgi.com Mon Jul 21 16:39:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 16:39:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6LNdG4X022155 for ; Mon, 21 Jul 2008 16:39:18 -0700 Received: from [134.15.251.1] (melb-sw-corp-251-1.corp.sgi.com [134.15.251.1]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id JAA09816; Tue, 22 Jul 2008 09:40:15 +1000 Message-ID: <48851E5C.8010005@sgi.com> Date: Tue, 22 Jul 2008 09:40:12 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Richard Ems , xfs@oss.sgi.com, "Bill O'Donnell" Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <488457F3.2050405@cape-horn-eng.com> <4884B527.1030104@sandeen.net> In-Reply-To: <4884B527.1030104@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16986 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Richard Ems wrote: >> Mark Goodwin wrote: >>> Hi Richard, >>> >>> this looks like XFS b-tree corruption of some sort. We have some patches >>> that should help here. The patches are being back-ported to SLES10 and >>> should also apply to OpenSUSE. We should have something ready early next >>> week. >> Thanks Mark. The most annoying thing is that, after many repairs, it's >> working again! But my big question is ... for how long? How stable is >> the filesystem now? Should I better recreate it? WHY did this happen? >> Why did the FS fail again after some repairs? 8( >> >> Where can I get more info about these patches? Is there a developer >> mailing list? Or some webpage to follow the development progress? > > This *is* the developer mailing list, and I am honestly a bit frustrated > that said bugs & patches are not being aired & reviewed in public, honestly. I'm sorry Eric for not being very clear. Nothing "secret" going on here, nor intended. The problems have all been reported (or mostly, but I'm not going to report every problem seen by every SGI customer). The issues I'm referring to are extent list corruption (causing hangs), bmap corruption due to failed allocs in full AGs (and locking hierarchy issues), and invalid btree cursors following btree splits. Lachlan and others have posted patches for all of these over the past couple of months (I'll dredge the archives and post the references if you want). The changes are all reviewed, checked in and available in CVS. Some made it into .26 and others will appear in .27 in a day or two. The topic at hand in this thread (for folks like Richard) is collecting these fixes into a patchset and back-porting the result to the distros that are based on 2.6.{16,18} or earlier. This affects SLES, RHEL, OpenSuSE10, earlier FC, etc. Cheers -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Mon Jul 21 16:41:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 16:42:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.5 required=5.0 tests=BAYES_00,FROM_SALUTATION, J_CHICKENPOX_13 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6LNfuew022630 for ; Mon, 21 Jul 2008 16:41:56 -0700 X-ASG-Debug-ID: 1216683785-52af00090000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ns3.baby-dragons.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 05781310D72 for ; Mon, 21 Jul 2008 16:43:05 -0700 (PDT) Received: from ns3.baby-dragons.com (ns3.system-techniques.com [204.91.156.41]) by cuda.sgi.com with ESMTP id pMrITGM1ep91Ex86 for ; Mon, 21 Jul 2008 16:43:05 -0700 (PDT) Received: from localhost (ns3.baby-dragons.com [204.91.156.41]) by ns3.baby-dragons.com (8.13.8/8.13.8) with ESMTP id m6LNh3De018333; Mon, 21 Jul 2008 23:43:03 GMT Date: Mon, 21 Jul 2008 15:43:03 -0800 (AKDT) From: "Mr. James W. Laferriere" To: Neil Brown cc: linux-raid maillist , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: INFO: task pdflush:393 blocked for more than 120 seconds. & Call traces ... (fwd) Subject: Re: INFO: task pdflush:393 blocked for more than 120 seconds. & Call traces ... (fwd) In-Reply-To: <18565.6095.988483.628391@notabene.brown> Message-ID: References: <18565.6095.988483.628391@notabene.brown> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.1.8 (ns3.baby-dragons.com [204.91.156.41]); Mon, 21 Jul 2008 23:43:04 +0000 (UTC) X-Barracuda-Connect: ns3.system-techniques.com[204.91.156.41] X-Barracuda-Start-Time: 1216683786 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56710 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16987 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: babydr@baby-dragons.com Precedence: bulk X-list: xfs Hello Neil , On Tue, 22 Jul 2008, Neil Brown wrote: > On Monday July 21, babydr@baby-dragons.com wrote: >> INFO: task pdflush:393 blocked for more than 120 seconds. >> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. >> pdflush D c8209f80 4748 393 2 >> f75e5e58 00000046 f7f7ad50 c8209f80 f7f7a8a0 f75e5e24 c014fc57 00000000 >> f7f7a8a0 e5d0dd00 c8209f80 f75e4000 c0819e00 c8209f80 f7f7aaf4 f75e5e44 >> 00000286 f75e5e80 f510de30 f75e5e58 c0142233 f510de00 f75e5e80 f510de30 >> Call Trace: >> [] ? mark_held_locks+0x67/0x80 >> [] ? add_wait_queue+0x33/0x50 >> [] xfs_buf_wait_unpin+0xb5/0xe0 >> [] ? default_wake_function+0x0/0x10 >> [] ? default_wake_function+0x0/0x10 >> [] xfs_buf_iorequest+0x4b/0x80 >> [] xfs_bdstrat_cb+0x3e/0x50 >> [] xfs_bwrite+0x5c/0xe0 >> [] xfs_syncsub+0x121/0x2b0 >> [] ? lock_super+0x1b/0x20 >> [] ? lock_super+0x1b/0x20 >> [] xfs_sync+0x48/0x70 >> [] xfs_fs_write_super+0x23/0x30 >> [] sync_supers+0xaf/0xc0 > > Looks a lot like an XFS problem to me. > Or at least, XFS people would be able to interpret this stack the > best. Hmm , Ok , I'll post there , I can provide a -complete- boot -> renboot log of the actions , But it ain't small ~ 649K . So I'll post that on the back of my website , ie: http://www.baby-dragons.com/bonnie++1.03c-2.6.26-rc9.console.trace.log This includes the Sysrq-w & sysrq-b outputs at the bottom . If you're interested in that kind of thing ;-) . >> [] wb_kupdate+0x29/0x100 >> [] ? __pdflush+0xcc/0x1a0 >> [] __pdflush+0xd2/0x1a0 >> [] ? pdflush+0x0/0x40 >> [] pdflush+0x31/0x40 >> [] ? wb_kupdate+0x0/0x100 >> [] ? pdflush+0x0/0x40 >> [] kthread+0x5c/0xa0 >> [] ? kthread+0x0/0xa0 >> [] kernel_thread_helper+0x7/0x10 >> ======================= >> 2 locks held by pdflush/393: >> #0: (&type->s_umount_key#17){----}, at: [] sync_supers+0x52/0xc0 >> #1: (&type->s_lock_key#7){--..}, at: [] lock_super+0x1b/0x20 >> >> ...snip... Repeats of above message ad-infintum . > > > Hmm... I guess I clipped a bit too much for our XFS friends to know > the context. > bonnie is being run on an XFS filesystem on md/raid6. and it gets > this warning a lot and essentially hangs. > NeilBrown Nah , wasn't you who did the clipping t'was me . in order to get the size of the original message below ~ 80K . Tnx , JimL -- +------------------------------------------------------------------+ | James W. Laferriere | System Techniques | Give me VMS | | Network&System Engineer | 2133 McCullam Ave | Give me Linux | | babydr@baby-dragons.com | Fairbanks, AK. 99701 | only on AXP | +------------------------------------------------------------------+ From owner-xfs@oss.sgi.com Mon Jul 21 18:24:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 18:24:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M1OZmx029184 for ; Mon, 21 Jul 2008 18:24:37 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA01258; Tue, 22 Jul 2008 11:25:35 +1000 Message-ID: <4885370F.9000301@sgi.com> Date: Tue, 22 Jul 2008 11:25:35 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Neil Brown CC: "Mr. James W. Laferriere" , linux-raid maillist , xfs@oss.sgi.com Subject: Re: INFO: task pdflush:393 blocked for more than 120 seconds. & Call traces ... (fwd) References: <18565.6095.988483.628391@notabene.brown> In-Reply-To: <18565.6095.988483.628391@notabene.brown> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16988 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Neil Brown wrote: > On Monday July 21, babydr@baby-dragons.com wrote: >> INFO: task pdflush:393 blocked for more than 120 seconds. >> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. >> pdflush D c8209f80 4748 393 2 >> f75e5e58 00000046 f7f7ad50 c8209f80 f7f7a8a0 f75e5e24 c014fc57 00000000 >> f7f7a8a0 e5d0dd00 c8209f80 f75e4000 c0819e00 c8209f80 f7f7aaf4 f75e5e44 >> 00000286 f75e5e80 f510de30 f75e5e58 c0142233 f510de00 f75e5e80 f510de30 >> Call Trace: >> [] ? mark_held_locks+0x67/0x80 >> [] ? add_wait_queue+0x33/0x50 >> [] xfs_buf_wait_unpin+0xb5/0xe0 >> [] ? default_wake_function+0x0/0x10 >> [] ? default_wake_function+0x0/0x10 >> [] xfs_buf_iorequest+0x4b/0x80 >> [] xfs_bdstrat_cb+0x3e/0x50 >> [] xfs_bwrite+0x5c/0xe0 >> [] xfs_syncsub+0x121/0x2b0 >> [] ? lock_super+0x1b/0x20 >> [] ? lock_super+0x1b/0x20 >> [] xfs_sync+0x48/0x70 >> [] xfs_fs_write_super+0x23/0x30 >> [] sync_supers+0xaf/0xc0 > > Looks a lot like an XFS problem to me. > Or at least, XFS people would be able to interpret this stack the > best. > I presume if it is waiting in xfs_buf_wait_unpin() for a long time (>2min) then maybe a journal-log io completion hasn't come back to say that the matching buffer item has made to the ondisk log. i.e the buffer hasn't been unpinned yet (pincount>0) which is supposed to happen when its data hits the ondisk log. >> [] wb_kupdate+0x29/0x100 >> [] ? __pdflush+0xcc/0x1a0 >> [] __pdflush+0xd2/0x1a0 >> [] ? pdflush+0x0/0x40 >> [] pdflush+0x31/0x40 >> [] ? wb_kupdate+0x0/0x100 >> [] ? pdflush+0x0/0x40 >> [] kthread+0x5c/0xa0 >> [] ? kthread+0x0/0xa0 >> [] kernel_thread_helper+0x7/0x10 >> ======================= >> 2 locks held by pdflush/393: >> #0: (&type->s_umount_key#17){----}, at: [] sync_supers+0x52/0xc0 >> #1: (&type->s_lock_key#7){--..}, at: [] lock_super+0x1b/0x20 >> >> ...snip... Repeats of above message ad-infintum . > > > Hmm... I guess I clipped a bit too much for our XFS friends to know > the context. > bonnie is being run on an XFS filesystem on md/raid6. and it gets > this warning a lot and essentially hangs. > Just for the record, in rc-9 we hadn't removed the QUEUE_ORDERED tag check yet and so I presume for md/raid6, barriers will be disabled. So barrier writes on the log won't be being issued. I don't see that as anything to do with the problem here - that is more of an issue on replay if we have the cache on and no barrier support - I just thought I'd mention it. --Tim From owner-xfs@oss.sgi.com Mon Jul 21 19:06:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 19:06:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M26OTJ031587 for ; Mon, 21 Jul 2008 19:06:25 -0700 X-ASG-Debug-ID: 1216692454-69e7001a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AB7BAE71D0A for ; Mon, 21 Jul 2008 19:07:34 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id Q5hcfiv9BjIDL6Qp for ; Mon, 21 Jul 2008 19:07:34 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id E1600AC6272; Mon, 21 Jul 2008 21:07:32 -0500 (CDT) Message-ID: <488540E3.7030702@sandeen.net> Date: Mon, 21 Jul 2008 21:07:31 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: Richard Ems , xfs@oss.sgi.com, "Bill O'Donnell" X-ASG-Orig-Subj: Re: XFS internal error xfs_btree_check_lblock Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <488457F3.2050405@cape-horn-eng.com> <4884B527.1030104@sandeen.net> <48851E5C.8010005@sgi.com> In-Reply-To: <48851E5C.8010005@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216692454 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0011 1.0000 -2.0139 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56722 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16989 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mark Goodwin wrote: > > Eric Sandeen wrote: >> Richard Ems wrote: >>> Mark Goodwin wrote: >>>> Hi Richard, >>>> >>>> this looks like XFS b-tree corruption of some sort. We have some patches >>>> that should help here. The patches are being back-ported to SLES10 and >>>> should also apply to OpenSUSE. We should have something ready early next >>>> week. >>> Thanks Mark. The most annoying thing is that, after many repairs, it's >>> working again! But my big question is ... for how long? How stable is >>> the filesystem now? Should I better recreate it? WHY did this happen? >>> Why did the FS fail again after some repairs? 8( >>> >>> Where can I get more info about these patches? Is there a developer >>> mailing list? Or some webpage to follow the development progress? >> This *is* the developer mailing list, and I am honestly a bit frustrated >> that said bugs & patches are not being aired & reviewed in public, honestly. > > I'm sorry Eric for not being very clear. Nothing "secret" going on here, > nor intended. The problems have all been reported (or mostly, but I'm > not going to report every problem seen by every SGI customer). The issues > I'm referring to are extent list corruption (causing hangs), bmap corruption > due to failed allocs in full AGs (and locking hierarchy issues), and invalid > btree cursors following btree splits. Lachlan and others have posted patches > for all of these over the past couple of months (I'll dredge the archives > and post the references if you want). The changes are all reviewed, checked > in and available in CVS. Some made it into .26 and others will appear in .27 > in a day or two. Great. From your earlier reply I had the impression that they were patches still internal to SGI - which of course SGI has every right to do, but patch reviews have the potential to be better if more eyes can see them - but if they're all already out there on the list, then thanks and sorry for the noise. :) -Eric From owner-xfs@oss.sgi.com Mon Jul 21 19:10:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 19:10:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M2AG7G032087 for ; Mon, 21 Jul 2008 19:10:17 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA02228; Tue, 22 Jul 2008 12:11:21 +1000 Message-ID: <4885430D.7000506@sgi.com> Date: Tue, 22 Jul 2008 12:16:45 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: xfs-dev , xfs-oss Subject: [PATCH] Do not access buffers after dropping reference count Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16990 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs We should not access a buffer after dropping it's reference count otherwise we could race with another thread that releases the final reference count and frees the buffer causing us to access potentially unmapped memory. Lachlan --- fs/xfs/linux-2.6/xfs_buf.c_1.257 2008-07-16 17:38:00.000000000 +1000 +++ fs/xfs/linux-2.6/xfs_buf.c 2008-07-22 12:05:50.000000000 +1000 @@ -839,6 +839,7 @@ xfs_buf_rele( return; } + ASSERT(atomic_read(&bp->b_hold) > 0); if (atomic_dec_and_lock(&bp->b_hold, &hash->bh_lock)) { if (bp->b_relse) { atomic_inc(&bp->b_hold); @@ -852,11 +853,6 @@ xfs_buf_rele( spin_unlock(&hash->bh_lock); xfs_buf_free(bp); } - } else { - /* - * Catch reference count leaks - */ - ASSERT(atomic_read(&bp->b_hold) >= 0); } } From owner-xfs@oss.sgi.com Mon Jul 21 19:19:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 19:20:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M2JvNE000561 for ; Mon, 21 Jul 2008 19:19:57 -0700 X-ASG-Debug-ID: 1216693264-597d02290000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 630C01915DEB for ; Mon, 21 Jul 2008 19:21:04 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id hU2GEgE1EXuGEcX4 for ; Mon, 21 Jul 2008 19:21:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8CAGjhhEh5LFxAiGdsb2JhbACSRQEBAQ8gnEc X-IronPort-AV: E=Sophos;i="4.31,228,1215354600"; d="scan'208";a="154764192" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Jul 2008 11:50:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KL7Ug-0002cF-8c; Tue, 22 Jul 2008 12:20:50 +1000 Date: Tue, 22 Jul 2008 12:20:50 +1000 From: Dave Chinner To: "Mr. James W. Laferriere" Cc: Neil Brown , linux-raid maillist , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: INFO: task pdflush:393 blocked for more than 120 seconds. & Call traces ... (fwd) Subject: Re: INFO: task pdflush:393 blocked for more than 120 seconds. & Call traces ... (fwd) Message-ID: <20080722022050.GG6761@disturbed> Mail-Followup-To: "Mr. James W. Laferriere" , Neil Brown , linux-raid maillist , xfs@oss.sgi.com References: <18565.6095.988483.628391@notabene.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216693266 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56723 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16991 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 03:43:03PM -0800, Mr. James W. Laferriere wrote: > Hello Neil , > > On Tue, 22 Jul 2008, Neil Brown wrote: >> On Monday July 21, babydr@baby-dragons.com wrote: >>> INFO: task pdflush:393 blocked for more than 120 seconds. >>> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. >>> pdflush D c8209f80 4748 393 2 >>> f75e5e58 00000046 f7f7ad50 c8209f80 f7f7a8a0 f75e5e24 c014fc57 00000000 >>> f7f7a8a0 e5d0dd00 c8209f80 f75e4000 c0819e00 c8209f80 f7f7aaf4 f75e5e44 >>> 00000286 f75e5e80 f510de30 f75e5e58 c0142233 f510de00 f75e5e80 f510de30 >>> Call Trace: >>> [] ? mark_held_locks+0x67/0x80 >>> [] ? add_wait_queue+0x33/0x50 >>> [] xfs_buf_wait_unpin+0xb5/0xe0 >>> [] ? default_wake_function+0x0/0x10 >>> [] ? default_wake_function+0x0/0x10 >>> [] xfs_buf_iorequest+0x4b/0x80 >>> [] xfs_bdstrat_cb+0x3e/0x50 >>> [] xfs_bwrite+0x5c/0xe0 >>> [] xfs_syncsub+0x121/0x2b0 >>> [] ? lock_super+0x1b/0x20 >>> [] ? lock_super+0x1b/0x20 >>> [] xfs_sync+0x48/0x70 >>> [] xfs_fs_write_super+0x23/0x30 >>> [] sync_supers+0xaf/0xc0 >> >> Looks a lot like an XFS problem to me. >> Or at least, XFS people would be able to interpret this stack the >> best. > Hmm , Ok , I'll post there , I can provide a -complete- boot -> > renboot log of the actions , But it ain't small ~ 649K . So I'll post > that on the back of my website , ie: > > http://www.baby-dragons.com/bonnie++1.03c-2.6.26-rc9.console.trace.log Given that it's a log hang on 2.6.29-rc9, I'd first say add this commit: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=49641f1acfdfd437ed9b0a70b86bf36626c02afe to your build (went in after -rc9 but before 2.6.26 was released) and see if that solves the problem. In more detail, this stack trace implies log I/O has not completed after the log force was triggered in xfs_buf_wait_unpin(). The above patch fixes a bug in log I/o dispatch where an non-atomic compare and decrement would result in log I/O not being dispatched. So, you've got a hang waiting for log I/o to complete on a kernel that has a known problem with log I/O dispatch, so it's likely that's what you've hit. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 19:22:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 19:23:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M2MwDV001009 for ; Mon, 21 Jul 2008 19:22:58 -0700 X-ASG-Debug-ID: 1216693447-69ec00c30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4E245E78DB2 for ; Mon, 21 Jul 2008 19:24:07 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id TKFUJuMXHBvGz4r4 for ; Mon, 21 Jul 2008 19:24:07 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8CAGjhhEh5LFxAiGdsb2JhbACSRQEBAQ8gnEc X-IronPort-AV: E=Sophos;i="4.31,228,1215354600"; d="scan'208";a="154766627" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Jul 2008 11:54:06 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KL7Xp-0002gH-3b; Tue, 22 Jul 2008 12:24:05 +1000 Date: Tue, 22 Jul 2008 12:24:04 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] Do not access buffers after dropping reference count Subject: Re: [PATCH] Do not access buffers after dropping reference count Message-ID: <20080722022404.GH6761@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs-dev , xfs-oss References: <4885430D.7000506@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4885430D.7000506@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216693448 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56722 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16992 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 12:16:45PM +1000, Lachlan McIlroy wrote: > We should not access a buffer after dropping it's reference count otherwise > we could race with another thread that releases the final reference count > and frees the buffer causing us to access potentially unmapped memory. Looks OK. The commit message should point out this is a problem only for DEBUG kernels, though. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 19:49:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 19:49:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M2nNhO002931 for ; Mon, 21 Jul 2008 19:49:25 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA03054; Tue, 22 Jul 2008 12:50:28 +1000 Message-ID: <48854C38.8050007@sgi.com> Date: Tue, 22 Jul 2008 12:55:52 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Lachlan McIlroy , xfs-dev , xfs-oss Subject: Re: [PATCH] Do not access buffers after dropping reference count References: <4885430D.7000506@sgi.com> <20080722022404.GH6761@disturbed> In-Reply-To: <20080722022404.GH6761@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16993 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Tue, Jul 22, 2008 at 12:16:45PM +1000, Lachlan McIlroy wrote: >> We should not access a buffer after dropping it's reference count otherwise >> we could race with another thread that releases the final reference count >> and frees the buffer causing us to access potentially unmapped memory. > > Looks OK. The commit message should point out this is a problem > only for DEBUG kernels, though. Okay, will do. From owner-xfs@oss.sgi.com Mon Jul 21 20:00:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 20:00:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M30uTX003929 for ; Mon, 21 Jul 2008 20:00:56 -0700 X-ASG-Debug-ID: 1216695725-695c039b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 05EB81916524 for ; Mon, 21 Jul 2008 20:02:05 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by cuda.sgi.com with ESMTP id JZYpJ90OZGcJJx6e for ; Mon, 21 Jul 2008 20:02:05 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so436851and.75 for ; Mon, 21 Jul 2008 20:02:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Qv9LnbWiyo9JGxnoOxt49wgTa7o+e89LZyYUqJwe0X8=; b=eEaLfRu2E3Tx9QHLuyN3XVY8W0VwDqr0jNgvUNis9gkLw4YXLDGWQjajyIv/QHzxwc GNnfRd3RdvlG0RSk6mAUtZ+O0NhUSsqYJMe5r0Bdf0UK2bP111e9VZwseMldCVkqvjCN A1MVZNZ8Q8iW0EAB59jztA7KmWT0gQ518s0ww= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=KQSz3c039+sRS8hvLqsQV4OmwAOMu/hNFH18SkSxxBTgfb8hthlo4JrczG10uKwoJu hhyHayL6Kq5CZQvr23+KiFam08pidceU2kRsM6m2OQvzE1s4L1NTw9GR+4OBn4AwfEBL IffuAqiWM2uiBv3JZ8F74J834y3nlwKX86X04= Received: by 10.100.10.11 with SMTP id 11mr2142855anj.94.1216695725518; Mon, 21 Jul 2008 20:02:05 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Mon, 21 Jul 2008 20:02:05 -0700 (PDT) Message-ID: <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> Date: Tue, 22 Jul 2008 05:02:05 +0200 From: "Richard Hartmann" To: "Bill Kendall" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: xfs@oss.sgi.com In-Reply-To: <4884F2A5.5050507@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.250] X-Barracuda-Start-Time: 1216695726 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3164 1.0000 -0.2801 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.28 X-Barracuda-Spam-Status: No, SCORE=-0.28 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56725 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m6M30vTX003932 X-archive-position: 16994 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 22:33, Bill Kendall wrote: > % cat dumpfile | ssh root@host xfsrestore - /restore/here I did try cat root.xfs | ssh root@192.168.1.213 xfsrestore - /mnt/sda3 which resulted in The authenticity of host '192.168.1.213 (192.168.1.213)' can't be established. RSA key fingerprint is 3c:a9:a3:84:0f:8e:e2:84:c9:c6:85:af:5f:8d:52:5f. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.1.213' (RSA) to the list of known hosts. Password: xfsrestore: using file dump (drive_simple) strategy xfsrestore: version 2.2.45 (dump format 3.0) - Running single-threaded xfsrestore: unable to construct a file system handle for /mnt/sda3: Das Argument ist ung�ltig xfsrestore: Restore Status: ERROR 'The argument is invalid' -- needless to say, this is a valid xfs partition of appropriate size.. Richard From owner-xfs@oss.sgi.com Mon Jul 21 20:23:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 20:23:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M3NYMY010048 for ; Mon, 21 Jul 2008 20:23:35 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA03571; Tue, 22 Jul 2008 13:24:31 +1000 Message-ID: <488552EC.8060803@sgi.com> Date: Tue, 22 Jul 2008 13:24:28 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Russell Cattelan CC: Richard Ems , xfs@oss.sgi.com, "Bill O'Donnell" Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <4884B419.6080603@thebarn.com> In-Reply-To: <4884B419.6080603@thebarn.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16995 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Russell Cattelan wrote: > If the patches are for current XFS can we post them here? / reviewed? > Not sure why the backport to sles10 should hold them up if they are ready? For the record, the patches I'm referring to are: # Prevent extent btree block allocation failures http://oss.sgi.com/archives/xfs/2008-06/msg00122.html # fix extent corruption in xfs_iext_irec_compact_full() http://oss.sgi.com/archives/xfs/2008-06/msg00209.html # Convert ASSERTs to XFS_WANT_CORRUPTED_GOTOs http://oss.sgi.com/archives/xfs/2008-06/msg00231.html # Always reset btree cursor after an insert http://oss.sgi.com/archives/xfs/2008-06/msg00243.html # set minleft in xfs_bmbt_split() http://oss.sgi.com/archives/xfs/2008-06/msg00280.html # Restore the lowspace extent allocator algorithm http://oss.sgi.com/archives/xfs/2008-06/msg00281.html Some of the above might not refer directly to the final committed patches but the thread URLs should be accurate. These are bug fixes that go a long way back and really do need to be back-ported and pushed out for the mentioned distros. There are probably other patches not listed above that should be considered too. Cheers >> Richard Ems wrote: >>> Hi, >>> >>> this FS error occurred on an openSUSE 10.3 64 bit, with all openSUSE >>> updates. xfsprogs is xfsprogs-2.9.4-17.1 . >>> >>> The filesystem with the error is our /home, on an Areca ARC-1220 RAID >>> Controller, 6 Hitachi 1TB disks on RAID 5. >>> >>> The controller reports all disks are fine, no errors. >>> >>> The system had an uptime of 74 days, and had no problems with any FS >>> before. >>> >>> >>> First errors logged on /var/log/messages start at today 11:16 : >>> >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: f >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 2 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 10 >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 11 >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 20 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 12 >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 13 >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 13 >>> >>> >>> and this continues up to 11:58 where we got >>> >>> >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff88306053 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: Call Trace: >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_btree_check_lblock+0xf4/0xfe >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmbt_lookup+0x16e/0x44b >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmap_add_extent_delay_real+0x3f7/0xf16 >>> Jul 18 11:58:37 c3m kernel: [] __up_read+0x13/0x8a >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmap_btalloc+0x5d7/0x693 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmap_add_extent+0x21c/0x3ad >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_btree_init_cursor+0x37/0x168 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmapi+0xa98/0x108f >>> Jul 18 11:58:37 c3m kernel: [] >>> cfq_set_request+0x2e7/0x345 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_trans_reserve+0xdd/0x1b0 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap_write_allocate+0x255/0x3ce >>> Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap+0x2a3/0x33b >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_map_blocks+0x35/0x66 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_submit_ioend+0xb2/0xc4 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_page_state_convert+0x2b3/0x556 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_vm_writepage+0xa7/0xe0 >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> write_cache_pages+0x184/0x2cd >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_acceptable+0x0/0xca >>> Jul 18 11:58:37 c3m kernel: [] >>> do_writepages+0x20/0x2d >>> Jul 18 11:58:37 c3m kernel: [] >>> __filemap_fdatawrite_range+0x5b/0x6e >>> Jul 18 11:58:37 c3m kernel: [] >>> __dentry_open+0x101/0x1aa >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_sync+0x5b/0xa5 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_commit+0x57/0x7a >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_dispatch+0xdd/0x19e >>> Jul 18 11:58:37 c3m kernel: [] >>> :sunrpc:svc_process+0x3e1/0x726 >>> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>> 0xffffffff88321fd2 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: Call Trace: >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_trans_cancel+0x5c/0xf2 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap_write_allocate+0x3a8/0x3ce >>> Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap+0x2a3/0x33b >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_map_blocks+0x35/0x66 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_submit_ioend+0xb2/0xc4 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_page_state_convert+0x2b3/0x556 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_vm_writepage+0xa7/0xe0 >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> write_cache_pages+0x184/0x2cd >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_acceptable+0x0/0xca >>> Jul 18 11:58:37 c3m kernel: [] >>> do_writepages+0x20/0x2d >>> Jul 18 11:58:37 c3m kernel: [] >>> __filemap_fdatawrite_range+0x5b/0x6e >>> Jul 18 11:58:37 c3m kernel: [] >>> __dentry_open+0x101/0x1aa >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_sync+0x5b/0xa5 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_commit+0x57/0x7a >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_dispatch+0xdd/0x19e >>> Jul 18 11:58:37 c3m kernel: [] >>> :sunrpc:svc_process+0x3e1/0x726 >>> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: xfs_force_shutdown(sdc1,0x8) called from >>> line 1133 of file fs/xfs/xfs_trans.c. Return address = >>> 0xffffffff8832ea7c >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": Corruption of >>> in-memory data detected. Shutting down filesystem: sdc1 >>> Jul 18 11:58:37 c3m kernel: Please umount the filesystem, and rectify >>> the problem(s) >>> Jul 18 11:58:37 c3m kernel: nfsd: non-standard errno: -117 >>> >>> >>> >>> It was impossible for me to xfs_check (out of memory) or repair >>> without rebooting. >>> After rebooting only "xfs_repair -L" worked and repaired the FS, but >>> short time >>> later it failed again and it continues failing after each repair. >>> >>> What's happening here? >>> >>> Any help would be very appreciated! >>> >>> Many thanks, Richard >>> >>> >>> >>> # grep -i "xfs internal error" /var/log/messages | wc -l >>> 182 >>> >>> # grep -i "xfs internal error" /var/log/messages >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff88306053 >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>> 0xffffffff88321fd2 >>> Jul 18 12:39:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xlog_recover_do_inode_trans(1) at line 2310 of file >>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>> Jul 18 12:41:32 c3m kernel: Filesystem "sdc1": XFS internal error >>> xlog_recover_do_inode_trans(1) at line 2310 of file >>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>> Jul 18 12:44:15 c3m kernel: Filesystem "sdc1": XFS internal error >>> xlog_recover_do_inode_trans(1) at line 2310 of file >>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>> Jul 18 12:57:35 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:35 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:39 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:39 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:39 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:39 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:42 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:45 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:47 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:47 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:48 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:49 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:53 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:15 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:32 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:32 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:18:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:18:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 16:21:48 c3m kernel: XFS internal error > >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:48 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:49 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d8451 >>> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>> 0xffffffff88304f9e >>> >>> >>> >> > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Mon Jul 21 20:58:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 20:58:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M3wIrY012146 for ; Mon, 21 Jul 2008 20:58:19 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA04124; Tue, 22 Jul 2008 13:59:18 +1000 Message-ID: <48855B16.4050208@sgi.com> Date: Tue, 22 Jul 2008 13:59:18 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Richard Hartmann CC: Bill Kendall , xfs@oss.sgi.com Subject: Re: xfsrestore over ssh? References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> In-Reply-To: <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16996 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Richard Hartmann wrote: > On Mon, Jul 21, 2008 at 22:33, Bill Kendall wrote: > > >> % cat dumpfile | ssh root@host xfsrestore - /restore/here > > I did try > > cat root.xfs | ssh root@192.168.1.213 xfsrestore - /mnt/sda3 > > which resulted in > > The authenticity of host '192.168.1.213 (192.168.1.213)' can't be established. > RSA key fingerprint is 3c:a9:a3:84:0f:8e:e2:84:c9:c6:85:af:5f:8d:52:5f. > Are you sure you want to continue connecting (yes/no)? yes > Warning: Permanently added '192.168.1.213' (RSA) to the list of known hosts. > Password: > xfsrestore: using file dump (drive_simple) strategy > xfsrestore: version 2.2.45 (dump format 3.0) - Running single-threaded > xfsrestore: unable to construct a file system handle for /mnt/sda3: > Das Argument ist ung�ltig > xfsrestore: Restore Status: ERROR > > 'The argument is invalid' -- needless to say, this is a valid xfs partition of > appropriate size.. > > The final argument to restore should be a destination directory not a device (as Donald sitting nearby mentioned to me :). xfsrestore just uses standard posix calls for the most part to restore the files (seeks, writes, etc...) to a mounted filesystem - and in many circumstances can restore on a non-xfs mounted filesystem. It is _NOT_ a low level file system restorer to an unmounted filesystem like some other restorers. --Tim From owner-xfs@oss.sgi.com Mon Jul 21 21:22:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 21:23:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M4MuRl013968 for ; Mon, 21 Jul 2008 21:22:57 -0700 X-ASG-Debug-ID: 1216700646-3c3802a10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F3FA7E7965C for ; Mon, 21 Jul 2008 21:24:06 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id G7BVMFA6eb5okLio for ; Mon, 21 Jul 2008 21:24:06 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KL9Py-0001Zl-Cd; Tue, 22 Jul 2008 04:24:06 +0000 Date: Tue, 22 Jul 2008 00:24:06 -0400 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Subject: Re: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() Message-ID: <20080722042406.GA27123@infradead.org> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-2-git-send-email-david@fromorbit.com> <20080721075826.GC6692@infradead.org> <20080721113302.GD6761@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080721113302.GD6761@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216700646 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.86 X-Barracuda-Spam-Status: No, SCORE=0.86 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RATWARE_EFROM X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56730 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 2.88 RATWARE_EFROM Bulk email fingerprint (envfrom) found X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16997 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 21, 2008 at 09:33:02PM +1000, Dave Chinner wrote: > It's not really harmless - it reclaims inodes faster as reclaim > is now triggered by means other than xfssyncd. I'm not sure I should > perturb the reclaim behaviour right now (wasn't my intent) so I'll > change it back to the original code. It doesn't affect the other > patches in any material way... Yes, makes sense. > Fixed patch is below. Looks good. From owner-xfs@oss.sgi.com Mon Jul 21 21:27:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 21:27:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M4RL18014529 for ; Mon, 21 Jul 2008 21:27:21 -0700 X-ASG-Debug-ID: 1216700910-28a303680000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 45B8A311127 for ; Mon, 21 Jul 2008 21:28:31 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 21uXZaqCm50QpK1V for ; Mon, 21 Jul 2008 21:28:31 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KL9UD-0000au-8E; Tue, 22 Jul 2008 04:28:29 +0000 Date: Tue, 22 Jul 2008 00:28:29 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080722042829.GB27123@infradead.org> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216556394-17529-3-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216700911 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56730 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16998 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Sun, Jul 20, 2008 at 10:19:52PM +1000, Dave Chinner wrote: > Update xfs_sync_inodes to walk the inode radix tree cache to find > dirty inodes. This removes a huge bunch of nasty, messy code for > traversing the mount inode list safely and removes another user of > the mount inode list. Looks good, some minor nits below: > xfs_inode_t *ip = NULL; > bhv_vnode_t *vp = NULL; As you're touching most uses of vp what about just turning it into a plain Linux inode? > + if (!pag->pag_ici_init) > + return 0; I think it would be cleaner to move this into the caller and not even call into this function for uninitialized AGs. > + read_lock(&pag->pag_ici_lock); > + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, > + (void**)&ip, first_index, 1); This needs a big comment on why you're using the gang lookup for a single lookup. I guess that's because the gang lookup skips to the next actually existing entry instead of returning NULL, but that's not really obvious to the reader. > + VN_RELE(vp); This should either be an iput or IRELE, VN_RELE is on it's way out. Btw, all these also apply to the next patch, I won't comment on them there again. From owner-xfs@oss.sgi.com Mon Jul 21 21:27:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 21:28:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M4RsNg014741 for ; Mon, 21 Jul 2008 21:27:54 -0700 X-ASG-Debug-ID: 1216700943-715c03310000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8A6EF191688D for ; Mon, 21 Jul 2008 21:29:03 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id RjnKaufuobjDSOzT for ; Mon, 21 Jul 2008 21:29:03 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KL9Ul-0000b4-9Q; Tue, 22 Jul 2008 04:29:03 +0000 Date: Tue, 22 Jul 2008 00:29:03 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] XFS: remove the mount inode list Subject: Re: [PATCH 4/4] XFS: remove the mount inode list Message-ID: <20080722042903.GC27123@infradead.org> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216556394-17529-5-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216700944 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56731 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 16999 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Sun, Jul 20, 2008 at 10:19:54PM +1000, Dave Chinner wrote: > Now we've removed all users of the mount inode list, > we can kill it. This reduces the size of the xfs_inode > by 2 pointers. Looks good, but xfsidbg needs to be fixed up for this. From owner-xfs@oss.sgi.com Mon Jul 21 21:37:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 21:37:45 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M4bg7f015750 for ; Mon, 21 Jul 2008 21:37:43 -0700 X-ASG-Debug-ID: 1216701532-3c38033d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BF15BE792FB; Mon, 21 Jul 2008 21:38:52 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id CLX0XJjDbYn2uUQ2; Mon, 21 Jul 2008 21:38:52 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KL9eF-0003cR-Qw; Tue, 22 Jul 2008 04:38:51 +0000 Date: Tue, 22 Jul 2008 00:38:51 -0400 From: Christoph Hellwig To: Niv Sardi Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [UPDATED RFC] Create with EA initial work Subject: Re: [UPDATED RFC] Create with EA initial work Message-ID: <20080722043851.GA7244@infradead.org> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1215675545-2707-1-git-send-email-xaiki@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216701532 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56732 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17000 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Thu, Jul 10, 2008 at 05:39:01PM +1000, Niv Sardi wrote: > There is a bug in this, that I can see with the Parent Pointers code > going on top of it (that will be posted soon), it is basically calling > xfs_attr_set_int_trans() in xfs_create() just before the last > commit. For some reason, the first call to xfs_roll_trans (after > xfs_bmap_add_attrfork_trans()) will complain about the inode being > unlocked after xfs_trans_commit(). I understand I need to call > xfs_trans_ihold(ip) on it, but we already do in xfs_create() so I > think I must be missing something else??? any ideas ? There are multiple ways to deal with inodes linked to transactions. In all cases it needs to be linked into the transaction by xfs_trans_ijoin, or the opencoded equivalent for a new inode in xfs_trans_iget. Then you can use xfs_trans_ihold to make sure on transaction commit the inode reference count is not dropped and the inode is not unlocked, or simply grab a reference to the inode and let the transaction commit handler unlock it and decrement the reference count. The latter is what's used by xfs_create and the former is what the attr code does, and as far as I can see the only things what works with xfs_attr_rolltrans. From owner-xfs@oss.sgi.com Mon Jul 21 21:42:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 21:42:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M4g2am016265 for ; Mon, 21 Jul 2008 21:42:02 -0700 X-ASG-Debug-ID: 1216701792-1da801110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 501CF1916BF7 for ; Mon, 21 Jul 2008 21:43:12 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.247]) by cuda.sgi.com with ESMTP id cGyGHsjCPBzE166Q for ; Mon, 21 Jul 2008 21:43:12 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so441105and.75 for ; Mon, 21 Jul 2008 21:43:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=YNqmxfc7hgq/bggFpiE/gdBqWdvxVxCBovCauK/s2ZM=; b=ALAvI+K5BJbb7Vcdn+dsOzedx41be9CYgEAK8g8kMLmDP6tonwZAegWdG23HvwRWMi c98ZocBgIjYwuTlzSBbpGw7NWZJ83SkCQ3L2o0CijwRf4E6OxIg2KmL0CWHS9opGDzFP qT7VyJcQ31Z68mXacw8nAeaMn3H8seIzu8ITw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=oFbJ8dFMqQBrvBzBMj9YewEwryaaZhazPsRkE4ZAR0N3nygE8wV3/kYARTaWxsPixO 0kABSu/TUzHEgaE9SmJ4RJxIjR/XAhlsYvffg7noX1EwJy6Po9jcPp1taP34CmbPJ5yP rqbNA2ralZkm2lCgHhXPMD+lnEUHAA1+0xyss= Received: by 10.100.254.18 with SMTP id b18mr2169748ani.81.1216701791836; Mon, 21 Jul 2008 21:43:11 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Mon, 21 Jul 2008 21:43:11 -0700 (PDT) Message-ID: <2d460de70807212143j1f80e016y6a48cab966091215@mail.gmail.com> Date: Tue, 22 Jul 2008 06:43:11 +0200 From: "Richard Hartmann" To: "Timothy Shimmin" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <48855B16.4050208@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.247] X-Barracuda-Start-Time: 1216701792 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56731 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17001 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 05:59, Timothy Shimmin wrote: > xfsrestore just uses standard posix calls for the most part to > restore the files (seeks, writes, etc...) to a mounted filesystem - > and in many circumstances can restore on a non-xfs mounted filesystem. > It is _NOT_ a low level file system restorer to an unmounted filesystem > like some other restorers. True, this is why I told it to use /mnt/sda3, not a raw device :) Richard From owner-xfs@oss.sgi.com Mon Jul 21 21:42:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 21:42:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M4gSJ5016436 for ; Mon, 21 Jul 2008 21:42:28 -0700 X-ASG-Debug-ID: 1216701817-3f0503340000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E2BCDE7987E; Mon, 21 Jul 2008 21:43:37 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id gFZprznCIjwneUhm; Mon, 21 Jul 2008 21:43:37 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KL9ir-0003QG-3p; Tue, 22 Jul 2008 04:43:37 +0000 Date: Tue, 22 Jul 2008 00:43:37 -0400 From: Christoph Hellwig To: Niv Sardi Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Export xfs_attr_set_int_trans Subject: Re: [PATCH] Export xfs_attr_set_int_trans Message-ID: <20080722044337.GA10290@infradead.org> References: <1215675545-2707-5-git-send-email-xaiki@sgi.com> <1215754695-6958-1-git-send-email-xaiki@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1215754695-6958-1-git-send-email-xaiki@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216701817 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56732 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17002 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Fri, Jul 11, 2008 at 03:38:14PM +1000, Niv Sardi wrote: > make xfs_attr_set_int_trans non static so we can use it outside of xfs_attr.c > (Needed to use it in vnodeops.c, for create+EA) Any reason this is not merged into the previous patch? From owner-xfs@oss.sgi.com Mon Jul 21 22:29:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 22:29:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M5TLkl022086 for ; Mon, 21 Jul 2008 22:29:22 -0700 X-ASG-Debug-ID: 1216704628-51ec009d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6207A1916F34 for ; Mon, 21 Jul 2008 22:30:28 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id YgV4UVK9gZ3dlXkh for ; Mon, 21 Jul 2008 22:30:28 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8CAJgLhUh5LFxAiGdsb2JhbACSRgEBAQ8gnDY X-IronPort-AV: E=Sophos;i="4.31,229,1215354600"; d="scan'208";a="154898539" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Jul 2008 15:00:26 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLAS3-0006lZ-RP; Tue, 22 Jul 2008 15:30:19 +1000 Date: Tue, 22 Jul 2008 15:30:19 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080722053019.GI6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080722042829.GB27123@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216704631 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0071 1.0000 -1.9744 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.97 X-Barracuda-Spam-Status: No, SCORE=-1.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56735 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17003 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 12:28:29AM -0400, Christoph Hellwig wrote: > On Sun, Jul 20, 2008 at 10:19:52PM +1000, Dave Chinner wrote: > > Update xfs_sync_inodes to walk the inode radix tree cache to find > > dirty inodes. This removes a huge bunch of nasty, messy code for > > traversing the mount inode list safely and removes another user of > > the mount inode list. > > Looks good, some minor nits below: > > > xfs_inode_t *ip = NULL; > > bhv_vnode_t *vp = NULL; > > As you're touching most uses of vp what about just turning it > into a plain Linux inode? Until the method we'll use for referencing VFS inodes in core XFS code is clear, I'd rather leave it consistent with the rest of the code. As it is, I expect that this code will be revisited several times as new functionality is added (e.g. combining the VFS and XFS inodes) because that will change the way we interface with VFS and XFS inodes. Much of this vnode specific code will change at that time; I'd rather just change it once when the time is appropriate than have to change it multiple times.... > > + if (!pag->pag_ici_init) > > + return 0; > > I think it would be cleaner to move this into the caller and not even > call into this function for uninitialized AGs. Ok. No big deal either way. > > > + read_lock(&pag->pag_ici_lock); > > + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, > > + (void**)&ip, first_index, 1); > > This needs a big comment on why you're using the gang lookup for > a single lookup. I guess that's because the gang lookup skips to > the next actually existing entry instead of returning NULL, but that's > not really obvious to the reader. Fair enough. This was later in the original series where this was a dirty tag lookup and didn't need commenting ;) > > + VN_RELE(vp); > > This should either be an iput or IRELE, VN_RELE is on it's way out. Good catch, I'll change it. > Btw, all these also apply to the next patch, I won't comment on them > there again. Ok, I'll update that as well. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 22:40:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 22:40:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M5esvH024086 for ; Mon, 21 Jul 2008 22:40:54 -0700 X-ASG-Debug-ID: 1216705322-520100d30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 2A1E41917637 for ; Mon, 21 Jul 2008 22:42:03 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ZfKy5J7aIpSgTjb1 for ; Mon, 21 Jul 2008 22:42:03 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ah8CABcPhUh5LFxAiGdsb2JhbACSRgEBAQ8gnEE X-IronPort-AV: E=Sophos;i="4.31,229,1215354600"; d="scan'208";a="154907607" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 22 Jul 2008 15:12:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLAdM-00070T-NJ; Tue, 22 Jul 2008 15:42:00 +1000 Date: Tue, 22 Jul 2008 15:42:00 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] XFS: remove the mount inode list Subject: Re: [PATCH 4/4] XFS: remove the mount inode list Message-ID: <20080722054200.GK6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-5-git-send-email-david@fromorbit.com> <20080722042903.GC27123@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080722042903.GC27123@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216705324 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56735 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17004 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 12:29:03AM -0400, Christoph Hellwig wrote: > On Sun, Jul 20, 2008 at 10:19:54PM +1000, Dave Chinner wrote: > > Now we've removed all users of the mount inode list, > > we can kill it. This reduces the size of the xfs_inode > > by 2 pointers. > > Looks good, but xfsidbg needs to be fixed up for this. Yeah, well, it's not in the git tree. CVS + quilt is too painful to go back to once you've started using guilt + git + branches and basked in it's goodness. SGI folk - a -dev branch in the XFS git tree that contains everything the CVS tree contains would be really helpful here. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Mon Jul 21 23:05:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 23:05:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M65nBF026638 for ; Mon, 21 Jul 2008 23:05:51 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA07472; Tue, 22 Jul 2008 16:06:57 +1000 From: Niv Sardi To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH] Export xfs_attr_set_int_trans References: <1215675545-2707-5-git-send-email-xaiki@sgi.com> <1215754695-6958-1-git-send-email-xaiki@sgi.com> <20080722044337.GA10290@infradead.org> Date: Tue, 22 Jul 2008 16:06:55 +1000 In-Reply-To: <20080722044337.GA10290@infradead.org> (Christoph Hellwig's message of "Tue, 22 Jul 2008 00:43:37 -0400") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17005 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig writes: > On Fri, Jul 11, 2008 at 03:38:14PM +1000, Niv Sardi wrote: >> make xfs_attr_set_int_trans non static so we can use it outside of xfs_attr.c >> (Needed to use it in vnodeops.c, for create+EA) > > Any reason this is not merged into the previous patch? you =) you didn't like my attr_* function to be exported, so I splitted the export out from now on. that's about it. Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Mon Jul 21 23:20:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 23:20:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M6Jvm4027859 for ; Mon, 21 Jul 2008 23:19:58 -0700 Received: from cxfsmac10.melbourne.sgi.com (cxfsmac10.melbourne.sgi.com [134.14.55.100]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA07736; Tue, 22 Jul 2008 16:20:56 +1000 Message-ID: <48857C4A.6060004@sgi.com> Date: Tue, 22 Jul 2008 16:20:58 +1000 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Richard Hartmann CC: Timothy Shimmin , Bill Kendall , xfs@oss.sgi.com Subject: Re: xfsrestore over ssh? References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <2d460de70807212143j1f80e016y6a48cab966091215@mail.gmail.com> In-Reply-To: <2d460de70807212143j1f80e016y6a48cab966091215@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17006 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Richard Hartmann wrote: > On Tue, Jul 22, 2008 at 05:59, Timothy Shimmin wrote: > > >> xfsrestore just uses standard posix calls for the most part to >> restore the files (seeks, writes, etc...) to a mounted filesystem - >> and in many circumstances can restore on a non-xfs mounted filesystem. >> It is _NOT_ a low level file system restorer to an unmounted filesystem >> like some other restorers. > > True, this is why I told it to use /mnt/sda3, not a raw device :) :), looks like we both misread that. Should be working then. If you hexdump the start of the dump does it look reasonable? It should be something like: molten:/home/donaldd # hexdump -C dump | head 00000000 78 46 53 64 75 6d 70 30 00 00 00 02 02 05 e8 49 |xFSdump0.......I| 00000010 48 85 7c cc 00 00 00 00 00 00 00 00 0e 86 21 36 |H.|...........!6| 00000020 86 06 e5 1d 17 32 49 a0 ad ea 5d 1d a2 7c d9 a3 |.....2I...]..|..| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000100 6d 6f 6c 74 65 6e 00 00 00 00 00 00 00 00 00 00 |molten..........| 00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000200 73 6f 6d 65 6c 61 62 65 6c 00 00 00 00 00 00 00 |somelabel.......| 00000210 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| From owner-xfs@oss.sgi.com Mon Jul 21 23:26:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 23:26:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M6PwKN028523 for ; Mon, 21 Jul 2008 23:26:01 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA07784; Tue, 22 Jul 2008 16:27:03 +1000 Message-ID: <48857EFB.3030301@sgi.com> Date: Tue, 22 Jul 2008 16:32:27 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: xfs-dev , xfs-oss Subject: [PATCH] Prevent log tail pushing from blocking on buffer locks Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17007 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs This changes xfs_inode_item_push() to use XFS_IFLUSH_ASYNC_NOBLOCK when flushing an inode so the flush wont block on inode cluster buffer lock. Also change the prototype of the IOP_PUSH operation so that xfsaild_push() can bump it's stuck count. This change was prompted by a deadlock that would only occur on a debug XFS where a thread creating an inode had the buffer locked and was trying to allocate space for the inode tracing facility. That recursed back into the filesystem to flush data which created a transaction and needed log space which wasn't available. --- fs/xfs/quota/xfs_dquot_item.c_1.22 2008-07-03 15:37:12.000000000 +1000 +++ fs/xfs/quota/xfs_dquot_item.c 2008-07-03 14:39:12.000000000 +1000 @@ -141,7 +141,7 @@ xfs_qm_dquot_logitem_unpin_remove( * we simply get xfs_qm_dqflush() to do the work, and unlock the dquot * at the end. */ -STATIC void +STATIC int xfs_qm_dquot_logitem_push( xfs_dq_logitem_t *logitem) { @@ -168,6 +168,8 @@ xfs_qm_dquot_logitem_push( "xfs_qm_dquot_logitem_push: push error %d on dqp %p", error, dqp); xfs_dqunlock(dqp); + + return error; } /*ARGSUSED*/ @@ -417,7 +419,7 @@ static struct xfs_item_ops xfs_dquot_ite .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_unlock, .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_qm_dquot_logitem_committed, - .iop_push = (void(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_push, + .iop_push = (int(*)(xfs_log_item_t*))xfs_qm_dquot_logitem_push, .iop_pushbuf = (void(*)(xfs_log_item_t*)) xfs_qm_dquot_logitem_pushbuf, .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) @@ -554,10 +556,10 @@ xfs_qm_qoff_logitem_committed(xfs_qoff_l * stuck waiting for the log to be flushed to disk. */ /*ARGSUSED*/ -STATIC void +STATIC int xfs_qm_qoff_logitem_push(xfs_qoff_logitem_t *qf) { - return; + return 0; } @@ -622,7 +624,7 @@ static struct xfs_item_ops xfs_qm_qoffen .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unlock, .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_qm_qoffend_logitem_committed, - .iop_push = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_push, + .iop_push = (int(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_push, .iop_pushbuf = NULL, .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_qm_qoffend_logitem_committing @@ -644,7 +646,7 @@ static struct xfs_item_ops xfs_qm_qoff_l .iop_unlock = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_unlock, .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_qm_qoff_logitem_committed, - .iop_push = (void(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_push, + .iop_push = (int(*)(xfs_log_item_t*))xfs_qm_qoff_logitem_push, .iop_pushbuf = NULL, .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_qm_qoff_logitem_committing --- fs/xfs/xfs_buf_item.c_1.166 2008-07-03 15:37:14.000000000 +1000 +++ fs/xfs/xfs_buf_item.c 2008-07-03 14:38:17.000000000 +1000 @@ -633,11 +633,12 @@ xfs_buf_item_committed( * B_DELWRI set, then get it going out to disk with a call to bawrite(). * If not, then just release the buffer. */ -STATIC void +STATIC int xfs_buf_item_push( xfs_buf_log_item_t *bip) { xfs_buf_t *bp; + int error = 0; ASSERT(!(bip->bli_flags & XFS_BLI_STALE)); xfs_buf_item_trace("PUSH", bip); @@ -645,7 +646,6 @@ xfs_buf_item_push( bp = bip->bli_buf; if (XFS_BUF_ISDELAYWRITE(bp)) { - int error; error = xfs_bawrite(bip->bli_item.li_mountp, bp); if (error) xfs_fs_cmn_err(CE_WARN, bip->bli_item.li_mountp, @@ -654,6 +654,8 @@ xfs_buf_item_push( } else { xfs_buf_relse(bp); } + + return error; } /* ARGSUSED */ @@ -677,7 +679,7 @@ static struct xfs_item_ops xfs_buf_item_ .iop_unlock = (void(*)(xfs_log_item_t*))xfs_buf_item_unlock, .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_buf_item_committed, - .iop_push = (void(*)(xfs_log_item_t*))xfs_buf_item_push, + .iop_push = (int(*)(xfs_log_item_t*))xfs_buf_item_push, .iop_pushbuf = NULL, .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_buf_item_committing --- fs/xfs/xfs_extfree_item.c_1.69 2008-07-03 15:37:16.000000000 +1000 +++ fs/xfs/xfs_extfree_item.c 2008-07-03 14:38:40.000000000 +1000 @@ -202,10 +202,10 @@ xfs_efi_item_committed(xfs_efi_log_item_ * committed to disk. */ /*ARGSUSED*/ -STATIC void +STATIC int xfs_efi_item_push(xfs_efi_log_item_t *efip) { - return; + return 0; } /* @@ -237,7 +237,7 @@ static struct xfs_item_ops xfs_efi_item_ .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efi_item_unlock, .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_efi_item_committed, - .iop_push = (void(*)(xfs_log_item_t*))xfs_efi_item_push, + .iop_push = (int(*)(xfs_log_item_t*))xfs_efi_item_push, .iop_pushbuf = NULL, .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_efi_item_committing @@ -498,10 +498,10 @@ xfs_efd_item_committed(xfs_efd_log_item_ * stuck waiting for the log to be flushed to disk. */ /*ARGSUSED*/ -STATIC void +STATIC int xfs_efd_item_push(xfs_efd_log_item_t *efdp) { - return; + return 0; } /* @@ -533,7 +533,7 @@ static struct xfs_item_ops xfs_efd_item_ .iop_unlock = (void(*)(xfs_log_item_t*))xfs_efd_item_unlock, .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_efd_item_committed, - .iop_push = (void(*)(xfs_log_item_t*))xfs_efd_item_push, + .iop_push = (int(*)(xfs_log_item_t*))xfs_efd_item_push, .iop_pushbuf = NULL, .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_efd_item_committing --- fs/xfs/xfs_inode_item.c_1.136 2008-07-03 15:37:18.000000000 +1000 +++ fs/xfs/xfs_inode_item.c 2008-07-03 14:39:33.000000000 +1000 @@ -849,11 +849,12 @@ xfs_inode_item_pushbuf( * inode log item out to disk. The inode will already have been locked by * a successful call to xfs_inode_item_trylock(). */ -STATIC void +STATIC int xfs_inode_item_push( xfs_inode_log_item_t *iip) { xfs_inode_t *ip; + int error; ip = iip->ili_inode; @@ -875,10 +876,10 @@ xfs_inode_item_push( * Write out the inode. The completion routine ('iflush_done') will * pull it from the AIL, mark it clean, unlock the flush lock. */ - (void) xfs_iflush(ip, XFS_IFLUSH_ASYNC); + error = xfs_iflush(ip, XFS_IFLUSH_ASYNC_NOBLOCK); xfs_iunlock(ip, XFS_ILOCK_SHARED); - return; + return error; } /* @@ -910,7 +911,7 @@ static struct xfs_item_ops xfs_inode_ite .iop_unlock = (void(*)(xfs_log_item_t*))xfs_inode_item_unlock, .iop_committed = (xfs_lsn_t(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_inode_item_committed, - .iop_push = (void(*)(xfs_log_item_t*))xfs_inode_item_push, + .iop_push = (int(*)(xfs_log_item_t*))xfs_inode_item_push, .iop_pushbuf = (void(*)(xfs_log_item_t*))xfs_inode_item_pushbuf, .iop_committing = (void(*)(xfs_log_item_t*, xfs_lsn_t)) xfs_inode_item_committing --- fs/xfs/xfs_trans.h_1.149 2008-07-03 15:37:19.000000000 +1000 +++ fs/xfs/xfs_trans.h 2008-07-03 14:33:58.000000000 +1000 @@ -140,7 +140,7 @@ typedef struct xfs_item_ops { uint (*iop_trylock)(xfs_log_item_t *); void (*iop_unlock)(xfs_log_item_t *); xfs_lsn_t (*iop_committed)(xfs_log_item_t *, xfs_lsn_t); - void (*iop_push)(xfs_log_item_t *); + int (*iop_push)(xfs_log_item_t *); void (*iop_pushbuf)(xfs_log_item_t *); void (*iop_committing)(xfs_log_item_t *, xfs_lsn_t); } xfs_item_ops_t; --- fs/xfs/xfs_trans_ail.c_1.87 2008-07-03 15:37:21.000000000 +1000 +++ fs/xfs/xfs_trans_ail.c 2008-07-03 14:40:29.000000000 +1000 @@ -188,7 +188,8 @@ xfsaild_push( switch (lock_result) { case XFS_ITEM_SUCCESS: XFS_STATS_INC(xs_push_ail_success); - IOP_PUSH(lip); + if (IOP_PUSH(lip)) + stuck++; last_pushed_lsn = lsn; break; From owner-xfs@oss.sgi.com Mon Jul 21 23:33:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 21 Jul 2008 23:33:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M6Xa7f029244 for ; Mon, 21 Jul 2008 23:33:36 -0700 X-ASG-Debug-ID: 1216708484-51ff01da0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from postoffice2.aconex.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F405419166F0 for ; Mon, 21 Jul 2008 23:34:44 -0700 (PDT) Received: from postoffice2.aconex.com (prod.aconex.com [203.89.192.138]) by cuda.sgi.com with ESMTP id 7huxYvGxZq8WlqyV for ; Mon, 21 Jul 2008 23:34:44 -0700 (PDT) Received: from postoffice.aconex.com (localhost [127.0.0.1]) by postoffice2.aconex.com (Spam Firewall) with ESMTP id 0743D3E1572; Tue, 22 Jul 2008 16:34:40 +1000 (EST) Received: from postoffice.aconex.com (postoffice.yarra.acx [192.168.3.1]) by postoffice2.aconex.com with ESMTP id DtKI21luz6He5pPT; Tue, 22 Jul 2008 16:34:40 +1000 (EST) Received: from [192.168.5.24] (unknown [203.89.192.141]) by postoffice.aconex.com (Postfix) with ESMTP id EC27A92C34B; Tue, 22 Jul 2008 16:34:40 +1000 (EST) X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? From: Nathan Scott To: Timothy Shimmin Cc: Richard Hartmann , Bill Kendall , xfs@oss.sgi.com In-Reply-To: <48855B16.4050208@sgi.com> References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> Content-Type: text/plain; charset=utf-8 Date: Tue, 22 Jul 2008 16:33:17 +1000 Message-Id: <1216708397.4499.57.camel@verge.scott.net.au> Mime-Version: 1.0 X-Mailer: Evolution 2.22.2 Content-Transfer-Encoding: 8bit X-Barracuda-Connect: prod.aconex.com[203.89.192.138] X-Barracuda-Start-Time: 1216708485 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56739 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17008 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nscott@aconex.com Precedence: bulk X-list: xfs On Tue, 2008-07-22 at 13:59 +1000, Timothy Shimmin wrote: > Richard Hartmann wrote: > > On Mon, Jul 21, 2008 at 22:33, Bill Kendall xfsrestore: unable to construct a file system handle for /mnt/sda3: > > Das Argument ist ung�ltig > > xfsrestore: Restore Status: ERROR "unable to construct a file system handle" - theres only one place in the restore code that can come from - the path_to_fshandle call. Is there a 32 bit userspace and 64 bit kernel on the machine where xfsrestore is running? Its not clear to me what that code in xfsrestore is trying to do, you may be able to just comment it out...?!? cheers. -- Nathan From owner-xfs@oss.sgi.com Tue Jul 22 00:03:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 00:03:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_34, J_CHICKENPOX_44,J_CHICKENPOX_46,J_CHICKENPOX_47,J_CHICKENPOX_48, J_CHICKENPOX_66 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M73LOs001393 for ; Tue, 22 Jul 2008 00:03:23 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA08465; Tue, 22 Jul 2008 17:04:22 +1000 Message-ID: <48858676.3030105@sgi.com> Date: Tue, 22 Jul 2008 17:04:22 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Nathan Scott CC: Richard Hartmann , Bill Kendall , xfs@oss.sgi.com Subject: Re: xfsrestore over ssh? References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> In-Reply-To: <1216708397.4499.57.camel@verge.scott.net.au> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17009 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Nathan Scott wrote: > On Tue, 2008-07-22 at 13:59 +1000, Timothy Shimmin wrote: >> Richard Hartmann wrote: >>> On Mon, Jul 21, 2008 at 22:33, Bill Kendall > xfsrestore: unable to construct a file system handle for /mnt/sda3: >>> Das Argument ist ung�ltig >>> xfsrestore: Restore Status: ERROR > > "unable to construct a file system handle" - theres only one place > in the restore code that can come from - the path_to_fshandle call. > Is there a 32 bit userspace and 64 bit kernel on the machine where > xfsrestore is running? > > Its not clear to me what that code in xfsrestore is trying to do, > you may be able to just comment it out...?!? > > cheers. > > -- > Nathan > Oh yeah from this code: > /* effectively initialize libhandle on this filesystem by > * allocating a file system handle. this needs to be done > * before any open_by_handle() calls (and possibly other > * libhandle calls). > */ > if ( persp->a.dstdirisxfspr ) { > void *fshanp; > size_t fshlen=0; > > if(path_to_fshandle(persp->a.dstdir, &fshanp, &fshlen)) { > mlog( MLOG_NORMAL, > _("unable to construct a file " > "system handle for %s: %s\n"), > persp->a.dstdir, > strerror( errno )); IIRC, I think it wants an fd to use for the filesystem in handle ioctl calls. It caches it against the fsid in the handle. I don't think commenting out will work as it will stop the handle calls from working. If you could strace it then we could see what call was failing in path_to_fshandle(). path_to_fshandle... > fd = open(path, O_RDONLY); > if (fd < 0) > return -1; > > obj.path = path; > result = obj_to_handle(path, fd, XFS_IOC_PATH_TO_FSHANDLE, > obj, fshanp, fshlen); > if (result < 0) { > close(fd); > return result; So I guess either open failed or obj_to_handle failed. obj_to_handle... > hreq.path = obj.path; > } > > hreq.oflags = O_LARGEFILE; > hreq.ihandle = NULL; > hreq.ihandlen = 0; > hreq.ohandle = hbuf; > hreq.ohandlen = &handlen; > > ret = xfsctl(fspath, fsfd, opcode, &hreq); > if (ret) > return ret; --Tim From owner-xfs@oss.sgi.com Tue Jul 22 00:26:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 00:26:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M7QOx3007533 for ; Tue, 22 Jul 2008 00:26:25 -0700 X-ASG-Debug-ID: 1216711654-426603640000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F311BE7D9F4 for ; Tue, 22 Jul 2008 00:27:34 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id YdifiBg6DGcixZq8 for ; Tue, 22 Jul 2008 00:27:34 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLCHV-0004OF-Vd; Tue, 22 Jul 2008 07:27:34 +0000 Date: Tue, 22 Jul 2008 03:27:33 -0400 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080722072733.GA15376@infradead.org> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080722053019.GI6761@disturbed> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216711654 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.86 X-Barracuda-Spam-Status: No, SCORE=0.86 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=RATWARE_EFROM X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56741 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 2.88 RATWARE_EFROM Bulk email fingerprint (envfrom) found X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17010 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 03:30:19PM +1000, Dave Chinner wrote: > Until the method we'll use for referencing VFS inodes in core XFS > code is clear, I'd rather leave it consistent with the rest of the code. I would expect your cleanups in this area to go in before this patch, or not? > As it is, I expect that this code will be revisited several times as > new functionality is added (e.g. combining the VFS and XFS inodes) > because that will change the way we interface with VFS and XFS inodes. > Much of this vnode specific code will change at that time; I'd > rather just change it once when the time is appropriate than have > to change it multiple times.... Well, it's not vnode specific code. bhv_vnode_t is just a typedef for struct inode and the various functions dealing with it are trivial wrapper, many of them in fact expanding to no code at all. But maybe killing this syntactic sugar should be a separate patch. I only fear we'll never get it in with the current review and commit latencies for XFS :( > > This needs a big comment on why you're using the gang lookup for > > a single lookup. I guess that's because the gang lookup skips to > > the next actually existing entry instead of returning NULL, but that's > > not really obvious to the reader. > > Fair enough. This was later in the original series where this was > a dirty tag lookup and didn't need commenting ;) Actually even then a comment describing why we want a gang lookup when just looking up a single element might be a good idea. On the other hand I wonder whether we might actually want to use the gang lookups, the unconditional igrab is probably cheaper than lots of radix tree lookups. From owner-xfs@oss.sgi.com Tue Jul 22 00:27:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 00:27:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.9 required=5.0 tests=AWL,BAYES_50, MIME_BOUND_MANY_HEX,MIME_QP_LONG_LINE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M7RJac007776 for ; Tue, 22 Jul 2008 00:27:19 -0700 X-ASG-Debug-ID: 1216711654-6a7c00e00001-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from gmail1694.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with SMTP id 349B43121DC for ; Tue, 22 Jul 2008 00:28:14 -0700 (PDT) Received: from gmail1694.com (tselnode-152.telkomsel.co.id [221.132.200.152]) by cuda.sgi.com with SMTP id 39UDVljMw4y5t56y for ; Tue, 22 Jul 2008 00:28:14 -0700 (PDT) From: "www.bungapapan.net" To: linux-xfs@oss.sgi.com Reply-To: bungapapan@gmail.com X-ASG-Orig-Subj: INTRODUCTION : 'Sakura Florist" = Creating and Delivering of Stick Werk (Bunga Papan) for JAKARTA - INDONESIA Subject: INTRODUCTION : 'Sakura Florist" = Creating and Delivering of Stick Werk (Bunga Papan) for JAKARTA - INDONESIA Date: Tue, 22 Jul 2008 14:28:25 +0700 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="91a36b1e-7517-4070-aace-c388e2da335c" X-Barracuda-Connect: tselnode-152.telkomsel.co.id[221.132.200.152] X-Barracuda-Start-Time: 1216711709 Message-Id: <20080722072814.349B43121DC@cuda.sgi.com> X-Barracuda-Bayes: INNOCENT GLOBAL 0.3881 1.0000 -0.0317 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.67 X-Barracuda-Spam-Status: No, SCORE=0.67 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MIME_BOUND_MANY_HEX, MSGID_FROM_MTA_ID X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56741 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 MIME_BOUND_MANY_HEX Spam tool pattern in MIME boundary 0.70 MSGID_FROM_MTA_ID Message-Id for external message added locally X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17011 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bungapapan@gmail.com Precedence: bulk X-list: xfs This is a multi-part message in MIME format --91a36b1e-7517-4070-aace-c388e2da335c Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Hello, We are small-medium enterprise provide service for creating and delivering = of Stick Werk (Bunga Papan) that usually is for giving utterance to familie= s, colleagues, friends, etc. Service and delivery for Jakarta city - INDONESIA. WE ACCEPT ORDER FROM OUTSIDE JAKARTA. Here Events that're usually using our service: o weddings o condolences o enterprises ceremony o birthday parties, etc Thank you, +6221 93606390 +62818745955 http://www.bungapapan.net/ email : bungapapan@gmail.com messenger : bungapapan@hotmail.com =20=20 --91a36b1e-7517-4070-aace-c388e2da335c-- From owner-xfs@oss.sgi.com Tue Jul 22 00:57:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 00:57:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6M7vAbQ009604 for ; Tue, 22 Jul 2008 00:57:11 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA09478; Tue, 22 Jul 2008 17:58:14 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 0D78358C4C3F; Tue, 22 Jul 2008 17:58:13 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 984429 - Do not access buffers after dropping reference count Message-Id: <20080722075814.0D78358C4C3F@chook.melbourne.sgi.com> Date: Tue, 22 Jul 2008 17:58:13 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17012 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Do not access buffers after dropping reference count We should not access a buffer after dropping it's reference count otherwise we could race with another thread that releases the final reference count and frees the buffer causing us to access potentially unmapped memory. The bug this change fixes only occured on DEBUG XFS since the offending code was in an ASSERT. Date: Tue Jul 22 17:57:07 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-tot Inspected by: david@fromorbit.com Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31715a fs/xfs/linux-2.6/xfs_buf.c - 1.258 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_buf.c.diff?r1=text&tr1=1.258&r2=text&tr2=1.257&f=h - Do not access buffers after dropping reference count From owner-xfs@oss.sgi.com Tue Jul 22 01:49:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 01:49:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M8n72M014956 for ; Tue, 22 Jul 2008 01:49:08 -0700 X-ASG-Debug-ID: 1216716616-28a900ec0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4D8441918579 for ; Tue, 22 Jul 2008 01:50:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 0oa2rAfYfLk67e9U for ; Tue, 22 Jul 2008 01:50:16 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6M8o7Ng000705 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 22 Jul 2008 10:50:07 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6M8o7i1000703 for xfs@oss.sgi.com; Tue, 22 Jul 2008 10:50:07 +0200 Date: Tue, 22 Jul 2008 10:50:07 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] fix XFSQA 096 for recent xfsprogs Subject: [PATCH] fix XFSQA 096 for recent xfsprogs Message-ID: <20080722085007.GA32499@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216716617 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56747 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17013 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs With recent xfsprogs xfs_info is aware of the case insensitive support and displays ascii-ci=[01] in the naming section. Update testcase 096 to strip away this information in the big sed expression. Signed-off-by: Christoph Hellwig Index: xfstests/096 =================================================================== RCS file: /cvs/xfs-cmds/xfstests/096,v retrieving revision 1.13 diff -u -p -r1.13 096 --- xfstests/096 30 Nov 2007 03:07:14 -0000 1.13 +++ xfstests/096 22 Jul 2008 08:34:53 -0000 @@ -64,6 +64,7 @@ _mkfs_filter() -e '/ *= *sectsz=[0-9][0-9]* *attr=[0-9][0-9]*$/d' \ -e '/ *= *mmr=[0-9][0-9]* *$/d' \ -e 's/ *mixed-case=[YN]//' \ + -e 's/ *ascii-ci=[01]//' \ -e 's/sectsz=[0-9][0-9]* *//' \ -e 's/, lazy-count.*//' \ -e '/inode-paths/d' \ From owner-xfs@oss.sgi.com Tue Jul 22 02:35:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 02:35:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24, J_CHICKENPOX_53,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M9ZgnC018008 for ; Tue, 22 Jul 2008 02:35:42 -0700 X-ASG-Debug-ID: 1216719409-110203dc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F08D61918799 for ; Tue, 22 Jul 2008 02:36:49 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id pVRPzS6EHwHygsWW for ; Tue, 22 Jul 2008 02:36:49 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54A.nec.co.jp [10.7.69.193]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9aYmP012168; Tue, 22 Jul 2008 18:36:34 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m6M9aYQ00031; Tue, 22 Jul 2008 18:36:34 +0900 (JST) Received: from shoin.jp.nec.com (shoin.jp.nec.com [10.26.220.3]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9aXNn014552; Tue, 22 Jul 2008 18:36:33 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Tue, 22 Jul 2008 18:36:30 +0900 To: "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , Andrew Morton , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" Cc: "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 3/3] Add timeout feature Subject: [PATCH 3/3] Add timeout feature Message-Id: <20080722183630t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Tue, 22 Jul 2008 18:36:30 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1216719410 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56749 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17014 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs The timeout feature is added to freeze ioctl. And new ioctl to reset the timeout period is added. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, long *timeout_sec) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze timeout_sec: the timeout period in seconds If it's 0 or 1, the timeout isn't set. This special case of "1" is implemented to keep the compatibility with XFS applications. Return value: 0 if the operation succeeds. Otherwise, -1 o Reset the timeout period int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec) fd:file descriptor of mountpoint FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period timeout_sec: new timeout period in seconds Return value: 0 if the operation succeeds. Otherwise, -1 Error number: If the filesystem has already been unfrozen, errno is set to EINVAL. Signed-off-by: Takashi Sato Signed-off-by: Masayuki Hamaguchi --- drivers/md/dm.c | 2 - fs/block_dev.c | 2 + fs/buffer.c | 16 +++++++-- fs/ioctl.c | 77 ++++++++++++++++++++++++++++++++++++++++++-- fs/super.c | 57 ++++++++++++++++++++++++++++++++ fs/xfs/xfs_fsops.c | 2 - include/linux/buffer_head.h | 3 + include/linux/fs.h | 10 +++++ 8 files changed, 160 insertions(+), 9 deletions(-) diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/drivers/md/dm.c linux-2.6.26-timeout/drivers/md/d m.c --- linux-2.6.26-xfs/drivers/md/dm.c 2008-07-17 11:33:03.000000000 +0900 +++ linux-2.6.26-timeout/drivers/md/dm.c 2008-07-17 11:36:00.000000000 +0900 @@ -1407,7 +1407,7 @@ static int lock_fs(struct mapped_device WARN_ON(md->frozen_sb); - md->frozen_sb = freeze_bdev(md->suspended_bdev); + md->frozen_sb = freeze_bdev(md->suspended_bdev, 0); if (IS_ERR(md->frozen_sb)) { r = PTR_ERR(md->frozen_sb); md->frozen_sb = NULL; diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/block_dev.c linux-2.6.26-timeout/fs/block_dev. c --- linux-2.6.26-xfs/fs/block_dev.c 2008-07-18 15:53:51.000000000 +0900 +++ linux-2.6.26-timeout/fs/block_dev.c 2008-07-18 17:12:22.000000000 +0900 @@ -287,6 +287,8 @@ static void init_once(struct kmem_cache inode_init_once(&ei->vfs_inode); /* Initialize semaphore for freeze. */ sema_init(&bdev->bd_freeze_sem, 1); + /* Setup freeze timeout function. */ + INIT_DELAYED_WORK(&bdev->bd_freeze_timeout, freeze_timeout); } static inline void __bd_forget(struct inode *inode) diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/buffer.c linux-2.6.26-timeout/fs/buffer.c --- linux-2.6.26-xfs/fs/buffer.c 2008-07-18 15:53:51.000000000 +0900 +++ linux-2.6.26-timeout/fs/buffer.c 2008-07-18 17:17:50.000000000 +0900 @@ -190,14 +190,18 @@ int fsync_bdev(struct block_device *bdev /** * freeze_bdev -- lock a filesystem and force it into a consistent state - * @bdev: blockdevice to lock + * @bdev: blockdevice to lock + * @timeout_msec: timeout period * * This takes the block device bd_mount_sem to make sure no new mounts * happen on bdev until thaw_bdev() is called. * If a superblock is found on this device, we take the s_umount semaphore * on it to make sure nobody unmounts until the snapshot creation is done. + * If timeout_msec is bigger than 0, this registers the delayed work for + * timeout of the freeze feature. */ -struct super_block *freeze_bdev(struct block_device *bdev) +struct super_block *freeze_bdev(struct block_device *bdev, + unsigned int timeout_msec) { struct super_block *sb; @@ -228,8 +232,11 @@ struct super_block *freeze_bdev(struct b } sync_blockdev(bdev); - up(&bdev->bd_freeze_sem); + /* Setup unfreeze timer. */ + if (timeout_msec > 0) + add_freeze_timeout(bdev, timeout_msec); + up(&bdev->bd_freeze_sem); return sb; /* thaw_bdev releases s->s_umount and bd_mount_sem */ } EXPORT_SYMBOL(freeze_bdev); @@ -255,6 +262,9 @@ int thaw_bdev(struct block_device *bdev, return 0; } + /* Delete unfreeze timer. */ + del_freeze_timeout(bdev); + if (sb) { BUG_ON(sb->s_bdev != bdev); diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/ioctl.c linux-2.6.26-timeout/fs/ioctl.c --- linux-2.6.26-xfs/fs/ioctl.c 2008-07-18 21:57:20.000000000 +0900 +++ linux-2.6.26-timeout/fs/ioctl.c 2008-07-22 11:50:42.000000000 +0900 @@ -145,12 +145,16 @@ static int ioctl_fioasync(unsigned int f * ioctl_freeze - Freeze the filesystem. * * @filp: target file + * @argp: timeout value(sec) * * Call freeze_bdev() to freeze the filesystem. */ -static int ioctl_freeze(struct file *filp) +static int ioctl_freeze(struct file *filp, int __user *argp) { + int timeout_sec; + unsigned int timeout_msec; struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + int error; if (!capable(CAP_SYS_ADMIN)) return -EPERM; @@ -163,8 +167,25 @@ static int ioctl_freeze(struct file *fil if (sb->s_bdev == NULL) return -EINVAL; + /* arg(sec) to tick value. */ + error = get_user(timeout_sec, argp); + if (error != 0) + return error; + + if (timeout_sec < 0 || timeout_sec > UINT_MAX/1000) + return -EINVAL; + + /* + * If 1 is specified as the timeout period it is changed into 0 + * to retain compatibility with XFS's xfs_freeze. + */ + if (timeout_sec == 1) + timeout_sec = 0; + + timeout_msec = timeout_sec * 1000; + /* Freeze */ - sb = freeze_bdev(sb->s_bdev); + sb = freeze_bdev(sb->s_bdev, timeout_msec); if (IS_ERR(sb)) return PTR_ERR(sb); return 0; @@ -193,6 +214,52 @@ static int ioctl_thaw(struct file *filp) } /* + * ioctl_freeze_reset_timeout - Reset timeout for freeze. + * + * @filp: target file + * @argp: timeout value(sec) + * + * Reset timeout for freeze. + */ +static int +ioctl_freeze_reset_timeout(struct file *filp, int __user *argp) +{ + int timeout_sec; + unsigned int timeout_msec; + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + struct block_device *bdev = sb->s_bdev; + int error; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + /* If a regular file or a directory isn't specified, return EINVAL. */ + if (bdev == NULL) + return -EINVAL; + + /* arg(sec) to tick value */ + error = get_user(timeout_sec, argp); + if (error) + return error; + + if (timeout_sec <= 0 || timeout_sec > UINT_MAX/1000) + return -EINVAL; + + timeout_msec = timeout_sec * 1000; + + down(&bdev->bd_freeze_sem); + if (!bdev->bd_freeze_count) { + up(&bdev->bd_freeze_sem); + return -EINVAL; + } + /* setup unfreeze timer */ + add_freeze_timeout(bdev, timeout_msec); + up(&bdev->bd_freeze_sem); + + return 0; +} + +/* * When you add any new common ioctls to the switches above and below * please update compat_sys_ioctl() too. * @@ -235,13 +302,17 @@ int do_vfs_ioctl(struct file *filp, unsi break; case FIFREEZE: - error = ioctl_freeze(filp); + error = ioctl_freeze(filp, argp); break; case FITHAW: error = ioctl_thaw(filp); break; + case FIFREEZE_RESET_TIMEOUT: + error = ioctl_freeze_reset_timeout(filp, argp); + break; + default: if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) error = file_ioctl(filp, cmd, arg); diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/super.c linux-2.6.26-timeout/fs/super.c --- linux-2.6.26-xfs/fs/super.c 2008-07-17 11:33:13.000000000 +0900 +++ linux-2.6.26-timeout/fs/super.c 2008-07-17 11:36:00.000000000 +0900 @@ -980,3 +980,60 @@ struct vfsmount *kern_mount_data(struct } EXPORT_SYMBOL_GPL(kern_mount_data); + +/* + * freeze_timeout - Thaw the filesystem. + * + * @work: work queue (delayed_work.work) + * + * Called by the delayed work when elapsing the timeout period. + * Thaw the filesystem. + */ +void freeze_timeout(struct work_struct *work) +{ + struct block_device *bd = container_of(work, + struct block_device, bd_freeze_timeout.work); + struct super_block *sb = get_super(bd); + + thaw_bdev(bd, sb); + + if (sb) + drop_super(sb); +} +EXPORT_SYMBOL_GPL(freeze_timeout); + +/* + * add_freeze_timeout - Add timeout for freeze. + * + * @bdev: block device struct + * @timeout_msec: timeout period + * + * Add the delayed work for freeze timeout to the delayed work queue. + */ +void add_freeze_timeout(struct block_device *bdev, unsigned int timeout_msec) +{ + s64 timeout_jiffies = msecs_to_jiffies(timeout_msec); + + /* Set delayed work queue */ + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); + schedule_delayed_work(&bdev->bd_freeze_timeout, timeout_jiffies); +} + +/* + * del_freeze_timeout - Delete timeout for freeze. + * + * @bdev: block device struct + * + * Delete the delayed work for freeze timeout from the delayed work queue. + */ +void del_freeze_timeout(struct block_device *bdev) +{ + /* + * It's possible that the delayed work task (freeze_timeout()) calls + * del_freeze_timeout(). If the delayed work task calls + * cancel_delayed_work_sync((), the deadlock will occur. + * So we need this check (delayed_work_pending()). + */ + if (delayed_work_pending(&bdev->bd_freeze_timeout)) + cancel_delayed_work_sync(&bdev->bd_freeze_timeout); +} diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/fs/xfs/xfs_fsops.c linux-2.6.26-timeout/fs/xfs/xf s_fsops.c --- linux-2.6.26-xfs/fs/xfs/xfs_fsops.c 2008-07-17 11:33:13.000000000 +0900 +++ linux-2.6.26-timeout/fs/xfs/xfs_fsops.c 2008-07-17 11:36:00.000000000 +0900 @@ -619,7 +619,7 @@ xfs_fs_goingdown( { switch (inflags) { case XFS_FSOP_GOING_FLAGS_DEFAULT: { - struct super_block *sb = freeze_bdev(mp->m_super->s_bdev); + struct super_block *sb = freeze_bdev(mp->m_super->s_bdev, 0); if (sb && !IS_ERR(sb)) { xfs_force_shutdown(mp, SHUTDOWN_FORCE_UMOUNT); diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/include/linux/buffer_head.h linux-2.6.26-timeout/ include/linux/buffer_head.h --- linux-2.6.26-xfs/include/linux/buffer_head.h 2008-07-17 11:33:14.000000000 +0900 +++ linux-2.6.26-timeout/include/linux/buffer_head.h 2008-07-17 11:36:00.000000000 +0900 @@ -170,7 +170,8 @@ int sync_blockdev(struct block_device *b void __wait_on_buffer(struct buffer_head *); wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); int fsync_bdev(struct block_device *); -struct super_block *freeze_bdev(struct block_device *); +struct super_block *freeze_bdev(struct block_device *, + unsigned int timeout_msec); int thaw_bdev(struct block_device *, struct super_block *); int fsync_super(struct super_block *); int fsync_no_super(struct block_device *); diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-xfs/include/linux/fs.h linux-2.6.26-timeout/include/l inux/fs.h --- linux-2.6.26-xfs/include/linux/fs.h 2008-07-18 15:53:51.000000000 +0900 +++ linux-2.6.26-timeout/include/linux/fs.h 2008-07-18 21:51:41.000000000 +0900 @@ -8,6 +8,7 @@ #include #include +#include /* * It's silly to have NR_OPEN bigger than NR_FILE, but you can change @@ -226,6 +227,7 @@ extern int dir_notify_enable; #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ #define FIFREEZE _IOWR('X', 119, int) /* Freeze */ #define FITHAW _IOWR('X', 120, int) /* Thaw */ +#define FIFREEZE_RESET_TIMEOUT _IO(0x00, 3) /* Reset freeze timeout */ #define FS_IOC_GETFLAGS _IOR('f', 1, long) #define FS_IOC_SETFLAGS _IOW('f', 2, long) @@ -550,10 +552,13 @@ struct block_device { * care to not mess up bd_private for that case. */ unsigned long bd_private; + /* The counter of freeze processes */ int bd_freeze_count; /* Semaphore for freeze */ struct semaphore bd_freeze_sem; + /* Delayed work for freeze */ + struct delayed_work bd_freeze_timeout; }; /* @@ -2140,5 +2145,10 @@ int proc_nr_files(struct ctl_table *tabl int get_filesystem_list(char * buf); +extern void add_freeze_timeout(struct block_device *bdev, + unsigned int timeout_msec); +extern void del_freeze_timeout(struct block_device *bdev); +extern void freeze_timeout(struct work_struct *work); + #endif /* __KERNEL__ */ #endif /* _LINUX_FS_H */ From owner-xfs@oss.sgi.com Tue Jul 22 02:37:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 02:37:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M9b8n7018627 for ; Tue, 22 Jul 2008 02:37:08 -0700 X-ASG-Debug-ID: 1216719496-149d03870000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo201.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EA03D19187EB for ; Tue, 22 Jul 2008 02:38:17 -0700 (PDT) Received: from tyo201.gate.nec.co.jp (TYO201.gate.nec.co.jp [202.32.8.193]) by cuda.sgi.com with ESMTP id m2VM8PyoLdEH6M2f for ; Tue, 22 Jul 2008 02:38:17 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53E.nec.co.jp [10.7.69.161]) by tyo201.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9c7CQ013997; Tue, 22 Jul 2008 18:38:07 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m6M9c7s02644; Tue, 22 Jul 2008 18:38:07 +0900 (JST) Received: from kaishu.jp.nec.com (kaishu.jp.nec.com [10.26.220.5]) by mailsv4.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9c61H015822; Tue, 22 Jul 2008 18:38:06 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Tue, 22 Jul 2008 18:38:06 +0900 To: "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , Andrew Morton , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" Cc: "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 2/3] Remove XFS specific ioctl interfaces for freeze feature Subject: [PATCH 2/3] Remove XFS specific ioctl interfaces for freeze feature Message-Id: <20080722183805t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Tue, 22 Jul 2008 18:38:05 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO201.gate.nec.co.jp[202.32.8.193] X-Barracuda-Start-Time: 1216719497 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56749 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17017 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs It removes XFS specific ioctl interfaces and request codes for freeze feature. This patch has been supplied by David Chinner. Signed-off-by: Dave Chinner Signed-off-by: Takashi Sato --- linux-2.6/xfs_ioctl.c | 15 --------------- linux-2.6/xfs_ioctl32.c | 2 -- xfs_fs.h | 4 ++-- 3 files changed, 2 insertions(+), 19 deletions(-) diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-freeze/fs/xfs/linux-2.6/xfs_ioctl.c linux-2.6.26-xfs/ fs/xfs/linux-2.6/xfs_ioctl.c --- linux-2.6.26-freeze/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-17 11:29:29.000000000 +0900 +++ linux-2.6.26-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-17 11:34:20.000000000 +0900 @@ -1233,21 +1233,6 @@ xfs_ioctl( return -error; } - case XFS_IOC_FREEZE: - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - - if (inode->i_sb->s_frozen == SB_UNFROZEN) - freeze_bdev(inode->i_sb->s_bdev); - return 0; - - case XFS_IOC_THAW: - if (!capable(CAP_SYS_ADMIN)) - return -EPERM; - if (inode->i_sb->s_frozen != SB_UNFROZEN) - thaw_bdev(inode->i_sb->s_bdev, inode->i_sb); - return 0; - case XFS_IOC_GOINGDOWN: { __uint32_t in; diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-freeze/fs/xfs/linux-2.6/xfs_ioctl32.c linux-2.6.26-xf s/fs/xfs/linux-2.6/xfs_ioctl32.c --- linux-2.6.26-freeze/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-07-17 11:29:29.000000000 +0900 +++ linux-2.6.26-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-07-17 11:34:20.000000000 +0900 @@ -398,8 +398,6 @@ xfs_compat_ioctl( case XFS_IOC_FSGROWFSDATA: case XFS_IOC_FSGROWFSLOG: case XFS_IOC_FSGROWFSRT: - case XFS_IOC_FREEZE: - case XFS_IOC_THAW: case XFS_IOC_GOINGDOWN: case XFS_IOC_ERROR_INJECTION: case XFS_IOC_ERROR_CLEARALL: diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26-freeze/fs/xfs/xfs_fs.h linux-2.6.26-xfs/fs/xfs/xfs_fs .h --- linux-2.6.26-freeze/fs/xfs/xfs_fs.h 2008-07-17 11:29:29.000000000 +0900 +++ linux-2.6.26-xfs/fs/xfs/xfs_fs.h 2008-07-17 11:34:20.000000000 +0900 @@ -473,8 +473,8 @@ typedef struct xfs_handle { #define XFS_IOC_ERROR_INJECTION _IOW ('X', 116, struct xfs_error_injection) #define XFS_IOC_ERROR_CLEARALL _IOW ('X', 117, struct xfs_error_injection) /* XFS_IOC_ATTRCTL_BY_HANDLE -- deprecated 118 */ -#define XFS_IOC_FREEZE _IOWR('X', 119, int) -#define XFS_IOC_THAW _IOWR('X', 120, int) +/* XFS_IOC_FREEZE -- FIFREEZE 119 */ +/* XFS_IOC_THAW -- FITHAW 120 */ #define XFS_IOC_FSSETDM_BY_HANDLE _IOW ('X', 121, struct xfs_fsop_setdm_handlereq) #define XFS_IOC_ATTRLIST_BY_HANDLE _IOW ('X', 122, struct xfs_fsop_attrlist_handlereq) #define XFS_IOC_ATTRMULTI_BY_HANDLE _IOW ('X', 123, struct xfs_fsop_attrmulti_handlereq) From owner-xfs@oss.sgi.com Tue Jul 22 02:36:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 02:36:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_53 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M9ac0A018307 for ; Tue, 22 Jul 2008 02:36:39 -0700 X-ASG-Debug-ID: 1216719466-17a603c10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 69461E7DF6A for ; Tue, 22 Jul 2008 02:37:46 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id aAONXhBmDO9zziCN for ; Tue, 22 Jul 2008 02:37:46 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate54.nec.co.jp [10.7.69.197]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9bc2q013669; Tue, 22 Jul 2008 18:37:38 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m6M9bcl06991; Tue, 22 Jul 2008 18:37:38 +0900 (JST) Received: from togyo.jp.nec.com (togyo.jp.nec.com [10.26.220.4]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9bb2o000516; Tue, 22 Jul 2008 18:37:37 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Tue, 22 Jul 2008 18:37:34 +0900 To: "linux-ext4@vger.kernel.org" , "dm-devel@redhat.com" , "linux-fsdevel@vger.kernel.org" , Andrew Morton , "viro@ZenIV.linux.org.uk" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" Cc: "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 1/3] Implement generic freeze feature Subject: [PATCH 1/3] Implement generic freeze feature Message-Id: <20080722183734t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Tue, 22 Jul 2008 18:37:34 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1216719467 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56749 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17016 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs When multiple freeze requests arrive simultaneously, only the last unfreeze process should unfreeze the frozen filesystem actually (as Dave Chinner, Eric Sandeen and Alasdair G Kergon commented). So I've added the reference counter to the freeze feature. It counts up in freeze_bdev() and counts down in thaw_bdev(). When it becomes "0", thaw_bdev() will unfreeze actually. The ioctls for the generic freeze feature are below. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, arg) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 o Unfreeze the filesystem int ioctl(int fd, int FITHAW, arg) fd: The file descriptor of the mountpoint FITHAW: request code for unfreeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 Signed-off-by: Takashi Sato Signed-off-by: Masayuki Hamaguchi --- fs/block_dev.c | 2 + fs/buffer.c | 27 ++++++++++++++++++- fs/ioctl.c | 61 ++++++++++++++++++++++++++++++++++++++++++++ include/linux/buffer_head.h | 2 - include/linux/fs.h | 6 ++++ 5 files changed, 96 insertions(+), 2 deletions(-) diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26.org/fs/block_dev.c linux-2.6.26-freeze/fs/block_dev.c --- linux-2.6.26.org/fs/block_dev.c 2008-07-14 06:51:29.000000000 +0900 +++ linux-2.6.26-freeze/fs/block_dev.c 2008-07-18 15:38:03.000000000 +0900 @@ -285,6 +285,8 @@ static void init_once(struct kmem_cache INIT_LIST_HEAD(&bdev->bd_holder_list); #endif inode_init_once(&ei->vfs_inode); + /* Initialize semaphore for freeze. */ + sema_init(&bdev->bd_freeze_sem, 1); } static inline void __bd_forget(struct inode *inode) diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26.org/fs/buffer.c linux-2.6.26-freeze/fs/buffer.c --- linux-2.6.26.org/fs/buffer.c 2008-07-14 06:51:29.000000000 +0900 +++ linux-2.6.26-freeze/fs/buffer.c 2008-07-18 15:45:17.000000000 +0900 @@ -201,6 +201,15 @@ struct super_block *freeze_bdev(struct b { struct super_block *sb; + down(&bdev->bd_freeze_sem); + bdev->bd_freeze_count++; + if (bdev->bd_freeze_count > 1) { + sb = get_super(bdev); + drop_super(sb); + up(&bdev->bd_freeze_sem); + return sb; + } + down(&bdev->bd_mount_sem); sb = get_super(bdev); if (sb && !(sb->s_flags & MS_RDONLY)) { @@ -219,6 +228,8 @@ struct super_block *freeze_bdev(struct b } sync_blockdev(bdev); + up(&bdev->bd_freeze_sem); + return sb; /* thaw_bdev releases s->s_umount and bd_mount_sem */ } EXPORT_SYMBOL(freeze_bdev); @@ -230,8 +241,20 @@ EXPORT_SYMBOL(freeze_bdev); * * Unlocks the filesystem and marks it writeable again after freeze_bdev(). */ -void thaw_bdev(struct block_device *bdev, struct super_block *sb) +int thaw_bdev(struct block_device *bdev, struct super_block *sb) { + + down(&bdev->bd_freeze_sem); + if (!bdev->bd_freeze_count) { + up(&bdev->bd_freeze_sem); + return 0; + } + bdev->bd_freeze_count--; + if (bdev->bd_freeze_count > 0) { + up(&bdev->bd_freeze_sem); + return 0; + } + if (sb) { BUG_ON(sb->s_bdev != bdev); @@ -244,6 +267,8 @@ void thaw_bdev(struct block_device *bdev } up(&bdev->bd_mount_sem); + up(&bdev->bd_freeze_sem); + return 0; } EXPORT_SYMBOL(thaw_bdev); diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26.org/fs/ioctl.c linux-2.6.26-freeze/fs/ioctl.c --- linux-2.6.26.org/fs/ioctl.c 2008-07-14 06:51:29.000000000 +0900 +++ linux-2.6.26-freeze/fs/ioctl.c 2008-07-18 21:24:42.000000000 +0900 @@ -13,6 +13,7 @@ #include #include #include +#include #include @@ -141,6 +142,57 @@ static int ioctl_fioasync(unsigned int f } /* + * ioctl_freeze - Freeze the filesystem. + * + * @filp: target file + * + * Call freeze_bdev() to freeze the filesystem. + */ +static int ioctl_freeze(struct file *filp) +{ + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + /* If filesystem doesn't support freeze feature, return. */ + if (sb->s_op->write_super_lockfs == NULL) + return -EOPNOTSUPP; + + /* If a regular file or a directory isn't specified, return. */ + if (sb->s_bdev == NULL) + return -EINVAL; + + /* Freeze */ + sb = freeze_bdev(sb->s_bdev); + if (IS_ERR(sb)) + return PTR_ERR(sb); + return 0; +} + +/* + * ioctl_thaw - Thaw the filesystem. + * + * @filp: target file + * + * Call thaw_bdev() to thaw the filesystem. + */ +static int ioctl_thaw(struct file *filp) +{ + struct super_block *sb = filp->f_path.dentry->d_inode->i_sb; + + if (!capable(CAP_SYS_ADMIN)) + return -EPERM; + + /* If a regular file or a directory isn't specified, return EINVAL. */ + if (sb->s_bdev == NULL) + return -EINVAL; + + /* Thaw */ + return thaw_bdev(sb->s_bdev, sb); +} + +/* * When you add any new common ioctls to the switches above and below * please update compat_sys_ioctl() too. * @@ -181,6 +233,15 @@ int do_vfs_ioctl(struct file *filp, unsi } else error = -ENOTTY; break; + + case FIFREEZE: + error = ioctl_freeze(filp); + break; + + case FITHAW: + error = ioctl_thaw(filp); + break; + default: if (S_ISREG(filp->f_path.dentry->d_inode->i_mode)) error = file_ioctl(filp, cmd, arg); diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26.org/include/linux/buffer_head.h linux-2.6.26-freeze/i nclude/linux/buffer_head.h --- linux-2.6.26.org/include/linux/buffer_head.h 2008-07-14 06:51:29.000000000 +0900 +++ linux-2.6.26-freeze/include/linux/buffer_head.h 2008-07-17 11:32:37.000000000 +0900 @@ -171,7 +171,7 @@ void __wait_on_buffer(struct buffer_head wait_queue_head_t *bh_waitq_head(struct buffer_head *bh); int fsync_bdev(struct block_device *); struct super_block *freeze_bdev(struct block_device *); -void thaw_bdev(struct block_device *, struct super_block *); +int thaw_bdev(struct block_device *, struct super_block *); int fsync_super(struct super_block *); int fsync_no_super(struct block_device *); struct buffer_head *__find_get_block(struct block_device *bdev, sector_t block, diff -uprN -X linux-2.6.26.org/Documentation/dontdiff linux-2.6.26.org/include/linux/fs.h linux-2.6.26-freeze/include/li nux/fs.h --- linux-2.6.26.org/include/linux/fs.h 2008-07-14 06:51:29.000000000 +0900 +++ linux-2.6.26-freeze/include/linux/fs.h 2008-07-18 15:34:46.000000000 +0900 @@ -224,6 +224,8 @@ extern int dir_notify_enable; #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ #define FIBMAP _IO(0x00,1) /* bmap access */ #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ +#define FIFREEZE _IOWR('X', 119, int) /* Freeze */ +#define FITHAW _IOWR('X', 120, int) /* Thaw */ #define FS_IOC_GETFLAGS _IOR('f', 1, long) #define FS_IOC_SETFLAGS _IOW('f', 2, long) @@ -548,6 +550,10 @@ struct block_device { * care to not mess up bd_private for that case. */ unsigned long bd_private; + /* The counter of freeze processes */ + int bd_freeze_count; + /* Semaphore for freeze */ + struct semaphore bd_freeze_sem; }; /* From owner-xfs@oss.sgi.com Tue Jul 22 02:36:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 02:36:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_24, J_CHICKENPOX_53 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6M9a3Om018066 for ; Tue, 22 Jul 2008 02:36:03 -0700 X-ASG-Debug-ID: 1216719431-18d003970000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from tyo202.gate.nec.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E448CE7DF63 for ; Tue, 22 Jul 2008 02:37:12 -0700 (PDT) Received: from tyo202.gate.nec.co.jp (TYO202.gate.nec.co.jp [202.32.8.206]) by cuda.sgi.com with ESMTP id HBBKWBkVEb1iCQzQ for ; Tue, 22 Jul 2008 02:37:12 -0700 (PDT) Received: from mailgate3.nec.co.jp (mailgate53.nec.co.jp [10.7.69.161]) by tyo202.gate.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9b1LS013179; Tue, 22 Jul 2008 18:37:01 +0900 (JST) Received: (from root@localhost) by mailgate3.nec.co.jp (8.11.7/3.7W-MAILGATE-NEC) id m6M9b1001030; Tue, 22 Jul 2008 18:37:01 +0900 (JST) Received: from shoin.jp.nec.com (shoin.jp.nec.com [10.26.220.3]) by mailsv3.nec.co.jp (8.13.8/8.13.4) with ESMTP id m6M9b0RP000070; Tue, 22 Jul 2008 18:37:00 +0900 (JST) Received: from TNESB07336 ([10.64.168.65] [10.64.168.65]) by mail.jp.nec.com with ESMTP; Tue, 22 Jul 2008 18:36:59 +0900 To: "linux-fsdevel@vger.kernel.org" , "dm-devel@redhat.com" , Andrew Morton , "viro@ZenIV.linux.org.uk" , "linux-ext4@vger.kernel.org" , "xfs@oss.sgi.com" , Christoph Hellwig , "axboe@kernel.dk" , "mtk.manpages@googlemail.com" Cc: "linux-kernel@vger.kernel.org" X-ASG-Orig-Subj: [PATCH 0/3] freeze feature ver 1.9 Subject: [PATCH 0/3] freeze feature ver 1.9 Message-Id: <20080722183659t-sato@mail.jp.nec.com> Mime-Version: 1.0 X-Mailer: WeMail32[2.51] ID:1K0086 From: Takashi Sato Date: Tue, 22 Jul 2008 18:36:59 +0900 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Barracuda-Connect: TYO202.gate.nec.co.jp[202.32.8.206] X-Barracuda-Start-Time: 1216719432 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56749 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17015 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: t-sato@yk.jp.nec.com Precedence: bulk X-list: xfs Hi, When multiple freeze requests arrive simultaneously, only the last unfreeze process should unfreeze the frozen filesystem actually (as Dave Chinner, Eric Sandeen and Alasdair G Kergon commented). So I've added the reference counter to the freeze feature. It counts up in freeze_bdev() and counts down in thaw_bdev(). When it becomes "0", thaw_bdev() will unfreeze actually. The following regular cases have worked correctly. A) 1. dmsetup suspend 2. FIFREEZE 3. FITHAW 4. dmsetup resume B) 1. FIFREEZE 2. dmsetup suspend 3. dmsetup resume 4. FITHAW But in the following case, the last FITHAW has been frozen for writing the super block because device-mapper layer is still frozen. It's a irregular case (app's bug) and the next "dmsetup resume" can solve it. So I don't think it is a problem. C) 1. dmsetup suspend 2. FIFREEZE 3. FITHAW 4. FITHAW<- The thaw process was frozen. In my previous mail, I have mentioned considering removing the timeout feature. But I leave it in my patch-set because we need it for the case someone dirties so much data that the freeze process is swapped out (as some people said). Currently, ext3 in mainline Linux doesn't have the freeze feature which suspends write requests. So, we cannot take a backup which keeps the filesystem's consistency with the storage device's features (snapshot and replication) while it is mounted. In many case, a commercial filesystem (e.g. VxFS) has the freeze feature and it would be used to get the consistent backup. If Linux's standard filesytem ext3 has the freeze feature, we can do it without a commercial filesystem. So I have implemented the ioctls of the freeze feature. I think we can take the consistent backup with the following steps. 1. Freeze the filesystem with the freeze ioctl. 2. Separate the replication volume or create the snapshot with the storage device's feature. 3. Unfreeze the filesystem with the unfreeze ioctl. 4. Take the backup from the separated replication volume or the snapshot. [PATCH 1/3] Implement generic freeze feature I have modified to set the suitable error number (EOPNOTSUPP) in case the filesystem doesn't support the freeze feature. The ioctls for the generic freeze feature are below. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, arg) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 o Unfreeze the filesystem int ioctl(int fd, int FITHAW, arg) fd: The file descriptor of the mountpoint FITHAW: request code for unfreeze arg: Ignored Return value: 0 if the operation succeeds. Otherwise, -1 [PATCH 2/3] Remove XFS specific ioctl interfaces for freeze feature It removes XFS specific ioctl interfaces and request codes for freeze feature. This patch has been supplied by David Chinner. [PATCH 3/3] Add timeout feature The timeout feature is added to freeze ioctl. And new ioctl to reset the timeout period is added. o Freeze the filesystem int ioctl(int fd, int FIFREEZE, long *timeout_sec) fd: The file descriptor of the mountpoint FIFREEZE: request code for the freeze timeout_sec: the timeout period in seconds If it's 0 or 1, the timeout isn't set. This special case of "1" is implemented to keep the compatibility with XFS applications. Return value: 0 if the operation succeeds. Otherwise, -1 o Reset the timeout period This is useful for the application to set the timeout_sec more accurately. For example, the freezer resets the timeout_sec to 10 seconds every 5 seconds. In this approach, even if the freezer causes a deadlock by accessing the frozen filesystem, it will be solved by the timeout in 10 seconds and the freezer can recognize that at the next reset of timeout_sec. int ioctl(int fd, int FIFREEZE_RESET_TIMEOUT, long *timeout_sec) fd:file descriptor of mountpoint FIFREEZE_RESET_TIMEOUT: request code for reset of timeout period timeout_sec: new timeout period in seconds Return value: 0 if the operation succeeds. Otherwise, -1 Error number: If the filesystem has already been unfrozen, errno is set to EINVAL. Any comments are very welcome. Cheers, Takashi From owner-xfs@oss.sgi.com Tue Jul 22 03:39:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 03:39:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MAdX7J023380 for ; Tue, 22 Jul 2008 03:39:34 -0700 X-ASG-Debug-ID: 1216723243-063901730000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B4CE6312C2E for ; Tue, 22 Jul 2008 03:40:43 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.249]) by cuda.sgi.com with ESMTP id OGxBQAr623MySCak for ; Tue, 22 Jul 2008 03:40:43 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so456084and.75 for ; Tue, 22 Jul 2008 03:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=j4V9t0g7fhprff2fSTfL0E5xOLqpkQVoYjoGMnek3jQ=; b=oL4S+EZtkAa3LsntvJc56i4pvBybPBxMnh0lsiDO3Ui6SnonimZgESByDpwmd4MI2W 5P5mxZy8kytGhDMkM4aXSIayOpE4EHokhw2wcoks1DoF1JbjgEBHClWWmpRaR5OR0YXn 1TK7EtQ+8NBHrmXrfJl9eDSh0E2oF/P7h9n9Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=eW+QsNvOFDzS9iuEHl8VfgGyzox+kIAHiVOsCoiBW+4y9MXhzuzjFsb0XN4S+3nXt0 hYHhE9IyZPMVLQxzqYgejmVLD7sQNtu8baaKQGZEeGsyKObT9i3ZdE3aat9YN50mO6B3 1Md1mhAnwZYaO11lHcB7DmGafGeoNI7KxAoOQ= Received: by 10.100.173.9 with SMTP id v9mr2297991ane.92.1216723242894; Tue, 22 Jul 2008 03:40:42 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Tue, 22 Jul 2008 03:40:42 -0700 (PDT) Message-ID: <2d460de70807220340g59507d8ejce30fba28e65a20e@mail.gmail.com> Date: Tue, 22 Jul 2008 12:40:42 +0200 From: "Richard Hartmann" To: "Donald Douwsma" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Timothy Shimmin" , "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <48857C4A.6060004@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <2d460de70807212143j1f80e016y6a48cab966091215@mail.gmail.com> <48857C4A.6060004@sgi.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.249] X-Barracuda-Start-Time: 1216723243 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0207 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56752 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17018 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 08:20, Donald Douwsma wrote: > Should be working then. If you hexdump the start of the dump does it look > reasonable? It should be something like: 00000000 78 46 53 64 75 6d 70 30 00 00 00 02 7c 88 36 7e |xFSdump0....|.6~| 00000010 48 80 68 62 00 00 00 00 00 00 00 00 00 7f 01 01 |H.hb............| 00000020 4d 5b 06 14 c5 68 40 99 9d 23 9d ef 10 23 5d 4a |M[...h@..#...#]J| 00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000100 69 6c 6f 6e 61 2d 6c 61 70 74 6f 70 00 00 00 00 |ilona-laptop....| 00000110 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| * 00000400 00 00 00 01 00 00 00 00 00 00 00 01 00 00 00 00 |................| 00000410 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................| An interactive xfsrestore on the local computer does work like a charm, as well. Richard From owner-xfs@oss.sgi.com Tue Jul 22 03:43:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 03:43:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MAhph7023877 for ; Tue, 22 Jul 2008 03:43:51 -0700 X-ASG-Debug-ID: 1216723500-063801a00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 59604312C62 for ; Tue, 22 Jul 2008 03:45:00 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.243]) by cuda.sgi.com with ESMTP id wppSLlCTDWFaHCHs for ; Tue, 22 Jul 2008 03:45:00 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so456283and.75 for ; Tue, 22 Jul 2008 03:45:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=aZFFaZux+whxeOlnGUf9WZV3O2S2CAFuM9PIC+VoDvY=; b=x1Hi5CquScJ3MKCOwQRz9Jae70cO5ef0KAFS2P8ntAqjv7kQNkizbRH5nWLGoCiZX8 bvSniTFTYUEW3KMj5nR855/bAFZL1NWkViK/c/UgMwVLw7BkIdeRwsV2Oo47j0kOC9ny B4EbzAHv5PELEndqDwiQ4162JUZveRvr/PlD0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ntQOLtDJQEjTXs+RKrhsOa+N6oCDePsyee7FhjbGC0DoC6Z4OvbYRpqCcSmXkm7j0N oXjGlIaMRT7HmWRpLBVPd98z4lJAMWBSY36xOY/fwYTXFB8317gSKxLnU3pZedanWRLu pkxfAHbU4AAJjODy+q29MJSe5X+X8FQxS6FH0= Received: by 10.100.213.4 with SMTP id l4mr2310691ang.53.1216723500419; Tue, 22 Jul 2008 03:45:00 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Tue, 22 Jul 2008 03:45:00 -0700 (PDT) Message-ID: <2d460de70807220345i44939565oc703222747705694@mail.gmail.com> Date: Tue, 22 Jul 2008 12:45:00 +0200 From: "Richard Hartmann" To: "Nathan Scott" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Timothy Shimmin" , "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <1216708397.4499.57.camel@verge.scott.net.au> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.243] X-Barracuda-Start-Time: 1216723501 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56752 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17019 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 08:33, Nathan Scott wrote: > "unable to construct a file system handle" - theres only one place > in the restore code that can come from - the path_to_fshandle call. > Is there a 32 bit userspace and 64 bit kernel on the machine where > xfsrestore is running? The dump was created on a 32 bit system, is stored on a 32 bit system and I am trying to restore on (the first) 32 bit system, again. Both the backed-up & the storage system have Debian's 2.2.48-1 version of xfsdump. > Its not clear to me what that code in xfsrestore is trying to do, > you may be able to just comment it out...?!? I would like to avoid hacks like this if possible at all. That is asking for trouble, especially when the root file system is concerned :/ Richard From owner-xfs@oss.sgi.com Tue Jul 22 03:48:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 03:48:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MAmBVH024385 for ; Tue, 22 Jul 2008 03:48:12 -0700 X-ASG-Debug-ID: 1216723760-7a03024f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtprelay08.ispgateway.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4A608312B49; Tue, 22 Jul 2008 03:49:20 -0700 (PDT) Received: from smtprelay08.ispgateway.de (smtprelay08.ispgateway.de [80.67.29.8]) by cuda.sgi.com with ESMTP id 8KlgsNZJ49h3k3qC; Tue, 22 Jul 2008 03:49:20 -0700 (PDT) Received: from [62.43.225.238] (helo=[192.168.30.191]) by smtprelay08.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KLFQl-0005no-67; Tue, 22 Jul 2008 12:49:19 +0200 Message-ID: <4885BB2E.3010508@cape-horn-eng.com> Date: Tue, 22 Jul 2008 12:49:18 +0200 From: Richard Ems User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: Russell Cattelan , xfs@oss.sgi.com, "Bill O'Donnell" X-ASG-Orig-Subj: Re: XFS internal error xfs_btree_check_lblock Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <4884B419.6080603@thebarn.com> <488552EC.8060803@sgi.com> In-Reply-To: <488552EC.8060803@sgi.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Df-Sender: 337294 X-Barracuda-Connect: smtprelay08.ispgateway.de[80.67.29.8] X-Barracuda-Start-Time: 1216723761 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1685 1.0000 -0.9977 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.00 X-Barracuda-Spam-Status: No, SCORE=-1.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56755 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17020 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Richard.Ems@cape-horn-eng.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > Some of the above might not refer directly to the final committed > patches but the thread URLs should be accurate. These are bug fixes > that go a long way back and really do need to be back-ported and > pushed out for the mentioned distros. There are probably other patches > not listed above that should be considered too. Hi Mark, thanks for the list and clarifications. But still some more questions ... who does the backporting for the distros? SGI or the distros themselves? Is someone from Novell / SUSE / openSUSE reading here? When can we *expect* to have these patches backported? In one month? Three months? More? Thanks, Richard -- Richard Ems mail: Richard.Ems@Cape-Horn-Eng.com Cape Horn Engineering S.L. C/ Dr. J.J. Dómine 1, 5º piso 46011 Valencia Tel : +34 96 3242923 / Fax 924 From owner-xfs@oss.sgi.com Tue Jul 22 03:48:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 03:48:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MAmFnK024403 for ; Tue, 22 Jul 2008 03:48:50 -0700 X-ASG-Debug-ID: 1216723765-062802190000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1C679E7E551 for ; Tue, 22 Jul 2008 03:49:25 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by cuda.sgi.com with ESMTP id 1VxtcHHzkA1hwAmR for ; Tue, 22 Jul 2008 03:49:25 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so456510and.75 for ; Tue, 22 Jul 2008 03:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=YToIjihIALLfWZfaNOdpiVaLcmFQOtrNfYYDipL+WNs=; b=m34FaXBSrOSfrmL9Zj3+IswAs+2hb48w7IP6XvQi77haW2YDQaPR2ML7ypKb8UpHrv HhXYOCRrw/q4Xd09bhv8zcZ8abgXAq42mNjM1DT8pKMfajtbOxj4GLQ6CkX7du19Qz3y nNmLC3bmsiyG/vlspVOMrLUD3T33EMVgLO+L0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=H7gPh9e08bK7LSvPfuzsbKonLtj7vOqyW3bdkA5T25JCyE7jdnjrvxxryTeJlLi3ZW h/KTJYZf1JOjFOwz2WtDNZp6UQNMBYxNgvH74egTIaFZtrXg+pBp7pO1m6bzRO2JNslL pZKIFZf9lBvfNZN+1jnibdEMq7HPui9r8WGso= Received: by 10.100.202.9 with SMTP id z9mr2312942anf.8.1216723765108; Tue, 22 Jul 2008 03:49:25 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Tue, 22 Jul 2008 03:49:25 -0700 (PDT) Message-ID: <2d460de70807220349t7ac0504cyf08ca670e48991ca@mail.gmail.com> Date: Tue, 22 Jul 2008 12:49:25 +0200 From: "Richard Hartmann" To: "Nathan Scott" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Timothy Shimmin" , "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <2d460de70807220345i44939565oc703222747705694@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> <2d460de70807220345i44939565oc703222747705694@mail.gmail.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.250] X-Barracuda-Start-Time: 1216723766 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56754 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17021 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 12:45, Richard Hartmann wrote: > Both the backed-up & the storage system have Debian's 2.2.48-1 > version of xfsdump. The Knoppix boot CD is am using to restore has 2.2.24-1, btw. Richard From owner-xfs@oss.sgi.com Tue Jul 22 03:50:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 03:50:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MAoXkQ025130 for ; Tue, 22 Jul 2008 03:50:35 -0700 X-ASG-Debug-ID: 1216723901-7f6b02a00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C8B1A1918BF3 for ; Tue, 22 Jul 2008 03:51:41 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.251]) by cuda.sgi.com with ESMTP id iarW9sUMB38xi6wg for ; Tue, 22 Jul 2008 03:51:41 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so456617and.75 for ; Tue, 22 Jul 2008 03:51:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=OxZv/fz8+PB5tB02xKC/W8cHF5MwHwevyN9XQebo1CI=; b=Mn8FVY2fH5ae85XnWzcLqS/PhL+pkjkfPSbPk+10AUj2tddCeFLLe3iOyuLQzwtnbh bId56B405MnesEPRm1WG2fqnrHzYhlc7zNnnsFlVWQn3NplCBJYZlRkfp3Sxwo97AQOP HVt52UfBa/l05dBvwuf2PX2m16kjZPnxCtf1g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=HVSV9qRW4+181XHe740yDc5AIT58Q7EXRUiL8QhTRY4m0OLMPOoUILt9GC14+V8zar UUDANIyFA8fEejYbrLj9M40EE/+rYyfQ1vqtbvSsnMQmlAnJnmYbgTc4DqL3YX8XB39y 9/LRSp1AfcQ5Tj6WStj8KKiiitR8pBbjjIDf4= Received: by 10.100.216.12 with SMTP id o12mr2299108ang.117.1216723900886; Tue, 22 Jul 2008 03:51:40 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Tue, 22 Jul 2008 03:51:40 -0700 (PDT) Message-ID: <2d460de70807220351i7c468de5o33fa5aa5e9ddab99@mail.gmail.com> Date: Tue, 22 Jul 2008 12:51:40 +0200 From: "Richard Hartmann" To: "Timothy Shimmin" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Nathan Scott" , "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <48858676.3030105@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> <48858676.3030105@sgi.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.251] X-Barracuda-Start-Time: 1216723901 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0203 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56755 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m6MAoZkQ025136 X-archive-position: 17022 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 09:04, Timothy Shimmin wrote: > If you could strace it then we could see what call was failing > in path_to_fshandle(). First with -ttt to get rid of a tty allocation error, then without: % cat root.xfs | ssh -ttt root@192.168.1.213 strace xfsrestore - /mnt/sda3 Password: tcgetattr: Invalid argument execve("/sbin/xfsrestore", ["xfsrestore", "-", "/mnt/sda3"], [/* 15 vars */]) = 0 brk(0) = 0x808c000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f84000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=187135, ...}) = 0 mmap2(NULL, 187135, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f56000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libuuid.so.1", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \20\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=12656, ...}) = 0 mmap2(NULL, 15440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f52000 mmap2(0xb7f55000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7f55000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libhandle.so.1", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\n\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=7144, ...}) = 0 mmap2(NULL, 10164, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f4f000 mmap2(0xb7f51000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7f51000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libattr.so.1", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\f\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=12820, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f4e000 mmap2(NULL, 15680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f4a000 mmap2(0xb7f4d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7f4d000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1356012, ...}) = 0 mmap2(NULL, 1361520, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dfd000 mmap2(0xb7f44000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x147) = 0xb7f44000 mmap2(0xb7f47000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f47000 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dfc000 set_thread_area({entry_number:-1 -> 6, base_addr:0xb7dfc6f0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 mprotect(0xb7f44000, 4096, PROT_READ) = 0 munmap(0xb7f56000, 187135) = 0 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=16969248, ...}) = 0 mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7bfc000 mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0x321) = 0xb7f83000 brk(0) = 0x808c000 brk(0x80ad000) = 0x80ad000 close(3) = 0 getpid() = 5078 getrlimit(RLIMIT_AS, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_STACK, {rlim_cur=32768*1024, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=32768*1024, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_CPU, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_CPU, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_CPU, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getcwd("/UNIONFS/root", 4096) = 14 stat64("/var/lib/xfsdump", 0xbf9e4d70) = -1 ENOENT (No such file or directory) stat64("/var/xfsdump", 0xbf9e4d10) = -1 ENOENT (No such file or directory) open("/dev/tty", O_RDWR|O_LARGEFILE) = 3 fstat64(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 4), ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f82000 write(1, "xfsrestore: using file dump (dri"..., 52xfsrestore: using file dump (drive_simple) strategy ) = 52 mmap2(NULL, 270336, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7bba000 ioctl(3, SNDCTL_TMR_TIMEBASE or TCGETS, {B38400 opost isig icanon echo ...}) = 0 write(1, "xfsrestore: version 2.2.45 (dump"..., 44xfsrestore: version 2.2.45 (dump format 3.0)) = 44 write(1, " - Running single-threaded\n", 27 - Running single-threaded ) = 27 time(NULL) = 1216723667 stat64("/mnt/sda3", {st_mode=S_IFDIR|0755, st_size=38, ...}) = 0 mkdir("/mnt/sda3/xfsrestorehousekeepingdir", 0700) = -1 EEXIST (File exists) open("/mnt/sda3/xfsrestorehousekeepingdir/state", O_RDWR|O_CREAT|O_LARGEFILE, 0600) = 4 fstat64(4, {st_mode=S_IFREG|0600, st_size=20480, ...}) = 0 mmap2(NULL, 20480, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xb7f7d000 geteuid32() = 0 munmap(0xb7f7d000, 20480) = 0 ftruncate64(4, 20480) = 0 fstat64(4, {st_mode=S_IFREG|0600, st_size=20480, ...}) = 0 mmap2(NULL, 20480, PROT_READ|PROT_WRITE, MAP_SHARED, 4, 0) = 0xb7f7d000 statfs64("/mnt/sda3", 84, {f_type=0x58465342, f_bsize=4096, f_blocks=2201496, f_bfree=2200427, f_bavail=2200427, f_files=8816192, f_ffree=8816187, f_fsid={2051, 0}, f_namelen=255, f_frsize=4096}) = 0 open("/mnt/sda3", O_RDONLY|O_LARGEFILE) = 5 ioctl(5, 0xc01c5868, 0xbf9e4c1c) = -1 EINVAL (Invalid argument) close(5) = 0 open("/usr/share/locale/locale.alias", O_RDONLY) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=2586, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f7c000 read(5, "# Locale name alias data base.\n#"..., 2048) = 2048 read(5, "rean.euc \tko_KR.eucKR\nko_KR\t\tko_"..., 2048) = 538 read(5, "", 2048) = 0 close(5) = 0 munmap(0xb7f7c000, 4096) = 0 open("/usr/share/locale/de/LC_MESSAGES/libc.mo", O_RDONLY) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=123187, ...}) = 0 mmap2(NULL, 123187, PROT_READ, MAP_PRIVATE, 5, 0) = 0xb7f5e000 close(5) = 0 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 5 fstat64(5, {st_mode=S_IFREG|0644, st_size=25700, ...}) = 0 mmap2(NULL, 25700, PROT_READ, MAP_SHARED, 5, 0) = 0xb7f57000 close(5) = 0 open("/usr/lib/gconv/ISO8859-15.so", O_RDONLY) = 5 read(5, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\3\0\000"..., 512) = 512 fstat64(5, {st_mode=S_IFREG|0644, st_size=9480, ...}) = 0 mmap2(NULL, 12316, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 5, 0) = 0xb7bb6000 mmap2(0xb7bb8000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 5, 0x1) = 0xb7bb8000 close(5) = 0 write(1, "xfsrestore: unable to construct "..., 94xfsrestore: unable to construct a file system handle for /mnt/sda3: Das Argument ist ung�ltig ) = 94 rt_sigaction(SIGCHLD, {SIG_IGN}, {SIG_DFL}, 8) = 0 rt_sigaction(SIGCHLD, {SIG_IGN}, {SIG_IGN}, 8) = 0 write(1, "xfsrestore: Restore Status: ERRO"..., 34xfsrestore: Restore Status: ERROR ) = 34 exit_group(1) = ? Process 5078 detached Connection to 192.168.1.213 closed. ######################################### ######################################### ######################################### % cat root.xfs | ssh root@192.168.1.213 strace xfsrestore - /mnt/sda3 Password: execve("/sbin/xfsrestore", ["xfsrestore", "-", "/mnt/sda3"], [/* 13 vars */]) = 0 brk(0) = 0x808c000 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f5f000 access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory) open("/etc/ld.so.cache", O_RDONLY) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=187135, ...}) = 0 mmap2(NULL, 187135, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7f31000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libuuid.so.1", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0 \20\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=12656, ...}) = 0 mmap2(NULL, 15440, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f2d000 mmap2(0xb7f30000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7f30000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libhandle.so.1", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0@\n\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=7144, ...}) = 0 mmap2(NULL, 10164, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f2a000 mmap2(0xb7f2c000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1) = 0xb7f2c000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libattr.so.1", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\f\0\000"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0644, st_size=12820, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f29000 mmap2(NULL, 15680, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7f25000 mmap2(0xb7f28000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2) = 0xb7f28000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/libc.so.6", O_RDONLY) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\260e\1"..., 512) = 512 fstat64(3, {st_mode=S_IFREG|0755, st_size=1356012, ...}) = 0 mmap2(NULL, 1361520, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb7dd8000 mmap2(0xb7f1f000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x147) = 0xb7f1f000 mmap2(0xb7f22000, 9840, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xb7f22000 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7dd7000 set_thread_area({entry_number:-1 -> 6, base_addr:0xb7dd76f0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0 mprotect(0xb7f1f000, 4096, PROT_READ) = 0 munmap(0xb7f31000, 187135) = 0 open("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=16969248, ...}) = 0 mmap2(NULL, 2097152, PROT_READ, MAP_PRIVATE, 3, 0) = 0xb7bd7000 mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0x321) = 0xb7f5e000 brk(0) = 0x808c000 brk(0x80ad000) = 0x80ad000 close(3) = 0 getpid() = 5083 getrlimit(RLIMIT_AS, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_STACK, {rlim_cur=32768*1024, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=32768*1024, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_DATA, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_FSIZE, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_CPU, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 setrlimit(RLIMIT_CPU, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getrlimit(RLIMIT_CPU, {rlim_cur=RLIM_INFINITY, rlim_max=RLIM_INFINITY}) = 0 getcwd("/UNIONFS/root", 4096) = 14 stat64("/var/lib/xfsdump", 0xbfd418e0) = -1 ENOENT (No such file or directory) stat64("/var/xfsdump", 0xbfd41880) = -1 ENOENT (No such file or directory) open("/dev/tty", O_RDWR|O_LARGEFILE) = -1 ENXIO (No such device or address) dup(2) = 3 fcntl64(3, F_GETFL) = 0x2 (flags O_RDWR) fstat64(3, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f5d000 _llseek(3, 0, 0xbfd413a8, SEEK_CUR) = -1 ESPIPE (Illegal seek) open("/usr/share/locale/locale.alias", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=2586, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f5c000 read(4, "# Locale name alias data base.\n#"..., 2048) = 2048 read(4, "rean.euc \tko_KR.eucKR\nko_KR\t\tko_"..., 2048) = 538 read(4, "", 2048) = 0 close(4) = 0 munmap(0xb7f5c000, 4096) = 0 open("/usr/share/locale/de/LC_MESSAGES/libc.mo", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=123187, ...}) = 0 mmap2(NULL, 123187, PROT_READ, MAP_PRIVATE, 4, 0) = 0xb7f3e000 close(4) = 0 open("/usr/lib/gconv/gconv-modules.cache", O_RDONLY) = 4 fstat64(4, {st_mode=S_IFREG|0644, st_size=25700, ...}) = 0 mmap2(NULL, 25700, PROT_READ, MAP_SHARED, 4, 0) = 0xb7f37000 close(4) = 0 open("/usr/lib/gconv/ISO8859-15.so", O_RDONLY) = 4 read(4, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0p\3\0\000"..., 512) = 512 fstat64(4, {st_mode=S_IFREG|0644, st_size=9480, ...}) = 0 mmap2(NULL, 12316, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 4, 0) = 0xb7f33000 mmap2(0xb7f35000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 4, 0x1) = 0xb7f35000 close(4) = 0 write(3, "/dev/tty: Kein passendes Ger\344t b"..., 68/dev/tty: Kein passendes Ger�t bzw. keine passende Adresse gefunden ) = 68 close(3) = 0 munmap(0xb7f5d000, 4096) = 0 fstat64(1, {st_mode=S_IFSOCK|0777, st_size=0, ...}) = 0 xfsrestore: using file dump (drive_simple) strategy mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7f5d000 write(1, "xfsrestore: using file dump (dri"..., 52) = 52 mmap2(NULL, 270336, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb7b95000 xfsrestore: version 2.2.45 (dump format 3.0)write(1, "xfsrestore: version 2.2.45 (dump"..., 44) = 44 - Running single-threaded write(1, " - Running single-threaded\n", 27) = 27 time(NULL) = 1216723678 stat64("/mnt/sda3", {st_mode=S_IFDIR|0755, st_size=38, ...}) = 0 mkdir("/mnt/sda3/xfsrestorehousekeepingdir", 0700) = -1 EEXIST (File exists) open("/mnt/sda3/xfsrestorehousekeepingdir/state", O_RDWR|O_CREAT|O_LARGEFILE, 0600) = 3 fstat64(3, {st_mode=S_IFREG|0600, st_size=20480, ...}) = 0 mmap2(NULL, 20480, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0xb7b90000 geteuid32() = 0 munmap(0xb7b90000, 20480) = 0 ftruncate64(3, 20480) = 0 fstat64(3, {st_mode=S_IFREG|0600, st_size=20480, ...}) = 0 mmap2(NULL, 20480, PROT_READ|PROT_WRITE, MAP_SHARED, 3, 0) = 0xb7b90000 statfs64("/mnt/sda3", 84, {f_type=0x58465342, f_bsize=4096, f_blocks=2201496, f_bfree=2200427, f_bavail=2200427, f_files=8816192, f_ffree=8816187, f_fsid={2051, 0}, f_namelen=255, f_frsize=4096}) = 0 open("/mnt/sda3", O_RDONLY|O_LARGEFILE) = 4 ioctl(4, 0xc01c5868, 0xbfd4178c) = -1 EINVAL (Invalid argument) close(4) = 0 xfsrestore: unable to construct a file system handle for /mnt/sda3: Das Argument ist ung�ltig write(1, "xfsrestore: unable to construct "..., 94) = 94 rt_sigaction(SIGCHLD, {SIG_IGN}, xfsrestore: Restore Status: ERROR {SIG_DFL}, 8) = 0 rt_sigaction(SIGCHLD, {SIG_IGN}, {SIG_IGN}, 8) = 0 write(1, "xfsrestore: Restore Status: ERRO"..., 34) = 34 exit_group(1) = ? Process 5083 detached Again, the German error message means 'argument invalid' Thanks, RIchard From owner-xfs@oss.sgi.com Tue Jul 22 03:51:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 03:51:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MApjcS025535 for ; Tue, 22 Jul 2008 03:51:46 -0700 X-ASG-Debug-ID: 1216723975-297200560000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1AA99E7E57E for ; Tue, 22 Jul 2008 03:52:55 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by cuda.sgi.com with ESMTP id C4rsDm3eO6eixNrE for ; Tue, 22 Jul 2008 03:52:55 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so456678and.75 for ; Tue, 22 Jul 2008 03:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=uEQ1TpNGYe7RJ1w5flmerbkwNAFq1V+iSCq/Wb8hjYg=; b=Ie+5uxpQYau7Le9YS47LtaK0Hf52ewWMsko8oDCDIdxnj8Wm0e3n1LIIu2KnuzHJ1K rF2oWuHx3kynqh2VaXHxHhGvvIPRSnb1j89MlPNlRhH/yj6VNpDnMBlzF8Oy7movT2Rg 1MDOc7zEzKD9YiT3e58sMqf7wxMWDzY1J0YXo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=jPmDbFS+NlS2CLX9G8Fs4AWe8GEJ5iWOqAkMGePH92a+AcP1dL7A1biL6TyDm6+R7W sxpdW4oSSVZMdFUXw66uORtkCiP+o9ucVSDhgGvIsOS4wyQ3+fJC1AWD7i/7UfBBZfas 2Il3WHQSWoTkhRaE+Hlr6TOsuBTkjTFxH38o8= Received: by 10.100.47.13 with SMTP id u13mr2319491anu.56.1216723975351; Tue, 22 Jul 2008 03:52:55 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Tue, 22 Jul 2008 03:52:55 -0700 (PDT) Message-ID: <2d460de70807220352k19ca73lbfc9218ea6d6d026@mail.gmail.com> Date: Tue, 22 Jul 2008 12:52:55 +0200 From: "Richard Hartmann" To: "Timothy Shimmin" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Nathan Scott" , "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <2d460de70807220351i7c468de5o33fa5aa5e9ddab99@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> <48858676.3030105@sgi.com> <2d460de70807220351i7c468de5o33fa5aa5e9ddab99@mail.gmail.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.245] X-Barracuda-Start-Time: 1216723976 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1907 1.0000 -0.8773 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.88 X-Barracuda-Spam-Status: No, SCORE=-0.88 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56754 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m6MAplcS025538 X-archive-position: 17023 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 12:51, Richard Hartmann wrote: > write(3, "/dev/tty: Kein passendes Ger\344t b"..., 68/dev/tty: Kein > passendes Ger�t bzw. keine passende Adresse gefunden > ) = 68 'No suitable device found or address found.' From owner-xfs@oss.sgi.com Tue Jul 22 04:26:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 04:26:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6MBQauW000753 for ; Tue, 22 Jul 2008 04:26:39 -0700 Received: from [134.15.251.2] (melb-sw-corp-251-2.corp.sgi.com [134.15.251.2]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA13306; Tue, 22 Jul 2008 21:27:37 +1000 Message-ID: <4885C425.9020309@sgi.com> Date: Tue, 22 Jul 2008 21:27:33 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Richard Ems CC: Russell Cattelan , xfs@oss.sgi.com, "Bill O'Donnell" Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <4884B419.6080603@thebarn.com> <488552EC.8060803@sgi.com> <4885BB2E.3010508@cape-horn-eng.com> In-Reply-To: <4885BB2E.3010508@cape-horn-eng.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17024 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Richard Ems wrote: > Mark Goodwin wrote: >> Some of the above might not refer directly to the final committed >> patches but the thread URLs should be accurate. These are bug fixes >> that go a long way back and really do need to be back-ported and >> pushed out for the mentioned distros. There are probably other patches >> not listed above that should be considered too. > > Hi Mark, thanks for the list and clarifications. > > But still some more questions ... who does the backporting for the > distros? SGI or the distros themselves? Generally the distros, except for SGI storage platforms and SLES where SGI has a contractural support agreement with Novell. > Is someone from Novell / SUSE / openSUSE reading here? Andreas Gruenbacher is probably listening > When can we *expect* to have these patches backported? In one month? > Three months? More? For SLES, within a week. For OpenSuSE presumeably the SLES folks will follow-up with OpenSuSE, but I can't predict when. For Fedora, Eric Sandeen. For RHEL (on anything except SGI storage platforms), nobody since XFS is not supported directly by Redhat. For all other distros and server & NAS vendors, it's entirely up to their maintainers and respective support organization - generally they track a release or two behind kernel.org. Cheers -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Tue Jul 22 04:59:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 04:59:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MBxlPJ002727 for ; Tue, 22 Jul 2008 04:59:47 -0700 X-ASG-Debug-ID: 1216728056-6e5800260000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7090412E901C for ; Tue, 22 Jul 2008 05:00:57 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.250]) by cuda.sgi.com with ESMTP id ROKU4feZE4xMAGLr for ; Tue, 22 Jul 2008 05:00:57 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so460645and.75 for ; Tue, 22 Jul 2008 05:00:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=Cugl6JOSN2mCocA2X/c03ET6txowLqc3ztAbAgd1U04=; b=gJm1oEnUPHgUSd1YPx2pTaEIMZjP7gXVYVCd0kJVqVojJpoAAsRbNiPE+5Kd66ZYpR yHF3G6S6gG80pzBIhsoVoyCrq551UpPOhU4kVJ22lch1MiAPGnVyxY/HvXRvYKpoTN3+ PY5JA110BZsxvSwU8RQmr1rpZOkOz5i52OW0c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=GpSeYuGHkT5yl46aCGzqlLfk7Q4U5NCf9rgHYRPZQorGcGI6a9LyC3rCTDSC4wPD/0 ILd7RcQMgEaPmTdEsiuH5gFezCFMcxMibl0F1J/+Ou+JELjIdtEJoeAq/0d/CNf/TgSw ntFCU8+o3yBQ+hj1m4iMvr4oHfZSFxHQX960Y= Received: by 10.100.47.13 with SMTP id u13mr2337573anu.56.1216728056630; Tue, 22 Jul 2008 05:00:56 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Tue, 22 Jul 2008 05:00:56 -0700 (PDT) Message-ID: <2d460de70807220500k42f03219j4c33ab4bb80ae2c4@mail.gmail.com> Date: Tue, 22 Jul 2008 14:00:56 +0200 From: "Richard Hartmann" To: "Nathan Scott" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Timothy Shimmin" , "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <2d460de70807220349t7ac0504cyf08ca670e48991ca@mail.gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> <2d460de70807220345i44939565oc703222747705694@mail.gmail.com> <2d460de70807220349t7ac0504cyf08ca670e48991ca@mail.gmail.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.250] X-Barracuda-Start-Time: 1216728057 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56758 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17025 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 12:49, Richard Hartmann wrote: > The Knoppix boot CD is am using to restore has 2.2.24-1, btw. Grml to the rescue.. I downloaded a grml iso, which has 2.2.45-1, and was able to restore the image. Extremely annoying, as I spent quite some time poking various options, thinking I had been doing something very basic very wrong. I assume the issue has been fixed between .24 and .45. Thanks again, Richard From owner-xfs@oss.sgi.com Tue Jul 22 08:21:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 08:22:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6MFLiD0018529 for ; Tue, 22 Jul 2008 08:21:45 -0700 X-ASG-Debug-ID: 1216740174-32d0028b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0F5C419194AB for ; Tue, 22 Jul 2008 08:22:54 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id AT6Gn94fApcv6O20 for ; Tue, 22 Jul 2008 08:22:54 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 4ED28AC6272; Tue, 22 Jul 2008 10:22:48 -0500 (CDT) Message-ID: <4885FB40.5000807@sandeen.net> Date: Tue, 22 Jul 2008 10:22:40 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: Richard Ems , Russell Cattelan , xfs@oss.sgi.com, "Bill O'Donnell" X-ASG-Orig-Subj: Re: XFS internal error xfs_btree_check_lblock Subject: Re: XFS internal error xfs_btree_check_lblock References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <4884B419.6080603@thebarn.com> <488552EC.8060803@sgi.com> <4885BB2E.3010508@cape-horn-eng.com> <4885C425.9020309@sgi.com> In-Reply-To: <4885C425.9020309@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216740175 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56773 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17026 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mark Goodwin wrote: > > Richard Ems wrote: >> When can we *expect* to have these patches backported? In one month? >> Three months? More? > > For SLES, within a week. For OpenSuSE presumeably the SLES folks will > follow-up with OpenSuSE, but I can't predict when. For Fedora, Eric > Sandeen. For RHEL (on anything except SGI storage platforms), nobody > since XFS is not supported directly by Redhat. Nor even shipped with RHEL. But hopefully the CentOS guys will pick it up, I'll give them a heads up when the list of fixes appears. Thanks, -Eric From owner-xfs@oss.sgi.com Tue Jul 22 17:04:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 17:05:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N04tco024191 for ; Tue, 22 Jul 2008 17:04:57 -0700 X-ASG-Debug-ID: 1216771563-52ed00ac0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C06C6191C700 for ; Tue, 22 Jul 2008 17:06:04 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id VPU6WQCRlyMEhzHJ for ; Tue, 22 Jul 2008 17:06:04 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEAThkh5LFxAiGdsb2JhbACSTQEBAQ8gnxs X-IronPort-AV: E=Sophos;i="4.31,234,1215354600"; d="scan'208";a="155479119" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 09:35:50 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLRrY-0007c2-Rm; Wed, 23 Jul 2008 10:05:48 +1000 Date: Wed, 23 Jul 2008 10:05:48 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080723000548.GG5947@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080722072733.GA15376@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216771565 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56802 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17027 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 03:27:33AM -0400, Christoph Hellwig wrote: > On Tue, Jul 22, 2008 at 03:30:19PM +1000, Dave Chinner wrote: > > Until the method we'll use for referencing VFS inodes in core XFS > > code is clear, I'd rather leave it consistent with the rest of the code. > > I would expect your cleanups in this area to go in before this patch, > or not? The cleanups are on top of these patches. I'll have to reorder and redo them if they are to go in first... > > As it is, I expect that this code will be revisited several times as > > new functionality is added (e.g. combining the VFS and XFS inodes) > > because that will change the way we interface with VFS and XFS inodes. > > Much of this vnode specific code will change at that time; I'd > > rather just change it once when the time is appropriate than have > > to change it multiple times.... > > Well, it's not vnode specific code. bhv_vnode_t is just a typedef for > struct inode and the various functions dealing with it are trivial > wrapper, many of them in fact expanding to no code at all. Right, but we are still using bhv_vnode_t in core XFS code, not struct inode. There haven't been patches to decide that one way or another. > But maybe > killing this syntactic sugar should be a separate patch. I think so - do it once and once only. > I only fear > we'll never get it in with the current review and commit latencies > for XFS :( I can see this being a big issue in the not-too-distant future..... > > > This needs a big comment on why you're using the gang lookup for > > > a single lookup. I guess that's because the gang lookup skips to > > > the next actually existing entry instead of returning NULL, but that's > > > not really obvious to the reader. > > > > Fair enough. This was later in the original series where this was > > a dirty tag lookup and didn't need commenting ;) > > Actually even then a comment describing why we want a gang lookup > when just looking up a single element might be a good idea. Sure - I added that. > On the > other hand I wonder whether we might actually want to use the gang > lookups, the unconditional igrab is probably cheaper than lots of > radix tree lookups. Yes, agreed, and that is the way I'm heading. I want to get everything working against the radix tree before attempting to optimise the lookups. The next steps are: - combine the XFS + VFS inodes into one structure so that we can simplify inode lookup. - bypass the linux icache so all lookups run from the radix tree. This involves adding our own dirty VFS inode tracking. This initially just uses the VFS superblock dirty list like the generic code - expand the dirty inode tracking to setting a tag in the radix tree. - changing radix tree walkers looking for dirty inodes to use tag lookups - this requires adding interfaces to the radix tree code - Use a tag in the radix tree to mark inodes for reclaim. - change reclaim to use a radix tree walk. - changing radix tree walkers to all use gang and gang-tag lookups - this requires adding interfaces to the radix tree code - factor the individual radix tree walk implementations once commonalities are obvious. This is just basic groundwork. The interesting stuff starts after this - separating data and inode flushing, avoiding RMW cycles in xfs_iflush, writeback aggregation beyond a single inode cluster, multi-level caching and cache compression, RCU locking, thread pools to parallelise tree walks, and so on. There's a bunch of stuff in the pipeline - this is the basic groundwork needed to catch it all effectively... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 22 17:18:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 17:18:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43, J_CHICKENPOX_54 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N0IP7R025267 for ; Tue, 22 Jul 2008 17:18:27 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id KAA29354; Wed, 23 Jul 2008 10:19:24 +1000 Message-ID: <4886790C.7040100@sgi.com> Date: Wed, 23 Jul 2008 10:19:24 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Richard Hartmann CC: Nathan Scott , Bill Kendall , xfs@oss.sgi.com Subject: Re: xfsrestore over ssh? References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> <48858676.3030105@sgi.com> <2d460de70807220351i7c468de5o33fa5aa5e9ddab99@mail.gmail.com> In-Reply-To: <2d460de70807220351i7c468de5o33fa5aa5e9ddab99@mail.gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17028 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Richard Hartmann wrote: > On Tue, Jul 22, 2008 at 09:04, Timothy Shimmin wrote: >> If you could strace it then we could see what call was failing> in path_to_fshandle(). > First with -ttt to get rid of a tty allocation error, then without: > % cat root.xfs | ssh -ttt root@192.168.1.213 strace xfsrestore - /mnt/sda3 From your output: > open("/mnt/sda3", O_RDONLY|O_LARGEFILE) = 4 > ioctl(4, 0xc01c5868, 0xbfd4178c) = -1 EINVAL (Invalid argument) > close(4) (I probably should have just asked for: # strace -o output -e trace=open,ioctl xfsrestore ...) > On Tue, Jul 22, 2008 at 12:49, Richard Hartmann > wrote: > >> > The Knoppix boot CD is am using to restore has 2.2.24-1, btw. > > Grml to the rescue.. I downloaded a grml iso, which has 2.2.45-1, > and was able to restore the image. > > Extremely annoying, as I spent quite some time poking various > options, thinking I had been doing something very basic very > wrong. I assume the issue has been fixed between .24 and .45. > > > Thanks again, > Richard Okay, my best guess is that you are trying to restore to a non-xfs filesystem. This was fixed again in 2.2.26 so that it would work on a non-xfs filesystem. Otherwise the xfs ioctl will be being called and get back an EINVAL as we saw in the strace. Personally, I can't remember why we are bothering with handle code in restore (in dump, yes, because of bulkstat but restore.... I vaguely remember a comment about optimitisation). Looking at the code (annotated version) in restore: wkendall |1.34 |master-melb:xfs-cmds:187436a| /* effectively initialize libhandle on this filesystem by wkendall |1.34 |master-melb:xfs-cmds:187436a| * allocating a file system handle. this needs to be done wkendall |1.34 |master-melb:xfs-cmds:187436a| * before any open_by_handle() calls (and possibly other wkendall |1.34 |master-melb:xfs-cmds:187436a| * libhandle calls). wkendall |1.34 |master-melb:xfs-cmds:187436a| */ wkendall |1.34 |master-melb:xfs-cmds:187436a| if ( persp->a.dstdirisxfspr ) { wkendall |1.34 |master-melb:xfs-cmds:187436a| void *fshanp; wkendall |1.34 |master-melb:xfs-cmds:187436a| size_t fshlen=0; wkendall |1.34 |master-melb:xfs-cmds:187436a| wkendall |1.34 |master-melb:xfs-cmds:187436a| if(path_to_fshandle(persp->a.dstdir, &fshanp, &fshlen)) { wkendall |1.34 |master-melb:xfs-cmds:187436a| mlog( MLOG_NORMAL, wkendall |1.34 |master-melb:xfs-cmds:187436a| _("unable to construct a file " wkendall |1.34 |master-melb:xfs-cmds:187436a| "system handle for %s: %s\n"), wkendall |1.34 |master-melb:xfs-cmds:187436a| persp->a.dstdir, wkendall |1.34 |master-melb:xfs-cmds:187436a| strerror( errno )); wkendall |1.34 |master-melb:xfs-cmds:187436a| return BOOL_FALSE; wkendall |1.34 |master-melb:xfs-cmds:187436a| } wkendall |1.34 |master-melb:xfs-cmds:187436a| /* libhandle has it cached, release this copy */ wkendall |1.34 |master-melb:xfs-cmds:187436a| free_handle(fshanp, fshlen); wkendall |1.34 |master-melb:xfs-cmds:187436a| } wkendall |1.34 |master-melb:xfs-cmds:187436a| ---------------------------- revision 1.34 date: 2005/02/10 02:14:17; author: wkendall.bonnie.engr.sgi.com; state: Exp; lines: +34 -26 modid: master-melb:xfs-cmds:187436a Fix a couple of spots in xfsrestore where XFS-specific calls were being made without first checking to see if the filesystem being restored is XFS. Merge of master:xfs-cmds:187436a by kenmcd. ---------------------------- xfsdump-2.2.26 (09 February 2005) - Fix xfsrestore so that it can restore to non-XFS filesystems again. --Tim From owner-xfs@oss.sgi.com Tue Jul 22 17:40:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 17:40:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N0e7nY026470 for ; Tue, 22 Jul 2008 17:40:07 -0700 X-ASG-Debug-ID: 1216773676-0369003e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5B85B191C93A for ; Tue, 22 Jul 2008 17:41:16 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id PVA8CMCGWjD9UPfA for ; Tue, 22 Jul 2008 17:41:16 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEcahkh5LFxAiGdsb2JhbACSTQEBAQ8gnwo X-IronPort-AV: E=Sophos;i="4.31,234,1215354600"; d="scan'208";a="155512408" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 10:11:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLSPp-0000y6-SL for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:41:13 +1000 From: Dave Chinner To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Subject: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Date: Wed, 23 Jul 2008 10:41:09 +1000 Message-Id: <1216773673-3620-1-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216773677 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0207 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56805 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17029 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs The list of all inodes on a mount is superfluous. We can traverse all inodes now by walking the per-AG inode radix trees without needing a separate list. This enables us to remove a bunch of complex list traversal code and remove another two pointers from the xfs_inode. Also, by replacing the sync traversal with an ascending inode number traversal, we will issue better inode I/O patterns for writeback triggered by xfssyncd or unmount. From owner-xfs@oss.sgi.com Tue Jul 22 17:40:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 17:40:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N0e8qd026483 for ; Tue, 22 Jul 2008 17:40:08 -0700 X-ASG-Debug-ID: 1216773676-0369003e0001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BA3F1191C93F for ; Tue, 22 Jul 2008 17:41:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id XztMQHOypgkT6cpr for ; Tue, 22 Jul 2008 17:41:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEcahkh5LFxAiGdsb2JhbACSTQEBAQ8gnwo X-IronPort-AV: E=Sophos;i="4.31,234,1215354600"; d="scan'208";a="155512411" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 10:11:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLSPq-0000yD-1Z; Wed, 23 Jul 2008 10:41:14 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 3/4] XFS: Traverse inode trees when releasing dquots V2 Subject: [PATCH 3/4] XFS: Traverse inode trees when releasing dquots V2 Date: Wed, 23 Jul 2008 10:41:12 +1000 Message-Id: <1216773673-3620-4-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216773673-3620-1-git-send-email-david@fromorbit.com> References: <1216773673-3620-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216773678 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56805 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17030 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Make releasing all inode dquots traverse the per-ag inode radix trees rather than the mount inode list. This removes another user of the mount inode list. Version 2 o add comment explaining use of gang lookups for a single inode o use IRELE, not VN_RELE o move check for ag initialisation to caller. Signed-off-by: Dave Chinner --- fs/xfs/quota/xfs_qm_syscalls.c | 125 ++++++++++++++++++--------------------- 1 files changed, 58 insertions(+), 67 deletions(-) diff --git a/fs/xfs/quota/xfs_qm_syscalls.c b/fs/xfs/quota/xfs_qm_syscalls.c index adfb872..6924bbd 100644 --- a/fs/xfs/quota/xfs_qm_syscalls.c +++ b/fs/xfs/quota/xfs_qm_syscalls.c @@ -1022,101 +1022,92 @@ xfs_qm_export_flags( /* - * Go thru all the inodes in the file system, releasing their dquots. - * Note that the mount structure gets modified to indicate that quotas are off - * AFTER this, in the case of quotaoff. This also gets called from - * xfs_rootumount. + * Release all the dquots on the inodes in an AG. */ -void -xfs_qm_dqrele_all_inodes( - struct xfs_mount *mp, - uint flags) +STATIC void +xfs_qm_dqrele_inodes_ag( + xfs_mount_t *mp, + int ag, + uint flags) { - xfs_inode_t *ip, *topino; - uint ireclaims; - bhv_vnode_t *vp; - boolean_t vnode_refd; + xfs_inode_t *ip = NULL; + bhv_vnode_t *vp = NULL; + xfs_perag_t *pag = &mp->m_perag[ag]; + int first_index = 0; + int nr_found; - ASSERT(mp->m_quotainfo); - - XFS_MOUNT_ILOCK(mp); -again: - ip = mp->m_inodes; - if (ip == NULL) { - XFS_MOUNT_IUNLOCK(mp); - return; - } do { - /* Skip markers inserted by xfs_sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; + boolean_t vnode_refd = B_FALSE; + + /* + * use a gang lookup to find the next inode in the tree + * as the tree is sparse and a gang lookup walks to find + * the number of objects requested. + */ + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); + break; } + + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); + /* Root inode, rbmip and rsumip have associated blocks */ - if (ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { - ASSERT(ip->i_udquot == NULL); - ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; - continue; - } vp = XFS_ITOV_NULL(ip); - if (!vp) { + if (!vp || ip == XFS_QI_UQIP(mp) || ip == XFS_QI_GQIP(mp)) { ASSERT(ip->i_udquot == NULL); ASSERT(ip->i_gdquot == NULL); - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } - vnode_refd = B_FALSE; if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; vp = vn_grab(vp); + read_unlock(&pag->pag_ici_lock); if (!vp) - goto again; - - XFS_MOUNT_IUNLOCK(mp); - /* XXX restart limit ? */ - xfs_ilock(ip, XFS_ILOCK_EXCL); + continue; vnode_refd = B_TRUE; + xfs_ilock(ip, XFS_ILOCK_EXCL); } else { - ireclaims = mp->m_ireclaims; - topino = mp->m_inodes; - XFS_MOUNT_IUNLOCK(mp); + read_unlock(&pag->pag_ici_lock); } - - /* - * We don't keep the mountlock across the dqrele() call, - * since it can take a while.. - */ if ((flags & XFS_UQUOTA_ACCT) && ip->i_udquot) { xfs_qm_dqrele(ip->i_udquot); ip->i_udquot = NULL; } - if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && ip->i_gdquot) { + if (flags & (XFS_PQUOTA_ACCT|XFS_GQUOTA_ACCT) && + ip->i_gdquot) { xfs_qm_dqrele(ip->i_gdquot); ip->i_gdquot = NULL; } xfs_iunlock(ip, XFS_ILOCK_EXCL); - /* - * Wait until we've dropped the ilock and mountlock to - * do the vn_rele. Or be condemned to an eternity in the - * inactive code in hell. - */ if (vnode_refd) IRELE(ip); - XFS_MOUNT_ILOCK(mp); - /* - * If an inode was inserted or removed, we gotta - * start over again. - */ - if (topino != mp->m_inodes || mp->m_ireclaims != ireclaims) { - /* XXX use a sentinel */ - goto again; - } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); +} - XFS_MOUNT_IUNLOCK(mp); +/* + * Go thru all the inodes in the file system, releasing their dquots. + * Note that the mount structure gets modified to indicate that quotas are off + * AFTER this, in the case of quotaoff. This also gets called from + * xfs_rootumount. + */ +void +xfs_qm_dqrele_all_inodes( + struct xfs_mount *mp, + uint flags) +{ + int i; + + ASSERT(mp->m_quotainfo); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + if (!mp->m_perag[i].pag_ici_init) + continue; + xfs_qm_dqrele_inodes_ag(mp, i, flags); + } } /*------------------------------------------------------------------------*/ -- 1.5.6 From owner-xfs@oss.sgi.com Tue Jul 22 17:40:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 17:40:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N0eA1R026506 for ; Tue, 22 Jul 2008 17:40:10 -0700 X-ASG-Debug-ID: 1216773677-2c2e01520001-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CB347316FC6 for ; Tue, 22 Jul 2008 17:41:18 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 8mGCgii324fqBgE1 for ; Tue, 22 Jul 2008 17:41:18 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEcahkh5LFxAiGdsb2JhbACSTQEBAQ8gnwo X-IronPort-AV: E=Sophos;i="4.31,234,1215354600"; d="scan'208";a="155512412" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 10:11:15 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLSPp-0000yB-Vy; Wed, 23 Jul 2008 10:41:13 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes V2 Subject: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes V2 Date: Wed, 23 Jul 2008 10:41:11 +1000 Message-Id: <1216773673-3620-3-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216773673-3620-1-git-send-email-david@fromorbit.com> References: <1216773673-3620-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216773679 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56804 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17031 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Update xfs_sync_inodes to walk the inode radix tree cache to find dirty inodes. This removes a huge bunch of nasty, messy code for traversing the mount inode list safely and removes another user of the mount inode list. Version 2 o add comment explaining use of gang lookups for a single inode o use IRELE, not VN_RELE o move check for ag initialisation to caller. Signed-off-by: Dave Chinner --- fs/xfs/xfs_vfsops.c | 361 ++++++++++++++------------------------------------ 1 files changed, 101 insertions(+), 260 deletions(-) diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index ab3f004..197a308 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -271,356 +271,197 @@ xfs_sync( } /* - * xfs sync routine for internal use - * - * This routine supports all of the flags defined for the generic vfs_sync - * interface as explained above under xfs_sync. - * + * Sync all the inodes in the given AG according to the + * direction given by the flags. */ -int -xfs_sync_inodes( +STATIC int +xfs_sync_inodes_ag( xfs_mount_t *mp, + int ag, int flags, - int *bypassed) + int *bypassed) { xfs_inode_t *ip = NULL; bhv_vnode_t *vp = NULL; - int error; - int last_error; - uint64_t fflag; - uint lock_flags; - uint base_lock_flags; - boolean_t mount_locked; - boolean_t vnode_refed; - int preempt; - xfs_iptr_t *ipointer; -#ifdef DEBUG - boolean_t ipointer_in = B_FALSE; - -#define IPOINTER_SET ipointer_in = B_TRUE -#define IPOINTER_CLR ipointer_in = B_FALSE -#else -#define IPOINTER_SET -#define IPOINTER_CLR -#endif - - -/* Insert a marker record into the inode list after inode ip. The list - * must be locked when this is called. After the call the list will no - * longer be locked. - */ -#define IPOINTER_INSERT(ip, mp) { \ - ASSERT(ipointer_in == B_FALSE); \ - ipointer->ip_mnext = ip->i_mnext; \ - ipointer->ip_mprev = ip; \ - ip->i_mnext = (xfs_inode_t *)ipointer; \ - ipointer->ip_mnext->i_mprev = (xfs_inode_t *)ipointer; \ - preempt = 0; \ - XFS_MOUNT_IUNLOCK(mp); \ - mount_locked = B_FALSE; \ - IPOINTER_SET; \ - } - -/* Remove the marker from the inode list. If the marker was the only item - * in the list then there are no remaining inodes and we should zero out - * the whole list. If we are the current head of the list then move the head - * past us. - */ -#define IPOINTER_REMOVE(ip, mp) { \ - ASSERT(ipointer_in == B_TRUE); \ - if (ipointer->ip_mnext != (xfs_inode_t *)ipointer) { \ - ip = ipointer->ip_mnext; \ - ip->i_mprev = ipointer->ip_mprev; \ - ipointer->ip_mprev->i_mnext = ip; \ - if (mp->m_inodes == (xfs_inode_t *)ipointer) { \ - mp->m_inodes = ip; \ - } \ - } else { \ - ASSERT(mp->m_inodes == (xfs_inode_t *)ipointer); \ - mp->m_inodes = NULL; \ - ip = NULL; \ - } \ - IPOINTER_CLR; \ - } - -#define XFS_PREEMPT_MASK 0x7f - - ASSERT(!(flags & SYNC_BDFLUSH)); - - if (bypassed) - *bypassed = 0; - if (mp->m_flags & XFS_MOUNT_RDONLY) - return 0; - error = 0; - last_error = 0; - preempt = 0; - - /* Allocate a reference marker */ - ipointer = (xfs_iptr_t *)kmem_zalloc(sizeof(xfs_iptr_t), KM_SLEEP); + xfs_perag_t *pag = &mp->m_perag[ag]; + boolean_t vnode_refed = B_FALSE; + int nr_found; + int first_index = 0; + int error = 0; + int last_error = 0; + int fflag = XFS_B_ASYNC; + int lock_flags = XFS_ILOCK_SHARED; - fflag = XFS_B_ASYNC; /* default is don't wait */ if (flags & SYNC_DELWRI) fflag = XFS_B_DELWRI; if (flags & SYNC_WAIT) fflag = 0; /* synchronous overrides all */ - base_lock_flags = XFS_ILOCK_SHARED; if (flags & (SYNC_DELWRI | SYNC_CLOSE)) { /* * We need the I/O lock if we're going to call any of * the flush/inval routines. */ - base_lock_flags |= XFS_IOLOCK_SHARED; + lock_flags |= XFS_IOLOCK_SHARED; } - XFS_MOUNT_ILOCK(mp); - - ip = mp->m_inodes; - - mount_locked = B_TRUE; - vnode_refed = B_FALSE; - - IPOINTER_CLR; - do { - ASSERT(ipointer_in == B_FALSE); - ASSERT(vnode_refed == B_FALSE); - - lock_flags = base_lock_flags; - /* - * There were no inodes in the list, just break out - * of the loop. + * use a gang lookup to find the next inode in the tree + * as the tree is sparse and a gang lookup walks to find + * the number of objects requested. */ - if (ip == NULL) { - break; - } + read_lock(&pag->pag_ici_lock); + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); - /* - * We found another sync thread marker - skip it - */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; + if (!nr_found) { + read_unlock(&pag->pag_ici_lock); + break; } - vp = XFS_ITOV_NULL(ip); + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); /* - * If the vnode is gone then this is being torn down, - * call reclaim if it is flushed, else let regular flush - * code deal with it later in the loop. + * skip inodes in reclaim. Let xfs_syncsub do that for + * us so we don't need to worry. */ - - if (vp == NULL) { - /* Skip ones already in reclaim */ - if (ip->i_flags & XFS_IRECLAIM) { - ip = ip->i_mnext; - continue; - } - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) { - ip = ip->i_mnext; - } else if ((xfs_ipincount(ip) == 0) && - xfs_iflock_nowait(ip)) { - IPOINTER_INSERT(ip, mp); - - xfs_finish_reclaim(ip, 1, - XFS_IFLUSH_DELWRI_ELSE_ASYNC); - - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - } else { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - ip = ip->i_mnext; - } + vp = XFS_ITOV_NULL(ip); + if (!vp) { + read_unlock(&pag->pag_ici_lock); continue; } + /* bad inodes are dealt with elsewhere */ if (VN_BAD(vp)) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); continue; } + /* nothing to sync during shutdown */ if (XFS_FORCED_SHUTDOWN(mp) && !(flags & SYNC_CLOSE)) { - XFS_MOUNT_IUNLOCK(mp); - kmem_free(ipointer); + read_unlock(&pag->pag_ici_lock); return 0; } /* - * Try to lock without sleeping. We're out of order with - * the inode list lock here, so if we fail we need to drop - * the mount lock and try again. If we're called from - * bdflush() here, then don't bother. - * - * The inode lock here actually coordinates with the - * almost spurious inode lock in xfs_ireclaim() to prevent - * the vnode we handle here without a reference from - * being freed while we reference it. If we lock the inode - * while it's on the mount list here, then the spurious inode - * lock in xfs_ireclaim() after the inode is pulled from - * the mount list will sleep until we release it here. - * This keeps the vnode from being freed while we reference - * it. + * The inode lock here actually coordinates with the almost + * spurious inode lock in xfs_ireclaim() to prevent the vnode + * we handle here without a reference from being freed while we + * reference it. If we lock the inode while it's on the mount + * list here, then the spurious inode lock in xfs_ireclaim() + * after the inode is pulled from the mount list will sleep + * until we release it here. This keeps the vnode from being + * freed while we reference it. */ if (xfs_ilock_nowait(ip, lock_flags) == 0) { - if (vp == NULL) { - ip = ip->i_mnext; - continue; - } - vp = vn_grab(vp); - if (vp == NULL) { - ip = ip->i_mnext; + read_unlock(&pag->pag_ici_lock); + if (!vp) continue; - } - - IPOINTER_INSERT(ip, mp); xfs_ilock(ip, lock_flags); ASSERT(vp == XFS_ITOV(ip)); ASSERT(ip->i_mount == mp); vnode_refed = B_TRUE; + } else { + /* safe to unlock here as we have a reference */ + read_unlock(&pag->pag_ici_lock); } - - /* From here on in the loop we may have a marker record - * in the inode list. - */ - /* * If we have to flush data or wait for I/O completion * we need to drop the ilock that we currently hold. * If we need to drop the lock, insert a marker if we * have not already done so. */ - if ((flags & (SYNC_CLOSE|SYNC_IOWAIT)) || - ((flags & SYNC_DELWRI) && VN_DIRTY(vp))) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } + if (flags & SYNC_CLOSE) { xfs_iunlock(ip, XFS_ILOCK_SHARED); - - if (flags & SYNC_CLOSE) { - /* Shutdown case. Flush and invalidate. */ - if (XFS_FORCED_SHUTDOWN(mp)) - xfs_tosspages(ip, 0, -1, - FI_REMAPF); - else - error = xfs_flushinval_pages(ip, - 0, -1, FI_REMAPF); - } else if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { - error = xfs_flush_pages(ip, 0, - -1, fflag, FI_NONE); - } - - /* - * When freezing, we need to wait ensure all I/O (including direct - * I/O) is complete to ensure no further data modification can take - * place after this point - */ + if (XFS_FORCED_SHUTDOWN(mp)) + xfs_tosspages(ip, 0, -1, FI_REMAPF); + else + error = xfs_flushinval_pages(ip, 0, -1, + FI_REMAPF); + /* wait for I/O on freeze */ if (flags & SYNC_IOWAIT) vn_iowait(ip); xfs_ilock(ip, XFS_ILOCK_SHARED); } - if ((flags & SYNC_ATTR) && - (ip->i_update_core || - (ip->i_itemp && ip->i_itemp->ili_format.ilf_fields))) { - if (mount_locked) - IPOINTER_INSERT(ip, mp); + if ((flags & SYNC_DELWRI) && VN_DIRTY(vp)) { + xfs_iunlock(ip, XFS_ILOCK_SHARED); + error = xfs_flush_pages(ip, 0, -1, fflag, FI_NONE); + if (flags & SYNC_IOWAIT) + vn_iowait(ip); + xfs_ilock(ip, XFS_ILOCK_SHARED); + } + if ((flags & SYNC_ATTR) && !xfs_inode_clean(ip)) { if (flags & SYNC_WAIT) { xfs_iflock(ip); - error = xfs_iflush(ip, XFS_IFLUSH_SYNC); - - /* - * If we can't acquire the flush lock, then the inode - * is already being flushed so don't bother waiting. - * - * If we can lock it then do a delwri flush so we can - * combine multiple inode flushes in each disk write. - */ + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_SYNC); + else + xfs_ifunlock(ip); } else if (xfs_iflock_nowait(ip)) { - error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + if (!xfs_inode_clean(ip)) + error = xfs_iflush(ip, XFS_IFLUSH_DELWRI); + else + xfs_ifunlock(ip); } else if (bypassed) { (*bypassed)++; } } - if (lock_flags != 0) { + if (lock_flags) xfs_iunlock(ip, lock_flags); - } if (vnode_refed) { - /* - * If we had to take a reference on the vnode - * above, then wait until after we've unlocked - * the inode to release the reference. This is - * because we can be already holding the inode - * lock when IRELE() calls xfs_inactive(). - * - * Make sure to drop the mount lock before calling - * IRELE() so that we don't trip over ourselves if - * we have to go for the mount lock again in the - * inactive code. - */ - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - IRELE(ip); - vnode_refed = B_FALSE; } - if (error) { + if (error) last_error = error; - } - /* * bail out if the filesystem is corrupted. */ - if (error == EFSCORRUPTED) { - if (!mount_locked) { - XFS_MOUNT_ILOCK(mp); - IPOINTER_REMOVE(ip, mp); - } - XFS_MOUNT_IUNLOCK(mp); - ASSERT(ipointer_in == B_FALSE); - kmem_free(ipointer); + if (error == EFSCORRUPTED) return XFS_ERROR(error); - } - /* Let other threads have a chance at the mount lock - * if we have looped many times without dropping the - * lock. - */ - if ((++preempt & XFS_PREEMPT_MASK) == 0) { - if (mount_locked) { - IPOINTER_INSERT(ip, mp); - } - } - - if (mount_locked == B_FALSE) { - XFS_MOUNT_ILOCK(mp); - mount_locked = B_TRUE; - IPOINTER_REMOVE(ip, mp); - continue; - } - - ASSERT(ipointer_in == B_FALSE); - ip = ip->i_mnext; + } while (nr_found); - } while (ip != mp->m_inodes); + return last_error; +} - XFS_MOUNT_IUNLOCK(mp); +int +xfs_sync_inodes( + xfs_mount_t *mp, + int flags, + int *bypassed) +{ + int error; + int last_error; + int i; - ASSERT(ipointer_in == B_FALSE); + if (bypassed) + *bypassed = 0; + if (mp->m_flags & XFS_MOUNT_RDONLY) + return 0; + error = 0; + last_error = 0; - kmem_free(ipointer); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + if (!mp->m_perag[i].pag_ici_init) + continue; + error = xfs_sync_inodes_ag(mp, i, flags, bypassed); + if (error) + last_error = error; + if (error == EFSCORRUPTED) + break; + } return XFS_ERROR(last_error); } -- 1.5.6 From owner-xfs@oss.sgi.com Tue Jul 22 17:40:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 17:40:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N0e8sL026492 for ; Tue, 22 Jul 2008 17:40:09 -0700 X-ASG-Debug-ID: 1216773677-197002940000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 06C99316FC5 for ; Tue, 22 Jul 2008 17:41:18 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id c8eItMHV8PB64VJN for ; Tue, 22 Jul 2008 17:41:18 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEcahkh5LFxAiGdsb2JhbACSTQEBAQ8gnwo X-IronPort-AV: E=Sophos;i="4.31,234,1215354600"; d="scan'208";a="155512414" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 10:11:15 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLSPp-0000y9-U9; Wed, 23 Jul 2008 10:41:13 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Subject: [PATCH 1/4] XFS: Remove xfs_iflush_all and clean up xfs_finish_reclaim_all() V2 Date: Wed, 23 Jul 2008 10:41:10 +1000 Message-Id: <1216773673-3620-2-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216773673-3620-1-git-send-email-david@fromorbit.com> References: <1216773673-3620-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216773679 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56804 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17033 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs xfs_iflush_all() walks the m_inodes list to find inodes that need reclaiming. We already have such a list - the m_del_inodes list. Replace xfs_iflush_all() with a call to xfs_finish_reclaim_all() and clean up xfs_finish_reclaim_all() to handle the different flush modes now needed. Originally based on a patch from Christoph Hellwig. Version 2 o revert xfs_syncsub() inode reclaim behaviour back to original code o xfs_quiesce_fs() should use XFS_IFLUSH_DELWRI_ELSE_ASYNC, not XFS_IFLUSH_ASYNC, to prevent change of behaviour. Signed-off-by: Dave Chinner --- fs/xfs/xfs_inode.c | 39 --------------------------------------- fs/xfs/xfs_inode.h | 3 +-- fs/xfs/xfs_mount.c | 2 +- fs/xfs/xfs_vfsops.c | 4 ++-- fs/xfs/xfs_vnodeops.c | 42 ++++++++++++++++++------------------------ 5 files changed, 22 insertions(+), 68 deletions(-) diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c index 20b6f87..ae19b05 100644 --- a/fs/xfs/xfs_inode.c +++ b/fs/xfs/xfs_inode.c @@ -3456,45 +3456,6 @@ corrupt_out: return XFS_ERROR(EFSCORRUPTED); } - -/* - * Flush all inactive inodes in mp. - */ -void -xfs_iflush_all( - xfs_mount_t *mp) -{ - xfs_inode_t *ip; - bhv_vnode_t *vp; - - again: - XFS_MOUNT_ILOCK(mp); - ip = mp->m_inodes; - if (ip == NULL) - goto out; - - do { - /* Make sure we skip markers inserted by sync */ - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - - vp = XFS_ITOV_NULL(ip); - if (!vp) { - XFS_MOUNT_IUNLOCK(mp); - xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); - goto again; - } - - ASSERT(vn_count(vp) == 0); - - ip = ip->i_mnext; - } while (ip != mp->m_inodes); - out: - XFS_MOUNT_IUNLOCK(mp); -} - #ifdef XFS_ILOCK_TRACE ktrace_t *xfs_ilock_trace_buf; diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 17a04b6..7ce41d3 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -480,7 +480,7 @@ void xfs_iunlock_map_shared(xfs_inode_t *, uint); void xfs_ifunlock(xfs_inode_t *); void xfs_ireclaim(xfs_inode_t *); int xfs_finish_reclaim(xfs_inode_t *, int, int); -int xfs_finish_reclaim_all(struct xfs_mount *, int); +int xfs_finish_reclaim_all(struct xfs_mount *, int, int); /* * xfs_inode.c prototypes. @@ -518,7 +518,6 @@ void xfs_ipin(xfs_inode_t *); void xfs_iunpin(xfs_inode_t *); int xfs_iextents_copy(xfs_inode_t *, xfs_bmbt_rec_t *, int); int xfs_iflush(xfs_inode_t *, uint); -void xfs_iflush_all(struct xfs_mount *); void xfs_ichgtime(xfs_inode_t *, int); xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); void xfs_lock_inodes(xfs_inode_t **, int, uint); diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 6c5d132..0c23f6a 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1268,7 +1268,7 @@ xfs_unmountfs(xfs_mount_t *mp) * need to force the log first. */ xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE | XFS_LOG_SYNC); - xfs_iflush_all(mp); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_ASYNC); XFS_QM_DQPURGEALL(mp, XFS_QMOPT_QUOTALL | XFS_QMOPT_UMOUNTING); diff --git a/fs/xfs/xfs_vfsops.c b/fs/xfs/xfs_vfsops.c index 4a9a433..ab3f004 100644 --- a/fs/xfs/xfs_vfsops.c +++ b/fs/xfs/xfs_vfsops.c @@ -65,7 +65,7 @@ xfs_quiesce_fs( int count = 0, pincount; xfs_flush_buftarg(mp->m_ddev_targp, 0); - xfs_finish_reclaim_all(mp, 0); + xfs_finish_reclaim_all(mp, 0, XFS_IFLUSH_DELWRI_ELSE_ASYNC); /* This loop must run at least twice. * The first instance of the loop will flush @@ -654,7 +654,7 @@ xfs_syncsub( if (flags & (SYNC_ATTR|SYNC_DELWRI)) { if (flags & SYNC_BDFLUSH) - xfs_finish_reclaim_all(mp, 1); + xfs_finish_reclaim_all(mp, 1, XFS_IFLUSH_DELWRI_ELSE_ASYNC); else error = xfs_sync_inodes(mp, flags, bypassed); } diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index b792a12..2af1be3 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c @@ -2985,36 +2985,30 @@ xfs_finish_reclaim( } int -xfs_finish_reclaim_all(xfs_mount_t *mp, int noblock) +xfs_finish_reclaim_all( + xfs_mount_t *mp, + int noblock, + int mode) { - int purged; xfs_inode_t *ip, *n; - int done = 0; - while (!done) { - purged = 0; - XFS_MOUNT_ILOCK(mp); - list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { - if (noblock) { - if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) - continue; - if (xfs_ipincount(ip) || - !xfs_iflock_nowait(ip)) { - xfs_iunlock(ip, XFS_ILOCK_EXCL); - continue; - } +restart: + XFS_MOUNT_ILOCK(mp); + list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { + if (noblock) { + if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) + continue; + if (xfs_ipincount(ip) || + !xfs_iflock_nowait(ip)) { + xfs_iunlock(ip, XFS_ILOCK_EXCL); + continue; } - XFS_MOUNT_IUNLOCK(mp); - if (xfs_finish_reclaim(ip, noblock, - XFS_IFLUSH_DELWRI_ELSE_ASYNC)) - delay(1); - purged = 1; - break; } - - done = !purged; + XFS_MOUNT_IUNLOCK(mp); + if (xfs_finish_reclaim(ip, noblock, mode)) + delay(1); + goto restart; } - XFS_MOUNT_IUNLOCK(mp); return 0; } -- 1.5.6 From owner-xfs@oss.sgi.com Tue Jul 22 17:40:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 17:40:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N0e8x0026480 for ; Tue, 22 Jul 2008 17:40:08 -0700 X-ASG-Debug-ID: 1216773677-2c2e01520000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4A1B5316FC3 for ; Tue, 22 Jul 2008 17:41:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id ZNJ5pBjIqXx95Gwc for ; Tue, 22 Jul 2008 17:41:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEcahkh5LFxAiGdsb2JhbACSTQEBAQ8gnwo X-IronPort-AV: E=Sophos;i="4.31,234,1215354600"; d="scan'208";a="155512409" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 10:11:14 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLSPq-0000yG-36; Wed, 23 Jul 2008 10:41:14 +1000 From: Dave Chinner To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 4/4] XFS: remove the mount inode list Subject: [PATCH 4/4] XFS: remove the mount inode list Date: Wed, 23 Jul 2008 10:41:13 +1000 Message-Id: <1216773673-3620-5-git-send-email-david@fromorbit.com> X-Mailer: git-send-email 1.5.6 In-Reply-To: <1216773673-3620-1-git-send-email-david@fromorbit.com> References: <1216773673-3620-1-git-send-email-david@fromorbit.com> X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216773678 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.97 X-Barracuda-Spam-Status: No, SCORE=-0.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE_7582B X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56804 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.05 BSF_RULE_7582B Custom Rule 7582B X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17032 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs Now we've removed all users of the mount inode list, we can kill it. This reduces the size of the xfs_inode by 2 pointers. Signed-off-by: Dave Chinner --- fs/xfs/xfs_iget.c | 42 +----------------------------------------- fs/xfs/xfs_inode.h | 8 -------- fs/xfs/xfs_mount.c | 5 ----- fs/xfs/xfs_mount.h | 1 - 4 files changed, 1 insertions(+), 55 deletions(-) diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c index b07604b..f16ca6c 100644 --- a/fs/xfs/xfs_iget.c +++ b/fs/xfs/xfs_iget.c @@ -76,7 +76,6 @@ xfs_iget_core( { struct inode *old_inode; xfs_inode_t *ip; - xfs_inode_t *iq; int error; unsigned long first_index, mask; xfs_perag_t *pag; @@ -260,24 +259,6 @@ finish_inode: write_unlock(&pag->pag_ici_lock); radix_tree_preload_end(); - - /* - * Link ip to its mount and thread it on the mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - if ((iq = mp->m_inodes)) { - ASSERT(iq->i_mprev->i_mnext == iq); - ip->i_mprev = iq->i_mprev; - iq->i_mprev->i_mnext = ip; - iq->i_mprev = ip; - ip->i_mnext = iq; - } else { - ip->i_mnext = ip; - ip->i_mprev = ip; - } - mp->m_inodes = ip; - - XFS_MOUNT_IUNLOCK(mp); xfs_put_perag(mp, pag); return_ip: @@ -490,36 +471,15 @@ xfs_iextract( { xfs_mount_t *mp = ip->i_mount; xfs_perag_t *pag = xfs_get_perag(mp, ip->i_ino); - xfs_inode_t *iq; write_lock(&pag->pag_ici_lock); radix_tree_delete(&pag->pag_ici_root, XFS_INO_TO_AGINO(mp, ip->i_ino)); write_unlock(&pag->pag_ici_lock); xfs_put_perag(mp, pag); - /* - * Remove from mount's inode list. - */ - XFS_MOUNT_ILOCK(mp); - ASSERT((ip->i_mnext != NULL) && (ip->i_mprev != NULL)); - iq = ip->i_mnext; - iq->i_mprev = ip->i_mprev; - ip->i_mprev->i_mnext = iq; - - /* - * Fix up the head pointer if it points to the inode being deleted. - */ - if (mp->m_inodes == ip) { - if (ip == iq) { - mp->m_inodes = NULL; - } else { - mp->m_inodes = iq; - } - } - /* Deal with the deleted inodes list */ + XFS_MOUNT_ILOCK(mp); list_del_init(&ip->i_reclaim); - mp->m_ireclaims++; XFS_MOUNT_IUNLOCK(mp); } diff --git a/fs/xfs/xfs_inode.h b/fs/xfs/xfs_inode.h index 7ce41d3..c440b1d 100644 --- a/fs/xfs/xfs_inode.h +++ b/fs/xfs/xfs_inode.h @@ -192,16 +192,8 @@ typedef struct xfs_icdinode { __uint32_t di_gen; /* generation number */ } xfs_icdinode_t; -typedef struct { - struct xfs_inode *ip_mnext; /* next inode in mount list */ - struct xfs_inode *ip_mprev; /* ptr to prev inode */ - struct xfs_mount *ip_mount; /* fs mount struct ptr */ -} xfs_iptr_t; - typedef struct xfs_inode { /* Inode linking and identification information. */ - struct xfs_inode *i_mnext; /* next inode in mount list */ - struct xfs_inode *i_mprev; /* ptr to prev inode */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ bhv_vnode_t *i_vnode; /* vnode backpointer */ diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index 0c23f6a..364c075 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -1314,11 +1314,6 @@ xfs_unmountfs(xfs_mount_t *mp) xfs_freesb(mp); - /* - * All inodes from this mount point should be freed. - */ - ASSERT(mp->m_inodes == NULL); - if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) uuid_table_remove(&mp->m_sb.sb_uuid); diff --git a/fs/xfs/xfs_mount.h b/fs/xfs/xfs_mount.h index 6482005..4f257d7 100644 --- a/fs/xfs/xfs_mount.h +++ b/fs/xfs/xfs_mount.h @@ -247,7 +247,6 @@ typedef struct xfs_mount { xfs_agnumber_t m_agirotor; /* last ag dir inode alloced */ spinlock_t m_agirotor_lock;/* .. and lock protecting it */ xfs_agnumber_t m_maxagi; /* highest inode alloc group */ - struct xfs_inode *m_inodes; /* active inode list */ struct list_head m_del_inodes; /* inodes to reclaim */ mutex_t m_ilock; /* inode list mutex */ uint m_ireclaims; /* count of calls to reclaim*/ -- 1.5.6 From owner-xfs@oss.sgi.com Tue Jul 22 19:09:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 19:09:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N28xpZ002808 for ; Tue, 22 Jul 2008 19:09:02 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA01415; Wed, 23 Jul 2008 12:10:04 +1000 Message-ID: <488692FB.1010101@sgi.com> Date: Wed, 23 Jul 2008 12:10:03 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> In-Reply-To: <20080723000548.GG5947@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17034 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Tue, Jul 22, 2008 at 03:27:33AM -0400, Christoph Hellwig wrote: >> ... >> I only fear >> we'll never get it in with the current review and commit latencies >> for XFS :( > > I can see this being a big issue in the not-too-distant future..... [getting off-topic for this thread, but anyway ..] This is already a big issue, obviously, and has been for some time. Internally, we're attempting to refine our patch acceptance processes, (e.g. gitify our internal dev tree and mirror it on oss so it's much easier to push back out to oss). But the QA overhead remains a stubborn problem. I think we're going to have to ask for QA tests (both regression and performance) to be written as part of the patch acceptance policy - under this policy, merely passing existing QA will not be sufficient. Comments? We have recently set up external access to a system for QA and regression testing for Christoph's use .. perhaps that should be a permanent offering? Cheers -- Mark From owner-xfs@oss.sgi.com Tue Jul 22 19:22:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 19:22:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N2MYJv004498 for ; Tue, 22 Jul 2008 19:22:35 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA01622; Wed, 23 Jul 2008 12:23:36 +1000 Message-ID: <48869628.8010201@sgi.com> Date: Wed, 23 Jul 2008 12:23:36 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Dave Chinner CC: xfs@oss.sgi.com Subject: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 References: <1216773673-3620-1-git-send-email-david@fromorbit.com> In-Reply-To: <1216773673-3620-1-git-send-email-david@fromorbit.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17035 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > The list of all inodes on a mount is superfluous. We can traverse > all inodes now by walking the per-AG inode radix trees without > needing a separate list. This enables us to remove a bunch of > complex list traversal code and remove another two pointers from > the xfs_inode. sounds like a good move. > Also, by replacing the sync traversal with an ascending inode > number traversal, we will issue better inode I/O patterns for > writeback triggered by xfssyncd or unmount. Dave, have you made any performance measurements showing this to be the case? If so, what is the improvement? Or should we just assume such traversals will be more naturally sequential and therefore more efficient? Cheers -- Mark From owner-xfs@oss.sgi.com Tue Jul 22 20:46:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 20:46:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N3kJ9D016082 for ; Tue, 22 Jul 2008 20:46:19 -0700 X-ASG-Debug-ID: 1216784849-2ce4027c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EB5273175D9 for ; Tue, 22 Jul 2008 20:47:29 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id ABjBBvHPi4g7MXhw for ; Tue, 22 Jul 2008 20:47:29 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 9D419AC6272; Tue, 22 Jul 2008 22:47:08 -0500 (CDT) Message-ID: <4886A9A3.8090805@sandeen.net> Date: Tue, 22 Jul 2008 22:46:43 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> In-Reply-To: <488692FB.1010101@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216784849 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56817 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17036 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mark Goodwin wrote: > > Dave Chinner wrote: >> On Tue, Jul 22, 2008 at 03:27:33AM -0400, Christoph Hellwig wrote: >>> ... >>> I only fear >>> we'll never get it in with the current review and commit latencies >>> for XFS :( >> I can see this being a big issue in the not-too-distant future..... > > [getting off-topic for this thread, but anyway ..] > This is already a big issue, obviously, and has been for some time. > > Internally, we're attempting to refine our patch acceptance processes, > (e.g. gitify our internal dev tree and mirror it on oss so it's much > easier to push back out to oss). But the QA overhead remains a stubborn > problem. I think we're going to have to ask for QA tests (both regression > and performance) to be written as part of the patch acceptance policy - > under this policy, merely passing existing QA will not be sufficient. > Comments? I think that'll depend very much on what the change is. For new functionality, sounds good; for bugfixes with testcases, sounds good. For general algorithm improvements... how do you write a new QA test for "Use the inode tree for finding dirty inodes?" Or for that matter, my remaining 2 shouting-removal patches ;) > We have recently set up external access to a system for QA and > regression testing for Christoph's use .. perhaps that should > be a permanent offering? Sounds awesome, for serious contributors. I'd be happy to use it, too ;) -Eric From owner-xfs@oss.sgi.com Tue Jul 22 20:48:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 20:48:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N3mcuQ016549 for ; Tue, 22 Jul 2008 20:48:39 -0700 X-ASG-Debug-ID: 1216784988-628a02e50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 366A9E88994 for ; Tue, 22 Jul 2008 20:49:48 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id zgRHBsD2Je0MUjV2 for ; Tue, 22 Jul 2008 20:49:48 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id D7E62AC6272; Tue, 22 Jul 2008 22:49:41 -0500 (CDT) Message-ID: <4886AA4B.3030302@sandeen.net> Date: Tue, 22 Jul 2008 22:49:31 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: David Chinner CC: xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [patch] Use BIO_META tags for metadata rather than BIO_SYNC Subject: Re: [patch] Use BIO_META tags for metadata rather than BIO_SYNC References: <20080121041826.GB155259@sgi.com> In-Reply-To: <20080121041826.GB155259@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216784989 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56816 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17037 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs David Chinner wrote: > Improve metadata I/O merging in the elevator > > Change all async metadata buffers to use [READ|WRITE]_META I/O types > so that the I/O doesn't get issued immediately. This allows merging > of adjacent metadata requests but still prioritises them over bulk > data. This shows a 10-15% improvement in sequential create speed of > small files. That sounds awesome. I'll test it on a similar workload I've been playing with. Lachlan reviewed this, I think - any plans to add it? I'll run my test & post results. Thanks, -Eric > Don't include the log buffers in this classification - leave them > as sync types so they are issued immediately. > > Signed-off-by: Dave Chinner > --- > fs/xfs/linux-2.6/xfs_buf.c | 6 +++++- > include/linux/fs.h | 1 + > 2 files changed, 6 insertions(+), 1 deletion(-) > > Index: 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c > =================================================================== > --- 2.6.x-xfs-new.orig/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:47.977477993 +1100 > +++ 2.6.x-xfs-new/fs/xfs/linux-2.6/xfs_buf.c 2007-12-19 11:56:52.200932303 +1100 > @@ -1136,10 +1136,14 @@ _xfs_buf_ioapply( > if (bp->b_flags & XBF_ORDERED) { > ASSERT(!(bp->b_flags & XBF_READ)); > rw = WRITE_BARRIER; > - } else if (bp->b_flags & _XBF_RUN_QUEUES) { > + } else if (bp->b_flags & XBF_LOG_BUFFER) { > ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); > bp->b_flags &= ~_XBF_RUN_QUEUES; > rw = (bp->b_flags & XBF_WRITE) ? WRITE_SYNC : READ_SYNC; > + } else if (bp->b_flags & _XBF_RUN_QUEUES) { > + ASSERT(!(bp->b_flags & XBF_READ_AHEAD)); > + bp->b_flags &= ~_XBF_RUN_QUEUES; > + rw = (bp->b_flags & XBF_WRITE) ? WRITE_META : READ_META; > } else { > rw = (bp->b_flags & XBF_WRITE) ? WRITE : > (bp->b_flags & XBF_READ_AHEAD) ? READA : READ; > Index: 2.6.x-xfs-new/include/linux/fs.h > =================================================================== > --- 2.6.x-xfs-new.orig/include/linux/fs.h 2007-12-19 01:11:16.495229881 +1100 > +++ 2.6.x-xfs-new/include/linux/fs.h 2007-12-19 11:56:52.352912667 +1100 > @@ -83,6 +83,7 @@ extern int dir_notify_enable; > #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) > #define READ_META (READ | (1 << BIO_RW_META)) > #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) > +#define WRITE_META (WRITE | (1 << BIO_RW_META)) > #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) > > #define SEL_IN 1 > > From owner-xfs@oss.sgi.com Tue Jul 22 21:03:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 21:03:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N433AW018163 for ; Tue, 22 Jul 2008 21:03:05 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA03253; Wed, 23 Jul 2008 14:04:06 +1000 Message-ID: <4886ADB6.5060109@sgi.com> Date: Wed, 23 Jul 2008 14:04:06 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <4886A9A3.8090805@sandeen.net> In-Reply-To: <4886A9A3.8090805@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17038 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Mark Goodwin wrote: >> Dave Chinner wrote: >>> On Tue, Jul 22, 2008 at 03:27:33AM -0400, Christoph Hellwig wrote: >>>> ... >>>> I only fear >>>> we'll never get it in with the current review and commit latencies >>>> for XFS :( >>> I can see this being a big issue in the not-too-distant future..... >> [getting off-topic for this thread, but anyway ..] >> This is already a big issue, obviously, and has been for some time. >> >> Internally, we're attempting to refine our patch acceptance processes, >> (e.g. gitify our internal dev tree and mirror it on oss so it's much >> easier to push back out to oss). But the QA overhead remains a stubborn >> problem. I think we're going to have to ask for QA tests (both regression >> and performance) to be written as part of the patch acceptance policy - >> under this policy, merely passing existing QA will not be sufficient. >> Comments? > > I think that'll depend very much on what the change is. For new > functionality, sounds good; for bugfixes with testcases, sounds good. and for cleanups, just run existing QA (new test wouldn't normally make sense). > For general algorithm improvements... how do you write a new QA test for > "Use the inode tree for finding dirty inodes?" Case by case basis I guess. e.g. write a test that exercises or stresses the changed algorithm or functionality, especially corner cases (low space, full AGs, mem pressure, whatever). Performance regression testing is trickier - need access to suitable h/w and the historical data; so it's probably best run on dedicated h/w every night against the dev tree. > Or for that matter, my > remaining 2 shouting-removal patches ;) As above, just run QA for cleanups. > >> We have recently set up external access to a system for QA and >> regression testing for Christoph's use .. perhaps that should >> be a permanent offering? > > Sounds awesome, for serious contributors. I'd be happy to use it, too ;) > > -Eric > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Tue Jul 22 21:08:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 21:08:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N48oUq019013 for ; Tue, 22 Jul 2008 21:08:50 -0700 X-ASG-Debug-ID: 1216786199-1aa001b80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A2B1A191D413 for ; Tue, 22 Jul 2008 21:09:59 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id jyl3GyjNFIpdO7Jv for ; Tue, 22 Jul 2008 21:09:59 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id A15D1AC6272; Tue, 22 Jul 2008 23:09:54 -0500 (CDT) Message-ID: <4886AF06.40808@sandeen.net> Date: Tue, 22 Jul 2008 23:09:42 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: markgw@sgi.com CC: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <4886A9A3.8090805@sandeen.net> <4886ADB6.5060109@sgi.com> In-Reply-To: <4886ADB6.5060109@sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216786200 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56817 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17039 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Mark Goodwin wrote: > As above, just run QA for cleanups. Out of curiosity, will you trust this? You'll run QA anyway, right? And do you very often find errors in submitted patches by running QA? -Eric From owner-xfs@oss.sgi.com Tue Jul 22 21:17:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 21:17:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N4HR01020191 for ; Tue, 22 Jul 2008 21:17:27 -0700 X-ASG-Debug-ID: 1216786716-3274000a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5AF13E87C97 for ; Tue, 22 Jul 2008 21:18:36 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id qKSbxOkD9eSrcDRi for ; Tue, 22 Jul 2008 21:18:36 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAEhLhkh5LFxAiGdsb2JhbACSTQEBAQ8gni4 X-IronPort-AV: E=Sophos;i="4.31,235,1215354600"; d="scan'208";a="155672253" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 13:48:34 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLVo8-0006C0-4a; Wed, 23 Jul 2008 14:18:32 +1000 Date: Wed, 23 Jul 2008 14:18:32 +1000 From: Dave Chinner To: Mark Goodwin Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080723041832.GH5947@disturbed> Mail-Followup-To: Mark Goodwin , Christoph Hellwig , xfs@oss.sgi.com References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <488692FB.1010101@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216786717 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0598 1.0000 -1.6383 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.64 X-Barracuda-Spam-Status: No, SCORE=-1.64 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56817 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17040 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 12:10:03PM +1000, Mark Goodwin wrote: > > > Dave Chinner wrote: >> On Tue, Jul 22, 2008 at 03:27:33AM -0400, Christoph Hellwig wrote: >>> ... >>> I only fear >>> we'll never get it in with the current review and commit latencies >>> for XFS :( >> >> I can see this being a big issue in the not-too-distant future..... > > [getting off-topic for this thread, but anyway ..] > This is already a big issue, obviously, and has been for some time. > > Internally, we're attempting to refine our patch acceptance processes, > (e.g. gitify our internal dev tree and mirror it on oss so it's much > easier to push back out to oss). But the QA overhead remains a stubborn > problem. I think we're going to have to ask for QA tests (both regression > and performance) to be written as part of the patch acceptance policy - > under this policy, merely passing existing QA will not be sufficient. > Comments? In general - unnecessary because most changes submitted don't change behaviour or interfaces or that subsystem/behaviour is already tested by the QA suite. For new features with externally visable interfaces (the rare case) then requiring new tests is just fine. In reality - the community will route around SGI and go straight to Andrew or Linus if this proves to be a burden. Passing XFSQA is a significant indication that the change is as good as the developer can do in their own environment; if it passes review then at that point it needs wider QA, and that comes from committing to *public repositories* so that and varied workloads and machines stress the code. If QA is a burden, it's because you're not allowing the wider community easy access to the dev code to test at an early stage. A dev tree is *meant to break*, it's not a prodution environment. Gett eh code out there early and distribute the QA workload, don't make it a burden on the developers or a bottleneck to getting code accepted. > We have recently set up external access to a system for QA and > regression testing for Christoph's use .. perhaps that should > be a permanent offering? Yes. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 22 21:26:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 21:26:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N4QFEf021217 for ; Tue, 22 Jul 2008 21:26:15 -0700 X-ASG-Debug-ID: 1216787244-1b0b02150000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E49B5191D374 for ; Tue, 22 Jul 2008 21:27:25 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id bpUU2f1DxbRBb1Mz for ; Tue, 22 Jul 2008 21:27:25 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAARPhkh5LFxAiGdsb2JhbACSTQEBAQ8gniw X-IronPort-AV: E=Sophos;i="4.31,235,1215354600"; d="scan'208";a="155678102" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 13:57:23 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLVwg-0006NC-2u; Wed, 23 Jul 2008 14:27:22 +1000 Date: Wed, 23 Jul 2008 14:27:21 +1000 From: Dave Chinner To: Mark Goodwin Cc: Eric Sandeen , Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080723042721.GI5947@disturbed> Mail-Followup-To: Mark Goodwin , Eric Sandeen , Christoph Hellwig , xfs@oss.sgi.com References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <4886A9A3.8090805@sandeen.net> <4886ADB6.5060109@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4886ADB6.5060109@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216787245 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56818 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17041 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 02:04:06PM +1000, Mark Goodwin wrote: > > Eric Sandeen wrote: >> Mark Goodwin wrote: >> For general algorithm improvements... how do you write a new QA test for >> "Use the inode tree for finding dirty inodes?" > > Case by case basis I guess. e.g. write a test that exercises or stresses > the changed algorithm or functionality, especially corner cases > (low space, full AGs, mem pressure, whatever). Most of these corner cases are already covered by XFSQA. > Performance regression testing > is trickier - need access to suitable h/w and the historical data; so it's > probably best run on dedicated h/w every night against the dev tree. Performance regressions are something that generally are only detected some time after the commit occurs - usually when it gets to the wider community. Once again, it's an argument for further distributing the QA load by committing quickly. Indeed, in the case of regressions caused by commmunity contributions, I think a bugzilla bug needs to be raised to track it properly.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 22 21:32:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 21:32:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N4WaRU021913 for ; Tue, 22 Jul 2008 21:32:36 -0700 X-ASG-Debug-ID: 1216787625-7e8900470000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 92E2A3178C1 for ; Tue, 22 Jul 2008 21:33:45 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id NhyefeiIVoS5p5hG for ; Tue, 22 Jul 2008 21:33:45 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AmsCAARPhkh5LFxAiGdsb2JhbACSTQEBAQ8gniw X-IronPort-AV: E=Sophos;i="4.31,235,1215354600"; d="scan'208";a="155682660" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 23 Jul 2008 14:03:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLW2p-0006VK-Df; Wed, 23 Jul 2008 14:33:43 +1000 Date: Wed, 23 Jul 2008 14:33:43 +1000 From: Dave Chinner To: Mark Goodwin Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Subject: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Message-ID: <20080723043343.GJ5947@disturbed> Mail-Followup-To: Mark Goodwin , xfs@oss.sgi.com References: <1216773673-3620-1-git-send-email-david@fromorbit.com> <48869628.8010201@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48869628.8010201@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216787626 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0002 1.0000 -2.0200 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56817 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17042 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 12:23:36PM +1000, Mark Goodwin wrote: > > > Dave Chinner wrote: >> The list of all inodes on a mount is superfluous. We can traverse >> all inodes now by walking the per-AG inode radix trees without >> needing a separate list. This enables us to remove a bunch of >> complex list traversal code and remove another two pointers from >> the xfs_inode. > > sounds like a good move. > >> Also, by replacing the sync traversal with an ascending inode >> number traversal, we will issue better inode I/O patterns for >> writeback triggered by xfssyncd or unmount. > > Dave, have you made any performance measurements showing this to > be the case? If so, what is the improvement? I don't have a test rig I can use to measure it sufficiently accurately. > Or should we just assume > such traversals will be more naturally sequential and therefore more > efficient? Not an assumption - I've verified this occurs with blktrace. I'm seeing ascending order dispatch and a reduction in the number and distance of seeks as well as I/Os being issued to "disk" during such events (like unmount, for example).... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 22 21:59:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 22:00:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N4xuoK023882 for ; Tue, 22 Jul 2008 21:59:57 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA04437; Wed, 23 Jul 2008 15:00:58 +1000 Message-ID: <4886BB09.3080400@sgi.com> Date: Wed, 23 Jul 2008 15:00:57 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Christoph Hellwig , xfs@oss.sgi.com Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <4886A9A3.8090805@sandeen.net> <4886ADB6.5060109@sgi.com> <4886AF06.40808@sandeen.net> In-Reply-To: <4886AF06.40808@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17043 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Mark Goodwin wrote: > >> As above, just run QA for cleanups. > > Out of curiosity, will you trust this? You'll run QA anyway, right? yes we run it anyway, so maybe this (as a requirement) is overkill. > And do you very often find errors in submitted patches by running QA? > don't know, but it is part of the review process. For cleanups, bugs/regressions seem to be fairly rare (hence they're subtle and unexpected). I think you found one such regression a while back, (after a herculean effort). Cheers -- Mark From owner-xfs@oss.sgi.com Tue Jul 22 22:34:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 22:34:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from relay.sgi.com (netops-testserver-3.corp.sgi.com [192.26.57.72]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N5YPrX026062 for ; Tue, 22 Jul 2008 22:34:25 -0700 Received: from outhouse.melbourne.sgi.com (outhouse.melbourne.sgi.com [134.14.52.145]) by netops-testserver-3.corp.sgi.com (Postfix) with ESMTP id 57D2F90891; Tue, 22 Jul 2008 22:35:30 -0700 (PDT) Received: from lagoh (xaiki@dhcp12.melbourne.sgi.com [134.14.55.12]) by outhouse.melbourne.sgi.com (SGI-8.12.5/8.12.5) with ESMTP id m6N5ZNjm2310435; Wed, 23 Jul 2008 15:35:26 +1000 (AEST) From: Niv Sardi To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [UPDATED RFC] Create with EA initial work References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <20080722043851.GA7244@infradead.org> Date: Wed, 23 Jul 2008 15:35:23 +1000 In-Reply-To: <20080722043851.GA7244@infradead.org> (Christoph Hellwig's message of "Tue, 22 Jul 2008 00:38:51 -0400") Message-ID: <87y73t9n8k.fsf@cxhome.ath.cx> User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (i486-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17044 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs --=-=-= Christoph Hellwig writes: > On Thu, Jul 10, 2008 at 05:39:01PM +1000, Niv Sardi wrote: >> There is a bug in this, that I can see with the Parent Pointers code >> going on top of it (that will be posted soon), it is basically calling >> xfs_attr_set_int_trans() in xfs_create() just before the last >> commit. For some reason, the first call to xfs_roll_trans (after >> xfs_bmap_add_attrfork_trans()) will complain about the inode being >> unlocked after xfs_trans_commit(). I understand I need to call >> xfs_trans_ihold(ip) on it, but we already do in xfs_create() so I >> think I must be missing something else??? any ideas ? > > There are multiple ways to deal with inodes linked to transactions. > > In all cases it needs to be linked into the transaction by > xfs_trans_ijoin, or the opencoded equivalent for a new inode in > xfs_trans_iget. Shouldn't the inode already be in the transaction ? we just created it and added it to the directory ? xfs_create() xfs_dir_ialloc(tp, dp, ip) xfs_ialloc(tp, dp, ip) xfs_trans_iget(tp, ip) and it has a i_transp after dir_ialloc. And is why don't we use ijoin in iget as we copy the exact same code a few lines later ? (like in [0]) > Then you can use xfs_trans_ihold to make sure on transaction commit > the inode reference count is not dropped and the inode is not > unlocked, or simply grab a reference to the inode and let the > transaction commit handler unlock it and decrement the reference > count. The latter is what's used by xfs_create and the former is what > the attr code does, and as far as I can see the only things what works > with xfs_attr_rolltrans. hum, that seemed to work on my UML, shall we require callers to do all the ihold, ijoin stuff or should we do that (or at least check it) from the new attr*_trans code ? [0] --=-=-= Content-Disposition: attachment From 18a682c77b0f89faae6906ebc0d73af59ddff632 Mon Sep 17 00:00:00 2001 From: Niv Sardi Date: Wed, 23 Jul 2008 11:27:20 +1000 Subject: [PATCH] Use xfs_trans_ijoin in xfs_trans_iget Avoid some code duplication Signed-off-by: Niv Sardi --- fs/xfs/xfs_trans_inode.c | 30 +----------------------------- 1 files changed, 1 insertions(+), 29 deletions(-) diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c index 2a1c0f0..1dbcbe9 100644 --- a/fs/xfs/xfs_trans_inode.c +++ b/fs/xfs/xfs_trans_inode.c @@ -138,35 +138,7 @@ xfs_trans_iget( } ASSERT(ip != NULL); - /* - * Get a log_item_desc to point at the new item. - */ - if (ip->i_itemp == NULL) - xfs_inode_item_init(ip, mp); - iip = ip->i_itemp; - (void) xfs_trans_add_item(tp, (xfs_log_item_t *)(iip)); - - xfs_trans_inode_broot_debug(ip); - - /* - * If the IO lock has been acquired, mark that in - * the inode log item so we'll know to unlock it - * when the transaction commits. - */ - ASSERT(iip->ili_flags == 0); - if (lock_flags & XFS_IOLOCK_EXCL) { - iip->ili_flags |= XFS_ILI_IOLOCKED_EXCL; - } else if (lock_flags & XFS_IOLOCK_SHARED) { - iip->ili_flags |= XFS_ILI_IOLOCKED_SHARED; - } - - /* - * Initialize i_transp so we can find it with xfs_inode_incore() - * above. - */ - ip->i_transp = tp; - - *ipp = ip; + xfs_trans_ijoin(tp, ip, lock_flags); return 0; } -- 1.5.6 --=-=-= Cheers, -- Niv Sardi --=-=-=-- From owner-xfs@oss.sgi.com Tue Jul 22 22:54:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 22:54:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.4 required=5.0 tests=BAYES_00,HTML_MESSAGE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N5sBjA027112 for ; Tue, 22 Jul 2008 22:54:11 -0700 X-ASG-Debug-ID: 1216792520-35f1034b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ti-out-0910.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6B159E89698 for ; Tue, 22 Jul 2008 22:55:20 -0700 (PDT) Received: from ti-out-0910.google.com (ti-out-0910.google.com [209.85.142.189]) by cuda.sgi.com with ESMTP id 1nqdPewWDXusNz9N for ; Tue, 22 Jul 2008 22:55:20 -0700 (PDT) Received: by ti-out-0910.google.com with SMTP id y6so1229602tia.18 for ; Tue, 22 Jul 2008 22:55:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=s9ucrwxK9HushamQjphVNJg09KDbWQHgNYjzErqJwtI=; b=FcxmctC7z89Uxm5ZcrGsc2T+T0ItolEo/zBcIbltQmuxseQ4CNZv/MGxhMNN72RxEb toKWUJv3rH7efeudSXT/bnaaPbLg8XcPhvPs56x3bAivhEh9yFbI74dEWQuPqBIPJ4O6 9QMqt52hAOSweGHKqHjFPMtJC4La1iQ594p4M= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=dk1DJjJ42dTHtO/jVtZZRxPLTYmjsl78cUtxAwRw09BzxUHjOSPlU/WwPQx3LsXXQk PQ+e6wJj4HEXbmUB5C/rkSPc1OHrHLUfOjzHv382jUfCApvdoHG+5YxxXe+N6GKwe/la Vj0kpI2DbkM5arzWFG6kuHZWUNyxcBoQkcgxY= Received: by 10.110.28.15 with SMTP id b15mr5428673tib.26.1216792519240; Tue, 22 Jul 2008 22:55:19 -0700 (PDT) Received: by 10.110.40.13 with HTTP; Tue, 22 Jul 2008 22:55:19 -0700 (PDT) Message-ID: Date: Wed, 23 Jul 2008 11:25:19 +0530 From: "Tharindu Rukshan Bamunuarachchi" To: xfs@oss.sgi.com X-ASG-Orig-Subj: Is it a bug ?? Subject: Is it a bug ?? MIME-Version: 1.0 X-Barracuda-Connect: ti-out-0910.google.com[209.85.142.189] X-Barracuda-Start-Time: 1216792521 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56821 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 2586 X-archive-position: 17045 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tharindunix@gmail.com Precedence: bulk X-list: xfs Dear XFS Gurus, I am using "Linux tintin 2.6.25-gentoo-r6 #2 SMP PREEMPT Sun Jul 13 10:50:58 IST 2008 x86_64 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz GenuineIntel GNU/Linux While working I got I/O error and file system has been shutdown. I had to run xfs_repair and now file system is working fine. This happened several time until i repair the file system. Is this a bug or due to hardware failure .....?? I do not know given info is enough to isolate anything, but i am happy to provide more info if you need. Cheers Tharindu [ 37.074883] br0: port 2(qtap1) entering forwarding state [ 57.179699] Filesystem "sda3": XFS internal error xfs_trans_cancel at line 1163 of file fs/xfs/xfs_trans.c. Caller 0xffffffff80352b66 [ 57.179699] Pid: 3757, comm: gconfd-2 Tainted: P 2.6.25-tintin #2 [ 57.179699] [ 57.179699] Call Trace: [ 57.179699] [] xfs_error_report+0x3c/0x3e [ 57.179699] [] ? xfs_create+0x3f3/0x477 [ 57.179699] [] xfs_trans_cancel+0x65/0x102 [ 57.179699] [] xfs_create+0x3f3/0x477 [ 57.179699] [] xfs_vn_mknod+0x165/0x266 [ 57.179699] [] xfs_vn_create+0xb/0xd [ 57.179699] [] vfs_create+0x8d/0x102 [ 57.179699] [] open_namei+0x1ae/0x6a0 [ 57.179699] [] ? __lookup_hash+0x55/0x11e [ 57.179699] [] do_filp_open+0x28/0x4b [ 57.179699] [] ? get_unused_fd_flags+0x113/0x121 [ 57.179699] [] do_sys_open+0x51/0xd2 [ 57.179699] [] sys_open+0x1b/0x1d [ 57.179699] [] system_call_after_swapgs+0x7b/0x80 [ 57.179699] [ 57.179699] xfs_force_shutdown(sda3,0x8) called from line 1164 of file fs/xfs/xfs_trans.c. Return address = 0xffffffff8034cae5 [ 57.192307] Filesystem "sda3": Corruption of in-memory data detected. Shutting down filesystem: sda3 [ 57.192307] Please umount the filesystem, and rectify the problem(s) [ 134.906667] xfs_force_shutdown(sda3,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xffffffff80355722 [ 155.042525] XFS mounting filesystem sda3 [ 155.050723] Starting XFS recovery on filesystem: sda3 (logdev: internal) [ 155.365958] Ending XFS recovery on filesystem: sda3 (logdev: internal) [ 261.328960] XFS mounting filesystem sda3 [ 261.413972] Ending clean XFS mount for filesystem: sda3 -- Tharindu Rukshan Bamunuarachchi In the end, It is the life in my years. [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Tue Jul 22 22:59:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 22:59:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N5xoZd027670 for ; Tue, 22 Jul 2008 22:59:51 -0700 X-ASG-Debug-ID: 1216792859-7775037c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 739F0317B33 for ; Tue, 22 Jul 2008 23:01:00 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id S2klGn8wOWkP9PBb for ; Tue, 22 Jul 2008 23:01:00 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N60oNg031066 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 08:00:50 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N60o4K031063 for xfs@oss.sgi.com; Wed, 23 Jul 2008 08:00:50 +0200 Date: Wed, 23 Jul 2008 08:00:50 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/2] dmapi: use ->put_listen callback directly Subject: Re: [PATCH 2/2] dmapi: use ->put_listen callback directly Message-ID: <20080723060050.GA30997@lst.de> References: <20080603114848.GC2703@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080603114848.GC2703@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216792861 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56822 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17046 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Any reason this didn't get commited with the other patch from the series? From owner-xfs@oss.sgi.com Tue Jul 22 23:35:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 23:35:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_83 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N6Z812029900 for ; Tue, 22 Jul 2008 23:35:10 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA06244; Wed, 23 Jul 2008 16:36:12 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 8939B58C4C3F; Wed, 23 Jul 2008 16:36:12 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - XFS: Avoid directly referencing the VFS inode V2 Message-Id: <20080723063612.8939B58C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 16:36:12 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17047 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs In several places we directly convert from the XFS inode to the linux (VFS) inode by a simple deference of ip->i_vnode. We should not do this - a helper function should be used to extract the VFS inode from the XFS inode. Introduce the function VFS_I() to extract the VFS inode from the XFS inode. The name was chosen to match XFS_I() which is used to extract the XFS inode from the VFS inode. Version 2: o don't use vn_to_inode() and inode_to_vn() functions as they are not needed Signed-off-by: Dave Chinner Date: Wed Jul 23 16:32:07 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: dchinner,hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31720a fs/xfs/xfs_iget.c - 1.242 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iget.c.diff?r1=text&tr1=1.242&r2=text&tr2=1.241&f=h fs/xfs/xfs_inode.h - 1.247 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.247&r2=text&tr2=1.246&f=h fs/xfs/xfs_utils.c - 1.85 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_utils.c.diff?r1=text&tr1=1.85&r2=text&tr2=1.84&f=h fs/xfs/linux-2.6/xfs_lrw.c - 1.281 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_lrw.c.diff?r1=text&tr1=1.281&r2=text&tr2=1.280&f=h fs/xfs/linux-2.6/xfs_fs_subr.c - 1.54 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_fs_subr.c.diff?r1=text&tr1=1.54&r2=text&tr2=1.53&f=h fs/xfs/linux-2.6/xfs_super.c - 1.436 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.436&r2=text&tr2=1.435&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.294 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.294&r2=text&tr2=1.293&f=h fs/xfs/linux-2.6/xfs_iops.h - 1.35 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.h.diff?r1=text&tr1=1.35&r2=text&tr2=1.34&f=h fs/xfs/linux-2.6/xfs_export.c - 1.25 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_export.c.diff?r1=text&tr1=1.25&r2=text&tr2=1.24&f=h From owner-xfs@oss.sgi.com Tue Jul 22 23:56:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 22 Jul 2008 23:56:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N6uHnF031266 for ; Tue, 22 Jul 2008 23:56:19 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA06512; Wed, 23 Jul 2008 16:57:21 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 1408058C4C3F; Wed, 23 Jul 2008 16:57:20 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - XFS: Avoid directly referencing the VFS inode V2 Message-Id: <20080723065721.1408058C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 16:57:20 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17048 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Avoid directly referencing the VFS inode V2 In several places we directly convert from the XFS inode to the linux (VFS) inode by a simple deference of ip->i_vnode. We should not do this - a helper function should be used to extract the VFS inode from the XFS inode. Introduce the function VFS_I() to extract the VFS inode from the XFS inode. The name was chosen to match XFS_I() which is used to extract the XFS inode from the VFS inode. Version 2: o don't use vn_to_inode() and inode_to_vn() functions as they are not needed Signed-off-by: Dave Chinner Date: Wed Jul 23 16:56:24 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: dgc,hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31722a fs/xfs/xfsidbg.c - 1.354 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.354&r2=text&tr2=1.353&f=h fs/xfs/xfs_vnodeops.c - 1.766 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.766&r2=text&tr2=1.765&f=h fs/xfs/xfs_vfsops.c - 1.571 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.571&r2=text&tr2=1.570&f=h fs/xfs/xfs_inode.c - 1.507 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.507&r2=text&tr2=1.506&f=h fs/xfs/xfs_inode.h - 1.248 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.248&r2=text&tr2=1.247&f=h fs/xfs/quota/xfs_qm_syscalls.c - 1.45 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm_syscalls.c.diff?r1=text&tr1=1.45&r2=text&tr2=1.44&f=h fs/xfs/linux-2.6/xfs_vnode.c - 1.158 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.158&r2=text&tr2=1.157&f=h From owner-xfs@oss.sgi.com Wed Jul 23 00:04:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:04:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N74SeE001816 for ; Wed, 23 Jul 2008 00:04:30 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06758; Wed, 23 Jul 2008 17:05:35 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id DD9EC58C4C3F; Wed, 23 Jul 2008 17:05:34 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Kill shouty XFS_ITOV() macro Message-Id: <20080723070534.DD9EC58C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 17:05:34 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17049 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Kill shouty XFS_ITOV() macro Replace XFS_ITOV() with the new VFS_I() inline. Signed-off-by: Dave Chinner Date: Wed Jul 23 17:03:24 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: dgc,hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31724a fs/xfs/xfs_vnodeops.c - 1.767 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.767&r2=text&tr2=1.766&f=h fs/xfs/xfs_itable.c - 1.166 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_itable.c.diff?r1=text&tr1=1.166&r2=text&tr2=1.165&f=h fs/xfs/xfs_vfsops.c - 1.572 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.572&r2=text&tr2=1.571&f=h fs/xfs/xfs_dfrag.c - 1.68 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.68&r2=text&tr2=1.67&f=h fs/xfs/xfs_inode.c - 1.508 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.508&r2=text&tr2=1.507&f=h fs/xfs/xfs_inode.h - 1.249 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.249&r2=text&tr2=1.248&f=h fs/xfs/xfs_utils.h - 1.43 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_utils.h.diff?r1=text&tr1=1.43&r2=text&tr2=1.42&f=h fs/xfs/xfs_bmap.c - 1.396 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.396&r2=text&tr2=1.395&f=h fs/xfs/quota/xfs_dquot.c - 1.35 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot.c.diff?r1=text&tr1=1.35&r2=text&tr2=1.34&f=h fs/xfs/linux-2.6/xfs_ioctl.c - 1.171 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ioctl.c.diff?r1=text&tr1=1.171&r2=text&tr2=1.170&f=h fs/xfs/linux-2.6/xfs_linux.h - 1.168 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_linux.h.diff?r1=text&tr1=1.168&r2=text&tr2=1.167&f=h fs/xfs/linux-2.6/xfs_super.c - 1.437 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.437&r2=text&tr2=1.436&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.295 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.295&r2=text&tr2=1.294&f=h fs/xfs/dmapi/xfs_dm.c - 1.76 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.76&r2=text&tr2=1.75&f=h From owner-xfs@oss.sgi.com Wed Jul 23 00:05:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:05:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N754t4002025 for ; Wed, 23 Jul 2008 00:05:05 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06775; Wed, 23 Jul 2008 17:06:10 +1000 From: Niv Sardi To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH 0/3] XFS: sanitise VFS inode extraction V2 References: <1216640819-19924-1-git-send-email-david@fromorbit.com> Date: Wed, 23 Jul 2008 17:06:05 +1000 In-Reply-To: <1216640819-19924-1-git-send-email-david@fromorbit.com> (Dave Chinner's message of "Mon, 21 Jul 2008 21:46:56 +1000") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17050 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Ok, Pushed that in, put them into idbg and dmapi too. Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Wed Jul 23 00:10:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:10:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N7ANuj002945 for ; Wed, 23 Jul 2008 00:10:26 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA06872; Wed, 23 Jul 2008 17:11:29 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 2579258C4C3F; Wed, 23 Jul 2008 17:11:29 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - XFS: Kill xfs_vtoi() Message-Id: <20080723071129.2579258C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 17:11:29 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17051 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs XFS: Kill xfs_vtoi() xfs_vtoi() is redundant and only unsed in small sections of code. Replace them with widely used XFS_I() inline and kill xfs_vtoi(). Signed-off-by: Dave Chinner Date: Wed Jul 23 17:10:41 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: dgc,hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31725a fs/xfs/xfs_acl.c - 1.76 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.c.diff?r1=text&tr1=1.76&r2=text&tr2=1.75&f=h fs/xfs/xfs_inode.h - 1.250 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.250&r2=text&tr2=1.249&f=h fs/xfs/linux-2.6/xfs_vnode.h - 1.154 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.154&r2=text&tr2=1.153&f=h fs/xfs/linux-2.6/xfs_aops.c - 1.163 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_aops.c.diff?r1=text&tr1=1.163&r2=text&tr2=1.162&f=h From owner-xfs@oss.sgi.com Wed Jul 23 00:16:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:16:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N7Gdk2003853 for ; Wed, 23 Jul 2008 00:16:40 -0700 X-ASG-Debug-ID: 1216797469-77ab00a20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 497B6317DC0 for ; Wed, 23 Jul 2008 00:17:49 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 8kesupJmnNcDyQey for ; Wed, 23 Jul 2008 00:17:49 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLYbc-0001hn-4M; Wed, 23 Jul 2008 07:17:48 +0000 Date: Wed, 23 Jul 2008 03:17:48 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Subject: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Message-ID: <20080723071748.GA25807@infradead.org> References: <1216773673-3620-1-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216773673-3620-1-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216797470 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56824 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17052 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:41:09AM +1000, Dave Chinner wrote: > The list of all inodes on a mount is superfluous. We can traverse > all inodes now by walking the per-AG inode radix trees without > needing a separate list. This enables us to remove a bunch of > complex list traversal code and remove another two pointers from > the xfs_inode. > > Also, by replacing the sync traversal with an ascending inode > number traversal, we will issue better inode I/O patterns for > writeback triggered by xfssyncd or unmount. All patches looks good to me. Well, minus the xfsidbg issue in 4 which would be a merge blocker for that patch. From owner-xfs@oss.sgi.com Wed Jul 23 00:23:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:23:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N7NDxW009272 for ; Wed, 23 Jul 2008 00:23:15 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07245; Wed, 23 Jul 2008 17:24:19 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 0F55858C4C3F; Wed, 23 Jul 2008 17:24:18 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Use KM_NOFS for incore inode extent tree allocation V2 Message-Id: <20080723072419.0F55858C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 17:24:18 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17053 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Use KM_NOFS for incore inode extent tree allocation V2 If we allow incore extent tree allocations to recurse into the filesystem under memory pressure, new delayed allocations through xfs_iomap_write_delay() can deadlock on themselves if memory reclaim tries to write back dirty pages from that inode. It will deadlock in xfs_iomap_write_allocate() trying to take the ilock we already hold. This can also show up as complex ABBA deadlocks when multiple threads are triggering memory reclaim when trying to allocate extents. The main cause of this is the fact that delayed allocation is not done in a transaction, so KM_NOFS is not automatically added to the allocations to prevent this recursion. Mark all allocations done for the incore inode extent tree as KM_NOFS to ensure they never recurse back into the filesystem. Version 2: o KM_NOFS implies KM_SLEEP, so just use KM_NOFS Signed-off-by: Dave Chinner Date: Wed Jul 23 17:22:16 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: dgc,hch,lachlan,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31726a fs/xfs/xfs_inode.c - 1.509 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.509&r2=text&tr2=1.508&f=h From owner-xfs@oss.sgi.com Wed Jul 23 00:27:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:27:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N7R9Un009818 for ; Wed, 23 Jul 2008 00:27:10 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07328; Wed, 23 Jul 2008 17:28:18 +1000 From: Niv Sardi To: Dave Chinner Cc: xfs@oss.sgi.com Subject: Re: [PATCH] XFS: Use KM_NOFS for incore inode extent tree allocation V2 References: <1216638192-6292-1-git-send-email-david@fromorbit.com> Date: Wed, 23 Jul 2008 17:28:13 +1000 In-Reply-To: <1216638192-6292-1-git-send-email-david@fromorbit.com> (Dave Chinner's message of "Mon, 21 Jul 2008 21:03:12 +1000") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17054 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs It's in -- Niv Sardi From owner-xfs@oss.sgi.com Wed Jul 23 00:30:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:30:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N7U1K4010314 for ; Wed, 23 Jul 2008 00:30:02 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07502; Wed, 23 Jul 2008 17:31:07 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id BF71C58C4C3F; Wed, 23 Jul 2008 17:31:06 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Move attr log alloc size calculator to another function. Message-Id: <20080723073106.BF71C58C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 17:31:06 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17055 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Move attr log alloc size calculator to another function. We will need that to be able to calculate the size of log we need for a specific attr (for Create+EA). The local flag is needed so that we can fail if we run into ENOSPC when trying to alloc blocks. Signed-off-by: Niv Sardi Date: Wed Jul 23 17:30:19 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: hch,tes,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31727a fs/xfs/xfs_attr.c - 1.155 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr.c.diff?r1=text&tr1=1.155&r2=text&tr2=1.154&f=h fs/xfs/xfs_attr.h - 1.45 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr.h.diff?r1=text&tr1=1.45&r2=text&tr2=1.44&f=h From owner-xfs@oss.sgi.com Wed Jul 23 00:33:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:34:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_33 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N7XsUS010932 for ; Wed, 23 Jul 2008 00:33:56 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07578; Wed, 23 Jul 2008 17:35:00 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 81FF258C4C3F; Wed, 23 Jul 2008 17:35:00 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - don't leak m_fsname/m_rtname/m_logname Message-Id: <20080723073500.81FF258C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 17:35:00 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17056 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs don't leak m_fsname/m_rtname/m_logname Add a helper to free the m_fsname/m_rtname/m_logname allocations and use it properly for all mount failure cases. Also switch the allocations for these to kstrdup while we're at it. Signed-off-by: Christoph Hellwig Date: Wed Jul 23 17:33:46 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: hch,dgc,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31728a fs/xfs/xfs_mount.c - 1.438 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.438&r2=text&tr2=1.437&f=h fs/xfs/linux-2.6/xfs_super.c - 1.438 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.438&r2=text&tr2=1.437&f=h From owner-xfs@oss.sgi.com Wed Jul 23 00:44:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:44:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N7itZl011948 for ; Wed, 23 Jul 2008 00:44:56 -0700 X-ASG-Debug-ID: 1216799165-790601aa0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D18E91915A72; Wed, 23 Jul 2008 00:46:05 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id Q1c6wXSiKg1lpUZj; Wed, 23 Jul 2008 00:46:05 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLZ2y-0006c8-Ui; Wed, 23 Jul 2008 07:46:04 +0000 Date: Wed, 23 Jul 2008 03:46:04 -0400 From: Christoph Hellwig To: Niv Sardi Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Export xfs_attr_set_int_trans Subject: Re: [PATCH] Export xfs_attr_set_int_trans Message-ID: <20080723074604.GB24031@infradead.org> References: <1215675545-2707-5-git-send-email-xaiki@sgi.com> <1215754695-6958-1-git-send-email-xaiki@sgi.com> <20080722044337.GA10290@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216799165 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56825 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17057 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 04:06:55PM +1000, Niv Sardi wrote: > Christoph Hellwig writes: > > > On Fri, Jul 11, 2008 at 03:38:14PM +1000, Niv Sardi wrote: > >> make xfs_attr_set_int_trans non static so we can use it outside of xfs_attr.c > >> (Needed to use it in vnodeops.c, for create+EA) > > > > Any reason this is not merged into the previous patch? > > you =) you didn't like my attr_* function to be exported, so I splitted > the export out from now on. that's about it. Heh, sorry. The general rule is exporting it is fine if one of the next patches uses it. That wasn't obvious when you posted the first patches, so I asked for it to be static for now. From owner-xfs@oss.sgi.com Wed Jul 23 00:49:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:49:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N7nNn0012591 for ; Wed, 23 Jul 2008 00:49:26 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA07929 for ; Wed, 23 Jul 2008 17:50:33 +1000 Date: Wed, 23 Jul 2008 17:52:24 +1000 To: "xfs@oss.sgi.com" Subject: Syncing up libxfs to kernel source From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.50 (Win32) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17058 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs This one is mainly for Dave... In xfs_alloc_read_agf() in xfs_alloc.c, the current user-space version checks: agf_ok = ... be32_to_cpu(agf->agf_btreeblks) <= be32_to_cpu(agf->agf_length) && ... but the kernel version doesn't. Is this an oversight with the lazy-counter code in the kernel, remove from user-space or leave them different? From owner-xfs@oss.sgi.com Wed Jul 23 00:50:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:50:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N7oa7m013039 for ; Wed, 23 Jul 2008 00:50:36 -0700 X-ASG-Debug-ID: 1216799505-196a00210000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 758DA317C70; Wed, 23 Jul 2008 00:51:46 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 4uVQUJCa6uODl6qe; Wed, 23 Jul 2008 00:51:46 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLZ8T-000759-Kw; Wed, 23 Jul 2008 07:51:45 +0000 Date: Wed, 23 Jul 2008 03:51:45 -0400 From: Christoph Hellwig To: Niv Sardi Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [UPDATED RFC] Create with EA initial work Subject: Re: [UPDATED RFC] Create with EA initial work Message-ID: <20080723075145.GC24031@infradead.org> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <20080722043851.GA7244@infradead.org> <87y73t9n8k.fsf@cxhome.ath.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y73t9n8k.fsf@cxhome.ath.cx> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216799506 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.52 X-Barracuda-Spam-Status: No, SCORE=-1.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17059 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 03:35:23PM +1000, Niv Sardi wrote: > > There are multiple ways to deal with inodes linked to transactions. > > > > In all cases it needs to be linked into the transaction by > > xfs_trans_ijoin, or the opencoded equivalent for a new inode in > > xfs_trans_iget. > > Shouldn't the inode already be in the transaction ? we just created it > and added it to the directory ? > > xfs_create() > xfs_dir_ialloc(tp, dp, ip) > xfs_ialloc(tp, dp, ip) > xfs_trans_iget(tp, ip) > > and it has a i_transp after dir_ialloc. > > And is why don't we use ijoin in iget as we copy the exact same code a > few lines later ? (like in [0]) Yes, it is in the transaction. I just meant to say xfs_trans_iget opencodes the transaction linking otherwise done in xfs_trans_ijoin. > > Then you can use xfs_trans_ihold to make sure on transaction commit > > the inode reference count is not dropped and the inode is not > > unlocked, or simply grab a reference to the inode and let the > > transaction commit handler unlock it and decrement the reference > > count. The latter is what's used by xfs_create and the former is what > > the attr code does, and as far as I can see the only things what works > > with xfs_attr_rolltrans. > > hum, that seemed to work on my UML, shall we require callers to do all > the ihold, ijoin stuff or should we do that (or at least check it) from > the new attr*_trans code ? I'm not sure. What we need to is to make sure we don't have multiple linked transactions that use the iget + unlock style. One way to do that would to alwas use the xfs_trans_ihold style first and then add a helper that just clears XFS_ILI_HOLD for the final transaction in create. > diff --git a/fs/xfs/xfs_trans_inode.c b/fs/xfs/xfs_trans_inode.c > index 2a1c0f0..1dbcbe9 100644 > --- a/fs/xfs/xfs_trans_inode.c > +++ b/fs/xfs/xfs_trans_inode.c > @@ -138,35 +138,7 @@ xfs_trans_iget( > } > ASSERT(ip != NULL); > > - /* > - * Get a log_item_desc to point at the new item. > - */ > - if (ip->i_itemp == NULL) > - xfs_inode_item_init(ip, mp); > - iip = ip->i_itemp; > - (void) xfs_trans_add_item(tp, (xfs_log_item_t *)(iip)); > - > - xfs_trans_inode_broot_debug(ip); > - > - /* > - * If the IO lock has been acquired, mark that in > - * the inode log item so we'll know to unlock it > - * when the transaction commits. > - */ > - ASSERT(iip->ili_flags == 0); > - if (lock_flags & XFS_IOLOCK_EXCL) { > - iip->ili_flags |= XFS_ILI_IOLOCKED_EXCL; > - } else if (lock_flags & XFS_IOLOCK_SHARED) { > - iip->ili_flags |= XFS_ILI_IOLOCKED_SHARED; > - } > - > - /* > - * Initialize i_transp so we can find it with xfs_inode_incore() > - * above. > - */ > - ip->i_transp = tp; > - > - *ipp = ip; > + xfs_trans_ijoin(tp, ip, lock_flags); Did you test this? For one the *ipp assignment seems to be missing now, and second I'd think we'd have to audit the ASSERTs in xfs_trans_ijoin if they are correct for the iget case. But I think this is a good idea, and if the asserts are not okay just create an _xfs_trans_ijoin without them that's used by xfs_trans_ijoin. From owner-xfs@oss.sgi.com Wed Jul 23 00:57:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:57:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N7vGJf013884 for ; Wed, 23 Jul 2008 00:57:17 -0700 X-ASG-Debug-ID: 1216799906-196800700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 43C22317CA2; Wed, 23 Jul 2008 00:58:26 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 7XdBR3qrP5ncfg8h; Wed, 23 Jul 2008 00:58:26 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLZEw-0007Xb-KC; Wed, 23 Jul 2008 07:58:26 +0000 Date: Wed, 23 Jul 2008 03:58:26 -0400 From: Christoph Hellwig To: Niv Sardi Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] Introduce xfs_bmap_add_attrfork_trans. Subject: Re: [PATCH] Introduce xfs_bmap_add_attrfork_trans. Message-ID: <20080723075826.GA27533@infradead.org> References: <1214196150-5427-1-git-send-email-xaiki@sgi.com> <1215675545-2707-1-git-send-email-xaiki@sgi.com> <1215675545-2707-2-git-send-email-xaiki@sgi.com> <1215675545-2707-3-git-send-email-xaiki@sgi.com> <1215675545-2707-4-git-send-email-xaiki@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1215675545-2707-4-git-send-email-xaiki@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216799907 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17061 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs > +error0: > + xfs_trans_cancel(tp, XFS_TRANS_RELEASE_LOG_RES|XFS_TRANS_ABORT); > + ASSERT(ip->i_df.if_ext_max == > + XFS_IFORK_DSIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t)); > + return error; I think the transaction cancelling should be done by the caller. The callers will surely have cases where they have to cancel the transaction already, and it's also more symmetric. > + VN_HOLD(XFS_ITOV(ip)); Please just use IHOLD(ip); instead of the above construct. Otherwise this looks fine and like another candidate to commit already. From owner-xfs@oss.sgi.com Wed Jul 23 00:57:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 00:57:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6N7v7gT013834 for ; Wed, 23 Jul 2008 00:57:08 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA08098; Wed, 23 Jul 2008 17:58:10 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 8F0B958C4C3F; Wed, 23 Jul 2008 17:58:10 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Move xfs_attr_rolltrans to xfs_trans_roll Message-Id: <20080723075810.8F0B958C4C3F@chook.melbourne.sgi.com> Date: Wed, 23 Jul 2008 17:58:10 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17060 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Move xfs_attr_rolltrans to xfs_trans_roll Move it from the attr code to the transaction code and make the attr code call the new function. We rolltrans is really usefull whenever we want to use rolling transaction, should be generic, it isn't dependent on any part of the attr code anyway. We use this excuse to change all the: if ((error = xfs_attr_rolltrans())) calls into: error = xfs_trans_roll(); if (error) Signed-off-by: Niv Sardi Date: Wed Jul 23 17:57:24 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31729a fs/xfs/xfs_attr_leaf.h - 1.49 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr_leaf.h.diff?r1=text&tr1=1.49&r2=text&tr2=1.48&f=h fs/xfs/xfs_attr_leaf.c - 1.114 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr_leaf.c.diff?r1=text&tr1=1.114&r2=text&tr2=1.113&f=h fs/xfs/xfs_trans.c - 1.186 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.c.diff?r1=text&tr1=1.186&r2=text&tr2=1.185&f=h fs/xfs/xfs_trans.h - 1.150 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.h.diff?r1=text&tr1=1.150&r2=text&tr2=1.149&f=h fs/xfs/xfs_attr.c - 1.156 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr.c.diff?r1=text&tr1=1.156&r2=text&tr2=1.155&f=h From owner-xfs@oss.sgi.com Wed Jul 23 01:04:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 01:04:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N84EFb014965 for ; Wed, 23 Jul 2008 01:04:15 -0700 X-ASG-Debug-ID: 1216800323-5aa401580000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 84293E8A950 for ; Wed, 23 Jul 2008 01:05:24 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id MU75D3O7i5E5oHzE for ; Wed, 23 Jul 2008 01:05:24 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N85ENg003466 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 10:05:14 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N85Egh003464 for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:05:14 +0200 Date: Wed, 23 Jul 2008 10:05:14 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/4] fix the noquota mount option Subject: Re: [PATCH 3/4] fix the noquota mount option Message-ID: <20080723080514.GB3417@lst.de> References: <20080525190750.GC13372@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190750.GC13372@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216800325 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56824 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17063 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs ping? On Sun, May 25, 2008 at 09:07:50PM +0200, Christoph Hellwig wrote: > Noquota should clear all mount options, and not just user and group > quota. Probably doesn't matter very much in real life. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:57:33.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:58:52.000000000 +0200 > @@ -337,6 +337,7 @@ xfs_parseargs( > } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { > mp->m_qflags &= ~(XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > + XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | > XFS_UQUOTA_ENFD | XFS_OQUOTA_ENFD); > } else if (!strcmp(this_char, MNTOPT_QUOTA) || > !strcmp(this_char, MNTOPT_UQUOTA) || ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 01:04:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 01:04:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_54, J_CHICKENPOX_75 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N84B5v014952 for ; Wed, 23 Jul 2008 01:04:11 -0700 X-ASG-Debug-ID: 1216800316-2a2b03b80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C4744E8A759 for ; Wed, 23 Jul 2008 01:05:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id SqkIEMVKoT0afaW1 for ; Wed, 23 Jul 2008 01:05:16 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N855Ng003450 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 10:05:06 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N855OB003448 for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:05:05 +0200 Date: Wed, 23 Jul 2008 10:05:05 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] kill struct xfs_mount_args Subject: Re: [PATCH 2/4] kill struct xfs_mount_args Message-ID: <20080723080505.GA3417@lst.de> References: <20080525190741.GB13372@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190741.GB13372@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216800319 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56824 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17062 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs ping? On Sun, May 25, 2008 at 09:07:41PM +0200, Christoph Hellwig wrote: > No need to parse the mount option into a structure before applying it > to struct xfs_mount. > > The content of xfs_start_flags gets merged into xfs_parseargs. Calls > inbetween don't care and can use mount members instead of the args > struct. > > This patch uncovered that the mount option for shared filesystems wasn't > ever exposed on Linux. The code to handle it is #if 0'ed in this patch > pending a decision on this feature. I'll send a writeup about it to > the list soon. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 16:23:57.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:57:16.000000000 +0200 > @@ -18,7 +18,6 @@ > #include "xfs.h" > #include "xfs_bit.h" > #include "xfs_log.h" > -#include "xfs_clnt.h" > #include "xfs_inum.h" > #include "xfs_trans.h" > #include "xfs_sb.h" > @@ -74,32 +73,6 @@ static kmem_zone_t *xfs_vnode_zone; > static kmem_zone_t *xfs_ioend_zone; > mempool_t *xfs_ioend_pool; > > -STATIC struct xfs_mount_args * > -xfs_args_allocate( > - struct super_block *sb, > - int silent) > -{ > - struct xfs_mount_args *args; > - > - args = kzalloc(sizeof(struct xfs_mount_args), GFP_KERNEL); > - if (!args) > - return NULL; > - > - args->logbufs = args->logbufsize = -1; > - strncpy(args->fsname, sb->s_id, MAXNAMELEN); > - > - /* Copy the already-parsed mount(2) flags we're interested in */ > - if (sb->s_flags & MS_DIRSYNC) > - args->flags |= XFSMNT_DIRSYNC; > - if (sb->s_flags & MS_SYNCHRONOUS) > - args->flags |= XFSMNT_WSYNC; > - if (silent) > - args->flags |= XFSMNT_QUIET; > - args->flags |= XFSMNT_32BITINODES; > - > - return args; > -} > - > #define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */ > #define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */ > #define MNTOPT_LOGDEV "logdev" /* log device */ > @@ -171,26 +144,54 @@ suffix_strtoul(char *s, char **endp, uns > return simple_strtoul((const char *)s, endp, base) << shift_left_factor; > } > > +/* > + * This function fills in xfs_mount_t fields based on mount args. > + * Note: the superblock has _not_ yet been read in. > + * > + * Note that this function leaks the various device name allocations on > + * failure. The caller takes care of them. > + */ > STATIC int > xfs_parseargs( > struct xfs_mount *mp, > char *options, > - struct xfs_mount_args *args, > - int update) > + char **mtpt) > { > + struct super_block *sb = mp->m_super; > char *this_char, *value, *eov; > - int dsunit, dswidth, vol_dsunit, vol_dswidth; > - int iosize; > + int dsunit = 0; > + int dswidth = 0; > + int iosize = 0; > int dmapi_implies_ikeep = 1; > + uchar_t iosizelog = 0; > > - args->flags |= XFSMNT_BARRIER; > - args->flags2 |= XFSMNT2_COMPAT_IOSIZE; > + /* > + * Copy binary VFS mount flags we are interested in. > + */ > + if (sb->s_flags & MS_RDONLY) > + mp->m_flags |= XFS_MOUNT_RDONLY; > + if (sb->s_flags & MS_DIRSYNC) > + mp->m_flags |= XFS_MOUNT_DIRSYNC; > + if (sb->s_flags & MS_SYNCHRONOUS) > + mp->m_flags |= XFS_MOUNT_WSYNC; > + > + /* > + * Set some default flags that could be cleared by the mount option > + * parsing. > + */ > + mp->m_flags |= XFS_MOUNT_BARRIER; > + mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; > + mp->m_flags |= XFS_MOUNT_SMALL_INUMS; > + > + /* > + * These can be overridden by the mount option parsing. > + */ > + mp->m_logbufs = -1; > + mp->m_logbsize = -1; > > if (!options) > goto done; > > - iosize = dsunit = dswidth = vol_dsunit = vol_dswidth = 0; > - > while ((this_char = strsep(&options, ",")) != NULL) { > if (!*this_char) > continue; > @@ -204,7 +205,7 @@ xfs_parseargs( > this_char); > return EINVAL; > } > - args->logbufs = simple_strtoul(value, &eov, 10); > + mp->m_logbufs = simple_strtoul(value, &eov, 10); > } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { > if (!value || !*value) { > cmn_err(CE_WARN, > @@ -212,7 +213,7 @@ xfs_parseargs( > this_char); > return EINVAL; > } > - args->logbufsize = suffix_strtoul(value, &eov, 10); > + mp->m_logbsize = suffix_strtoul(value, &eov, 10); > } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { > if (!value || !*value) { > cmn_err(CE_WARN, > @@ -220,7 +221,9 @@ xfs_parseargs( > this_char); > return EINVAL; > } > - strncpy(args->logname, value, MAXNAMELEN); > + mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > + if (!mp->m_logname) > + return ENOMEM; > } else if (!strcmp(this_char, MNTOPT_MTPT)) { > if (!value || !*value) { > cmn_err(CE_WARN, > @@ -228,7 +231,9 @@ xfs_parseargs( > this_char); > return EINVAL; > } > - strncpy(args->mtpt, value, MAXNAMELEN); > + *mtpt = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > + if (!*mtpt) > + return ENOMEM; > } else if (!strcmp(this_char, MNTOPT_RTDEV)) { > if (!value || !*value) { > cmn_err(CE_WARN, > @@ -236,7 +241,9 @@ xfs_parseargs( > this_char); > return EINVAL; > } > - strncpy(args->rtname, value, MAXNAMELEN); > + mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > + if (!mp->m_rtname) > + return ENOMEM; > } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) { > if (!value || !*value) { > cmn_err(CE_WARN, > @@ -245,8 +252,7 @@ xfs_parseargs( > return EINVAL; > } > iosize = simple_strtoul(value, &eov, 10); > - args->flags |= XFSMNT_IOSIZE; > - args->iosizelog = (uint8_t) iosize; > + iosizelog = (uint8_t) iosize; > } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) { > if (!value || !*value) { > cmn_err(CE_WARN, > @@ -255,8 +261,7 @@ xfs_parseargs( > return EINVAL; > } > iosize = suffix_strtoul(value, &eov, 10); > - args->flags |= XFSMNT_IOSIZE; > - args->iosizelog = ffs(iosize) - 1; > + iosizelog = ffs(iosize) - 1; > } else if (!strcmp(this_char, MNTOPT_GRPID) || > !strcmp(this_char, MNTOPT_BSDGROUPS)) { > mp->m_flags |= XFS_MOUNT_GRPID; > @@ -264,23 +269,25 @@ xfs_parseargs( > !strcmp(this_char, MNTOPT_SYSVGROUPS)) { > mp->m_flags &= ~XFS_MOUNT_GRPID; > } else if (!strcmp(this_char, MNTOPT_WSYNC)) { > - args->flags |= XFSMNT_WSYNC; > + mp->m_flags |= XFS_MOUNT_WSYNC; > } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) { > - args->flags |= XFSMNT_OSYNCISOSYNC; > + mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; > } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { > - args->flags |= XFSMNT_NORECOVERY; > + mp->m_flags |= XFS_MOUNT_NORECOVERY; > } else if (!strcmp(this_char, MNTOPT_INO64)) { > - args->flags |= XFSMNT_INO64; > -#if !XFS_BIG_INUMS > +#if XFS_BIG_INUMS > + mp->m_flags |= XFS_MOUNT_INO64; > + mp->m_inoadd = XFS_INO64_OFFSET; > +#else > cmn_err(CE_WARN, > "XFS: %s option not allowed on this system", > this_char); > return EINVAL; > #endif > } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { > - args->flags |= XFSMNT_NOALIGN; > + mp->m_flags |= XFS_MOUNT_NOALIGN; > } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { > - args->flags |= XFSMNT_SWALLOC; > + mp->m_flags |= XFS_MOUNT_SWALLOC; > } else if (!strcmp(this_char, MNTOPT_SUNIT)) { > if (!value || !*value) { > cmn_err(CE_WARN, > @@ -298,7 +305,7 @@ xfs_parseargs( > } > dswidth = simple_strtoul(value, &eov, 10); > } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { > - args->flags &= ~XFSMNT_32BITINODES; > + mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; > #if !XFS_BIG_INUMS > cmn_err(CE_WARN, > "XFS: %s option not allowed on this system", > @@ -306,56 +313,60 @@ xfs_parseargs( > return EINVAL; > #endif > } else if (!strcmp(this_char, MNTOPT_NOUUID)) { > - args->flags |= XFSMNT_NOUUID; > + mp->m_flags |= XFS_MOUNT_NOUUID; > } else if (!strcmp(this_char, MNTOPT_BARRIER)) { > - args->flags |= XFSMNT_BARRIER; > + mp->m_flags |= XFS_MOUNT_BARRIER; > } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { > - args->flags &= ~XFSMNT_BARRIER; > + mp->m_flags &= ~XFS_MOUNT_BARRIER; > } else if (!strcmp(this_char, MNTOPT_IKEEP)) { > - args->flags |= XFSMNT_IKEEP; > + mp->m_flags |= XFS_MOUNT_IKEEP; > } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { > dmapi_implies_ikeep = 0; > - args->flags &= ~XFSMNT_IKEEP; > + mp->m_flags &= ~XFS_MOUNT_IKEEP; > } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { > - args->flags2 &= ~XFSMNT2_COMPAT_IOSIZE; > + mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; > } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { > - args->flags2 |= XFSMNT2_COMPAT_IOSIZE; > + mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; > } else if (!strcmp(this_char, MNTOPT_ATTR2)) { > - args->flags |= XFSMNT_ATTR2; > + mp->m_flags |= XFS_MOUNT_ATTR2; > } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { > - args->flags &= ~XFSMNT_ATTR2; > - args->flags |= XFSMNT_NOATTR2; > + mp->m_flags &= ~XFS_MOUNT_ATTR2; > + mp->m_flags |= XFS_MOUNT_NOATTR2; > } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { > - args->flags2 |= XFSMNT2_FILESTREAMS; > + mp->m_flags |= XFS_MOUNT_FILESTREAMS; > } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { > - args->flags &= ~(XFSMNT_UQUOTAENF|XFSMNT_UQUOTA); > - args->flags &= ~(XFSMNT_GQUOTAENF|XFSMNT_GQUOTA); > + mp->m_qflags &= ~(XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > + XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > + XFS_UQUOTA_ENFD | XFS_OQUOTA_ENFD); > } else if (!strcmp(this_char, MNTOPT_QUOTA) || > !strcmp(this_char, MNTOPT_UQUOTA) || > !strcmp(this_char, MNTOPT_USRQUOTA)) { > - args->flags |= XFSMNT_UQUOTA | XFSMNT_UQUOTAENF; > + mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > + XFS_UQUOTA_ENFD); > } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || > !strcmp(this_char, MNTOPT_UQUOTANOENF)) { > - args->flags |= XFSMNT_UQUOTA; > - args->flags &= ~XFSMNT_UQUOTAENF; > + mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); > + mp->m_qflags &= ~XFS_UQUOTA_ENFD; > } else if (!strcmp(this_char, MNTOPT_PQUOTA) || > !strcmp(this_char, MNTOPT_PRJQUOTA)) { > - args->flags |= XFSMNT_PQUOTA | XFSMNT_PQUOTAENF; > + mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | > + XFS_OQUOTA_ENFD); > } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { > - args->flags |= XFSMNT_PQUOTA; > - args->flags &= ~XFSMNT_PQUOTAENF; > + mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); > + mp->m_qflags &= ~XFS_OQUOTA_ENFD; > } else if (!strcmp(this_char, MNTOPT_GQUOTA) || > !strcmp(this_char, MNTOPT_GRPQUOTA)) { > - args->flags |= XFSMNT_GQUOTA | XFSMNT_GQUOTAENF; > + mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > + XFS_OQUOTA_ENFD); > } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { > - args->flags |= XFSMNT_GQUOTA; > - args->flags &= ~XFSMNT_GQUOTAENF; > + mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); > + mp->m_qflags &= ~XFS_OQUOTA_ENFD; > } else if (!strcmp(this_char, MNTOPT_DMAPI)) { > - args->flags |= XFSMNT_DMAPI; > + mp->m_flags |= XFS_MOUNT_DMAPI; > } else if (!strcmp(this_char, MNTOPT_XDSM)) { > - args->flags |= XFSMNT_DMAPI; > + mp->m_flags |= XFS_MOUNT_DMAPI; > } else if (!strcmp(this_char, MNTOPT_DMI)) { > - args->flags |= XFSMNT_DMAPI; > + mp->m_flags |= XFS_MOUNT_DMAPI; > } else if (!strcmp(this_char, "ihashsize")) { > cmn_err(CE_WARN, > "XFS: ihashsize no longer used, option is deprecated."); > @@ -373,27 +384,29 @@ xfs_parseargs( > } > } > > - if (args->flags & XFSMNT_NORECOVERY) { > - if ((mp->m_flags & XFS_MOUNT_RDONLY) == 0) { > - cmn_err(CE_WARN, > - "XFS: no-recovery mounts must be read-only."); > - return EINVAL; > - } > + /* > + * no recovery flag requires a read-only mount > + */ > + if ((mp->m_flags & XFS_MOUNT_NORECOVERY) && > + !(mp->m_flags & XFS_MOUNT_RDONLY)) { > + cmn_err(CE_WARN, "XFS: no-recovery mounts must be read-only."); > + return EINVAL; > } > > - if ((args->flags & XFSMNT_NOALIGN) && (dsunit || dswidth)) { > + if ((mp->m_flags & XFS_MOUNT_NOALIGN) && (dsunit || dswidth)) { > cmn_err(CE_WARN, > "XFS: sunit and swidth options incompatible with the noalign option"); > return EINVAL; > } > > - if ((args->flags & XFSMNT_GQUOTA) && (args->flags & XFSMNT_PQUOTA)) { > + if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && > + (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) { > cmn_err(CE_WARN, > "XFS: cannot mount with both project and group quota"); > return EINVAL; > } > > - if ((args->flags & XFSMNT_DMAPI) && *args->mtpt == '\0') { > + if ((mp->m_flags & XFS_MOUNT_DMAPI) && !mtpt) { > printk("XFS: %s option needs the mount point option as well\n", > MNTOPT_DMAPI); > return EINVAL; > @@ -421,27 +434,66 @@ xfs_parseargs( > * Note that if "ikeep" or "noikeep" mount options are > * supplied, then they are honored. > */ > - if ((args->flags & XFSMNT_DMAPI) && dmapi_implies_ikeep) > - args->flags |= XFSMNT_IKEEP; > + if ((mp->m_flags & XFS_MOUNT_DMAPI) && dmapi_implies_ikeep) > + mp->m_flags |= XFS_MOUNT_IKEEP; > > - if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { > +done: > + if (!(mp->m_flags & XFS_MOUNT_NOALIGN)) { > + /* > + * At this point the superblock has not been read > + * in, therefore we do not know the block size. > + * Before the mount call ends we will convert > + * these to FSBs. > + */ > if (dsunit) { > - args->sunit = dsunit; > - args->flags |= XFSMNT_RETERR; > - } else { > - args->sunit = vol_dsunit; > + mp->m_dalign = dsunit; > + mp->m_flags |= XFS_MOUNT_RETERR; > } > - dswidth ? (args->swidth = dswidth) : > - (args->swidth = vol_dswidth); > - } else { > - args->sunit = args->swidth = 0; > + > + if (dswidth) > + mp->m_swidth = dswidth; > + } > + > + if (mp->m_logbufs != -1 && > + mp->m_logbufs != 0 && > + (mp->m_logbufs < XLOG_MIN_ICLOGS || > + mp->m_logbufs > XLOG_MAX_ICLOGS)) { > + cmn_err(CE_WARN, > + "XFS: invalid logbufs value: %d [not %d-%d]", > + mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); > + return XFS_ERROR(EINVAL); > + } > + if (mp->m_logbsize != -1 && > + mp->m_logbsize != 0 && > + (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || > + mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || > + !is_power_of_2(mp->m_logbsize))) { > + cmn_err(CE_WARN, > + "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", > + mp->m_logbsize); > + return XFS_ERROR(EINVAL); > + } > + > + mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL); > + if (!mp->m_fsname) > + return ENOMEM; > + mp->m_fsname_len = strlen(mp->m_fsname) + 1; > + > + if (iosizelog) { > + if (iosizelog > XFS_MAX_IO_LOG || > + iosizelog < XFS_MIN_IO_LOG) { > + cmn_err(CE_WARN, > + "XFS: invalid log iosize: %d [not %d-%d]", > + iosizelog, XFS_MIN_IO_LOG, > + XFS_MAX_IO_LOG); > + return XFS_ERROR(EINVAL); > + } > + > + mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; > + mp->m_readio_log = iosizelog; > + mp->m_writeio_log = iosizelog; > } > > -done: > - if (args->flags & XFSMNT_32BITINODES) > - mp->m_flags |= XFS_MOUNT_SMALL_INUMS; > - if (args->flags2) > - args->flags |= XFSMNT_FLAGS2; > return 0; > } > > @@ -693,8 +745,7 @@ xfs_close_devices( > */ > STATIC int > xfs_open_devices( > - struct xfs_mount *mp, > - struct xfs_mount_args *args) > + struct xfs_mount *mp) > { > struct block_device *ddev = mp->m_super->s_bdev; > struct block_device *logdev = NULL, *rtdev = NULL; > @@ -703,14 +754,14 @@ xfs_open_devices( > /* > * Open real time and log devices - order is important. > */ > - if (args->logname[0]) { > - error = xfs_blkdev_get(mp, args->logname, &logdev); > + if (mp->m_logname) { > + error = xfs_blkdev_get(mp, mp->m_logname, &logdev); > if (error) > goto out; > } > > - if (args->rtname[0]) { > - error = xfs_blkdev_get(mp, args->rtname, &rtdev); > + if (mp->m_rtname) { > + error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); > if (error) > goto out_close_logdev; > > @@ -1411,175 +1462,28 @@ xfs_fs_setxquota( > > /* > * This function fills in xfs_mount_t fields based on mount args. > - * Note: the superblock has _not_ yet been read in. > - */ > -STATIC int > -xfs_start_flags( > - struct xfs_mount_args *ap, > - struct xfs_mount *mp) > -{ > - int error; > - > - /* Values are in BBs */ > - if ((ap->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { > - /* > - * At this point the superblock has not been read > - * in, therefore we do not know the block size. > - * Before the mount call ends we will convert > - * these to FSBs. > - */ > - mp->m_dalign = ap->sunit; > - mp->m_swidth = ap->swidth; > - } > - > - if (ap->logbufs != -1 && > - ap->logbufs != 0 && > - (ap->logbufs < XLOG_MIN_ICLOGS || > - ap->logbufs > XLOG_MAX_ICLOGS)) { > - cmn_err(CE_WARN, > - "XFS: invalid logbufs value: %d [not %d-%d]", > - ap->logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); > - return XFS_ERROR(EINVAL); > - } > - mp->m_logbufs = ap->logbufs; > - if (ap->logbufsize != -1 && > - ap->logbufsize != 0 && > - (ap->logbufsize < XLOG_MIN_RECORD_BSIZE || > - ap->logbufsize > XLOG_MAX_RECORD_BSIZE || > - !is_power_of_2(ap->logbufsize))) { > - cmn_err(CE_WARN, > - "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", > - ap->logbufsize); > - return XFS_ERROR(EINVAL); > - } > - > - error = ENOMEM; > - > - mp->m_logbsize = ap->logbufsize; > - mp->m_fsname_len = strlen(ap->fsname) + 1; > - > - mp->m_fsname = kstrdup(ap->fsname, GFP_KERNEL); > - if (!mp->m_fsname) > - goto out; > - > - if (ap->rtname[0]) { > - mp->m_rtname = kstrdup(ap->rtname, GFP_KERNEL); > - if (!mp->m_rtname) > - goto out_free_fsname; > - > - } > - > - if (ap->logname[0]) { > - mp->m_logname = kstrdup(ap->logname, GFP_KERNEL); > - if (!mp->m_logname) > - goto out_free_rtname; > - } > - > - if (ap->flags & XFSMNT_WSYNC) > - mp->m_flags |= XFS_MOUNT_WSYNC; > -#if XFS_BIG_INUMS > - if (ap->flags & XFSMNT_INO64) { > - mp->m_flags |= XFS_MOUNT_INO64; > - mp->m_inoadd = XFS_INO64_OFFSET; > - } > -#endif > - if (ap->flags & XFSMNT_RETERR) > - mp->m_flags |= XFS_MOUNT_RETERR; > - if (ap->flags & XFSMNT_NOALIGN) > - mp->m_flags |= XFS_MOUNT_NOALIGN; > - if (ap->flags & XFSMNT_SWALLOC) > - mp->m_flags |= XFS_MOUNT_SWALLOC; > - if (ap->flags & XFSMNT_OSYNCISOSYNC) > - mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; > - if (ap->flags & XFSMNT_32BITINODES) > - mp->m_flags |= XFS_MOUNT_32BITINODES; > - > - if (ap->flags & XFSMNT_IOSIZE) { > - if (ap->iosizelog > XFS_MAX_IO_LOG || > - ap->iosizelog < XFS_MIN_IO_LOG) { > - cmn_err(CE_WARN, > - "XFS: invalid log iosize: %d [not %d-%d]", > - ap->iosizelog, XFS_MIN_IO_LOG, > - XFS_MAX_IO_LOG); > - return XFS_ERROR(EINVAL); > - } > - > - mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; > - mp->m_readio_log = mp->m_writeio_log = ap->iosizelog; > - } > - > - if (ap->flags & XFSMNT_IKEEP) > - mp->m_flags |= XFS_MOUNT_IKEEP; > - if (ap->flags & XFSMNT_DIRSYNC) > - mp->m_flags |= XFS_MOUNT_DIRSYNC; > - if (ap->flags & XFSMNT_ATTR2) > - mp->m_flags |= XFS_MOUNT_ATTR2; > - if (ap->flags & XFSMNT_NOATTR2) > - mp->m_flags |= XFS_MOUNT_NOATTR2; > - > - if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) > - mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; > - > - /* > - * no recovery flag requires a read-only mount > - */ > - if (ap->flags & XFSMNT_NORECOVERY) { > - if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { > - cmn_err(CE_WARN, > - "XFS: tried to mount a FS read-write without recovery!"); > - return XFS_ERROR(EINVAL); > - } > - mp->m_flags |= XFS_MOUNT_NORECOVERY; > - } > - > - if (ap->flags & XFSMNT_NOUUID) > - mp->m_flags |= XFS_MOUNT_NOUUID; > - if (ap->flags & XFSMNT_BARRIER) > - mp->m_flags |= XFS_MOUNT_BARRIER; > - else > - mp->m_flags &= ~XFS_MOUNT_BARRIER; > - > - if (ap->flags2 & XFSMNT2_FILESTREAMS) > - mp->m_flags |= XFS_MOUNT_FILESTREAMS; > - > - if (ap->flags & XFSMNT_DMAPI) > - mp->m_flags |= XFS_MOUNT_DMAPI; > - return 0; > - > - > - out_free_rtname: > - kfree(mp->m_rtname); > - out_free_fsname: > - kfree(mp->m_fsname); > - out: > - return error; > -} > - > -/* > - * This function fills in xfs_mount_t fields based on mount args. > * Note: the superblock _has_ now been read in. > */ > STATIC int > xfs_finish_flags( > - struct xfs_mount_args *ap, > struct xfs_mount *mp) > { > int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); > > /* Fail a mount where the logbuf is smaller then the log stripe */ > if (xfs_sb_version_haslogv2(&mp->m_sb)) { > - if ((ap->logbufsize <= 0) && > - (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) { > + if (mp->m_logbsize <= 0 && > + mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { > mp->m_logbsize = mp->m_sb.sb_logsunit; > - } else if (ap->logbufsize > 0 && > - ap->logbufsize < mp->m_sb.sb_logsunit) { > + } else if (mp->m_logbsize > 0 && > + mp->m_logbsize < mp->m_sb.sb_logsunit) { > cmn_err(CE_WARN, > "XFS: logbuf size must be greater than or equal to log stripe size"); > return XFS_ERROR(EINVAL); > } > } else { > /* Fail a mount if the logbuf is larger than 32K */ > - if (ap->logbufsize > XLOG_BIG_RECORD_BSIZE) { > + if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { > cmn_err(CE_WARN, > "XFS: logbuf size for version 1 logs must be 16K or 32K"); > return XFS_ERROR(EINVAL); > @@ -1591,7 +1495,7 @@ xfs_finish_flags( > * told by noattr2 to turn it off > */ > if (xfs_sb_version_hasattr2(&mp->m_sb) && > - !(ap->flags & XFSMNT_NOATTR2)) > + !(mp->m_flags & XFS_MOUNT_NOATTR2)) > mp->m_flags |= XFS_MOUNT_ATTR2; > > /* > @@ -1603,6 +1507,7 @@ xfs_finish_flags( > return XFS_ERROR(EROFS); > } > > +#if 0 /* shared mounts were never supported on Linux */ > /* > * check for shared mount. > */ > @@ -1625,25 +1530,11 @@ xfs_finish_flags( > /* > * Shared XFS V0 can't deal with DMI. Return EINVAL. > */ > - if (mp->m_sb.sb_shared_vn == 0 && (ap->flags & XFSMNT_DMAPI)) > + if (mp->m_sb.sb_shared_vn == 0 && > + (mp->m_flags & XFS_MOUNT_DMAPI)) > return XFS_ERROR(EINVAL); > } > - > - if (ap->flags & XFSMNT_UQUOTA) { > - mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); > - if (ap->flags & XFSMNT_UQUOTAENF) > - mp->m_qflags |= XFS_UQUOTA_ENFD; > - } > - > - if (ap->flags & XFSMNT_GQUOTA) { > - mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); > - if (ap->flags & XFSMNT_GQUOTAENF) > - mp->m_qflags |= XFS_OQUOTA_ENFD; > - } else if (ap->flags & XFSMNT_PQUOTA) { > - mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); > - if (ap->flags & XFSMNT_PQUOTAENF) > - mp->m_qflags |= XFS_OQUOTA_ENFD; > - } > +#endif > > return 0; > } > @@ -1656,16 +1547,12 @@ xfs_fs_fill_super( > { > struct inode *root; > struct xfs_mount *mp = NULL; > - struct xfs_mount_args *args; > int flags = 0, error = ENOMEM; > - > - args = xfs_args_allocate(sb, silent); > - if (!args) > - return -ENOMEM; > + char *mtpt = NULL; > > mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL); > if (!mp) > - goto out_free_args; > + goto out; > > spin_lock_init(&mp->m_sb_lock); > mutex_init(&mp->m_ilock); > @@ -1678,12 +1565,9 @@ xfs_fs_fill_super( > mp->m_super = sb; > sb->s_fs_info = mp; > > - if (sb->s_flags & MS_RDONLY) > - mp->m_flags |= XFS_MOUNT_RDONLY; > - > - error = xfs_parseargs(mp, (char *)data, args, 0); > + error = xfs_parseargs(mp, (char *)data, &mtpt); > if (error) > - goto out_free_mp; > + goto out_free_fsname; > > sb_min_blocksize(sb, BBSIZE); > sb->s_xattr = xfs_xattr_handlers; > @@ -1691,33 +1575,28 @@ xfs_fs_fill_super( > sb->s_qcop = &xfs_quotactl_operations; > sb->s_op = &xfs_super_operations; > > - error = xfs_dmops_get(mp, args); > + error = xfs_dmops_get(mp); > if (error) > - goto out_free_mp; > - error = xfs_qmops_get(mp, args); > + goto out_free_fsname; > + error = xfs_qmops_get(mp); > if (error) > goto out_put_dmops; > > - if (args->flags & XFSMNT_QUIET) > + if (silent) > flags |= XFS_MFSI_QUIET; > > - error = xfs_open_devices(mp, args); > + error = xfs_open_devices(mp); > if (error) > goto out_put_qmops; > > if (xfs_icsb_init_counters(mp)) > mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; > > - /* > - * Setup flags based on mount(2) options and then the superblock > - */ > - error = xfs_start_flags(args, mp); > - if (error) > - goto out_free_fsname; > error = xfs_readsb(mp, flags); > if (error) > - goto out_free_fsname; > - error = xfs_finish_flags(args, mp); > + goto out_destroy_counters; > + > + error = xfs_finish_flags(mp); > if (error) > goto out_free_sb; > > @@ -1736,7 +1615,7 @@ xfs_fs_fill_super( > if (error) > goto out_filestream_unmount; > > - XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, args->mtpt, args->fsname); > + XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, mtpt, mp->m_fsname); > > sb->s_dirt = 1; > sb->s_magic = XFS_SB_MAGIC; > @@ -1769,27 +1648,27 @@ xfs_fs_fill_super( > goto fail_vnrele; > } > > - xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); > + kfree(mtpt); > > - kfree(args); > + xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); > return 0; > > out_filestream_unmount: > xfs_filestream_unmount(mp); > out_free_sb: > xfs_freesb(mp); > - out_free_fsname: > - xfs_free_fsname(mp); > + out_destroy_counters: > xfs_icsb_destroy_counters(mp); > xfs_close_devices(mp); > out_put_qmops: > xfs_qmops_put(mp); > out_put_dmops: > xfs_dmops_put(mp); > - out_free_mp: > + out_free_fsname: > + xfs_free_fsname(mp); > + kfree(mtpt); > kfree(mp); > - out_free_args: > - kfree(args); > + out: > return -error; > > fail_vnrele: > Index: linux-2.6-xfs/fs/xfs/xfs_clnt.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_clnt.h 2008-05-25 16:23:44.000000000 +0200 > +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 > @@ -1,105 +0,0 @@ > -/* > - * Copyright (c) 2000-2005 Silicon Graphics, Inc. > - * All Rights Reserved. > - * > - * This program is free software; you can redistribute it and/or > - * modify it under the terms of the GNU General Public License as > - * published by the Free Software Foundation. > - * > - * This program is distributed in the hope that it would be useful, > - * but WITHOUT ANY WARRANTY; without even the implied warranty of > - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > - * GNU General Public License for more details. > - * > - * You should have received a copy of the GNU General Public License > - * along with this program; if not, write the Free Software Foundation, > - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA > - */ > -#ifndef __XFS_CLNT_H__ > -#define __XFS_CLNT_H__ > - > -/* > - * XFS arguments structure, constructed from the arguments we > - * are passed via the mount system call. > - * > - * NOTE: The mount system call is handled differently between > - * Linux and IRIX. In IRIX we worked work with a binary data > - * structure coming in across the syscall interface from user > - * space (the mount userspace knows about each filesystem type > - * and the set of valid options for it, and converts the users > - * argument string into a binary structure _before_ making the > - * system call), and the ABI issues that this implies. > - * > - * In Linux, we are passed a comma separated set of options; > - * ie. a NULL terminated string of characters. Userspace mount > - * code does not have any knowledge of mount options expected by > - * each filesystem type and so each filesystem parses its mount > - * options in kernel space. > - * > - * For the Linux port, we kept this structure pretty much intact > - * and use it internally (because the existing code groks it). > - */ > -struct xfs_mount_args { > - int flags; /* flags -> see XFSMNT_... macros below */ > - int flags2; /* flags -> see XFSMNT2_... macros below */ > - int logbufs; /* Number of log buffers, -1 to default */ > - int logbufsize; /* Size of log buffers, -1 to default */ > - char fsname[MAXNAMELEN+1]; /* data device name */ > - char rtname[MAXNAMELEN+1]; /* realtime device filename */ > - char logname[MAXNAMELEN+1]; /* journal device filename */ > - char mtpt[MAXNAMELEN+1]; /* filesystem mount point */ > - int sunit; /* stripe unit (BBs) */ > - int swidth; /* stripe width (BBs), multiple of sunit */ > - uchar_t iosizelog; /* log2 of the preferred I/O size */ > - int ihashsize; /* inode hash table size (buckets) */ > -}; > - > -/* > - * XFS mount option flags -- args->flags1 > - */ > -#define XFSMNT_ATTR2 0x00000001 /* allow ATTR2 EA format */ > -#define XFSMNT_WSYNC 0x00000002 /* safe mode nfs mount > - * compatible */ > -#define XFSMNT_INO64 0x00000004 /* move inode numbers up > - * past 2^32 */ > -#define XFSMNT_UQUOTA 0x00000008 /* user quota accounting */ > -#define XFSMNT_PQUOTA 0x00000010 /* IRIX prj quota accounting */ > -#define XFSMNT_UQUOTAENF 0x00000020 /* user quota limit > - * enforcement */ > -#define XFSMNT_PQUOTAENF 0x00000040 /* IRIX project quota limit > - * enforcement */ > -#define XFSMNT_QUIET 0x00000080 /* don't report mount errors */ > -#define XFSMNT_NOALIGN 0x00000200 /* don't allocate at > - * stripe boundaries*/ > -#define XFSMNT_RETERR 0x00000400 /* return error to user */ > -#define XFSMNT_NORECOVERY 0x00000800 /* no recovery, implies > - * read-only mount */ > -#define XFSMNT_SHARED 0x00001000 /* shared XFS mount */ > -#define XFSMNT_IOSIZE 0x00002000 /* optimize for I/O size */ > -#define XFSMNT_OSYNCISOSYNC 0x00004000 /* o_sync is REALLY o_sync */ > - /* (osyncisdsync is default) */ > -#define XFSMNT_NOATTR2 0x00008000 /* turn off ATTR2 EA format */ > -#define XFSMNT_32BITINODES 0x00200000 /* restrict inodes to 32 > - * bits of address space */ > -#define XFSMNT_GQUOTA 0x00400000 /* group quota accounting */ > -#define XFSMNT_GQUOTAENF 0x00800000 /* group quota limit > - * enforcement */ > -#define XFSMNT_NOUUID 0x01000000 /* Ignore fs uuid */ > -#define XFSMNT_DMAPI 0x02000000 /* enable dmapi/xdsm */ > -#define XFSMNT_BARRIER 0x04000000 /* use write barriers */ > -#define XFSMNT_IKEEP 0x08000000 /* inode cluster delete */ > -#define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width > - * allocation */ > -#define XFSMNT_DIRSYNC 0x40000000 /* sync creat,link,unlink,rename > - * symlink,mkdir,rmdir,mknod */ > -#define XFSMNT_FLAGS2 0x80000000 /* more flags set in flags2 */ > - > -/* > - * XFS mount option flags -- args->flags2 > - */ > -#define XFSMNT2_COMPAT_IOSIZE 0x00000001 /* don't report large preferred > - * I/O size in stat(2) */ > -#define XFSMNT2_FILESTREAMS 0x00000002 /* enable the filestreams > - * allocator */ > - > -#endif /* __XFS_CLNT_H__ */ > Index: linux-2.6-xfs/fs/xfs/xfs_dmops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_dmops.c 2008-05-25 16:23:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_dmops.c 2008-05-25 16:23:58.000000000 +0200 > @@ -25,7 +25,6 @@ > #include "xfs_inum.h" > #include "xfs_ag.h" > #include "xfs_mount.h" > -#include "xfs_clnt.h" > > > static struct xfs_dmops xfs_dmcore_stub = { > @@ -38,9 +37,9 @@ static struct xfs_dmops xfs_dmcore_stub > }; > > int > -xfs_dmops_get(struct xfs_mount *mp, struct xfs_mount_args *args) > +xfs_dmops_get(struct xfs_mount *mp) > { > - if (args->flags & XFSMNT_DMAPI) { > + if (mp->m_flags & XFS_MOUNT_DMAPI) { > struct xfs_dmops *ops; > > ops = symbol_get(xfs_dmcore_xfs); > Index: linux-2.6-xfs/fs/xfs/xfs_mount.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2008-05-25 16:23:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2008-05-25 16:23:58.000000000 +0200 > @@ -540,9 +540,9 @@ extern void xfs_sb_from_disk(struct xfs_ > extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); > extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); > > -extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); > +extern int xfs_dmops_get(struct xfs_mount *); > extern void xfs_dmops_put(struct xfs_mount *); > -extern int xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *); > +extern int xfs_qmops_get(struct xfs_mount *); > extern void xfs_qmops_put(struct xfs_mount *); > > extern struct xfs_dmops xfs_dmcore_xfs; > Index: linux-2.6-xfs/fs/xfs/xfs_qmops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_qmops.c 2008-05-25 16:23:45.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_qmops.c 2008-05-25 16:23:58.000000000 +0200 > @@ -28,7 +28,6 @@ > #include "xfs_mount.h" > #include "xfs_quota.h" > #include "xfs_error.h" > -#include "xfs_clnt.h" > > > STATIC struct xfs_dquot * > @@ -131,9 +130,11 @@ static struct xfs_qmops xfs_qmcore_stub > }; > > int > -xfs_qmops_get(struct xfs_mount *mp, struct xfs_mount_args *args) > +xfs_qmops_get(struct xfs_mount *mp) > { > - if (args->flags & (XFSMNT_UQUOTA | XFSMNT_PQUOTA | XFSMNT_GQUOTA)) { > + if (mp->m_qflags & (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > + XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > + XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) { > struct xfs_qmops *ops; > > ops = symbol_get(xfs_qmcore_xfs); > Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-05-25 16:23:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-05-25 16:23:58.000000000 +0200 > @@ -49,7 +49,6 @@ > #include "xfs_extfree_item.h" > #include "xfs_acl.h" > #include "xfs_attr.h" > -#include "xfs_clnt.h" > #include "xfs_mru_cache.h" > #include "xfs_filestream.h" > #include "xfs_fsops.h" > Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-05-25 16:23:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-05-25 16:23:58.000000000 +0200 > @@ -21,7 +21,6 @@ > #include "xfs_bit.h" > #include "xfs_log.h" > #include "xfs_inum.h" > -#include "xfs_clnt.h" > #include "xfs_trans.h" > #include "xfs_sb.h" > #include "xfs_ag.h" > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-25 16:23:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-25 16:23:58.000000000 +0200 > @@ -22,7 +22,6 @@ > #include "xfs_log.h" > #include "xfs_imap.h" > #include "xfs_inum.h" > -#include "xfs_clnt.h" > #include "xfs_trans.h" > #include "xfs_sb.h" > #include "xfs_ag.h" > Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.c 2008-05-25 16:23:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.c 2008-05-25 16:23:58.000000000 +0200 > @@ -20,7 +20,6 @@ > #include "xfs_bit.h" > #include "xfs_log.h" > #include "xfs_inum.h" > -#include "xfs_clnt.h" > #include "xfs_trans.h" > #include "xfs_sb.h" > #include "xfs_ag.h" > Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_bhv.c 2008-05-25 16:23:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c 2008-05-25 16:23:58.000000000 +0200 > @@ -20,7 +20,6 @@ > #include "xfs_bit.h" > #include "xfs_log.h" > #include "xfs_inum.h" > -#include "xfs_clnt.h" > #include "xfs_trans.h" > #include "xfs_sb.h" > #include "xfs_ag.h" ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 01:04:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 01:04:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N84Kec015031 for ; Wed, 23 Jul 2008 01:04:21 -0700 X-ASG-Debug-ID: 1216800329-78bc02a50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D779F1B27EB1 for ; Wed, 23 Jul 2008 01:05:30 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id LR0dPym5vHrOZgXR for ; Wed, 23 Jul 2008 01:05:30 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N85LNg003480 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 10:05:21 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N85LX9003478 for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:05:21 +0200 Date: Wed, 23 Jul 2008 10:05:20 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] fix biosize option Subject: Re: [PATCH 4/4] fix biosize option Message-ID: <20080723080520.GC3417@lst.de> References: <20080525190754.GD13372@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190754.GD13372@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216800330 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17064 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs ping? On Sun, May 25, 2008 at 09:07:54PM +0200, Christoph Hellwig wrote: > iosizelog shouldn't be the same as iosize but the logarithm of it. Then > again the current biosize option doesn't make much sense to me as it > doesn't set the preferred I/O size as mentioned in the comment next to > it but rather the allocation size and thus is identical to the allocsize > option (except for the missing logarithm). It's also not documented in > Documentation/filesystems/xfs.txt or the mount manpage. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:59:04.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-25 20:59:38.000000000 +0200 > @@ -252,7 +252,7 @@ xfs_parseargs( > return EINVAL; > } > iosize = simple_strtoul(value, &eov, 10); > - iosizelog = (uint8_t) iosize; > + iosizelog = ffs(iosize) - 1; > } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) { > if (!value || !*value) { > cmn_err(CE_WARN, ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 01:05:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 01:05:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N8582v015874 for ; Wed, 23 Jul 2008 01:05:08 -0700 X-ASG-Debug-ID: 1216800376-7e5e02530000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 606FB317BF5 for ; Wed, 23 Jul 2008 01:06:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id xwdWeCsOAeUCgHga for ; Wed, 23 Jul 2008 01:06:16 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N866Ng003535 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 10:06:06 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N866c1003533 for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:06:06 +0200 Date: Wed, 23 Jul 2008 10:06:06 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] sanitize xfs_initialize_vnode Subject: Re: [PATCH] sanitize xfs_initialize_vnode Message-ID: <20080723080606.GD3417@lst.de> References: <20080502105215.GA17870@lst.de> <20080520063622.GA8869@lst.de> <20080627130546.GA23431@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080627130546.GA23431@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216800378 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17065 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs ping^3 On Fri, Jun 27, 2008 at 03:05:46PM +0200, Christoph Hellwig wrote: > ping^2 > > On Tue, May 20, 2008 at 08:36:22AM +0200, Christoph Hellwig wrote: > > ping? > > > > On Fri, May 02, 2008 at 12:52:15PM +0200, Christoph Hellwig wrote: > > > Sanitize setting up the Linux indode. > > > > > > Setting up the xfs_inode <-> inode link is opencoded in xfs_iget_core > > > now because that's the only place it needs to be done, > > > xfs_initialize_vnode is renamed to xfs_setup_inode and loses all > > > superflous paramaters. The check for I_NEW is removed because it always > > > is true and the di_mode check moves into xfs_iget_core because it's only > > > needed there. > > > > > > xfs_set_inodeops and xfs_revalidate_inode are merged into > > > xfs_setup_inode and the whole things is moved into xfs_iops.c where it > > > belongs. > > > > > > > > > Signed-off-by: Christoph Hellwig > > > > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-05-02 08:41:27.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-05-02 08:51:46.000000000 +0200 > > > @@ -777,7 +777,7 @@ out_error: > > > return error; > > > } > > > > > > -const struct inode_operations xfs_inode_operations = { > > > +static const struct inode_operations xfs_inode_operations = { > > > .permission = xfs_vn_permission, > > > .truncate = xfs_vn_truncate, > > > .getattr = xfs_vn_getattr, > > > @@ -789,7 +789,7 @@ const struct inode_operations xfs_inode_ > > > .fallocate = xfs_vn_fallocate, > > > }; > > > > > > -const struct inode_operations xfs_dir_inode_operations = { > > > +static const struct inode_operations xfs_dir_inode_operations = { > > > .create = xfs_vn_create, > > > .lookup = xfs_vn_lookup, > > > .link = xfs_vn_link, > > > @@ -808,7 +808,7 @@ const struct inode_operations xfs_dir_in > > > .listxattr = xfs_vn_listxattr, > > > }; > > > > > > -const struct inode_operations xfs_symlink_inode_operations = { > > > +static const struct inode_operations xfs_symlink_inode_operations = { > > > .readlink = generic_readlink, > > > .follow_link = xfs_vn_follow_link, > > > .put_link = xfs_vn_put_link, > > > @@ -820,3 +820,95 @@ const struct inode_operations xfs_symlin > > > .removexattr = generic_removexattr, > > > .listxattr = xfs_vn_listxattr, > > > }; > > > + > > > +STATIC void > > > +xfs_diflags_to_iflags( > > > + struct inode *inode, > > > + struct xfs_inode *ip) > > > +{ > > > + if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) > > > + inode->i_flags |= S_IMMUTABLE; > > > + else > > > + inode->i_flags &= ~S_IMMUTABLE; > > > + if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) > > > + inode->i_flags |= S_APPEND; > > > + else > > > + inode->i_flags &= ~S_APPEND; > > > + if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) > > > + inode->i_flags |= S_SYNC; > > > + else > > > + inode->i_flags &= ~S_SYNC; > > > + if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) > > > + inode->i_flags |= S_NOATIME; > > > + else > > > + inode->i_flags &= ~S_NOATIME; > > > +} > > > + > > > +/* > > > + * Initialize the Linux inode, set up the operation vectors and > > > + * unlock the inode. > > > + * > > > + * When reading existing inodes from disk this is called directly > > > + * from xfs_iget, when creating a new inode it is called from > > > + * xfs_ialloc after setting up the inode. > > > + */ > > > +void > > > +xfs_setup_inode( > > > + struct xfs_inode *ip) > > > +{ > > > + struct inode *inode = ip->i_vnode; > > > + > > > + inode->i_mode = ip->i_d.di_mode; > > > + inode->i_nlink = ip->i_d.di_nlink; > > > + inode->i_uid = ip->i_d.di_uid; > > > + inode->i_gid = ip->i_d.di_gid; > > > + > > > + switch (inode->i_mode & S_IFMT) { > > > + case S_IFBLK: > > > + case S_IFCHR: > > > + inode->i_rdev = > > > + MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, > > > + sysv_minor(ip->i_df.if_u2.if_rdev)); > > > + break; > > > + default: > > > + inode->i_rdev = 0; > > > + break; > > > + } > > > + > > > + inode->i_generation = ip->i_d.di_gen; > > > + i_size_write(inode, ip->i_d.di_size); > > > + inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; > > > + inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; > > > + inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; > > > + inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; > > > + inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; > > > + inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; > > > + xfs_diflags_to_iflags(inode, ip); > > > + xfs_iflags_clear(ip, XFS_IMODIFIED); > > > + > > > + switch (inode->i_mode & S_IFMT) { > > > + case S_IFREG: > > > + inode->i_op = &xfs_inode_operations; > > > + inode->i_fop = &xfs_file_operations; > > > + inode->i_mapping->a_ops = &xfs_address_space_operations; > > > + break; > > > + case S_IFDIR: > > > + inode->i_op = &xfs_dir_inode_operations; > > > + inode->i_fop = &xfs_dir_file_operations; > > > + break; > > > + case S_IFLNK: > > > + inode->i_op = &xfs_symlink_inode_operations; > > > + if (!(ip->i_df.if_flags & XFS_IFINLINE)) > > > + inode->i_mapping->a_ops = &xfs_address_space_operations; > > > + break; > > > + default: > > > + inode->i_op = &xfs_inode_operations; > > > + init_special_inode(inode, inode->i_mode, inode->i_rdev); > > > + break; > > > + } > > > + > > > + xfs_iflags_clear(ip, XFS_INEW); > > > + barrier(); > > > + > > > + unlock_new_inode(inode); > > > +} > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h 2008-05-02 08:41:27.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h 2008-05-02 08:41:35.000000000 +0200 > > > @@ -18,9 +18,7 @@ > > > #ifndef __XFS_IOPS_H__ > > > #define __XFS_IOPS_H__ > > > > > > -extern const struct inode_operations xfs_inode_operations; > > > -extern const struct inode_operations xfs_dir_inode_operations; > > > -extern const struct inode_operations xfs_symlink_inode_operations; > > > +struct xfs_inode; > > > > > > extern const struct file_operations xfs_file_operations; > > > extern const struct file_operations xfs_dir_file_operations; > > > @@ -28,10 +26,11 @@ extern const struct file_operations xfs_ > > > > > > extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size); > > > > > > -struct xfs_inode; > > > extern void xfs_ichgtime(struct xfs_inode *, int); > > > extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); > > > > > > +extern void xfs_setup_inode(struct xfs_inode *); > > > + > > > #define xfs_vtoi(vp) \ > > > ((struct xfs_inode *)vn_to_inode(vp)->i_private) > > > > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-02 08:41:27.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-05-02 08:41:35.000000000 +0200 > > > @@ -155,12 +155,9 @@ EXPORT_SYMBOL(kmem_zone_free); > > > EXPORT_SYMBOL(kmem_zone_init); > > > EXPORT_SYMBOL(kmem_zone_zalloc); > > > EXPORT_SYMBOL(xfs_address_space_operations); > > > -EXPORT_SYMBOL(xfs_dir_inode_operations); > > > EXPORT_SYMBOL(xfs_dir_file_operations); > > > -EXPORT_SYMBOL(xfs_inode_operations); > > > EXPORT_SYMBOL(xfs_file_operations); > > > EXPORT_SYMBOL(xfs_invis_file_operations); > > > -EXPORT_SYMBOL(xfs_symlink_inode_operations); > > > EXPORT_SYMBOL(xfs_buf_delwri_dequeue); > > > EXPORT_SYMBOL(_xfs_buf_find); > > > EXPORT_SYMBOL(xfs_buf_iostart); > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-05-02 08:41:34.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-05-02 08:51:43.000000000 +0200 > > > @@ -558,115 +558,6 @@ xfs_max_file_offset( > > > return (((__uint64_t)pagefactor) << bitshift) - 1; > > > } > > > > > > -STATIC_INLINE void > > > -xfs_set_inodeops( > > > - struct inode *inode) > > > -{ > > > - switch (inode->i_mode & S_IFMT) { > > > - case S_IFREG: > > > - inode->i_op = &xfs_inode_operations; > > > - inode->i_fop = &xfs_file_operations; > > > - inode->i_mapping->a_ops = &xfs_address_space_operations; > > > - break; > > > - case S_IFDIR: > > > - inode->i_op = &xfs_dir_inode_operations; > > > - inode->i_fop = &xfs_dir_file_operations; > > > - break; > > > - case S_IFLNK: > > > - inode->i_op = &xfs_symlink_inode_operations; > > > - if (!(XFS_I(inode)->i_df.if_flags & XFS_IFINLINE)) > > > - inode->i_mapping->a_ops = &xfs_address_space_operations; > > > - break; > > > - default: > > > - inode->i_op = &xfs_inode_operations; > > > - init_special_inode(inode, inode->i_mode, inode->i_rdev); > > > - break; > > > - } > > > -} > > > - > > > -STATIC_INLINE void > > > -xfs_revalidate_inode( > > > - xfs_mount_t *mp, > > > - bhv_vnode_t *vp, > > > - xfs_inode_t *ip) > > > -{ > > > - struct inode *inode = vn_to_inode(vp); > > > - > > > - inode->i_mode = ip->i_d.di_mode; > > > - inode->i_nlink = ip->i_d.di_nlink; > > > - inode->i_uid = ip->i_d.di_uid; > > > - inode->i_gid = ip->i_d.di_gid; > > > - > > > - switch (inode->i_mode & S_IFMT) { > > > - case S_IFBLK: > > > - case S_IFCHR: > > > - inode->i_rdev = > > > - MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, > > > - sysv_minor(ip->i_df.if_u2.if_rdev)); > > > - break; > > > - default: > > > - inode->i_rdev = 0; > > > - break; > > > - } > > > - > > > - inode->i_generation = ip->i_d.di_gen; > > > - i_size_write(inode, ip->i_d.di_size); > > > - inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; > > > - inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; > > > - inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; > > > - inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; > > > - inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; > > > - inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; > > > - if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) > > > - inode->i_flags |= S_IMMUTABLE; > > > - else > > > - inode->i_flags &= ~S_IMMUTABLE; > > > - if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) > > > - inode->i_flags |= S_APPEND; > > > - else > > > - inode->i_flags &= ~S_APPEND; > > > - if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) > > > - inode->i_flags |= S_SYNC; > > > - else > > > - inode->i_flags &= ~S_SYNC; > > > - if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) > > > - inode->i_flags |= S_NOATIME; > > > - else > > > - inode->i_flags &= ~S_NOATIME; > > > - xfs_iflags_clear(ip, XFS_IMODIFIED); > > > -} > > > - > > > -void > > > -xfs_initialize_vnode( > > > - struct xfs_mount *mp, > > > - bhv_vnode_t *vp, > > > - struct xfs_inode *ip) > > > -{ > > > - struct inode *inode = vn_to_inode(vp); > > > - > > > - if (!ip->i_vnode) { > > > - ip->i_vnode = vp; > > > - inode->i_private = ip; > > > - } > > > - > > > - /* > > > - * We need to set the ops vectors, and unlock the inode, but if > > > - * we have been called during the new inode create process, it is > > > - * too early to fill in the Linux inode. We will get called a > > > - * second time once the inode is properly set up, and then we can > > > - * finish our work. > > > - */ > > > - if (ip->i_d.di_mode != 0 && (inode->i_state & I_NEW)) { > > > - xfs_revalidate_inode(mp, vp, ip); > > > - xfs_set_inodeops(inode); > > > - > > > - xfs_iflags_clear(ip, XFS_INEW); > > > - barrier(); > > > - > > > - unlock_new_inode(inode); > > > - } > > > -} > > > - > > > int > > > xfs_blkdev_get( > > > xfs_mount_t *mp, > > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.h 2008-05-02 08:41:27.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h 2008-05-02 08:41:35.000000000 +0200 > > > @@ -72,9 +72,6 @@ struct block_device; > > > > > > extern __uint64_t xfs_max_file_offset(unsigned int); > > > > > > -extern void xfs_initialize_vnode(struct xfs_mount *mp, bhv_vnode_t *vp, > > > - struct xfs_inode *ip); > > > - > > > extern void xfs_flush_inode(struct xfs_inode *); > > > extern void xfs_flush_device(struct xfs_inode *); > > > > > > Index: linux-2.6-xfs/fs/xfs/xfs_iget.c > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2008-05-02 08:41:27.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2008-05-02 08:53:18.000000000 +0200 > > > @@ -288,10 +288,17 @@ finish_inode: > > > *ipp = ip; > > > > > > /* > > > + * Set up the Linux with the Linux inode. > > > + */ > > > + ip->i_vnode = inode; > > > + inode->i_private = ip; > > > + > > > + /* > > > * If we have a real type for an on-disk inode, we can set ops(&unlock) > > > * now. If it's a new inode being created, xfs_ialloc will handle it. > > > */ > > > - xfs_initialize_vnode(mp, inode, ip); > > > + if (ip->i_d.di_mode != 0) > > > + xfs_setup_inode(ip); > > > return 0; > > > } > > > > > > Index: linux-2.6-xfs/fs/xfs/xfs_inode.c > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-05-02 08:41:27.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-05-02 08:41:35.000000000 +0200 > > > @@ -1046,7 +1046,6 @@ xfs_ialloc( > > > { > > > xfs_ino_t ino; > > > xfs_inode_t *ip; > > > - bhv_vnode_t *vp; > > > uint flags; > > > int error; > > > > > > @@ -1077,7 +1076,6 @@ xfs_ialloc( > > > } > > > ASSERT(ip != NULL); > > > > > > - vp = XFS_ITOV(ip); > > > ip->i_d.di_mode = (__uint16_t)mode; > > > ip->i_d.di_onlink = 0; > > > ip->i_d.di_nlink = nlink; > > > @@ -1220,7 +1218,7 @@ xfs_ialloc( > > > xfs_trans_log_inode(tp, ip, flags); > > > > > > /* now that we have an i_mode we can setup inode ops and unlock */ > > > - xfs_initialize_vnode(tp->t_mountp, vp, ip); > > > + xfs_setup_inode(ip); > > > > > > *ipp = ip; > > > return 0; > > ---end quoted text--- > ---end quoted text--- ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 01:05:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 01:05:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N85KwU015966 for ; Wed, 23 Jul 2008 01:05:20 -0700 X-ASG-Debug-ID: 1216800387-6e0a00120000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 27D07E8A963 for ; Wed, 23 Jul 2008 01:06:28 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id tMQ6xESPGlQHmE8R for ; Wed, 23 Jul 2008 01:06:28 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N86INg003570 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 10:06:18 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N86Iqj003568 for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:06:18 +0200 Date: Wed, 23 Jul 2008 10:06:18 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/2] merge xfs_rmdir into xfs_remove Subject: Re: [PATCH 1/2] merge xfs_rmdir into xfs_remove Message-ID: <20080723080618.GE3417@lst.de> References: <20080502105757.GB17870@lst.de> <20080521082548.GB3215@lst.de> <20080616061839.GA5230@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080616061839.GA5230@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216800390 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56824 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17066 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs ping? On Mon, Jun 16, 2008 at 08:18:39AM +0200, Christoph Hellwig wrote: > On Wed, May 21, 2008 at 10:25:48AM +0200, Christoph Hellwig wrote: > > On Fri, May 02, 2008 at 12:57:57PM +0200, Christoph Hellwig wrote: > > > xfs_remove and xfs_rmdir are almost the same with a little more work > > > performed in xfs_rmdir due to the . and .. entries. This patch merges > > > xfs_rmdir into xfs_remove and performs these actions conditionally. > > > > > > Also clean up the error handling which was a nightmare in both versions > > > before. > > > > Updated for the case-insensitive filename changes. > > And another update for the d_invalidate added on unlink/rmdir. > > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-06-16 08:11:12.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-06-16 08:14:16.000000000 +0200 > @@ -2116,13 +2116,6 @@ again: > #endif > } > > -#ifdef DEBUG > -#define REMOVE_DEBUG_TRACE(x) {remove_which_error_return = (x);} > -int remove_which_error_return = 0; > -#else /* ! DEBUG */ > -#define REMOVE_DEBUG_TRACE(x) > -#endif /* ! DEBUG */ > - > int > xfs_remove( > xfs_inode_t *dp, > @@ -2131,6 +2124,7 @@ xfs_remove( > { > xfs_mount_t *mp = dp->i_mount; > xfs_trans_t *tp = NULL; > + int is_dir = S_ISDIR(ip->i_d.di_mode); > int error = 0; > xfs_bmap_free_t free_list; > xfs_fsblock_t first_block; > @@ -2138,8 +2132,11 @@ xfs_remove( > int committed; > int link_zero; > uint resblks; > + uint trans; > + uint log_count; > > xfs_itrace_entry(dp); > + xfs_itrace_entry(ip); > > if (XFS_FORCED_SHUTDOWN(mp)) > return XFS_ERROR(EIO); > @@ -2152,19 +2149,25 @@ xfs_remove( > return error; > } > > - xfs_itrace_entry(ip); > - xfs_itrace_ref(ip); > - > error = XFS_QM_DQATTACH(mp, dp, 0); > - if (!error) > - error = XFS_QM_DQATTACH(mp, ip, 0); > - if (error) { > - REMOVE_DEBUG_TRACE(__LINE__); > + if (error) > + goto std_return; > + > + error = XFS_QM_DQATTACH(mp, ip, 0); > + if (error) > goto std_return; > + > + if (is_dir) { > + trans = XFS_TRANS_RMDIR; > + log_count = XFS_DEFAULT_LOG_COUNT; > + } else { > + trans = XFS_TRANS_REMOVE; > + log_count = XFS_REMOVE_LOG_COUNT; > } > > - tp = xfs_trans_alloc(mp, XFS_TRANS_REMOVE); > + tp = xfs_trans_alloc(mp, trans); > cancel_flags = XFS_TRANS_RELEASE_LOG_RES; > + > /* > * We try to get the real space reservation first, > * allowing for directory btree deletion(s) implying > @@ -2176,25 +2179,21 @@ xfs_remove( > */ > resblks = XFS_REMOVE_SPACE_RES(mp); > error = xfs_trans_reserve(tp, resblks, XFS_REMOVE_LOG_RES(mp), 0, > - XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT); > + XFS_TRANS_PERM_LOG_RES, log_count); > if (error == ENOSPC) { > resblks = 0; > error = xfs_trans_reserve(tp, 0, XFS_REMOVE_LOG_RES(mp), 0, > - XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT); > + XFS_TRANS_PERM_LOG_RES, log_count); > } > if (error) { > ASSERT(error != ENOSPC); > - REMOVE_DEBUG_TRACE(__LINE__); > - xfs_trans_cancel(tp, 0); > - return error; > + cancel_flags = 0; > + goto out_trans_cancel; > } > > error = xfs_lock_dir_and_entry(dp, ip); > - if (error) { > - REMOVE_DEBUG_TRACE(__LINE__); > - xfs_trans_cancel(tp, cancel_flags); > - goto std_return; > - } > + if (error) > + goto out_trans_cancel; > > /* > * At this point, we've gotten both the directory and the entry > @@ -2207,6 +2206,21 @@ xfs_remove( > xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); > > /* > + * If we're removing a directory perform some additional validation. > + */ > + if (is_dir) { > + ASSERT(ip->i_d.di_nlink >= 2); > + if (ip->i_d.di_nlink != 2) { > + error = XFS_ERROR(ENOTEMPTY); > + goto out_trans_cancel; > + } > + if (!xfs_dir_isempty(ip)) { > + error = XFS_ERROR(ENOTEMPTY); > + goto out_trans_cancel; > + } > + } > + > + /* > * Entry must exist since we did a lookup in xfs_lock_dir_and_entry. > */ > XFS_BMAP_INIT(&free_list, &first_block); > @@ -2214,39 +2228,64 @@ xfs_remove( > &first_block, &free_list, resblks); > if (error) { > ASSERT(error != ENOENT); > - REMOVE_DEBUG_TRACE(__LINE__); > - goto error1; > + goto out_bmap_cancel; > } > xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); > > + /* > + * Bump the in memory generation count on the parent > + * directory so that other can know that it has changed. > + */ > dp->i_gen++; > xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); > > - error = xfs_droplink(tp, ip); > - if (error) { > - REMOVE_DEBUG_TRACE(__LINE__); > - goto error1; > + if (is_dir) { > + /* > + * Drop the link from ip's "..". > + */ > + error = xfs_droplink(tp, dp); > + if (error) > + goto out_bmap_cancel; > + > + /* > + * Drop the link from dp to ip. > + */ > + error = xfs_droplink(tp, ip); > + if (error) > + goto out_bmap_cancel; > + } else { > + /* > + * When removing a non-directory we need to log the parent > + * inode here for the i_gen update. For a directory this is > + * done implicitly by the xfs_droplink call for the ".." entry. > + */ > + xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); > } > > - /* Determine if this is the last link while > + /* > + * Drop the "." link from ip to self. > + */ > + error = xfs_droplink(tp, ip); > + if (error) > + goto out_bmap_cancel; > + > + /* > + * Determine if this is the last link while > * we are in the transaction. > */ > - link_zero = (ip)->i_d.di_nlink==0; > + link_zero = (ip->i_d.di_nlink == 0); > > /* > * If this is a synchronous mount, make sure that the > * remove transaction goes to disk before returning to > * the user. > */ > - if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) { > + if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) > xfs_trans_set_sync(tp); > - } > > error = xfs_bmap_finish(&tp, &free_list, &committed); > - if (error) { > - REMOVE_DEBUG_TRACE(__LINE__); > - goto error_rele; > - } > + if (error) > + goto out_bmap_cancel; > > error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); > if (error) > @@ -2258,39 +2297,27 @@ xfs_remove( > * will get killed on last close in xfs_close() so we don't > * have to worry about that. > */ > - if (link_zero && xfs_inode_is_filestream(ip)) > + if (!is_dir && link_zero && xfs_inode_is_filestream(ip)) > xfs_filestream_deassociate(ip); > > xfs_itrace_exit(ip); > + xfs_itrace_exit(dp); > > -/* Fall through to std_return with error = 0 */ > std_return: > if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { > - (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, > - dp, DM_RIGHT_NULL, > - NULL, DM_RIGHT_NULL, > - name->name, NULL, ip->i_d.di_mode, error, 0); > + XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dp, DM_RIGHT_NULL, > + NULL, DM_RIGHT_NULL, name->name, NULL, > + ip->i_d.di_mode, error, 0); > } > + > return error; > > - error1: > + out_bmap_cancel: > xfs_bmap_cancel(&free_list); > cancel_flags |= XFS_TRANS_ABORT; > + out_trans_cancel: > xfs_trans_cancel(tp, cancel_flags); > goto std_return; > - > - error_rele: > - /* > - * In this case make sure to not release the inode until after > - * the current transaction is aborted. Releasing it beforehand > - * can cause us to go to xfs_inactive and start a recursive > - * transaction which can easily deadlock with the current one. > - */ > - xfs_bmap_cancel(&free_list); > - cancel_flags |= XFS_TRANS_ABORT; > - xfs_trans_cancel(tp, cancel_flags); > - > - goto std_return; > } > > int > @@ -2656,186 +2683,6 @@ std_return: > } > > int > -xfs_rmdir( > - xfs_inode_t *dp, > - struct xfs_name *name, > - xfs_inode_t *cdp) > -{ > - xfs_mount_t *mp = dp->i_mount; > - xfs_trans_t *tp; > - int error; > - xfs_bmap_free_t free_list; > - xfs_fsblock_t first_block; > - int cancel_flags; > - int committed; > - int last_cdp_link; > - uint resblks; > - > - xfs_itrace_entry(dp); > - > - if (XFS_FORCED_SHUTDOWN(mp)) > - return XFS_ERROR(EIO); > - > - if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { > - error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, > - dp, DM_RIGHT_NULL, > - NULL, DM_RIGHT_NULL, name->name, > - NULL, cdp->i_d.di_mode, 0, 0); > - if (error) > - return XFS_ERROR(error); > - } > - > - /* > - * Get the dquots for the inodes. > - */ > - error = XFS_QM_DQATTACH(mp, dp, 0); > - if (!error) > - error = XFS_QM_DQATTACH(mp, cdp, 0); > - if (error) { > - REMOVE_DEBUG_TRACE(__LINE__); > - goto std_return; > - } > - > - tp = xfs_trans_alloc(mp, XFS_TRANS_RMDIR); > - cancel_flags = XFS_TRANS_RELEASE_LOG_RES; > - /* > - * We try to get the real space reservation first, > - * allowing for directory btree deletion(s) implying > - * possible bmap insert(s). If we can't get the space > - * reservation then we use 0 instead, and avoid the bmap > - * btree insert(s) in the directory code by, if the bmap > - * insert tries to happen, instead trimming the LAST > - * block from the directory. > - */ > - resblks = XFS_REMOVE_SPACE_RES(mp); > - error = xfs_trans_reserve(tp, resblks, XFS_REMOVE_LOG_RES(mp), 0, > - XFS_TRANS_PERM_LOG_RES, XFS_DEFAULT_LOG_COUNT); > - if (error == ENOSPC) { > - resblks = 0; > - error = xfs_trans_reserve(tp, 0, XFS_REMOVE_LOG_RES(mp), 0, > - XFS_TRANS_PERM_LOG_RES, XFS_DEFAULT_LOG_COUNT); > - } > - if (error) { > - ASSERT(error != ENOSPC); > - cancel_flags = 0; > - goto error_return; > - } > - XFS_BMAP_INIT(&free_list, &first_block); > - > - /* > - * Now lock the child directory inode and the parent directory > - * inode in the proper order. This will take care of validating > - * that the directory entry for the child directory inode has > - * not changed while we were obtaining a log reservation. > - */ > - error = xfs_lock_dir_and_entry(dp, cdp); > - if (error) { > - xfs_trans_cancel(tp, cancel_flags); > - goto std_return; > - } > - > - IHOLD(dp); > - xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); > - > - IHOLD(cdp); > - xfs_trans_ijoin(tp, cdp, XFS_ILOCK_EXCL); > - > - ASSERT(cdp->i_d.di_nlink >= 2); > - if (cdp->i_d.di_nlink != 2) { > - error = XFS_ERROR(ENOTEMPTY); > - goto error_return; > - } > - if (!xfs_dir_isempty(cdp)) { > - error = XFS_ERROR(ENOTEMPTY); > - goto error_return; > - } > - > - error = xfs_dir_removename(tp, dp, name, cdp->i_ino, > - &first_block, &free_list, resblks); > - if (error) > - goto error1; > - > - xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); > - > - /* > - * Bump the in memory generation count on the parent > - * directory so that other can know that it has changed. > - */ > - dp->i_gen++; > - > - /* > - * Drop the link from cdp's "..". > - */ > - error = xfs_droplink(tp, dp); > - if (error) { > - goto error1; > - } > - > - /* > - * Drop the link from dp to cdp. > - */ > - error = xfs_droplink(tp, cdp); > - if (error) { > - goto error1; > - } > - > - /* > - * Drop the "." link from cdp to self. > - */ > - error = xfs_droplink(tp, cdp); > - if (error) { > - goto error1; > - } > - > - /* Determine these before committing transaction */ > - last_cdp_link = (cdp)->i_d.di_nlink==0; > - > - /* > - * If this is a synchronous mount, make sure that the > - * rmdir transaction goes to disk before returning to > - * the user. > - */ > - if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) { > - xfs_trans_set_sync(tp); > - } > - > - error = xfs_bmap_finish (&tp, &free_list, &committed); > - if (error) { > - xfs_bmap_cancel(&free_list); > - xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES | > - XFS_TRANS_ABORT)); > - goto std_return; > - } > - > - error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); > - if (error) { > - goto std_return; > - } > - > - > - /* Fall through to std_return with error = 0 or the errno > - * from xfs_trans_commit. */ > - std_return: > - if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { > - (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, > - dp, DM_RIGHT_NULL, > - NULL, DM_RIGHT_NULL, > - name->name, NULL, cdp->i_d.di_mode, > - error, 0); > - } > - return error; > - > - error1: > - xfs_bmap_cancel(&free_list); > - cancel_flags |= XFS_TRANS_ABORT; > - /* FALLTHROUGH */ > - > - error_return: > - xfs_trans_cancel(tp, cancel_flags); > - goto std_return; > -} > - > -int > xfs_symlink( > xfs_inode_t *dp, > struct xfs_name *link_name, > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-06-16 08:14:12.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-06-16 08:15:00.000000000 +0200 > @@ -252,8 +252,7 @@ STATIC void > xfs_cleanup_inode( > struct inode *dir, > struct inode *inode, > - struct dentry *dentry, > - int mode) > + struct dentry *dentry) > { > struct xfs_name teardown; > > @@ -264,10 +263,7 @@ xfs_cleanup_inode( > */ > xfs_dentry_to_name(&teardown, dentry); > > - if (S_ISDIR(mode)) > - xfs_rmdir(XFS_I(dir), &teardown, XFS_I(inode)); > - else > - xfs_remove(XFS_I(dir), &teardown, XFS_I(inode)); > + xfs_remove(XFS_I(dir), &teardown, XFS_I(inode)); > iput(inode); > } > > @@ -349,7 +345,7 @@ xfs_vn_mknod( > return -error; > > out_cleanup_inode: > - xfs_cleanup_inode(dir, inode, dentry, mode); > + xfs_cleanup_inode(dir, inode, dentry); > out_free_acl: > if (default_acl) > _ACL_FREE(default_acl); > @@ -525,38 +521,12 @@ xfs_vn_symlink( > return 0; > > out_cleanup_inode: > - xfs_cleanup_inode(dir, inode, dentry, 0); > + xfs_cleanup_inode(dir, inode, dentry); > out: > return -error; > } > > STATIC int > -xfs_vn_rmdir( > - struct inode *dir, > - struct dentry *dentry) > -{ > - struct inode *inode = dentry->d_inode; > - struct xfs_name name; > - int error; > - > - xfs_dentry_to_name(&name, dentry); > - > - error = xfs_rmdir(XFS_I(dir), &name, XFS_I(inode)); > - if (likely(!error)) { > - xfs_validate_fields(inode); > - xfs_validate_fields(dir); > - /* > - * With rmdir, the VFS makes the dentry "negative": no inode, > - * but still hashed. This is incompatible with case-insensitive > - * mode, so invalidate (unhash) the dentry in CI-mode. > - */ > - if (xfs_sb_version_hasasciici(&XFS_M(dir->i_sb)->m_sb)) > - d_invalidate(dentry); > - } > - return -error; > -} > - > -STATIC int > xfs_vn_rename( > struct inode *odir, > struct dentry *odentry, > @@ -850,7 +820,13 @@ static const struct inode_operations xfs > .unlink = xfs_vn_unlink, > .symlink = xfs_vn_symlink, > .mkdir = xfs_vn_mkdir, > - .rmdir = xfs_vn_rmdir, > + /* > + * Yes, XFS uses the same method for rmdir and unlink. > + * > + * There are some subtile differences deeper in the code, > + * but we use S_ISDIR to check for those. > + */ > + .rmdir = xfs_vn_unlink, > .mknod = xfs_vn_mknod, > .rename = xfs_vn_rename, > .permission = xfs_vn_permission, > @@ -869,7 +845,13 @@ static const struct inode_operations xfs > .unlink = xfs_vn_unlink, > .symlink = xfs_vn_symlink, > .mkdir = xfs_vn_mkdir, > - .rmdir = xfs_vn_rmdir, > + /* > + * Yes, XFS uses the same method for rmdir and unlink. > + * > + * There are some subtile differences deeper in the code, > + * but we use S_ISDIR to check for those. > + */ > + .rmdir = xfs_vn_unlink, > .mknod = xfs_vn_mknod, > .rename = xfs_vn_rename, > .permission = xfs_vn_permission, > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2008-06-16 08:11:12.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2008-06-16 08:14:16.000000000 +0200 > @@ -31,8 +31,6 @@ int xfs_link(struct xfs_inode *tdp, stru > struct xfs_name *target_name); > int xfs_mkdir(struct xfs_inode *dp, struct xfs_name *dir_name, > mode_t mode, struct xfs_inode **ipp, struct cred *credp); > -int xfs_rmdir(struct xfs_inode *dp, struct xfs_name *name, > - struct xfs_inode *cdp); > int xfs_readdir(struct xfs_inode *dp, void *dirent, size_t bufsize, > xfs_off_t *offset, filldir_t filldir); > int xfs_symlink(struct xfs_inode *dp, struct xfs_name *link_name, ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 01:11:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 01:11:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N8Bo6a016862 for ; Wed, 23 Jul 2008 01:11:50 -0700 X-ASG-Debug-ID: 1216800778-7d6d02500000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EE3141B3B22D for ; Wed, 23 Jul 2008 01:12:59 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id EdyFninJccHAxLf2 for ; Wed, 23 Jul 2008 01:12:59 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N8CnNg003851 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 10:12:49 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N8CnVC003849 for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:12:49 +0200 Date: Wed, 23 Jul 2008 10:12:49 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/2] merge xfs_rmdir into xfs_remove Subject: Re: [PATCH 1/2] merge xfs_rmdir into xfs_remove Message-ID: <20080723081249.GA3826@lst.de> References: <20080502105757.GB17870@lst.de> <20080521082548.GB3215@lst.de> <20080616061839.GA5230@lst.de> <20080723080618.GE3417@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723080618.GE3417@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216800779 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17067 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Oops, sorry. This one obviously is in already, I men to ping from 2/2 from this series. On Wed, Jul 23, 2008 at 10:06:18AM +0200, Christoph Hellwig wrote: > ping? > > On Mon, Jun 16, 2008 at 08:18:39AM +0200, Christoph Hellwig wrote: > > On Wed, May 21, 2008 at 10:25:48AM +0200, Christoph Hellwig wrote: > > > On Fri, May 02, 2008 at 12:57:57PM +0200, Christoph Hellwig wrote: > > > > xfs_remove and xfs_rmdir are almost the same with a little more work > > > > performed in xfs_rmdir due to the . and .. entries. This patch merges > > > > xfs_rmdir into xfs_remove and performs these actions conditionally. > > > > > > > > Also clean up the error handling which was a nightmare in both versions > > > > before. > > > > > > Updated for the case-insensitive filename changes. > > > > And another update for the d_invalidate added on unlink/rmdir. > > > > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-06-16 08:11:12.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-06-16 08:14:16.000000000 +0200 > > @@ -2116,13 +2116,6 @@ again: > > #endif > > } > > > > -#ifdef DEBUG > > -#define REMOVE_DEBUG_TRACE(x) {remove_which_error_return = (x);} > > -int remove_which_error_return = 0; > > -#else /* ! DEBUG */ > > -#define REMOVE_DEBUG_TRACE(x) > > -#endif /* ! DEBUG */ > > - > > int > > xfs_remove( > > xfs_inode_t *dp, > > @@ -2131,6 +2124,7 @@ xfs_remove( > > { > > xfs_mount_t *mp = dp->i_mount; > > xfs_trans_t *tp = NULL; > > + int is_dir = S_ISDIR(ip->i_d.di_mode); > > int error = 0; > > xfs_bmap_free_t free_list; > > xfs_fsblock_t first_block; > > @@ -2138,8 +2132,11 @@ xfs_remove( > > int committed; > > int link_zero; > > uint resblks; > > + uint trans; > > + uint log_count; > > > > xfs_itrace_entry(dp); > > + xfs_itrace_entry(ip); > > > > if (XFS_FORCED_SHUTDOWN(mp)) > > return XFS_ERROR(EIO); > > @@ -2152,19 +2149,25 @@ xfs_remove( > > return error; > > } > > > > - xfs_itrace_entry(ip); > > - xfs_itrace_ref(ip); > > - > > error = XFS_QM_DQATTACH(mp, dp, 0); > > - if (!error) > > - error = XFS_QM_DQATTACH(mp, ip, 0); > > - if (error) { > > - REMOVE_DEBUG_TRACE(__LINE__); > > + if (error) > > + goto std_return; > > + > > + error = XFS_QM_DQATTACH(mp, ip, 0); > > + if (error) > > goto std_return; > > + > > + if (is_dir) { > > + trans = XFS_TRANS_RMDIR; > > + log_count = XFS_DEFAULT_LOG_COUNT; > > + } else { > > + trans = XFS_TRANS_REMOVE; > > + log_count = XFS_REMOVE_LOG_COUNT; > > } > > > > - tp = xfs_trans_alloc(mp, XFS_TRANS_REMOVE); > > + tp = xfs_trans_alloc(mp, trans); > > cancel_flags = XFS_TRANS_RELEASE_LOG_RES; > > + > > /* > > * We try to get the real space reservation first, > > * allowing for directory btree deletion(s) implying > > @@ -2176,25 +2179,21 @@ xfs_remove( > > */ > > resblks = XFS_REMOVE_SPACE_RES(mp); > > error = xfs_trans_reserve(tp, resblks, XFS_REMOVE_LOG_RES(mp), 0, > > - XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT); > > + XFS_TRANS_PERM_LOG_RES, log_count); > > if (error == ENOSPC) { > > resblks = 0; > > error = xfs_trans_reserve(tp, 0, XFS_REMOVE_LOG_RES(mp), 0, > > - XFS_TRANS_PERM_LOG_RES, XFS_REMOVE_LOG_COUNT); > > + XFS_TRANS_PERM_LOG_RES, log_count); > > } > > if (error) { > > ASSERT(error != ENOSPC); > > - REMOVE_DEBUG_TRACE(__LINE__); > > - xfs_trans_cancel(tp, 0); > > - return error; > > + cancel_flags = 0; > > + goto out_trans_cancel; > > } > > > > error = xfs_lock_dir_and_entry(dp, ip); > > - if (error) { > > - REMOVE_DEBUG_TRACE(__LINE__); > > - xfs_trans_cancel(tp, cancel_flags); > > - goto std_return; > > - } > > + if (error) > > + goto out_trans_cancel; > > > > /* > > * At this point, we've gotten both the directory and the entry > > @@ -2207,6 +2206,21 @@ xfs_remove( > > xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); > > > > /* > > + * If we're removing a directory perform some additional validation. > > + */ > > + if (is_dir) { > > + ASSERT(ip->i_d.di_nlink >= 2); > > + if (ip->i_d.di_nlink != 2) { > > + error = XFS_ERROR(ENOTEMPTY); > > + goto out_trans_cancel; > > + } > > + if (!xfs_dir_isempty(ip)) { > > + error = XFS_ERROR(ENOTEMPTY); > > + goto out_trans_cancel; > > + } > > + } > > + > > + /* > > * Entry must exist since we did a lookup in xfs_lock_dir_and_entry. > > */ > > XFS_BMAP_INIT(&free_list, &first_block); > > @@ -2214,39 +2228,64 @@ xfs_remove( > > &first_block, &free_list, resblks); > > if (error) { > > ASSERT(error != ENOENT); > > - REMOVE_DEBUG_TRACE(__LINE__); > > - goto error1; > > + goto out_bmap_cancel; > > } > > xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); > > > > + /* > > + * Bump the in memory generation count on the parent > > + * directory so that other can know that it has changed. > > + */ > > dp->i_gen++; > > xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); > > > > - error = xfs_droplink(tp, ip); > > - if (error) { > > - REMOVE_DEBUG_TRACE(__LINE__); > > - goto error1; > > + if (is_dir) { > > + /* > > + * Drop the link from ip's "..". > > + */ > > + error = xfs_droplink(tp, dp); > > + if (error) > > + goto out_bmap_cancel; > > + > > + /* > > + * Drop the link from dp to ip. > > + */ > > + error = xfs_droplink(tp, ip); > > + if (error) > > + goto out_bmap_cancel; > > + } else { > > + /* > > + * When removing a non-directory we need to log the parent > > + * inode here for the i_gen update. For a directory this is > > + * done implicitly by the xfs_droplink call for the ".." entry. > > + */ > > + xfs_trans_log_inode(tp, dp, XFS_ILOG_CORE); > > } > > > > - /* Determine if this is the last link while > > + /* > > + * Drop the "." link from ip to self. > > + */ > > + error = xfs_droplink(tp, ip); > > + if (error) > > + goto out_bmap_cancel; > > + > > + /* > > + * Determine if this is the last link while > > * we are in the transaction. > > */ > > - link_zero = (ip)->i_d.di_nlink==0; > > + link_zero = (ip->i_d.di_nlink == 0); > > > > /* > > * If this is a synchronous mount, make sure that the > > * remove transaction goes to disk before returning to > > * the user. > > */ > > - if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) { > > + if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) > > xfs_trans_set_sync(tp); > > - } > > > > error = xfs_bmap_finish(&tp, &free_list, &committed); > > - if (error) { > > - REMOVE_DEBUG_TRACE(__LINE__); > > - goto error_rele; > > - } > > + if (error) > > + goto out_bmap_cancel; > > > > error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); > > if (error) > > @@ -2258,39 +2297,27 @@ xfs_remove( > > * will get killed on last close in xfs_close() so we don't > > * have to worry about that. > > */ > > - if (link_zero && xfs_inode_is_filestream(ip)) > > + if (!is_dir && link_zero && xfs_inode_is_filestream(ip)) > > xfs_filestream_deassociate(ip); > > > > xfs_itrace_exit(ip); > > + xfs_itrace_exit(dp); > > > > -/* Fall through to std_return with error = 0 */ > > std_return: > > if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { > > - (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, > > - dp, DM_RIGHT_NULL, > > - NULL, DM_RIGHT_NULL, > > - name->name, NULL, ip->i_d.di_mode, error, 0); > > + XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, dp, DM_RIGHT_NULL, > > + NULL, DM_RIGHT_NULL, name->name, NULL, > > + ip->i_d.di_mode, error, 0); > > } > > + > > return error; > > > > - error1: > > + out_bmap_cancel: > > xfs_bmap_cancel(&free_list); > > cancel_flags |= XFS_TRANS_ABORT; > > + out_trans_cancel: > > xfs_trans_cancel(tp, cancel_flags); > > goto std_return; > > - > > - error_rele: > > - /* > > - * In this case make sure to not release the inode until after > > - * the current transaction is aborted. Releasing it beforehand > > - * can cause us to go to xfs_inactive and start a recursive > > - * transaction which can easily deadlock with the current one. > > - */ > > - xfs_bmap_cancel(&free_list); > > - cancel_flags |= XFS_TRANS_ABORT; > > - xfs_trans_cancel(tp, cancel_flags); > > - > > - goto std_return; > > } > > > > int > > @@ -2656,186 +2683,6 @@ std_return: > > } > > > > int > > -xfs_rmdir( > > - xfs_inode_t *dp, > > - struct xfs_name *name, > > - xfs_inode_t *cdp) > > -{ > > - xfs_mount_t *mp = dp->i_mount; > > - xfs_trans_t *tp; > > - int error; > > - xfs_bmap_free_t free_list; > > - xfs_fsblock_t first_block; > > - int cancel_flags; > > - int committed; > > - int last_cdp_link; > > - uint resblks; > > - > > - xfs_itrace_entry(dp); > > - > > - if (XFS_FORCED_SHUTDOWN(mp)) > > - return XFS_ERROR(EIO); > > - > > - if (DM_EVENT_ENABLED(dp, DM_EVENT_REMOVE)) { > > - error = XFS_SEND_NAMESP(mp, DM_EVENT_REMOVE, > > - dp, DM_RIGHT_NULL, > > - NULL, DM_RIGHT_NULL, name->name, > > - NULL, cdp->i_d.di_mode, 0, 0); > > - if (error) > > - return XFS_ERROR(error); > > - } > > - > > - /* > > - * Get the dquots for the inodes. > > - */ > > - error = XFS_QM_DQATTACH(mp, dp, 0); > > - if (!error) > > - error = XFS_QM_DQATTACH(mp, cdp, 0); > > - if (error) { > > - REMOVE_DEBUG_TRACE(__LINE__); > > - goto std_return; > > - } > > - > > - tp = xfs_trans_alloc(mp, XFS_TRANS_RMDIR); > > - cancel_flags = XFS_TRANS_RELEASE_LOG_RES; > > - /* > > - * We try to get the real space reservation first, > > - * allowing for directory btree deletion(s) implying > > - * possible bmap insert(s). If we can't get the space > > - * reservation then we use 0 instead, and avoid the bmap > > - * btree insert(s) in the directory code by, if the bmap > > - * insert tries to happen, instead trimming the LAST > > - * block from the directory. > > - */ > > - resblks = XFS_REMOVE_SPACE_RES(mp); > > - error = xfs_trans_reserve(tp, resblks, XFS_REMOVE_LOG_RES(mp), 0, > > - XFS_TRANS_PERM_LOG_RES, XFS_DEFAULT_LOG_COUNT); > > - if (error == ENOSPC) { > > - resblks = 0; > > - error = xfs_trans_reserve(tp, 0, XFS_REMOVE_LOG_RES(mp), 0, > > - XFS_TRANS_PERM_LOG_RES, XFS_DEFAULT_LOG_COUNT); > > - } > > - if (error) { > > - ASSERT(error != ENOSPC); > > - cancel_flags = 0; > > - goto error_return; > > - } > > - XFS_BMAP_INIT(&free_list, &first_block); > > - > > - /* > > - * Now lock the child directory inode and the parent directory > > - * inode in the proper order. This will take care of validating > > - * that the directory entry for the child directory inode has > > - * not changed while we were obtaining a log reservation. > > - */ > > - error = xfs_lock_dir_and_entry(dp, cdp); > > - if (error) { > > - xfs_trans_cancel(tp, cancel_flags); > > - goto std_return; > > - } > > - > > - IHOLD(dp); > > - xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); > > - > > - IHOLD(cdp); > > - xfs_trans_ijoin(tp, cdp, XFS_ILOCK_EXCL); > > - > > - ASSERT(cdp->i_d.di_nlink >= 2); > > - if (cdp->i_d.di_nlink != 2) { > > - error = XFS_ERROR(ENOTEMPTY); > > - goto error_return; > > - } > > - if (!xfs_dir_isempty(cdp)) { > > - error = XFS_ERROR(ENOTEMPTY); > > - goto error_return; > > - } > > - > > - error = xfs_dir_removename(tp, dp, name, cdp->i_ino, > > - &first_block, &free_list, resblks); > > - if (error) > > - goto error1; > > - > > - xfs_ichgtime(dp, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); > > - > > - /* > > - * Bump the in memory generation count on the parent > > - * directory so that other can know that it has changed. > > - */ > > - dp->i_gen++; > > - > > - /* > > - * Drop the link from cdp's "..". > > - */ > > - error = xfs_droplink(tp, dp); > > - if (error) { > > - goto error1; > > - } > > - > > - /* > > - * Drop the link from dp to cdp. > > - */ > > - error = xfs_droplink(tp, cdp); > > - if (error) { > > - goto error1; > > - } > > - > > - /* > > - * Drop the "." link from cdp to self. > > - */ > > - error = xfs_droplink(tp, cdp); > > - if (error) { > > - goto error1; > > - } > > - > > - /* Determine these before committing transaction */ > > - last_cdp_link = (cdp)->i_d.di_nlink==0; > > - > > - /* > > - * If this is a synchronous mount, make sure that the > > - * rmdir transaction goes to disk before returning to > > - * the user. > > - */ > > - if (mp->m_flags & (XFS_MOUNT_WSYNC|XFS_MOUNT_DIRSYNC)) { > > - xfs_trans_set_sync(tp); > > - } > > - > > - error = xfs_bmap_finish (&tp, &free_list, &committed); > > - if (error) { > > - xfs_bmap_cancel(&free_list); > > - xfs_trans_cancel(tp, (XFS_TRANS_RELEASE_LOG_RES | > > - XFS_TRANS_ABORT)); > > - goto std_return; > > - } > > - > > - error = xfs_trans_commit(tp, XFS_TRANS_RELEASE_LOG_RES); > > - if (error) { > > - goto std_return; > > - } > > - > > - > > - /* Fall through to std_return with error = 0 or the errno > > - * from xfs_trans_commit. */ > > - std_return: > > - if (DM_EVENT_ENABLED(dp, DM_EVENT_POSTREMOVE)) { > > - (void) XFS_SEND_NAMESP(mp, DM_EVENT_POSTREMOVE, > > - dp, DM_RIGHT_NULL, > > - NULL, DM_RIGHT_NULL, > > - name->name, NULL, cdp->i_d.di_mode, > > - error, 0); > > - } > > - return error; > > - > > - error1: > > - xfs_bmap_cancel(&free_list); > > - cancel_flags |= XFS_TRANS_ABORT; > > - /* FALLTHROUGH */ > > - > > - error_return: > > - xfs_trans_cancel(tp, cancel_flags); > > - goto std_return; > > -} > > - > > -int > > xfs_symlink( > > xfs_inode_t *dp, > > struct xfs_name *link_name, > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-06-16 08:14:12.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-06-16 08:15:00.000000000 +0200 > > @@ -252,8 +252,7 @@ STATIC void > > xfs_cleanup_inode( > > struct inode *dir, > > struct inode *inode, > > - struct dentry *dentry, > > - int mode) > > + struct dentry *dentry) > > { > > struct xfs_name teardown; > > > > @@ -264,10 +263,7 @@ xfs_cleanup_inode( > > */ > > xfs_dentry_to_name(&teardown, dentry); > > > > - if (S_ISDIR(mode)) > > - xfs_rmdir(XFS_I(dir), &teardown, XFS_I(inode)); > > - else > > - xfs_remove(XFS_I(dir), &teardown, XFS_I(inode)); > > + xfs_remove(XFS_I(dir), &teardown, XFS_I(inode)); > > iput(inode); > > } > > > > @@ -349,7 +345,7 @@ xfs_vn_mknod( > > return -error; > > > > out_cleanup_inode: > > - xfs_cleanup_inode(dir, inode, dentry, mode); > > + xfs_cleanup_inode(dir, inode, dentry); > > out_free_acl: > > if (default_acl) > > _ACL_FREE(default_acl); > > @@ -525,38 +521,12 @@ xfs_vn_symlink( > > return 0; > > > > out_cleanup_inode: > > - xfs_cleanup_inode(dir, inode, dentry, 0); > > + xfs_cleanup_inode(dir, inode, dentry); > > out: > > return -error; > > } > > > > STATIC int > > -xfs_vn_rmdir( > > - struct inode *dir, > > - struct dentry *dentry) > > -{ > > - struct inode *inode = dentry->d_inode; > > - struct xfs_name name; > > - int error; > > - > > - xfs_dentry_to_name(&name, dentry); > > - > > - error = xfs_rmdir(XFS_I(dir), &name, XFS_I(inode)); > > - if (likely(!error)) { > > - xfs_validate_fields(inode); > > - xfs_validate_fields(dir); > > - /* > > - * With rmdir, the VFS makes the dentry "negative": no inode, > > - * but still hashed. This is incompatible with case-insensitive > > - * mode, so invalidate (unhash) the dentry in CI-mode. > > - */ > > - if (xfs_sb_version_hasasciici(&XFS_M(dir->i_sb)->m_sb)) > > - d_invalidate(dentry); > > - } > > - return -error; > > -} > > - > > -STATIC int > > xfs_vn_rename( > > struct inode *odir, > > struct dentry *odentry, > > @@ -850,7 +820,13 @@ static const struct inode_operations xfs > > .unlink = xfs_vn_unlink, > > .symlink = xfs_vn_symlink, > > .mkdir = xfs_vn_mkdir, > > - .rmdir = xfs_vn_rmdir, > > + /* > > + * Yes, XFS uses the same method for rmdir and unlink. > > + * > > + * There are some subtile differences deeper in the code, > > + * but we use S_ISDIR to check for those. > > + */ > > + .rmdir = xfs_vn_unlink, > > .mknod = xfs_vn_mknod, > > .rename = xfs_vn_rename, > > .permission = xfs_vn_permission, > > @@ -869,7 +845,13 @@ static const struct inode_operations xfs > > .unlink = xfs_vn_unlink, > > .symlink = xfs_vn_symlink, > > .mkdir = xfs_vn_mkdir, > > - .rmdir = xfs_vn_rmdir, > > + /* > > + * Yes, XFS uses the same method for rmdir and unlink. > > + * > > + * There are some subtile differences deeper in the code, > > + * but we use S_ISDIR to check for those. > > + */ > > + .rmdir = xfs_vn_unlink, > > .mknod = xfs_vn_mknod, > > .rename = xfs_vn_rename, > > .permission = xfs_vn_permission, > > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2008-06-16 08:11:12.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2008-06-16 08:14:16.000000000 +0200 > > @@ -31,8 +31,6 @@ int xfs_link(struct xfs_inode *tdp, stru > > struct xfs_name *target_name); > > int xfs_mkdir(struct xfs_inode *dp, struct xfs_name *dir_name, > > mode_t mode, struct xfs_inode **ipp, struct cred *credp); > > -int xfs_rmdir(struct xfs_inode *dp, struct xfs_name *name, > > - struct xfs_inode *cdp); > > int xfs_readdir(struct xfs_inode *dp, void *dirent, size_t bufsize, > > xfs_off_t *offset, filldir_t filldir); > > int xfs_symlink(struct xfs_inode *dp, struct xfs_name *link_name, > ---end quoted text--- ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 01:12:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 01:12:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6N8CF2m017043 for ; Wed, 23 Jul 2008 01:12:15 -0700 X-ASG-Debug-ID: 1216800804-78bc02f10000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B3E641B3B23C for ; Wed, 23 Jul 2008 01:13:24 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Sj2pu3bNgfL3udnG for ; Wed, 23 Jul 2008 01:13:24 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6N8DFNg003905 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 10:13:15 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6N8DFWw003903 for xfs@oss.sgi.com; Wed, 23 Jul 2008 10:13:15 +0200 Date: Wed, 23 Jul 2008 10:13:15 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/2] kill xfs_lock_dir_and_entry Subject: Re: [PATCH 2/2] kill xfs_lock_dir_and_entry Message-ID: <20080723081315.GA3863@lst.de> References: <20080502105803.GC17870@lst.de> <20080520063639.GC8869@lst.de> <20080627130627.GC23431@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080627130627.GC23431@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216800805 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17068 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs ping^3 - this time for real :) On Fri, Jun 27, 2008 at 03:06:27PM +0200, Christoph Hellwig wrote: > ping^2 > > On Tue, May 20, 2008 at 08:36:39AM +0200, Christoph Hellwig wrote: > > ping? > > > > On Fri, May 02, 2008 at 12:58:03PM +0200, Christoph Hellwig wrote: > > > When multiple inodes are locked in XFS it happens in order of the inode > > > number, with the everything but the first inode trylocked if any of > > > the previous inodes is in the AIL. > > > > > > Except for the sorting of the inodes this logic is implemented in > > > xfs_lock_inodes, but also partially duplicated in xfs_lock_dir_and_entry > > > in a particularly stupid way adds a lock roundtrip if the inode ordering > > > is not optimal. > > > > > > This patch adds a new helper xfs_lock_two_inodes that takes two inodes > > > and locks them in the most optimal way according to the above locking > > > protocol and uses it for all places that want to lock two inodes. > > > > > > The only caller of xfs_lock_inodes is xfs_rename which might lock up to > > > four inodes. > > > > > > > > > Signed-off-by: Christoph Hellwig > > > > > > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-05-02 08:30:24.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-05-02 08:30:30.000000000 +0200 > > > @@ -1897,111 +1897,6 @@ std_return: > > > } > > > > > > #ifdef DEBUG > > > -/* > > > - * Some counters to see if (and how often) we are hitting some deadlock > > > - * prevention code paths. > > > - */ > > > - > > > -int xfs_rm_locks; > > > -int xfs_rm_lock_delays; > > > -int xfs_rm_attempts; > > > -#endif > > > - > > > -/* > > > - * The following routine will lock the inodes associated with the > > > - * directory and the named entry in the directory. The locks are > > > - * acquired in increasing inode number. > > > - * > > > - * If the entry is "..", then only the directory is locked. The > > > - * vnode ref count will still include that from the .. entry in > > > - * this case. > > > - * > > > - * There is a deadlock we need to worry about. If the locked directory is > > > - * in the AIL, it might be blocking up the log. The next inode we lock > > > - * could be already locked by another thread waiting for log space (e.g > > > - * a permanent log reservation with a long running transaction (see > > > - * xfs_itruncate_finish)). To solve this, we must check if the directory > > > - * is in the ail and use lock_nowait. If we can't lock, we need to > > > - * drop the inode lock on the directory and try again. xfs_iunlock will > > > - * potentially push the tail if we were holding up the log. > > > - */ > > > -STATIC int > > > -xfs_lock_dir_and_entry( > > > - xfs_inode_t *dp, > > > - xfs_inode_t *ip) /* inode of entry 'name' */ > > > -{ > > > - int attempts; > > > - xfs_ino_t e_inum; > > > - xfs_inode_t *ips[2]; > > > - xfs_log_item_t *lp; > > > - > > > -#ifdef DEBUG > > > - xfs_rm_locks++; > > > -#endif > > > - attempts = 0; > > > - > > > -again: > > > - xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); > > > - > > > - e_inum = ip->i_ino; > > > - > > > - xfs_itrace_ref(ip); > > > - > > > - /* > > > - * We want to lock in increasing inum. Since we've already > > > - * acquired the lock on the directory, we may need to release > > > - * if if the inum of the entry turns out to be less. > > > - */ > > > - if (e_inum > dp->i_ino) { > > > - /* > > > - * We are already in the right order, so just > > > - * lock on the inode of the entry. > > > - * We need to use nowait if dp is in the AIL. > > > - */ > > > - > > > - lp = (xfs_log_item_t *)dp->i_itemp; > > > - if (lp && (lp->li_flags & XFS_LI_IN_AIL)) { > > > - if (!xfs_ilock_nowait(ip, XFS_ILOCK_EXCL)) { > > > - attempts++; > > > -#ifdef DEBUG > > > - xfs_rm_attempts++; > > > -#endif > > > - > > > - /* > > > - * Unlock dp and try again. > > > - * xfs_iunlock will try to push the tail > > > - * if the inode is in the AIL. > > > - */ > > > - > > > - xfs_iunlock(dp, XFS_ILOCK_EXCL); > > > - > > > - if ((attempts % 5) == 0) { > > > - delay(1); /* Don't just spin the CPU */ > > > -#ifdef DEBUG > > > - xfs_rm_lock_delays++; > > > -#endif > > > - } > > > - goto again; > > > - } > > > - } else { > > > - xfs_ilock(ip, XFS_ILOCK_EXCL); > > > - } > > > - } else if (e_inum < dp->i_ino) { > > > - xfs_iunlock(dp, XFS_ILOCK_EXCL); > > > - > > > - ips[0] = ip; > > > - ips[1] = dp; > > > - xfs_lock_inodes(ips, 2, XFS_ILOCK_EXCL); > > > - } > > > - /* else e_inum == dp->i_ino */ > > > - /* This can happen if we're asked to lock /x/.. > > > - * the entry is "..", which is also the parent directory. > > > - */ > > > - > > > - return 0; > > > -} > > > - > > > -#ifdef DEBUG > > > int xfs_locked_n; > > > int xfs_small_retries; > > > int xfs_middle_retries; > > > @@ -2135,6 +2030,45 @@ again: > > > #endif > > > } > > > > > > +void > > > +xfs_lock_two_inodes( > > > + xfs_inode_t *ip0, > > > + xfs_inode_t *ip1, > > > + uint lock_mode) > > > +{ > > > + xfs_inode_t *temp; > > > + int attempts = 0; > > > + xfs_log_item_t *lp; > > > + > > > + ASSERT(ip0->i_ino != ip1->i_ino); > > > + > > > + if (ip0->i_ino > ip1->i_ino) { > > > + temp = ip0; > > > + ip0 = ip1; > > > + ip1 = temp; > > > + } > > > + > > > + again: > > > + xfs_ilock(ip0, xfs_lock_inumorder(lock_mode, 0)); > > > + > > > + /* > > > + * If the first lock we have locked is in the AIL, we must TRY to get > > > + * the second lock. If we can't get it, we must release the first one > > > + * and try again. > > > + */ > > > + lp = (xfs_log_item_t *)ip0->i_itemp; > > > + if (lp && (lp->li_flags & XFS_LI_IN_AIL)) { > > > + if (!xfs_ilock_nowait(ip1, xfs_lock_inumorder(lock_mode, 1))) { > > > + xfs_iunlock(ip0, lock_mode); > > > + if ((++attempts % 5) == 0) > > > + delay(1); /* Don't just spin the CPU */ > > > + goto again; > > > + } > > > + } else { > > > + xfs_ilock(ip1, xfs_lock_inumorder(lock_mode, 1)); > > > + } > > > +} > > > + > > > int > > > xfs_remove( > > > xfs_inode_t *dp, > > > @@ -2210,9 +2144,7 @@ xfs_remove( > > > goto out_trans_cancel; > > > } > > > > > > - error = xfs_lock_dir_and_entry(dp, ip); > > > - if (error) > > > - goto out_trans_cancel; > > > + xfs_lock_two_inodes(dp, ip, XFS_ILOCK_EXCL); > > > > > > /* > > > * At this point, we've gotten both the directory and the entry > > > @@ -2239,9 +2171,6 @@ xfs_remove( > > > } > > > } > > > > > > - /* > > > - * Entry must exist since we did a lookup in xfs_lock_dir_and_entry. > > > - */ > > > XFS_BMAP_INIT(&free_list, &first_block); > > > error = xfs_dir_removename(tp, dp, name, ip->i_ino, > > > &first_block, &free_list, resblks); > > > @@ -2347,7 +2276,6 @@ xfs_link( > > > { > > > xfs_mount_t *mp = tdp->i_mount; > > > xfs_trans_t *tp; > > > - xfs_inode_t *ips[2]; > > > int error; > > > xfs_bmap_free_t free_list; > > > xfs_fsblock_t first_block; > > > @@ -2395,15 +2323,7 @@ xfs_link( > > > goto error_return; > > > } > > > > > > - if (sip->i_ino < tdp->i_ino) { > > > - ips[0] = sip; > > > - ips[1] = tdp; > > > - } else { > > > - ips[0] = tdp; > > > - ips[1] = sip; > > > - } > > > - > > > - xfs_lock_inodes(ips, 2, XFS_ILOCK_EXCL); > > > + xfs_lock_two_inodes(sip, tdp, XFS_ILOCK_EXCL); > > > > > > /* > > > * Increment vnode ref counts since xfs_trans_commit & > > > Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/xfs_dfrag.c 2008-04-26 17:43:14.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/xfs_dfrag.c 2008-05-02 08:30:30.000000000 +0200 > > > @@ -128,7 +128,6 @@ xfs_swap_extents( > > > xfs_swapext_t *sxp) > > > { > > > xfs_mount_t *mp; > > > - xfs_inode_t *ips[2]; > > > xfs_trans_t *tp; > > > xfs_bstat_t *sbp = &sxp->sx_stat; > > > bhv_vnode_t *vp, *tvp; > > > @@ -153,16 +152,7 @@ xfs_swap_extents( > > > vp = XFS_ITOV(ip); > > > tvp = XFS_ITOV(tip); > > > > > > - /* Lock in i_ino order */ > > > - if (ip->i_ino < tip->i_ino) { > > > - ips[0] = ip; > > > - ips[1] = tip; > > > - } else { > > > - ips[0] = tip; > > > - ips[1] = ip; > > > - } > > > - > > > - xfs_lock_inodes(ips, 2, lock_flags); > > > + xfs_lock_two_inodes(ip, tip, lock_flags); > > > locked = 1; > > > > > > /* Verify that both files have the same format */ > > > @@ -265,7 +255,7 @@ xfs_swap_extents( > > > locked = 0; > > > goto error0; > > > } > > > - xfs_lock_inodes(ips, 2, XFS_ILOCK_EXCL); > > > + xfs_lock_two_inodes(ip, tip, XFS_ILOCK_EXCL); > > > > > > /* > > > * Count the number of extended attribute blocks > > > Index: linux-2.6-xfs/fs/xfs/xfs_inode.h > > > =================================================================== > > > --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-05-01 22:56:57.000000000 +0200 > > > +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-05-02 08:30:30.000000000 +0200 > > > @@ -522,6 +522,7 @@ void xfs_iflush_all(struct xfs_mount *) > > > void xfs_ichgtime(xfs_inode_t *, int); > > > xfs_fsize_t xfs_file_last_byte(xfs_inode_t *); > > > void xfs_lock_inodes(xfs_inode_t **, int, uint); > > > +void xfs_lock_two_inodes(xfs_inode_t *, xfs_inode_t *, uint); > > > > > > void xfs_synchronize_atime(xfs_inode_t *); > > > void xfs_mark_inode_dirty_sync(xfs_inode_t *); > > ---end quoted text--- > ---end quoted text--- ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 04:20:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 04:21:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NBKlbh002212 for ; Wed, 23 Jul 2008 04:20:50 -0700 X-ASG-Debug-ID: 1216812115-2669031c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8E3281B290E0; Wed, 23 Jul 2008 04:21:55 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id 2qUMSwIehD1NHIb9; Wed, 23 Jul 2008 04:21:55 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLcPr-0007ZT-3m; Wed, 23 Jul 2008 11:21:55 +0000 Date: Wed, 23 Jul 2008 07:21:55 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks Subject: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks Message-ID: <20080723112154.GA17338@infradead.org> References: <48857EFB.3030301@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48857EFB.3030301@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216812117 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56836 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17069 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 04:32:27PM +1000, Lachlan McIlroy wrote: > This changes xfs_inode_item_push() to use XFS_IFLUSH_ASYNC_NOBLOCK when > flushing an inode so the flush wont block on inode cluster buffer lock. > Also change the prototype of the IOP_PUSH operation so that xfsaild_push() > can bump it's stuck count. > > This change was prompted by a deadlock that would only occur on a debug > XFS where a thread creating an inode had the buffer locked and was trying > to allocate space for the inode tracing facility. That recursed back into > the filesystem to flush data which created a transaction and needed log > space which wasn't available. The stuck propagation looks good, but I don't think this should be blindly done for all errors. The only error where it makes sense is the EAGAIN from xfs_iflush. All other returns inside the item_push handlers basically indicate filesystem corruption. From owner-xfs@oss.sgi.com Wed Jul 23 04:38:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 04:38:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NBcmsc003445 for ; Wed, 23 Jul 2008 04:38:48 -0700 X-ASG-Debug-ID: 1216813197-54d903d30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from an-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 82D43E8B120 for ; Wed, 23 Jul 2008 04:39:58 -0700 (PDT) Received: from an-out-0708.google.com (an-out-0708.google.com [209.85.132.245]) by cuda.sgi.com with ESMTP id 7rh7mHBkTMYulwpl for ; Wed, 23 Jul 2008 04:39:58 -0700 (PDT) Received: by an-out-0708.google.com with SMTP id d30so543148and.75 for ; Wed, 23 Jul 2008 04:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=evcHlCfPR3gzfXWJBjuKYyvFWM1bsvo5J0Nry6sV4KA=; b=VjMFOB5eDT+vZOWwu5n7JaR432GQawoFhpwxe2FjcgnTyJyBPspzgEwqAw1C1ME5cQ 8fe6igTmSPvgR5cmRL1QXx5dnGUvHbcxlxfLICQ/vAEQr+CmkD2kP/8XQaKFq94fQSZy Wz2Yk3pjJWTWvKnkwB/IeG+53d/NCm9JFz994= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=JxQh2P31EqLRmv1tkBfvBOES5rLlDqQTnklMrQ9ex7QAuG/hSMF/ZfTOM715g4Ijth 1NMoqOCels+ZAwtmrsOLMllw/bsRoGbCb/bzcnX6Ikm0zjgOvQNBiJY/qpWtWEdXlFg0 MhkCZw1Zv+gkAph6lUuRtO84+0d64y42BGSyI= Received: by 10.100.152.11 with SMTP id z11mr3044949and.157.1216813197439; Wed, 23 Jul 2008 04:39:57 -0700 (PDT) Received: by 10.100.43.19 with HTTP; Wed, 23 Jul 2008 04:39:57 -0700 (PDT) Message-ID: <2d460de70807230439gd058b9csa6a5e0be5bbadc0d@mail.gmail.com> Date: Wed, 23 Jul 2008 13:39:57 +0200 From: "Richard Hartmann" To: "Timothy Shimmin" X-ASG-Orig-Subj: Re: xfsrestore over ssh? Subject: Re: xfsrestore over ssh? Cc: "Nathan Scott" , "Bill Kendall" , xfs@oss.sgi.com In-Reply-To: <4886790C.7040100@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <2d460de70807211317m75bc236y403d8fa57514262e@mail.gmail.com> <4884F2A5.5050507@sgi.com> <2d460de70807212002k1a95706ic8291e2abd8796b8@mail.gmail.com> <48855B16.4050208@sgi.com> <1216708397.4499.57.camel@verge.scott.net.au> <48858676.3030105@sgi.com> <2d460de70807220351i7c468de5o33fa5aa5e9ddab99@mail.gmail.com> <4886790C.7040100@sgi.com> X-Barracuda-Connect: an-out-0708.google.com[209.85.132.245] X-Barracuda-Start-Time: 1216813198 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56836 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17070 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: richih.mailinglist@gmail.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 02:19, Timothy Shimmin wrote: > Okay, my best guess is that you are trying to restore to a non-xfs > filesystem. This was fixed again in 2.2.26 so that it would work > on a non-xfs filesystem. > Otherwise the xfs ioctl will be being called and get back an EINVAL > as we saw in the strace. As I cancelled the first working xfsrestore (kept the strace in the command), re-mkfs-ed and then restored, there is no way to verify, but I am _sure_ it was a xfs partition. I did not even know you could restore to non-xfs so I would never try to do that (not that I would use anything else, anyway ;) Thanks for looking into this, Richard From owner-xfs@oss.sgi.com Wed Jul 23 07:25:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 07:25:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NEPYEf013281 for ; Wed, 23 Jul 2008 07:25:35 -0700 X-ASG-Debug-ID: 1216823200-536c02610000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 06267319A19 for ; Wed, 23 Jul 2008 07:26:41 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 7TXF0S4zPNBR2vjH for ; Wed, 23 Jul 2008 07:26:41 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NEQVNg022911 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 16:26:31 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NEQV2Q022909 for xfs@oss.sgi.com; Wed, 23 Jul 2008 16:26:31 +0200 Date: Wed, 23 Jul 2008 16:26:30 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] remove dead inode flags Subject: [PATCH] remove dead inode flags Message-ID: <20080723142630.GA22859@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216823204 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56843 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17071 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs There are a few inode flags around that aren't used anywhere, so remove them. Also update xfsidbg to display all used inode flags correctly. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-23 15:11:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-23 15:12:00.000000000 +0200 @@ -2481,7 +2481,6 @@ xfs_dm_punch_hole( /* Let threads in send_data_event know we punched the file. */ ip->i_d.di_dmstate++; xfs_iunlock(ip, XFS_IOLOCK_EXCL); - xfs_iflags_set(ip, XFS_IMODIFIED); up_and_out: up_rw_sems(inode, DM_SEM_FLAG_WR); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2008-07-23 15:11:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c 2008-07-23 15:12:00.000000000 +0200 @@ -318,14 +318,9 @@ xfs_map_blocks( xfs_iomap_t *mapp, int flags) { - xfs_inode_t *ip = XFS_I(inode); - int error, nmaps = 1; + int nmaps = 1; - error = xfs_iomap(ip, offset, count, - flags, mapp, &nmaps); - if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) - xfs_iflags_set(ip, XFS_IMODIFIED); - return -error; + return -xfs_iomap(XFS_I(inode), offset, count, flags, mapp, &nmaps); } STATIC_INLINE int Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_file.c 2008-07-23 15:11:38.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2008-07-23 15:12:00.000000000 +0200 @@ -407,11 +407,8 @@ xfs_file_ioctl( unsigned int cmd, unsigned long p) { - int error; struct inode *inode = filp->f_path.dentry->d_inode; - error = xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p); - xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); /* NOTE: some of the ioctl's return positive #'s as a * byte count indicating success, such as @@ -419,7 +416,7 @@ xfs_file_ioctl( * like most other routines. This means true * errors need to be returned as a negative value. */ - return error; + return xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p); } STATIC long @@ -428,11 +425,8 @@ xfs_file_ioctl_invis( unsigned int cmd, unsigned long p) { - int error; struct inode *inode = filp->f_path.dentry->d_inode; - error = xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p); - xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); /* NOTE: some of the ioctl's return positive #'s as a * byte count indicating success, such as @@ -440,7 +434,7 @@ xfs_file_ioctl_invis( * like most other routines. This means true * errors need to be returned as a negative value. */ - return error; + return xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p); } #ifdef HAVE_DMAPI Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 15:12:14.000000000 +0200 @@ -214,8 +214,6 @@ xfs_init_security( } error = xfs_attr_set(ip, name, value, length, ATTR_SECURE); - if (!error) - xfs_iflags_set(ip, XFS_IMODIFIED); kfree(name); kfree(value); @@ -316,7 +314,6 @@ xfs_vn_mknod( error = _ACL_INHERIT(inode, mode, default_acl); if (unlikely(error)) goto out_cleanup_inode; - xfs_iflags_set(ip, XFS_IMODIFIED); _ACL_FREE(default_acl); } @@ -436,7 +433,6 @@ xfs_vn_link( return -error; } - xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED); d_instantiate(dentry, inode); return 0; } @@ -856,7 +852,6 @@ xfs_setup_inode( inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; xfs_diflags_to_iflags(inode, ip); - xfs_iflags_clear(ip, XFS_IMODIFIED); switch (inode->i_mode & S_IFMT) { case S_IFREG: Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-07-23 15:12:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-07-23 15:12:38.000000000 +0200 @@ -375,7 +375,6 @@ xfs_compat_ioctl( unsigned long arg) { struct inode *inode = file->f_path.dentry->d_inode; - int error; switch (cmd) { case XFS_IOC_DIOINFO: @@ -463,10 +462,7 @@ xfs_compat_ioctl( return -ENOIOCTLCMD; } - error = xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg); - xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); - - return error; + return xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg); } long Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 15:12:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 15:12:19.000000000 +0200 @@ -993,7 +993,6 @@ xfs_fs_clear_inode( XFS_STATS_DEC(vn_active); xfs_inactive(ip); - xfs_iflags_clear(ip, XFS_IMODIFIED); if (xfs_reclaim(ip)) panic("%s: cannot reclaim 0x%p\n", __func__, inode); } Index: linux-2.6-xfs/fs/xfs/xfs_iget.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2008-07-23 15:12:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2008-07-23 15:12:52.000000000 +0200 @@ -284,7 +284,6 @@ finish_inode: ASSERT(ip->i_df.if_ext_max == XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t)); - xfs_iflags_set(ip, XFS_IMODIFIED); *ipp = ip; /* Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-23 15:13:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-23 15:17:20.000000000 +0200 @@ -364,17 +364,12 @@ xfs_iflags_test_and_clear(xfs_inode_t *i /* * In-core inode flags. */ -#define XFS_IGRIO 0x0001 /* inode used for guaranteed rate i/o */ -#define XFS_IUIOSZ 0x0002 /* inode i/o sizes have been explicitly set */ -#define XFS_IQUIESCE 0x0004 /* we have started quiescing for this inode */ -#define XFS_IRECLAIM 0x0008 /* we have started reclaiming this inode */ -#define XFS_ISTALE 0x0010 /* inode has been staled */ -#define XFS_IRECLAIMABLE 0x0020 /* inode can be reclaimed */ -#define XFS_INEW 0x0040 -#define XFS_IFILESTREAM 0x0080 /* inode is in a filestream directory */ -#define XFS_IMODIFIED 0x0100 /* XFS inode state possibly differs */ - /* to the Linux inode state. */ -#define XFS_ITRUNCATED 0x0200 /* truncated down so flush-on-close */ +#define XFS_IRECLAIM 0x0001 /* we have started reclaiming this inode */ +#define XFS_ISTALE 0x0002 /* inode has been staled */ +#define XFS_IRECLAIMABLE 0x0004 /* inode can be reclaimed */ +#define XFS_INEW 0x0008 /* inode has just been allocated */ +#define XFS_IFILESTREAM 0x0010 /* inode is in a filestream directory */ +#define XFS_ITRUNCATED 0x0020 /* truncated down so flush-on-close */ /* * Flags for inode locking. Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-23 15:12:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-23 15:16:58.000000000 +0200 @@ -155,7 +155,6 @@ static void xfsidbg_xiclogall(xlog_in_co static void xfsidbg_xiclogcb(xlog_in_core_t *); static void xfsidbg_xinodes(xfs_mount_t *); static void xfsidbg_delayed_blocks(xfs_mount_t *); -static void xfsidbg_xinodes_quiesce(xfs_mount_t *); static void xfsidbg_xlog(xlog_t *); static void xfsidbg_xlog_ritem(xlog_recover_item_t *); static void xfsidbg_xlog_rtrans(xlog_recover_t *); @@ -1280,26 +1279,6 @@ static int kdbm_xfs_delayed_blocks( return 0; } - -static int kdbm_xfs_xinodes_quiesce( - int argc, - const char **argv) -{ - unsigned long addr; - int nextarg = 1; - long offset = 0; - int diag; - - if (argc != 1) - return KDB_ARGCOUNT; - diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); - if (diag) - return diag; - - xfsidbg_xinodes_quiesce((xfs_mount_t *) addr); - return 0; -} - static int kdbm_xfs_xlog( int argc, const char **argv) @@ -2374,8 +2353,6 @@ static struct xif xfsidbg_funcs[] = { #endif { "xinodes", kdbm_xfs_xinodes, "", "Dump XFS inodes per mount"}, - { "xquiesce",kdbm_xfs_xinodes_quiesce, "", - "Dump non-quiesced XFS inodes per mount"}, #ifdef XFS_LOG_TRACE { "xl_grtr", kdbm_xfs_xlog_granttrace, "", "Dump XFS log grant trace" }, @@ -5776,28 +5753,6 @@ xfsidbg_delayed_blocks(xfs_mount_t *mp) kdb_printf("delayed blocks total: %d in %d inodes\n", total, icount); } -static void -xfsidbg_xinodes_quiesce(xfs_mount_t *mp) -{ - xfs_inode_t *ip; - - kdb_printf("xfs_mount at 0x%p\n", mp); - ip = mp->m_inodes; - if (ip != NULL) { - do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } - if (!(ip->i_flags & XFS_IQUIESCE)) { - kdb_printf("ip 0x%p not quiesced\n", ip); - } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); - } - kdb_printf("\nEnd of Inodes\n"); -} - static char * xfsidbg_get_cstate(int state) { @@ -6399,12 +6354,11 @@ static void xfsidbg_xnode(xfs_inode_t *ip) { static char *tab_flags[] = { - "grio", /* XFS_IGRIO */ - "uiosize", /* XFS_IUIOSZ */ - "quiesce", /* XFS_IQUIESCE */ "reclaim", /* XFS_IRECLAIM */ "stale", /* XFS_ISTALE */ - "modified", /* XFS_IMODIFIED */ + "reclaimable", /* XFS_IRECLAIMABLE */ + "new", /* XFS_INEW */ + "filestream", /* XFS_IFILESTREAM */ "truncated", /* XFS_ITRUNCATED */ NULL }; From owner-xfs@oss.sgi.com Wed Jul 23 07:26:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 07:26:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NEQNTZ013417 for ; Wed, 23 Jul 2008 07:26:23 -0700 X-ASG-Debug-ID: 1216823252-535f028c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 285D2319A37 for ; Wed, 23 Jul 2008 07:27:32 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id hAEfvcF27SoLHv6x for ; Wed, 23 Jul 2008 07:27:32 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NERMNg023000 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 16:27:23 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NERMRG022998 for xfs@oss.sgi.com; Wed, 23 Jul 2008 16:27:22 +0200 Date: Wed, 23 Jul 2008 16:27:22 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] remove unused m_inode_quiesce member from struct xfs_mount Subject: [PATCH] remove unused m_inode_quiesce member from struct xfs_mount Message-ID: <20080723142720.GB22859@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216823254 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56843 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17072 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2008-07-23 15:07:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2008-07-23 15:07:51.000000000 +0200 @@ -313,8 +313,6 @@ typedef struct xfs_mount { int m_attr_magicpct;/* 37% of the blocksize */ int m_dir_magicpct; /* 37% of the dir blocksize */ __uint8_t m_mk_sharedro; /* mark shared ro on unmount */ - __uint8_t m_inode_quiesce;/* call quiesce on new inodes. - field governed by m_ilock */ __uint8_t m_sectbb_log; /* sectlog - BBSHIFT */ const struct xfs_nameops *m_dirnameops; /* vector of dir name ops */ int m_dirblksize; /* directory block sz--bytes */ Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-23 15:07:25.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-23 15:07:38.000000000 +0200 @@ -6377,8 +6377,8 @@ xfsidbg_xmount(xfs_mount_t *mp) kdb_printf("dalign %d swidth %d sinoalign %d attr_magicpct %d dir_magicpct %d\n", mp->m_dalign, mp->m_swidth, mp->m_sinoalign, mp->m_attr_magicpct, mp->m_dir_magicpct); - kdb_printf("mk_sharedro %d inode_quiesce %d sectbb_log %d\n", - mp->m_mk_sharedro, mp->m_inode_quiesce, mp->m_sectbb_log); + kdb_printf("mk_sharedro %d sectbb_log %d\n", + mp->m_mk_sharedro, mp->m_sectbb_log); kdb_printf("dirblkfsbs %d\n", mp->m_dirblkfsbs); kdb_printf("dirblksize %d dirdatablk 0x%Lx dirleafblk 0x%Lx dirfreeblk 0x%Lx\n", mp->m_dirblksize, From owner-xfs@oss.sgi.com Wed Jul 23 07:29:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 07:29:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NET58w014093 for ; Wed, 23 Jul 2008 07:29:05 -0700 X-ASG-Debug-ID: 1216823414-54ec02430000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BE5A4319A6E for ; Wed, 23 Jul 2008 07:30:14 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id QYvCR65D1KbqByIf for ; Wed, 23 Jul 2008 07:30:14 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AoQCALPbhkh5LFxAiGdsb2JhbACSTwEBAQ8gn1U X-IronPort-AV: E=Sophos;i="4.31,239,1215354600"; d="scan'208";a="156030784" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 00:00:12 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLfM2-0001Of-Jo; Thu, 24 Jul 2008 00:30:10 +1000 Date: Thu, 24 Jul 2008 00:30:09 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Subject: Re: [PATCH 0/4] XFS: replace the mount inode list with radix tree traversals V2 Message-ID: <20080723143009.GM6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <1216773673-3620-1-git-send-email-david@fromorbit.com> <20080723071748.GA25807@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723071748.GA25807@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216823415 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56843 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17073 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 03:17:48AM -0400, Christoph Hellwig wrote: > On Wed, Jul 23, 2008 at 10:41:09AM +1000, Dave Chinner wrote: > > The list of all inodes on a mount is superfluous. We can traverse > > all inodes now by walking the per-AG inode radix trees without > > needing a separate list. This enables us to remove a bunch of > > complex list traversal code and remove another two pointers from > > the xfs_inode. > > > > Also, by replacing the sync traversal with an ascending inode > > number traversal, we will issue better inode I/O patterns for > > writeback triggered by xfssyncd or unmount. > > All patches looks good to me. Well, minus the xfsidbg issue in 4 > which would be a merge blocker for that patch. Compile tested version of the xfsidbg code. I have no kdb enabled machines to test it on, so this is as good as I can do right now. Cheers, Dave. -- Dave Chinner david@fromorbit.com Kill the idbg users of the mount inode list and replace with radix tree walks. Signed-off-by: Dave Chinner --- fs/xfs/xfsidbg.c | 124 +++++++++++++++++++++++++++++++++---------------------- 1 file changed, 76 insertions(+), 48 deletions(-) Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-24 00:20:26.886167169 +1000 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-24 00:20:39.950162171 +1000 @@ -5734,20 +5734,27 @@ xfsidbg_xiclogtrace(xlog_in_core_t *iclo static void xfsidbg_xinodes(xfs_mount_t *mp) { - xfs_inode_t *ip; + int i; kdb_printf("xfs_mount at 0x%p\n", mp); - ip = mp->m_inodes; - if (ip != NULL) { + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) + continue; do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); kdb_printf("\n"); xfsidbg_xnode(ip); - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); } kdb_printf("\nEnd of Inodes\n"); } @@ -5755,23 +5762,30 @@ xfsidbg_xinodes(xfs_mount_t *mp) static void xfsidbg_delayed_blocks(xfs_mount_t *mp) { - xfs_inode_t *ip; unsigned int total = 0; unsigned int icount = 0; + int i; - ip = mp->m_inodes; - if (ip != NULL) { + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) + continue; do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); if (ip->i_delayed_blks) { total += ip->i_delayed_blks; icount++; } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); } kdb_printf("delayed blocks total: %d in %d inodes\n", total, icount); } @@ -5779,21 +5793,28 @@ xfsidbg_delayed_blocks(xfs_mount_t *mp) static void xfsidbg_xinodes_quiesce(xfs_mount_t *mp) { - xfs_inode_t *ip; + int i; kdb_printf("xfs_mount at 0x%p\n", mp); - ip = mp->m_inodes; - if (ip != NULL) { + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) + continue; do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; - continue; - } + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); if (!(ip->i_flags & XFS_IQUIESCE)) { kdb_printf("ip 0x%p not quiesced\n", ip); } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + } while (nr_found); } kdb_printf("\nEnd of Inodes\n"); } @@ -6319,8 +6340,8 @@ xfsidbg_xmount(xfs_mount_t *mp) mp->m_rtdev_targp ? mp->m_rtdev_targp->bt_dev : 0); kdb_printf("bsize %d agfrotor %d xfs_rotorstep %d agirotor %d\n", mp->m_bsize, mp->m_agfrotor, xfs_rotorstep, mp->m_agirotor); - kdb_printf("inodes 0x%p ilock 0x%p ireclaims 0x%x\n", - mp->m_inodes, &mp->m_ilock, mp->m_ireclaims); + kdb_printf("ilock 0x%p ireclaims 0x%x\n", + &mp->m_ilock, mp->m_ireclaims); kdb_printf("readio_log 0x%x readio_blocks 0x%x ", mp->m_readio_log, mp->m_readio_blocks); kdb_printf("writeio_log 0x%x writeio_blocks 0x%x\n", @@ -6409,11 +6430,7 @@ xfsidbg_xnode(xfs_inode_t *ip) NULL }; - kdb_printf("mount 0x%p mnext 0x%p mprev 0x%p vnode 0x%p \n", - ip->i_mount, - ip->i_mnext, - ip->i_mprev, - XFS_ITOV_NULL(ip)); + kdb_printf("mount 0x%p vnode 0x%p \n", ip->i_mount, XFS_ITOV_NULL(ip)); kdb_printf("dev %x ino %s\n", ip->i_mount->m_ddev_targp->bt_dev, xfs_fmtino(ip->i_ino, ip->i_mount)); @@ -6614,22 +6631,33 @@ xfsidbg_xqm_dquot(xfs_dquot_t *dqp) static void xfsidbg_xqm_dqattached_inos(xfs_mount_t *mp) { - xfs_inode_t *ip; - int n = 0; + int i, n = 0; - ip = mp->m_inodes; - do { - if (ip->i_mount == NULL) { - ip = ip->i_mnext; + kdb_printf("xfs_mount at 0x%p\n", mp); + for (i = 0; i < mp->m_sb.sb_agcount; i++) { + xfs_perag_t *pag = &mp->m_perag[i]; + xfs_inode_t *ip = NULL; + int first_index = 0; + int nr_found; + + if (!pag->pag_ici_init) continue; - } - if (ip->i_udquot || ip->i_gdquot) { - n++; - kdb_printf("inode = 0x%p, ino %d: udq 0x%p, gdq 0x%p\n", - ip, (int)ip->i_ino, ip->i_udquot, ip->i_gdquot); - } - ip = ip->i_mnext; - } while (ip != mp->m_inodes); + do { + nr_found = radix_tree_gang_lookup(&pag->pag_ici_root, + (void**)&ip, first_index, 1); + if (!nr_found) + break; + /* update the index for the next lookup */ + first_index = XFS_INO_TO_AGINO(mp, ip->i_ino + 1); + if (ip->i_udquot || ip->i_gdquot) { + n++; + kdb_printf("inode = 0x%p, ino %d: udq 0x%p, gdq 0x%p\n", + ip, (int)ip->i_ino, ip->i_udquot, ip->i_gdquot); + } + kdb_printf("\n"); + xfsidbg_xnode(ip); + } while (nr_found); + } kdb_printf("\nNumber of inodes with dquots attached: %d\n", n); } From owner-xfs@oss.sgi.com Wed Jul 23 08:36:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 08:36:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NFaSWX022847 for ; Wed, 23 Jul 2008 08:36:29 -0700 X-ASG-Debug-ID: 1216827457-2d2501d00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CF4C131A1D4; Wed, 23 Jul 2008 08:37:38 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id h4V7A2BpNA7XY6Y9; Wed, 23 Jul 2008 08:37:38 -0700 (PDT) Received: from funky.thebarn.com (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6NFbadc031177; Wed, 23 Jul 2008 10:37:37 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <48875040.9090400@thebarn.com> Date: Wed, 23 Jul 2008 10:37:36 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: markgw@sgi.com CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> In-Reply-To: <488692FB.1010101@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7796/Wed Jul 23 00:45:42 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1216827458 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0072 1.0000 -1.9742 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.97 X-Barracuda-Spam-Status: No, SCORE=-1.97 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.1, rules version 3.1.56847 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 17074 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > > > Dave Chinner wrote: >> On Tue, Jul 22, 2008 at 03:27:33AM -0400, Christoph Hellwig wrote: >>> ... >>> I only fear >>> we'll never get it in with the current review and commit latencies >>> for XFS :( >> >> I can see this being a big issue in the not-too-distant future..... > > [getting off-topic for this thread, but anyway ..] > This is already a big issue, obviously, and has been for some time. > > Internally, we're attempting to refine our patch acceptance processes, > (e.g. gitify our internal dev tree and mirror it on oss so it's much > easier to push back out to oss). I'm sure you have seen this before: http://oss.sgi.com/cgi-bin/gitweb.cgi?p=cattelan/xfs-import/.git;a=summary' That is a running mirror of the ptools tree into git. (via the cvs tree) It would be really nice to move all xfs development to git finally shut down the whole ptools -> cvs update process. This would help facilitate creation of more "experimental" trees and/or branches so there would not be such a long delay of getting patches distributed. > But the QA overhead remains a stubborn > problem. I think we're going to have to ask for QA tests (both regression > and performance) to be written as part of the patch acceptance policy - > under this policy, merely passing existing QA will not be sufficient. > Comments? > > We have recently set up external access to a system for QA and > regression testing for Christoph's use .. perhaps that should > be a permanent offering? > > Cheers > -- Mark > From owner-xfs@oss.sgi.com Wed Jul 23 10:39:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 10:39:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,J_CHICKENPOX_27, WHOIS_DMNBYPROXY autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NHdEaZ030741 for ; Wed, 23 Jul 2008 10:39:14 -0700 X-ASG-Debug-ID: 1216834823-03e203cc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp.stepping-stone.ch (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4615D31B1AD for ; Wed, 23 Jul 2008 10:40:23 -0700 (PDT) Received: from smtp.stepping-stone.ch (smtp.stepping-stone.ch [193.58.255.135]) by cuda.sgi.com with ESMTP id KWK0FjKBPCWoj1A5 for ; Wed, 23 Jul 2008 10:40:23 -0700 (PDT) Received: from localhost (mail-scanner-01.int.stepping-stone.ch [10.59.255.136]) by smtp.stepping-stone.ch (Postfix) with ESMTP id D107B863449 for ; Wed, 23 Jul 2008 19:40:22 +0200 (CEST) Received: from smtp.stepping-stone.ch ([10.59.255.135]) by localhost (mail-scanner-01.int.stepping-stone.ch [10.59.255.136]) (amavisd-new, port 10024) with LMTP id 21448-01-96 for ; Wed, 23 Jul 2008 19:40:20 +0200 (CEST) Received: from [192.168.1.201] (unknown [212.103.65.198]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by smtp.stepping-stone.ch (Postfix) with ESMTP id 2A3D3863446 for ; Wed, 23 Jul 2008 19:40:20 +0200 (CEST) Message-ID: <48876D03.8010804@stepping-stone.ch> Date: Wed, 23 Jul 2008 19:40:19 +0200 From: Christian Affolter User-Agent: Thunderbird 2.0.0.14 (X11/20080505) MIME-Version: 1.0 To: xfs@oss.sgi.com X-ASG-Orig-Subj: Corruption of in-memory data detected - on heavy hard linking Subject: Corruption of in-memory data detected - on heavy hard linking Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: amavisd-new at stepping-stone.ch X-Barracuda-Connect: smtp.stepping-stone.ch[193.58.255.135] X-Barracuda-Start-Time: 1216834824 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.598 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Status: Clean X-archive-position: 17075 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: christian.affolter@stepping-stone.ch Precedence: bulk X-list: xfs Dear XFS users While using rsnapshot [1] on an XFS filesystem I encountered the following error, which I can reproduce using the bash command below: i=0; while (( $i <20 )); do rm -rf link-dir; cp -al orig-dir link-dir echo "Round $i over"; let i++; done The problem mostly happens between the 6th and 10th run. "orig-dir" contains around 12 GB of data and around 40'000 files (the filesystem is 50 GB whereas 27 GB are free, mount options: rw,noatime,usrquota). The problem doesn't occur with a reiserfs filesystem (on the same device). Kernel-Error: Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1163 of file fs/xfs/xfs_trans.c. Caller 0xffffffff803a4fcf Pid: 22816, comm: cp Not tainted 2.6.24-gentoo-r8 #1 Call Trace: [] xfs_link+0x26f/0x390 [] xfs_trans_cancel+0x126/0x150 [] xfs_link+0x26f/0x390 [] xfs_trans_unlocked_item+0x3b/0x60 [] xfs_vn_link+0x3c/0xb0 [] vfs_link+0x123/0x180 [] sys_linkat+0x151/0x180 [] cp_new_stat+0xe7/0x100 [] sys_newlstat+0x36/0x50 [] system_call+0x7e/0x83 xfs_force_shutdown(sdc1,0x8) called from line 1164 of file fs/xfs/xfs_trans.c. Return address = 0xffffffff8039c66f Filesystem "sdc1": Corruption of in-memory data detected. Shutting down filesystem: sdc1 Please umount the filesystem, and rectify the problem(s) xfs_force_shutdown(sdc1,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xffffffff803a7fe9 xfs_force_shutdown(sdc1,0x1) called from line 420 of file fs/xfs/xfs_rw.c. Return address = 0xffffffff803a7fe9 After remounting, everything seems to be fine, even xfs_repair (xfsprogs 2.8.11) doesn't find any problems on the filesystem. The above error happens on a 2.6.24-gentoo-r8 SMP 64bit kernel with 4 GB of memory (~3G free), Intel 5000V chipset (ASUS DSBV-D), on top of a Areca ARC-1160 (V1.42) RAID controller. According to memcheck the memory seems to be OK, anyway I replaced the DIMMs with no success. Google leads to a lot of results, for the above error message, however I only found one forum entry [2] which seems to look similar. Any help would be highly appreciated Many thanks! Chris [1]http://www.rsnapshot.org/ [2]http://ubuntuforums.org/showthread.php?t=741425 -- stepping stone GmbH Pappelweg 41 CH-3013 Bern Telefon: +41 31 332 53 63 www.stepping-stone.ch christian.affolter@stepping-stone.ch From owner-xfs@oss.sgi.com Wed Jul 23 12:49:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:49:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJmxm5010829 for ; Wed, 23 Jul 2008 12:49:00 -0700 X-ASG-Debug-ID: 1216842580-5855027b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 99A76E2583B for ; Wed, 23 Jul 2008 12:49:40 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id MXA2RvzRHitSz1eC for ; Wed, 23 Jul 2008 12:49:40 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJnUNg006564 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:49:30 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJnUfj006562 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:49:30 +0200 Date: Wed, 23 Jul 2008 21:49:30 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/5] more vnode related macro cleanups Subject: [PATCH 0/5] more vnode related macro cleanups Message-ID: <20080723194930.GA6188@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842610 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17076 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs As Dave's cleanups got in so fast (thanks Niv!) I'll give these patches a spin to. They are all over so I'd love to get them in fast too and get the leftover bhv_vnode_t bits sorted out ASAP. From owner-xfs@oss.sgi.com Wed Jul 23 12:49:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:49:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJn3fL010864 for ; Wed, 23 Jul 2008 12:49:08 -0700 X-ASG-Debug-ID: 1216842596-1ff901db0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 20A1431BC8F for ; Wed, 23 Jul 2008 12:49:56 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id IRR9m1UGXzthR6BM for ; Wed, 23 Jul 2008 12:49:56 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJnlNg006626 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:49:47 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJnlwF006624 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:49:47 +0200 Date: Wed, 23 Jul 2008 21:49:47 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 4/5] remove remaining VN_HOLD calls Subject: [PATCH 4/5] remove remaining VN_HOLD calls Message-ID: <20080723194946.GE6188@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842614 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17080 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Use IHOLD(ip) instead of VN_HOLD(VFS_I(ip)). Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/quota/xfs_dquot.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_dquot.c 2008-07-23 19:40:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_dquot.c 2008-07-23 19:40:42.000000000 +0200 @@ -431,7 +431,7 @@ xfs_qm_dqalloc( * when it unlocks the inode. Since we want to keep the quota * inode around, we bump the vnode ref count now. */ - VN_HOLD(VFS_I(quotip)); + IHOLD(quotip); xfs_trans_ijoin(tp, quotip, XFS_ILOCK_EXCL); nmaps = 1; Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-23 19:40:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-23 19:40:42.000000000 +0200 @@ -4000,7 +4000,7 @@ xfs_bmap_add_attrfork( ip->i_d.di_aformat = XFS_DINODE_FMT_EXTENTS; } ASSERT(ip->i_d.di_anextents == 0); - VN_HOLD(VFS_I(ip)); + IHOLD(ip); xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); switch (ip->i_d.di_format) { Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dfrag.c 2008-07-23 19:40:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dfrag.c 2008-07-23 19:40:42.000000000 +0200 @@ -350,15 +350,11 @@ xfs_swap_extents( break; } - /* - * Increment vnode ref counts since xfs_trans_commit & - * xfs_trans_cancel will both unlock the inodes and - * decrement the associated ref counts. - */ - VN_HOLD(vp); - VN_HOLD(tvp); + IHOLD(ip); xfs_trans_ijoin(tp, ip, lock_flags); + + IHOLD(tip); xfs_trans_ijoin(tp, tip, lock_flags); xfs_trans_log_inode(tp, ip, ilf_fields); From owner-xfs@oss.sgi.com Wed Jul 23 12:49:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:49:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJmw0l010822 for ; Wed, 23 Jul 2008 12:49:03 -0700 X-ASG-Debug-ID: 1216842592-23d3018d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 39A6E31BCFD for ; Wed, 23 Jul 2008 12:49:52 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 76eadttA7FvBF97p for ; Wed, 23 Jul 2008 12:49:52 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJngNg006611 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:49:43 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJngvF006607 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:49:42 +0200 Date: Wed, 23 Jul 2008 21:49:42 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 3/5] remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c Subject: [PATCH 3/5] remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c Message-ID: <20080723194942.GD6188@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842609 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17079 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs All the ACL routines are called from inode operations which are guaranteed to have a referenced inode by the VFS, so there's no need for the ACL code to grab another temporary one. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_acl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-23 19:40:19.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-23 19:40:37.000000000 +0200 @@ -217,7 +217,6 @@ xfs_acl_vget( posix_acl_xattr_header *ext_acl = acl; int flags = 0; - VN_HOLD(vp); if(size) { if (!(_ACL_ALLOC(xfs_acl))) { error = ENOMEM; @@ -243,7 +242,6 @@ xfs_acl_vget( error = -posix_acl_xfs_to_xattr(xfs_acl, ext_acl, size); } out: - VN_RELE(vp); if(xfs_acl) _ACL_FREE(xfs_acl); return -error; @@ -256,7 +254,6 @@ xfs_acl_vremove( { int error; - VN_HOLD(vp); error = xfs_acl_allow_set(vp, kind); if (!error) { error = xfs_attr_remove(XFS_I(vp), @@ -266,7 +263,6 @@ xfs_acl_vremove( if (error == ENOATTR) error = 0; /* 'scool */ } - VN_RELE(vp); return -error; } @@ -298,7 +294,6 @@ xfs_acl_vset( return 0; } - VN_HOLD(vp); error = xfs_acl_allow_set(vp, kind); /* Incoming ACL exists, set file mode based on its value */ @@ -321,7 +316,6 @@ xfs_acl_vset( } out: - VN_RELE(vp); _ACL_FREE(xfs_acl); return -error; } From owner-xfs@oss.sgi.com Wed Jul 23 12:49:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:49:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJn0u7010836 for ; Wed, 23 Jul 2008 12:49:06 -0700 X-ASG-Debug-ID: 1216842583-309100dd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 15C821B3E78E for ; Wed, 23 Jul 2008 12:49:43 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id c5QEJIHqvZ6HviYe for ; Wed, 23 Jul 2008 12:49:43 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJnYNg006580 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:49:34 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJnYxo006578 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:49:34 +0200 Date: Wed, 23 Jul 2008 21:49:34 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/5] kill vn_from_inode Subject: [PATCH 1/5] kill vn_from_inode Message-ID: <20080723194934.GB6188@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842611 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17081 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs bhv_vnode_t is just a typedef for struct inode, so there's no need for a helper to convert between the two. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:29:16.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:29:22.000000000 +0200 @@ -994,7 +994,7 @@ STATIC void xfs_fs_destroy_inode( struct inode *inode) { - kmem_zone_free(xfs_vnode_zone, vn_from_inode(inode)); + kmem_zone_free(xfs_vnode_zone, inode); } STATIC void Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:29:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:29:52.000000000 +0200 @@ -27,10 +27,6 @@ typedef struct inode bhv_vnode_t; /* * Vnode to Linux inode mapping. */ -static inline bhv_vnode_t *vn_from_inode(struct inode *inode) -{ - return inode; -} static inline struct inode *vn_to_inode(bhv_vnode_t *vnode) { return vnode; @@ -100,8 +96,7 @@ extern bhv_vnode_t *vn_hold(bhv_vnode_t static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) { - struct inode *inode = igrab(vn_to_inode(vp)); - return inode ? vn_from_inode(inode) : NULL; + return igrab(vn_to_inode(vp)); } /* From owner-xfs@oss.sgi.com Wed Jul 23 12:49:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:49:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_41 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJmx03010830 for ; Wed, 23 Jul 2008 12:49:00 -0700 X-ASG-Debug-ID: 1216842588-52e202e70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9AFACE8D056 for ; Wed, 23 Jul 2008 12:49:49 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 2rNWIStRqLY6BIoD for ; Wed, 23 Jul 2008 12:49:49 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJncNg006594 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:49:38 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJncEO006592 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:49:38 +0200 Date: Wed, 23 Jul 2008 21:49:38 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 2/5] kill vn_to_inode Subject: [PATCH 2/5] kill vn_to_inode Message-ID: <20080723194938.GC6188@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842610 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17077 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs bhv_vnode_t is just a typedef for struct inode, so there's no need for a helper to convert between the two. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_linux.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_linux.h 2008-07-23 19:31:19.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_linux.h 2008-07-23 19:31:25.000000000 +0200 @@ -185,7 +185,7 @@ #define xfs_sort(a,n,s,fn) sort(a,n,s,fn,NULL) #define xfs_stack_trace() dump_stack() #define xfs_itruncate_data(ip, off) \ - (-vmtruncate(vn_to_inode(VFS_I(ip)), (off))) + (-vmtruncate(VFS_I(ip), (off))) /* Move the kernel do_div definition off to one side */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:31:29.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:34:46.000000000 +0200 @@ -613,10 +613,9 @@ xfs_set_inodeops( STATIC_INLINE void xfs_revalidate_inode( xfs_mount_t *mp, - bhv_vnode_t *vp, + struct inode *inode, xfs_inode_t *ip) { - struct inode *inode = vn_to_inode(vp); inode->i_mode = ip->i_d.di_mode; inode->i_nlink = ip->i_d.di_nlink; @@ -665,13 +664,12 @@ xfs_revalidate_inode( void xfs_initialize_vnode( struct xfs_mount *mp, - bhv_vnode_t *vp, + struct inode *inode, struct xfs_inode *ip) { - struct inode *inode = vn_to_inode(vp); if (!ip->i_vnode) { - ip->i_vnode = vp; + ip->i_vnode = inode; inode->i_private = ip; } @@ -683,7 +681,7 @@ xfs_initialize_vnode( * finish our work. */ if (ip->i_d.di_mode != 0 && (inode->i_state & I_NEW)) { - xfs_revalidate_inode(mp, vp, ip); + xfs_revalidate_inode(mp, inode, ip); xfs_set_inodeops(inode); xfs_iflags_clear(ip, XFS_INEW); @@ -987,7 +985,7 @@ xfs_fs_alloc_inode( vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); if (unlikely(!vp)) return NULL; - return vn_to_inode(vp); + return vp; } STATIC void @@ -1002,7 +1000,7 @@ xfs_fs_inode_init_once( kmem_zone_t *zonep, void *vnode) { - inode_init_once(vn_to_inode((bhv_vnode_t *)vnode)); + inode_init_once((struct inode *)vnode); } /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 19:30:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 19:31:15.000000000 +0200 @@ -94,7 +94,7 @@ vn_hold( XFS_STATS_INC(vn_hold); - inode = igrab(vn_to_inode(vp)); + inode = igrab(vp); ASSERT(inode); return vp; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:32:29.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:33:22.000000000 +0200 @@ -25,14 +25,6 @@ struct attrlist_cursor_kern; typedef struct inode bhv_vnode_t; /* - * Vnode to Linux inode mapping. - */ -static inline struct inode *vn_to_inode(bhv_vnode_t *vnode) -{ - return vnode; -} - -/* * Return values for xfs_inactive. A return value of * VN_INACTIVE_NOCACHE implies that the file system behavior * has disassociated its state and bhv_desc_t from the vnode. @@ -74,7 +66,7 @@ extern void vn_ioerror(struct xfs_inode static inline int vn_count(bhv_vnode_t *vp) { - return atomic_read(&vn_to_inode(vp)->i_count); + return atomic_read(&vp->i_count); } /* @@ -88,15 +80,15 @@ extern bhv_vnode_t *vn_hold(bhv_vnode_t xfs_itrace_hold(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address)) #define VN_RELE(vp) \ (xfs_itrace_rele(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ - iput(vn_to_inode(vp))) + iput(vp)) #else #define VN_HOLD(vp) ((void)vn_hold(vp)) -#define VN_RELE(vp) (iput(vn_to_inode(vp))) +#define VN_RELE(vp) (iput(vp)) #endif static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) { - return igrab(vn_to_inode(vp)); + return igrab(vp); } /* @@ -104,7 +96,7 @@ static inline bhv_vnode_t *vn_grab(bhv_v */ static inline int VN_BAD(bhv_vnode_t *vp) { - return is_bad_inode(vn_to_inode(vp)); + return is_bad_inode(vp); } /* @@ -129,9 +121,9 @@ static inline void vn_atime_to_time_t(bh /* * Some useful predicates. */ -#define VN_MAPPED(vp) mapping_mapped(vn_to_inode(vp)->i_mapping) -#define VN_CACHED(vp) (vn_to_inode(vp)->i_mapping->nrpages) -#define VN_DIRTY(vp) mapping_tagged(vn_to_inode(vp)->i_mapping, \ +#define VN_MAPPED(vp) mapping_mapped(vp->i_mapping) +#define VN_CACHED(vp) (vp->i_mapping->nrpages) +#define VN_DIRTY(vp) mapping_tagged(vp->i_mapping, \ PAGECACHE_TAG_DIRTY) Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 19:30:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 19:30:54.000000000 +0200 @@ -714,7 +714,7 @@ xfs_fsync( return XFS_ERROR(EIO); /* capture size updates in I/O completion before writing the inode. */ - error = filemap_fdatawait(vn_to_inode(VFS_I(ip))->i_mapping); + error = filemap_fdatawait(VFS_I(ip)->i_mapping); if (error) return XFS_ERROR(error); @@ -2917,7 +2917,7 @@ xfs_reclaim( XFS_MOUNT_ILOCK(mp); spin_lock(&ip->i_flags_lock); __xfs_iflags_set(ip, XFS_IRECLAIMABLE); - vn_to_inode(vp)->i_private = NULL; + vp->i_private = NULL; ip->i_vnode = NULL; spin_unlock(&ip->i_flags_lock); list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); From owner-xfs@oss.sgi.com Wed Jul 23 12:49:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:49:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJmxUh010831 for ; Wed, 23 Jul 2008 12:49:00 -0700 X-ASG-Debug-ID: 1216842600-577b02bc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9AC5DE647E1 for ; Wed, 23 Jul 2008 12:50:03 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id PR5P4z3hgYcxYwIU for ; Wed, 23 Jul 2008 12:50:03 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJnpNg006641 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:49:51 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJnoqQ006639 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:49:50 +0200 Date: Wed, 23 Jul 2008 21:49:50 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 5/5] implement IHOLD/IRELE directly Subject: [PATCH 5/5] implement IHOLD/IRELE directly Message-ID: <20080723194950.GF6188@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842610 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17078 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Now that all direct calls to VN_HOLD/VN_RELE are gone we can implement IHOLD/IRELE directly. For the IHOLD case also replace igrab with a direct increment of i_count because we are guaranteed to already have a live and referenced inode by the VFS. Also remove the vn_hold statistic because it's been rather meaningless for some time with most references done by other callers. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-23 19:39:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-23 19:40:57.000000000 +0200 @@ -179,7 +179,6 @@ EXPORT_SYMBOL(uuid_getnodeuniq); EXPORT_SYMBOL(uuid_hash64); EXPORT_SYMBOL(uuid_is_nil); EXPORT_SYMBOL(uuid_table_remove); -EXPORT_SYMBOL(vn_hold); #if defined(CONFIG_XFS_POSIX_ACL) EXPORT_SYMBOL(xfs_acl_vtoacl); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 19:39:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 19:40:57.000000000 +0200 @@ -82,24 +82,6 @@ vn_ioerror( xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l); } - -/* - * Add a reference to a referenced vnode. - */ -bhv_vnode_t * -vn_hold( - bhv_vnode_t *vp) -{ - struct inode *inode; - - XFS_STATS_INC(vn_hold); - - inode = igrab(vp); - ASSERT(inode); - - return vp; -} - #ifdef XFS_INODE_TRACE /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:39:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:40:57.000000000 +0200 @@ -69,22 +69,17 @@ static inline int vn_count(bhv_vnode_t * return atomic_read(&vp->i_count); } -/* - * Vnode reference counting functions (and macros for compatibility). - */ -extern bhv_vnode_t *vn_hold(bhv_vnode_t *); - -#if defined(XFS_INODE_TRACE) -#define VN_HOLD(vp) \ - ((void)vn_hold(vp), \ - xfs_itrace_hold(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address)) -#define VN_RELE(vp) \ - (xfs_itrace_rele(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ - iput(vp)) -#else -#define VN_HOLD(vp) ((void)vn_hold(vp)) -#define VN_RELE(vp) (iput(vp)) -#endif +#define IHOLD(ip) \ +do { \ + atomic_inc(&(VFS_I(ip)->i_count)); \ + xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ +} while (0) + +#define IRELE(ip) \ +do { \ + xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ + iput(VFS_I(ip)); \ +} while (0) static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) { Index: linux-2.6-xfs/fs/xfs/xfs_utils.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_utils.h 2008-07-23 19:39:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_utils.h 2008-07-23 19:40:57.000000000 +0200 @@ -18,9 +18,6 @@ #ifndef __XFS_UTILS_H__ #define __XFS_UTILS_H__ -#define IRELE(ip) VN_RELE(VFS_I(ip)) -#define IHOLD(ip) VN_HOLD(VFS_I(ip)) - extern int xfs_truncate_file(xfs_mount_t *, xfs_inode_t *); extern int xfs_dir_ialloc(xfs_trans_t **, xfs_inode_t *, mode_t, xfs_nlink_t, xfs_dev_t, cred_t *, prid_t, int, From owner-xfs@oss.sgi.com Wed Jul 23 12:50:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:50:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJoBMO011592 for ; Wed, 23 Jul 2008 12:50:13 -0700 X-ASG-Debug-ID: 1216842680-585502860000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 42846E8E6D7 for ; Wed, 23 Jul 2008 12:51:20 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id sXLe0uHTBepxMn9W for ; Wed, 23 Jul 2008 12:51:20 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJpANg006743 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:51:10 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJpAGM006741 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:51:10 +0200 Date: Wed, 23 Jul 2008 21:51:10 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] sanitize xfs_initialize_vnode Subject: Re: [PATCH] sanitize xfs_initialize_vnode Message-ID: <20080723195110.GA6645@lst.de> References: <20080502105215.GA17870@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080502105215.GA17870@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842682 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17082 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, May 02, 2008 at 12:52:15PM +0200, Christoph Hellwig wrote: > Sanitize setting up the Linux indode. > > Setting up the xfs_inode <-> inode link is opencoded in xfs_iget_core > now because that's the only place it needs to be done, > xfs_initialize_vnode is renamed to xfs_setup_inode and loses all > superflous paramaters. The check for I_NEW is removed because it always > is true and the di_mode check moves into xfs_iget_core because it's only > needed there. > > xfs_set_inodeops and xfs_revalidate_inode are merged into > xfs_setup_inode and the whole things is moved into xfs_iops.c where it > belongs. Rediffed to apply ontop of Dave's and my vnode helper cleanups: Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 19:28:08.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 19:42:02.000000000 +0200 @@ -718,7 +718,7 @@ out_error: return error; } -const struct inode_operations xfs_inode_operations = { +static const struct inode_operations xfs_inode_operations = { .permission = xfs_vn_permission, .truncate = xfs_vn_truncate, .getattr = xfs_vn_getattr, @@ -730,7 +730,7 @@ const struct inode_operations xfs_inode_ .fallocate = xfs_vn_fallocate, }; -const struct inode_operations xfs_dir_inode_operations = { +static const struct inode_operations xfs_dir_inode_operations = { .create = xfs_vn_create, .lookup = xfs_vn_lookup, .link = xfs_vn_link, @@ -755,7 +755,7 @@ const struct inode_operations xfs_dir_in .listxattr = xfs_vn_listxattr, }; -const struct inode_operations xfs_dir_ci_inode_operations = { +static const struct inode_operations xfs_dir_ci_inode_operations = { .create = xfs_vn_create, .lookup = xfs_vn_ci_lookup, .link = xfs_vn_link, @@ -780,7 +780,7 @@ const struct inode_operations xfs_dir_ci .listxattr = xfs_vn_listxattr, }; -const struct inode_operations xfs_symlink_inode_operations = { +static const struct inode_operations xfs_symlink_inode_operations = { .readlink = generic_readlink, .follow_link = xfs_vn_follow_link, .put_link = xfs_vn_put_link, @@ -792,3 +792,98 @@ const struct inode_operations xfs_symlin .removexattr = generic_removexattr, .listxattr = xfs_vn_listxattr, }; + +STATIC void +xfs_diflags_to_iflags( + struct inode *inode, + struct xfs_inode *ip) +{ + if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) + inode->i_flags |= S_IMMUTABLE; + else + inode->i_flags &= ~S_IMMUTABLE; + if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) + inode->i_flags |= S_APPEND; + else + inode->i_flags &= ~S_APPEND; + if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) + inode->i_flags |= S_SYNC; + else + inode->i_flags &= ~S_SYNC; + if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) + inode->i_flags |= S_NOATIME; + else + inode->i_flags &= ~S_NOATIME; +} + +/* + * Initialize the Linux inode, set up the operation vectors and + * unlock the inode. + * + * When reading existing inodes from disk this is called directly + * from xfs_iget, when creating a new inode it is called from + * xfs_ialloc after setting up the inode. + */ +void +xfs_setup_inode( + struct xfs_inode *ip) +{ + struct inode *inode = ip->i_vnode; + + inode->i_mode = ip->i_d.di_mode; + inode->i_nlink = ip->i_d.di_nlink; + inode->i_uid = ip->i_d.di_uid; + inode->i_gid = ip->i_d.di_gid; + + switch (inode->i_mode & S_IFMT) { + case S_IFBLK: + case S_IFCHR: + inode->i_rdev = + MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, + sysv_minor(ip->i_df.if_u2.if_rdev)); + break; + default: + inode->i_rdev = 0; + break; + } + + inode->i_generation = ip->i_d.di_gen; + i_size_write(inode, ip->i_d.di_size); + inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; + inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; + inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; + inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; + inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; + inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; + xfs_diflags_to_iflags(inode, ip); + xfs_iflags_clear(ip, XFS_IMODIFIED); + + switch (inode->i_mode & S_IFMT) { + case S_IFREG: + inode->i_op = &xfs_inode_operations; + inode->i_fop = &xfs_file_operations; + inode->i_mapping->a_ops = &xfs_address_space_operations; + break; + case S_IFDIR: + if (xfs_sb_version_hasasciici(&XFS_M(inode->i_sb)->m_sb)) + inode->i_op = &xfs_dir_ci_inode_operations; + else + inode->i_op = &xfs_dir_inode_operations; + inode->i_fop = &xfs_dir_file_operations; + break; + case S_IFLNK: + inode->i_op = &xfs_symlink_inode_operations; + if (!(ip->i_df.if_flags & XFS_IFINLINE)) + inode->i_mapping->a_ops = &xfs_address_space_operations; + break; + default: + inode->i_op = &xfs_inode_operations; + init_special_inode(inode, inode->i_mode, inode->i_rdev); + break; + } + + xfs_iflags_clear(ip, XFS_INEW); + barrier(); + + unlock_new_inode(inode); +} Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h 2008-07-23 19:28:08.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h 2008-07-23 19:42:35.000000000 +0200 @@ -18,10 +18,7 @@ #ifndef __XFS_IOPS_H__ #define __XFS_IOPS_H__ -extern const struct inode_operations xfs_inode_operations; -extern const struct inode_operations xfs_dir_inode_operations; -extern const struct inode_operations xfs_dir_ci_inode_operations; -extern const struct inode_operations xfs_symlink_inode_operations; +struct xfs_inode; extern const struct file_operations xfs_file_operations; extern const struct file_operations xfs_dir_file_operations; @@ -29,8 +26,9 @@ extern const struct file_operations xfs_ extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size); -struct xfs_inode; extern void xfs_ichgtime(struct xfs_inode *, int); extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); +extern void xfs_setup_inode(struct xfs_inode *); + #endif /* __XFS_IOPS_H__ */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-23 19:40:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-23 19:42:02.000000000 +0200 @@ -155,12 +155,9 @@ EXPORT_SYMBOL(kmem_zone_free); EXPORT_SYMBOL(kmem_zone_init); EXPORT_SYMBOL(kmem_zone_zalloc); EXPORT_SYMBOL(xfs_address_space_operations); -EXPORT_SYMBOL(xfs_dir_inode_operations); EXPORT_SYMBOL(xfs_dir_file_operations); -EXPORT_SYMBOL(xfs_inode_operations); EXPORT_SYMBOL(xfs_file_operations); EXPORT_SYMBOL(xfs_invis_file_operations); -EXPORT_SYMBOL(xfs_symlink_inode_operations); EXPORT_SYMBOL(xfs_buf_delwri_dequeue); EXPORT_SYMBOL(_xfs_buf_find); EXPORT_SYMBOL(xfs_buf_iostart); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.h 2008-07-23 18:06:21.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h 2008-07-23 19:42:02.000000000 +0200 @@ -72,9 +72,6 @@ struct block_device; extern __uint64_t xfs_max_file_offset(unsigned int); -extern void xfs_initialize_vnode(struct xfs_mount *mp, bhv_vnode_t *vp, - struct xfs_inode *ip); - extern void xfs_flush_inode(struct xfs_inode *); extern void xfs_flush_device(struct xfs_inode *); Index: linux-2.6-xfs/fs/xfs/xfs_iget.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2008-07-23 19:28:08.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2008-07-23 19:42:02.000000000 +0200 @@ -288,10 +288,17 @@ finish_inode: *ipp = ip; /* + * Set up the Linux with the Linux inode. + */ + ip->i_vnode = inode; + inode->i_private = ip; + + /* * If we have a real type for an on-disk inode, we can set ops(&unlock) * now. If it's a new inode being created, xfs_ialloc will handle it. */ - xfs_initialize_vnode(mp, inode, ip); + if (ip->i_d.di_mode != 0) + xfs_setup_inode(ip); return 0; } Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 19:28:08.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 19:45:01.000000000 +0200 @@ -1046,7 +1046,6 @@ xfs_ialloc( { xfs_ino_t ino; xfs_inode_t *ip; - bhv_vnode_t *vp; uint flags; int error; @@ -1077,7 +1076,6 @@ xfs_ialloc( } ASSERT(ip != NULL); - vp = VFS_I(ip); ip->i_d.di_mode = (__uint16_t)mode; ip->i_d.di_onlink = 0; ip->i_d.di_nlink = nlink; @@ -1220,7 +1218,7 @@ xfs_ialloc( xfs_trans_log_inode(tp, ip, flags); /* now that we have an i_mode we can setup inode ops and unlock */ - xfs_initialize_vnode(tp->t_mountp, vp, ip); + xfs_setup_inode(ip); *ipp = ip; return 0; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:34:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:46:23.000000000 +0200 @@ -581,116 +581,6 @@ xfs_max_file_offset( return (((__uint64_t)pagefactor) << bitshift) - 1; } -STATIC_INLINE void -xfs_set_inodeops( - struct inode *inode) -{ - switch (inode->i_mode & S_IFMT) { - case S_IFREG: - inode->i_op = &xfs_inode_operations; - inode->i_fop = &xfs_file_operations; - inode->i_mapping->a_ops = &xfs_address_space_operations; - break; - case S_IFDIR: - if (xfs_sb_version_hasasciici(&XFS_M(inode->i_sb)->m_sb)) - inode->i_op = &xfs_dir_ci_inode_operations; - else - inode->i_op = &xfs_dir_inode_operations; - inode->i_fop = &xfs_dir_file_operations; - break; - case S_IFLNK: - inode->i_op = &xfs_symlink_inode_operations; - if (!(XFS_I(inode)->i_df.if_flags & XFS_IFINLINE)) - inode->i_mapping->a_ops = &xfs_address_space_operations; - break; - default: - inode->i_op = &xfs_inode_operations; - init_special_inode(inode, inode->i_mode, inode->i_rdev); - break; - } -} - -STATIC_INLINE void -xfs_revalidate_inode( - xfs_mount_t *mp, - struct inode *inode, - xfs_inode_t *ip) -{ - - inode->i_mode = ip->i_d.di_mode; - inode->i_nlink = ip->i_d.di_nlink; - inode->i_uid = ip->i_d.di_uid; - inode->i_gid = ip->i_d.di_gid; - - switch (inode->i_mode & S_IFMT) { - case S_IFBLK: - case S_IFCHR: - inode->i_rdev = - MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, - sysv_minor(ip->i_df.if_u2.if_rdev)); - break; - default: - inode->i_rdev = 0; - break; - } - - inode->i_generation = ip->i_d.di_gen; - i_size_write(inode, ip->i_d.di_size); - inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; - inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; - inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; - inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; - inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; - inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; - if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) - inode->i_flags |= S_IMMUTABLE; - else - inode->i_flags &= ~S_IMMUTABLE; - if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) - inode->i_flags |= S_APPEND; - else - inode->i_flags &= ~S_APPEND; - if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) - inode->i_flags |= S_SYNC; - else - inode->i_flags &= ~S_SYNC; - if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) - inode->i_flags |= S_NOATIME; - else - inode->i_flags &= ~S_NOATIME; - xfs_iflags_clear(ip, XFS_IMODIFIED); -} - -void -xfs_initialize_vnode( - struct xfs_mount *mp, - struct inode *inode, - struct xfs_inode *ip) -{ - - if (!ip->i_vnode) { - ip->i_vnode = inode; - inode->i_private = ip; - } - - /* - * We need to set the ops vectors, and unlock the inode, but if - * we have been called during the new inode create process, it is - * too early to fill in the Linux inode. We will get called a - * second time once the inode is properly set up, and then we can - * finish our work. - */ - if (ip->i_d.di_mode != 0 && (inode->i_state & I_NEW)) { - xfs_revalidate_inode(mp, inode, ip); - xfs_set_inodeops(inode); - - xfs_iflags_clear(ip, XFS_INEW); - barrier(); - - unlock_new_inode(inode); - } -} - int xfs_blkdev_get( xfs_mount_t *mp, From owner-xfs@oss.sgi.com Wed Jul 23 12:50:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:50:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJoa4l012041 for ; Wed, 23 Jul 2008 12:50:40 -0700 X-ASG-Debug-ID: 1216842706-1fb802390000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 67F551B3E7E4 for ; Wed, 23 Jul 2008 12:51:46 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id w6u3765F3Dt4dDRj for ; Wed, 23 Jul 2008 12:51:46 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJpbNg006773 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:51:37 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJpbWQ006771 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:51:37 +0200 Date: Wed, 23 Jul 2008 21:51:37 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] remove dead inode flags Subject: Re: [PATCH] remove dead inode flags Message-ID: <20080723195137.GB6645@lst.de> References: <20080723142630.GA22859@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723142630.GA22859@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842707 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17083 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Btw, this needs "[PATCH] sanitize xfs_initialize_vnode" applied first. On Wed, Jul 23, 2008 at 04:26:30PM +0200, Christoph Hellwig wrote: > There are a few inode flags around that aren't used anywhere, so remove > them. Also update xfsidbg to display all used inode flags correctly. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-23 15:11:57.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-23 15:12:00.000000000 +0200 > @@ -2481,7 +2481,6 @@ xfs_dm_punch_hole( > /* Let threads in send_data_event know we punched the file. */ > ip->i_d.di_dmstate++; > xfs_iunlock(ip, XFS_IOLOCK_EXCL); > - xfs_iflags_set(ip, XFS_IMODIFIED); > > up_and_out: > up_rw_sems(inode, DM_SEM_FLAG_WR); > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_aops.c 2008-07-23 15:11:38.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_aops.c 2008-07-23 15:12:00.000000000 +0200 > @@ -318,14 +318,9 @@ xfs_map_blocks( > xfs_iomap_t *mapp, > int flags) > { > - xfs_inode_t *ip = XFS_I(inode); > - int error, nmaps = 1; > + int nmaps = 1; > > - error = xfs_iomap(ip, offset, count, > - flags, mapp, &nmaps); > - if (!error && (flags & (BMAPI_WRITE|BMAPI_ALLOCATE))) > - xfs_iflags_set(ip, XFS_IMODIFIED); > - return -error; > + return -xfs_iomap(XFS_I(inode), offset, count, flags, mapp, &nmaps); > } > > STATIC_INLINE int > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_file.c 2008-07-23 15:11:38.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_file.c 2008-07-23 15:12:00.000000000 +0200 > @@ -407,11 +407,8 @@ xfs_file_ioctl( > unsigned int cmd, > unsigned long p) > { > - int error; > struct inode *inode = filp->f_path.dentry->d_inode; > > - error = xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p); > - xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); > > /* NOTE: some of the ioctl's return positive #'s as a > * byte count indicating success, such as > @@ -419,7 +416,7 @@ xfs_file_ioctl( > * like most other routines. This means true > * errors need to be returned as a negative value. > */ > - return error; > + return xfs_ioctl(XFS_I(inode), filp, 0, cmd, (void __user *)p); > } > > STATIC long > @@ -428,11 +425,8 @@ xfs_file_ioctl_invis( > unsigned int cmd, > unsigned long p) > { > - int error; > struct inode *inode = filp->f_path.dentry->d_inode; > > - error = xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p); > - xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); > > /* NOTE: some of the ioctl's return positive #'s as a > * byte count indicating success, such as > @@ -440,7 +434,7 @@ xfs_file_ioctl_invis( > * like most other routines. This means true > * errors need to be returned as a negative value. > */ > - return error; > + return xfs_ioctl(XFS_I(inode), filp, IO_INVIS, cmd, (void __user *)p); > } > > #ifdef HAVE_DMAPI > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 15:11:44.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 15:12:14.000000000 +0200 > @@ -214,8 +214,6 @@ xfs_init_security( > } > > error = xfs_attr_set(ip, name, value, length, ATTR_SECURE); > - if (!error) > - xfs_iflags_set(ip, XFS_IMODIFIED); > > kfree(name); > kfree(value); > @@ -316,7 +314,6 @@ xfs_vn_mknod( > error = _ACL_INHERIT(inode, mode, default_acl); > if (unlikely(error)) > goto out_cleanup_inode; > - xfs_iflags_set(ip, XFS_IMODIFIED); > _ACL_FREE(default_acl); > } > > @@ -436,7 +433,6 @@ xfs_vn_link( > return -error; > } > > - xfs_iflags_set(XFS_I(dir), XFS_IMODIFIED); > d_instantiate(dentry, inode); > return 0; > } > @@ -856,7 +852,6 @@ xfs_setup_inode( > inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; > inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; > xfs_diflags_to_iflags(inode, ip); > - xfs_iflags_clear(ip, XFS_IMODIFIED); > > switch (inode->i_mode & S_IFMT) { > case S_IFREG: > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-07-23 15:12:23.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl32.c 2008-07-23 15:12:38.000000000 +0200 > @@ -375,7 +375,6 @@ xfs_compat_ioctl( > unsigned long arg) > { > struct inode *inode = file->f_path.dentry->d_inode; > - int error; > > switch (cmd) { > case XFS_IOC_DIOINFO: > @@ -463,10 +462,7 @@ xfs_compat_ioctl( > return -ENOIOCTLCMD; > } > > - error = xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg); > - xfs_iflags_set(XFS_I(inode), XFS_IMODIFIED); > - > - return error; > + return xfs_ioctl(XFS_I(inode), file, mode, cmd, (void __user *)arg); > } > > long > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 15:12:17.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 15:12:19.000000000 +0200 > @@ -993,7 +993,6 @@ xfs_fs_clear_inode( > XFS_STATS_DEC(vn_active); > > xfs_inactive(ip); > - xfs_iflags_clear(ip, XFS_IMODIFIED); > if (xfs_reclaim(ip)) > panic("%s: cannot reclaim 0x%p\n", __func__, inode); > } > Index: linux-2.6-xfs/fs/xfs/xfs_iget.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2008-07-23 15:12:46.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2008-07-23 15:12:52.000000000 +0200 > @@ -284,7 +284,6 @@ finish_inode: > ASSERT(ip->i_df.if_ext_max == > XFS_IFORK_DSIZE(ip) / sizeof(xfs_bmbt_rec_t)); > > - xfs_iflags_set(ip, XFS_IMODIFIED); > *ipp = ip; > > /* > Index: linux-2.6-xfs/fs/xfs/xfs_inode.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-23 15:13:05.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-23 15:17:20.000000000 +0200 > @@ -364,17 +364,12 @@ xfs_iflags_test_and_clear(xfs_inode_t *i > /* > * In-core inode flags. > */ > -#define XFS_IGRIO 0x0001 /* inode used for guaranteed rate i/o */ > -#define XFS_IUIOSZ 0x0002 /* inode i/o sizes have been explicitly set */ > -#define XFS_IQUIESCE 0x0004 /* we have started quiescing for this inode */ > -#define XFS_IRECLAIM 0x0008 /* we have started reclaiming this inode */ > -#define XFS_ISTALE 0x0010 /* inode has been staled */ > -#define XFS_IRECLAIMABLE 0x0020 /* inode can be reclaimed */ > -#define XFS_INEW 0x0040 > -#define XFS_IFILESTREAM 0x0080 /* inode is in a filestream directory */ > -#define XFS_IMODIFIED 0x0100 /* XFS inode state possibly differs */ > - /* to the Linux inode state. */ > -#define XFS_ITRUNCATED 0x0200 /* truncated down so flush-on-close */ > +#define XFS_IRECLAIM 0x0001 /* we have started reclaiming this inode */ > +#define XFS_ISTALE 0x0002 /* inode has been staled */ > +#define XFS_IRECLAIMABLE 0x0004 /* inode can be reclaimed */ > +#define XFS_INEW 0x0008 /* inode has just been allocated */ > +#define XFS_IFILESTREAM 0x0010 /* inode is in a filestream directory */ > +#define XFS_ITRUNCATED 0x0020 /* truncated down so flush-on-close */ > > /* > * Flags for inode locking. > Index: linux-2.6-xfs/fs/xfs/xfsidbg.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-23 15:12:57.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-23 15:16:58.000000000 +0200 > @@ -155,7 +155,6 @@ static void xfsidbg_xiclogall(xlog_in_co > static void xfsidbg_xiclogcb(xlog_in_core_t *); > static void xfsidbg_xinodes(xfs_mount_t *); > static void xfsidbg_delayed_blocks(xfs_mount_t *); > -static void xfsidbg_xinodes_quiesce(xfs_mount_t *); > static void xfsidbg_xlog(xlog_t *); > static void xfsidbg_xlog_ritem(xlog_recover_item_t *); > static void xfsidbg_xlog_rtrans(xlog_recover_t *); > @@ -1280,26 +1279,6 @@ static int kdbm_xfs_delayed_blocks( > return 0; > } > > - > -static int kdbm_xfs_xinodes_quiesce( > - int argc, > - const char **argv) > -{ > - unsigned long addr; > - int nextarg = 1; > - long offset = 0; > - int diag; > - > - if (argc != 1) > - return KDB_ARGCOUNT; > - diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); > - if (diag) > - return diag; > - > - xfsidbg_xinodes_quiesce((xfs_mount_t *) addr); > - return 0; > -} > - > static int kdbm_xfs_xlog( > int argc, > const char **argv) > @@ -2374,8 +2353,6 @@ static struct xif xfsidbg_funcs[] = { > #endif > { "xinodes", kdbm_xfs_xinodes, "", > "Dump XFS inodes per mount"}, > - { "xquiesce",kdbm_xfs_xinodes_quiesce, "", > - "Dump non-quiesced XFS inodes per mount"}, > #ifdef XFS_LOG_TRACE > { "xl_grtr", kdbm_xfs_xlog_granttrace, "", > "Dump XFS log grant trace" }, > @@ -5776,28 +5753,6 @@ xfsidbg_delayed_blocks(xfs_mount_t *mp) > kdb_printf("delayed blocks total: %d in %d inodes\n", total, icount); > } > > -static void > -xfsidbg_xinodes_quiesce(xfs_mount_t *mp) > -{ > - xfs_inode_t *ip; > - > - kdb_printf("xfs_mount at 0x%p\n", mp); > - ip = mp->m_inodes; > - if (ip != NULL) { > - do { > - if (ip->i_mount == NULL) { > - ip = ip->i_mnext; > - continue; > - } > - if (!(ip->i_flags & XFS_IQUIESCE)) { > - kdb_printf("ip 0x%p not quiesced\n", ip); > - } > - ip = ip->i_mnext; > - } while (ip != mp->m_inodes); > - } > - kdb_printf("\nEnd of Inodes\n"); > -} > - > static char * > xfsidbg_get_cstate(int state) > { > @@ -6399,12 +6354,11 @@ static void > xfsidbg_xnode(xfs_inode_t *ip) > { > static char *tab_flags[] = { > - "grio", /* XFS_IGRIO */ > - "uiosize", /* XFS_IUIOSZ */ > - "quiesce", /* XFS_IQUIESCE */ > "reclaim", /* XFS_IRECLAIM */ > "stale", /* XFS_ISTALE */ > - "modified", /* XFS_IMODIFIED */ > + "reclaimable", /* XFS_IRECLAIMABLE */ > + "new", /* XFS_INEW */ > + "filestream", /* XFS_IFILESTREAM */ > "truncated", /* XFS_ITRUNCATED */ > NULL > }; ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 12:52:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:52:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJq3Gt013387 for ; Wed, 23 Jul 2008 12:52:05 -0700 X-ASG-Debug-ID: 1216842792-514603320000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AFD36E8E71F for ; Wed, 23 Jul 2008 12:53:13 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id MkA4JuzH4K25Twdl for ; Wed, 23 Jul 2008 12:53:13 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJr3Ng006852 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:53:03 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJr3xO006850 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:53:03 +0200 Date: Wed, 23 Jul 2008 21:53:03 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] split out two helpers from xfs_syncsub Subject: [PATCH] split out two helpers from xfs_syncsub Message-ID: <20080723195303.GC6645@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842794 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.657 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17084 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Split out two helpers from xfs_syncsub for the dummy log commit and the superblock writeout. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 19:47:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 19:47:27.000000000 +0200 @@ -623,6 +623,93 @@ xfs_sync_inodes( return XFS_ERROR(last_error); } +STATIC int +xfs_commit_dummy_trans( + struct xfs_mount *mp, + uint log_flags) +{ + struct xfs_inode *ip = mp->m_rootip; + struct xfs_trans *tp; + int error; + + /* + * Put a dummy transaction in the log to tell recovery + * that all others are OK. + */ + tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); + error = xfs_trans_reserve(tp, 0, XFS_ICHANGE_LOG_RES(mp), 0, 0, 0); + if (error) { + xfs_trans_cancel(tp, 0); + return error; + } + + xfs_ilock(ip, XFS_ILOCK_EXCL); + + xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); + xfs_trans_ihold(tp, ip); + xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); + /* XXX(hch): ignoring the error here.. */ + error = xfs_trans_commit(tp, 0); + + xfs_iunlock(ip, XFS_ILOCK_EXCL); + + xfs_log_force(mp, 0, log_flags); + return 0; +} + +STATIC int +xfs_sync_fsdata( + struct xfs_mount *mp, + int flags) +{ + struct xfs_buf *bp; + struct xfs_buf_log_item *bip; + int error = 0; + + /* + * If this is xfssyncd() then only sync the superblock if we can + * lock it without sleeping and it is not pinned. + */ + if (flags & SYNC_BDFLUSH) { + ASSERT(!(flags & SYNC_WAIT)); + + bp = xfs_getsb(mp, XFS_BUF_TRYLOCK); + if (!bp) + goto out; + + bip = XFS_BUF_FSPRIVATE(bp, struct xfs_buf_log_item *); + if (!bip || !xfs_buf_item_dirty(bip) || XFS_BUF_ISPINNED(bp)) + goto out_brelse; + } else { + bp = xfs_getsb(mp, 0); + + /* + * If the buffer is pinned then push on the log so we won't + * get stuck waiting in the write for someone, maybe + * ourselves, to flush the log. + * + * Even though we just pushed the log above, we did not have + * the superblock buffer locked at that point so it can + * become pinned in between there and here. + */ + if (XFS_BUF_ISPINNED(bp)) + xfs_log_force(mp, 0, XFS_LOG_FORCE); + } + + + if (flags & SYNC_WAIT) + XFS_BUF_UNASYNC(bp); + else + XFS_BUF_ASYNC(bp); + + return xfs_bwrite(mp, bp); + + out_brelse: + xfs_buf_relse(bp); + out: + return error; +} + /* * xfs sync routine for internal use * @@ -639,8 +726,6 @@ xfs_syncsub( int error = 0; int last_error = 0; uint log_flags = XFS_LOG_FORCE; - xfs_buf_t *bp; - xfs_buf_log_item_t *bip; /* * Sync out the log. This ensures that the log is periodically @@ -663,83 +748,22 @@ xfs_syncsub( * log activity, so if this isn't vfs_sync() then flush * the log again. */ - if (flags & SYNC_DELWRI) { - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); - } + if (flags & SYNC_DELWRI) + xfs_log_force(mp, 0, log_flags); if (flags & SYNC_FSDATA) { - /* - * If this is vfs_sync() then only sync the superblock - * if we can lock it without sleeping and it is not pinned. - */ - if (flags & SYNC_BDFLUSH) { - bp = xfs_getsb(mp, XFS_BUF_TRYLOCK); - if (bp != NULL) { - bip = XFS_BUF_FSPRIVATE(bp,xfs_buf_log_item_t*); - if ((bip != NULL) && - xfs_buf_item_dirty(bip)) { - if (!(XFS_BUF_ISPINNED(bp))) { - XFS_BUF_ASYNC(bp); - error = xfs_bwrite(mp, bp); - } else { - xfs_buf_relse(bp); - } - } else { - xfs_buf_relse(bp); - } - } - } else { - bp = xfs_getsb(mp, 0); - /* - * If the buffer is pinned then push on the log so - * we won't get stuck waiting in the write for - * someone, maybe ourselves, to flush the log. - * Even though we just pushed the log above, we - * did not have the superblock buffer locked at - * that point so it can become pinned in between - * there and here. - */ - if (XFS_BUF_ISPINNED(bp)) - xfs_log_force(mp, (xfs_lsn_t)0, XFS_LOG_FORCE); - if (flags & SYNC_WAIT) - XFS_BUF_UNASYNC(bp); - else - XFS_BUF_ASYNC(bp); - error = xfs_bwrite(mp, bp); - } - if (error) { + error = xfs_sync_fsdata(mp, flags); + if (error) last_error = error; - } } /* * Now check to see if the log needs a "dummy" transaction. */ if (!(flags & SYNC_REMOUNT) && xfs_log_need_covered(mp)) { - xfs_trans_t *tp; - xfs_inode_t *ip; - - /* - * Put a dummy transaction in the log to tell - * recovery that all others are OK. - */ - tp = xfs_trans_alloc(mp, XFS_TRANS_DUMMY1); - if ((error = xfs_trans_reserve(tp, 0, - XFS_ICHANGE_LOG_RES(mp), - 0, 0, 0))) { - xfs_trans_cancel(tp, 0); + error = xfs_commit_dummy_trans(mp, log_flags); + if (error) return error; - } - - ip = mp->m_rootip; - xfs_ilock(ip, XFS_ILOCK_EXCL); - - xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); - xfs_trans_ihold(tp, ip); - xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE); - error = xfs_trans_commit(tp, 0); - xfs_iunlock(ip, XFS_ILOCK_EXCL); - xfs_log_force(mp, (xfs_lsn_t)0, log_flags); } /* From owner-xfs@oss.sgi.com Wed Jul 23 12:54:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:54:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_14, J_CHICKENPOX_62,J_CHICKENPOX_64,J_CHICKENPOX_65,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJspS2014058 for ; Wed, 23 Jul 2008 12:54:52 -0700 X-ASG-Debug-ID: 1216842960-309201190000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 87B6A18F5B60 for ; Wed, 23 Jul 2008 12:56:00 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id skrBECnKLjGP4VY2 for ; Wed, 23 Jul 2008 12:56:00 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJtpNg006949 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:55:51 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJtpD5006947 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:55:51 +0200 Date: Wed, 23 Jul 2008 21:55:51 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/2] factor out xfs_read_agi helper Subject: [PATCH 1/2] factor out xfs_read_agi helper Message-ID: <20080723195551.GD6645@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842961 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.32 X-Barracuda-Spam-Status: No, SCORE=-1.32 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_RULE7568M, BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.50 BSF_RULE7568M Custom Rule 7568M 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17085 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Add a helper to read the AGI header and perform basic verification. Based on hunks from a larger patch from Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_ag.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ag.h 2008-07-23 18:06:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ag.h 2008-07-23 19:47:29.000000000 +0200 @@ -142,6 +142,9 @@ typedef struct xfs_agi { #define XFS_AGI_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGI_DADDR(mp)) #define XFS_BUF_TO_AGI(bp) ((xfs_agi_t *)XFS_BUF_PTR(bp)) +extern int xfs_read_agi(struct xfs_mount *mp, struct xfs_trans *tp, + xfs_agnumber_t agno, struct xfs_buf **bpp); + /* * The third a.g. block contains the a.g. freelist, an array * of block pointers to blocks owned by the allocation btree code. Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-23 18:06:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-23 19:47:29.000000000 +0200 @@ -1370,70 +1370,95 @@ xfs_ialloc_log_agi( xfs_trans_log_buf(tp, bp, first, last); } +#ifdef DEBUG +STATIC void +xfs_check_agi_unlinked( + struct xfs_agi *agi) +{ + int i; + + for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) + ASSERT(agi->agi_unlinked[i]); +} +#else +#define xfs_check_agi_unlinked(agi) +#endif + /* * Read in the allocation group header (inode allocation section) */ int -xfs_ialloc_read_agi( - xfs_mount_t *mp, /* file system mount structure */ - xfs_trans_t *tp, /* transaction pointer */ - xfs_agnumber_t agno, /* allocation group number */ - xfs_buf_t **bpp) /* allocation group hdr buf */ +xfs_read_agi( + struct xfs_mount *mp, /* file system mount structure */ + struct xfs_trans *tp, /* transaction pointer */ + xfs_agnumber_t agno, /* allocation group number */ + struct xfs_buf **bpp) /* allocation group hdr buf */ { - xfs_agi_t *agi; /* allocation group header */ - int agi_ok; /* agi is consistent */ - xfs_buf_t *bp; /* allocation group hdr buf */ - xfs_perag_t *pag; /* per allocation group data */ - int error; + struct xfs_agi *agi; /* allocation group header */ + int agi_ok; /* agi is consistent */ + int error; ASSERT(agno != NULLAGNUMBER); - error = xfs_trans_read_buf( - mp, tp, mp->m_ddev_targp, + + error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0, &bp); + XFS_FSS_TO_BB(mp, 1), 0, bpp); if (error) return error; - ASSERT(bp && !XFS_BUF_GETERROR(bp)); + + ASSERT(*bpp && !XFS_BUF_GETERROR(*bpp)); + agi = XFS_BUF_TO_AGI(*bpp); /* * Validate the magic number of the agi block. */ - agi = XFS_BUF_TO_AGI(bp); - agi_ok = - be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC && - XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum)); + agi_ok = be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC && + XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum)) && + be32_to_cpu(agi->agi_seqno) == agno; if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IALLOC_READ_AGI, XFS_RANDOM_IALLOC_READ_AGI))) { - XFS_CORRUPTION_ERROR("xfs_ialloc_read_agi", XFS_ERRLEVEL_LOW, + XFS_CORRUPTION_ERROR("xfs_read_agi", XFS_ERRLEVEL_LOW, mp, agi); - xfs_trans_brelse(tp, bp); + xfs_trans_brelse(tp, *bpp); return XFS_ERROR(EFSCORRUPTED); } + + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_AGI, XFS_AGI_REF); + + xfs_check_agi_unlinked(agi); + return 0; +} + +int +xfs_ialloc_read_agi( + struct xfs_mount *mp, /* file system mount structure */ + struct xfs_trans *tp, /* transaction pointer */ + xfs_agnumber_t agno, /* allocation group number */ + struct xfs_buf **bpp) /* allocation group hdr buf */ +{ + struct xfs_agi *agi; /* allocation group header */ + struct xfs_perag *pag; /* per allocation group data */ + int error; + + error = xfs_read_agi(mp, tp, agno, bpp); + if (error) + return error; + + agi = XFS_BUF_TO_AGI(*bpp); pag = &mp->m_perag[agno]; + if (!pag->pagi_init) { pag->pagi_freecount = be32_to_cpu(agi->agi_freecount); pag->pagi_count = be32_to_cpu(agi->agi_count); pag->pagi_init = 1; - } else { - /* - * It's possible for these to be out of sync if - * we are in the middle of a forced shutdown. - */ - ASSERT(pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) || - XFS_FORCED_SHUTDOWN(mp)); - } - -#ifdef DEBUG - { - int i; - - for (i = 0; i < XFS_AGI_UNLINKED_BUCKETS; i++) - ASSERT(agi->agi_unlinked[i]); } -#endif - XFS_BUF_SET_VTYPE_REF(bp, B_FS_AGI, XFS_AGI_REF); - *bpp = bp; + /* + * It's possible for these to be out of sync if + * we are in the middle of a forced shutdown. + */ + ASSERT(pag->pagi_freecount == be32_to_cpu(agi->agi_freecount) || + XFS_FORCED_SHUTDOWN(mp)); return 0; } Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 19:45:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 19:47:29.000000000 +0200 @@ -1776,13 +1776,10 @@ xfs_iunlink( xfs_dinode_t *dip; xfs_buf_t *agibp; xfs_buf_t *ibp; - xfs_agnumber_t agno; - xfs_daddr_t agdaddr; xfs_agino_t agino; short bucket_index; int offset; int error; - int agi_ok; ASSERT(ip->i_d.di_nlink == 0); ASSERT(ip->i_d.di_mode != 0); @@ -1790,31 +1787,15 @@ xfs_iunlink( mp = tp->t_mountp; - agno = XFS_INO_TO_AGNO(mp, ip->i_ino); - agdaddr = XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)); - /* * Get the agi buffer first. It ensures lock ordering * on the list. */ - error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, agdaddr, - XFS_FSS_TO_BB(mp, 1), 0, &agibp); + error = xfs_read_agi(mp, tp, XFS_INO_TO_AGNO(mp, ip->i_ino), &agibp); if (error) return error; - - /* - * Validate the magic number of the agi block. - */ agi = XFS_BUF_TO_AGI(agibp); - agi_ok = - be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC && - XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum)); - if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK, - XFS_RANDOM_IUNLINK))) { - XFS_CORRUPTION_ERROR("xfs_iunlink", XFS_ERRLEVEL_LOW, mp, agi); - xfs_trans_brelse(tp, agibp); - return XFS_ERROR(EFSCORRUPTED); - } + /* * Get the index into the agi hash table for the * list this inode will go on. @@ -1874,7 +1855,6 @@ xfs_iunlink_remove( xfs_buf_t *agibp; xfs_buf_t *ibp; xfs_agnumber_t agno; - xfs_daddr_t agdaddr; xfs_agino_t agino; xfs_agino_t next_agino; xfs_buf_t *last_ibp; @@ -1882,45 +1862,23 @@ xfs_iunlink_remove( short bucket_index; int offset, last_offset = 0; int error; - int agi_ok; - /* - * First pull the on-disk inode from the AGI unlinked list. - */ mp = tp->t_mountp; - agno = XFS_INO_TO_AGNO(mp, ip->i_ino); - agdaddr = XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)); /* * Get the agi buffer first. It ensures lock ordering * on the list. */ - error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, agdaddr, - XFS_FSS_TO_BB(mp, 1), 0, &agibp); + error = xfs_read_agi(mp, tp, agno, &agibp); if (error) { cmn_err(CE_WARN, - "xfs_iunlink_remove: xfs_trans_read_buf() returned an error %d on %s. Returning error.", + "xfs_iunlink_remove: xfs_read_agi() returned an error %d on %s. Returning error.", error, mp->m_fsname); return error; } - /* - * Validate the magic number of the agi block. - */ agi = XFS_BUF_TO_AGI(agibp); - agi_ok = - be32_to_cpu(agi->agi_magicnum) == XFS_AGI_MAGIC && - XFS_AGI_GOOD_VERSION(be32_to_cpu(agi->agi_versionnum)); - if (unlikely(XFS_TEST_ERROR(!agi_ok, mp, XFS_ERRTAG_IUNLINK_REMOVE, - XFS_RANDOM_IUNLINK_REMOVE))) { - XFS_CORRUPTION_ERROR("xfs_iunlink_remove", XFS_ERRLEVEL_LOW, - mp, agi); - xfs_trans_brelse(tp, agibp); - cmn_err(CE_WARN, - "xfs_iunlink_remove: XFS_TEST_ERROR() returned an error on %s. Returning EFSCORRUPTED.", - mp->m_fsname); - return XFS_ERROR(EFSCORRUPTED); - } + /* * Get the index into the agi hash table for the * list this inode will go on. Index: linux-2.6-xfs/fs/xfs/xfs_log_recover.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log_recover.c 2008-07-23 18:06:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log_recover.c 2008-07-23 19:47:29.000000000 +0200 @@ -3134,19 +3134,16 @@ xlog_recover_clear_agi_bucket( int error; tp = xfs_trans_alloc(mp, XFS_TRANS_CLEAR_AGI_BUCKET); - error = xfs_trans_reserve(tp, 0, XFS_CLEAR_AGI_BUCKET_LOG_RES(mp), 0, 0, 0); - if (!error) - error = xfs_trans_read_buf(mp, tp, mp->m_ddev_targp, - XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0, &agibp); + error = xfs_trans_reserve(tp, 0, XFS_CLEAR_AGI_BUCKET_LOG_RES(mp), + 0, 0, 0); if (error) goto out_abort; - error = EINVAL; - agi = XFS_BUF_TO_AGI(agibp); - if (be32_to_cpu(agi->agi_magicnum) != XFS_AGI_MAGIC) + error = xfs_read_agi(mp, tp, agno, &agibp); + if (error) goto out_abort; + agi = XFS_BUF_TO_AGI(agibp); agi->agi_unlinked[bucket] = cpu_to_be32(NULLAGINO); offset = offsetof(xfs_agi_t, agi_unlinked) + (sizeof(xfs_agino_t) * bucket); @@ -3207,16 +3204,21 @@ xlog_recover_process_iunlinks( /* * Find the agi for this ag. */ - agibp = xfs_buf_read(mp->m_ddev_targp, - XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0); - if (XFS_BUF_ISERROR(agibp)) { - xfs_ioerror_alert("xlog_recover_process_iunlinks(#1)", - log->l_mp, agibp, - XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp))); + error = xfs_read_agi(mp, NULL, agno, &agibp); + if (error) { + /* + * AGI is b0rked. Don't process it. + * + * We should probably mark the filesystem as corrupt + * after we've recovered all the ag's we can.... + */ + xfs_fs_cmn_err(CE_ALERT, mp, + "xlog_recover_process_iunlinks(#1)" + "agi read failed agno %d error %d", + agno, error); + continue; } agi = XFS_BUF_TO_AGI(agibp); - ASSERT(XFS_AGI_MAGIC == be32_to_cpu(agi->agi_magicnum)); for (bucket = 0; bucket < XFS_AGI_UNLINKED_BUCKETS; bucket++) { @@ -3295,22 +3297,18 @@ xlog_recover_process_iunlinks( /* * Reacquire the agibuffer and continue around - * the loop. + * the loop. This should never fail as we know + * the buffer was good earlier on. */ - agibp = xfs_buf_read(mp->m_ddev_targp, - XFS_AG_DADDR(mp, agno, - XFS_AGI_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), 0); - if (XFS_BUF_ISERROR(agibp)) { - xfs_ioerror_alert( - "xlog_recover_process_iunlinks(#2)", - log->l_mp, agibp, - XFS_AG_DADDR(mp, agno, - XFS_AGI_DADDR(mp))); + error = xfs_read_agi(mp, NULL, agno, &agibp); + ASSERT(error == 0); + if (error) { + xfs_fs_cmn_err(CE_ALERT, mp, + "xlog_recover_process_iunlinks(#2)" + "agi read failed agno %d error %d", + agno, error); } agi = XFS_BUF_TO_AGI(agibp); - ASSERT(XFS_AGI_MAGIC == be32_to_cpu( - agi->agi_magicnum)); } } @@ -4004,7 +4002,6 @@ xlog_recover_check_summary( xfs_buf_t *agfbp; xfs_buf_t *agibp; xfs_daddr_t agfdaddr; - xfs_daddr_t agidaddr; xfs_buf_t *sbbp; #ifdef XFS_LOUD_RECOVERY xfs_sb_t *sbp; @@ -4013,6 +4010,7 @@ xlog_recover_check_summary( __uint64_t freeblks; __uint64_t itotal; __uint64_t ifree; + int error; mp = log->l_mp; @@ -4036,21 +4034,19 @@ xlog_recover_check_summary( be32_to_cpu(agfp->agf_flcount); xfs_buf_relse(agfbp); - agidaddr = XFS_AG_DADDR(mp, agno, XFS_AGI_DADDR(mp)); - agibp = xfs_buf_read(mp->m_ddev_targp, agidaddr, - XFS_FSS_TO_BB(mp, 1), 0); - if (XFS_BUF_ISERROR(agibp)) { - xfs_ioerror_alert("xlog_recover_check_summary(agi)", - mp, agibp, agidaddr); - } - agip = XFS_BUF_TO_AGI(agibp); - ASSERT(XFS_AGI_MAGIC == be32_to_cpu(agip->agi_magicnum)); - ASSERT(XFS_AGI_GOOD_VERSION(be32_to_cpu(agip->agi_versionnum))); - ASSERT(be32_to_cpu(agip->agi_seqno) == agno); + error = xfs_read_agi(mp, NULL, agno, &agibp); + if (error) { + xfs_fs_cmn_err(CE_ALERT, mp, + "xlog_recover_check_summary(agi)" + "agi read failed agno %d error %d", + agno, error); + } else { + agip = XFS_BUF_TO_AGI(agibp); - itotal += be32_to_cpu(agip->agi_count); - ifree += be32_to_cpu(agip->agi_freecount); - xfs_buf_relse(agibp); + itotal += be32_to_cpu(agip->agi_count); + ifree += be32_to_cpu(agip->agi_freecount); + xfs_buf_relse(agibp); + } } sbbp = xfs_getsb(mp, 0); From owner-xfs@oss.sgi.com Wed Jul 23 12:55:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 12:55:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NJtPYq014274 for ; Wed, 23 Jul 2008 12:55:25 -0700 X-ASG-Debug-ID: 1216842993-2874019f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C913D31C14B for ; Wed, 23 Jul 2008 12:56:34 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 2knIDgZEtBfoeOvB for ; Wed, 23 Jul 2008 12:56:34 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NJuONg006983 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 21:56:24 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NJuOjb006981 for xfs@oss.sgi.com; Wed, 23 Jul 2008 21:56:24 +0200 Date: Wed, 23 Jul 2008 21:56:24 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 2/2] factor out xfs_read_agf helper Subject: [PATCH 2/2] factor out xfs_read_agf helper Message-ID: <20080723195624.GE6645@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216842995 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17086 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Add a helper to read the AGF header and perform basic verification. Based on hunks from a larger patch from Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_ag.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ag.h 2008-07-23 14:58:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ag.h 2008-07-23 14:58:13.000000000 +0200 @@ -91,6 +91,8 @@ typedef struct xfs_agf { #define XFS_AGF_BLOCK(mp) XFS_HDR_BLOCK(mp, XFS_AGF_DADDR(mp)) #define XFS_BUF_TO_AGF(bp) ((xfs_agf_t *)XFS_BUF_PTR(bp)) +extern int xfs_read_agf(struct xfs_mount *mp, struct xfs_trans *tp, + xfs_agnumber_t agno, int flags, struct xfs_buf **bpp); /* * Size of the unlinked inode hash table in the agi. Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-23 14:58:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-23 14:58:13.000000000 +0200 @@ -2150,51 +2150,77 @@ xfs_alloc_put_freelist( * Read in the allocation group header (free/alloc section). */ int /* error */ -xfs_alloc_read_agf( - xfs_mount_t *mp, /* mount point structure */ - xfs_trans_t *tp, /* transaction pointer */ - xfs_agnumber_t agno, /* allocation group number */ - int flags, /* XFS_ALLOC_FLAG_... */ - xfs_buf_t **bpp) /* buffer for the ag freelist header */ +xfs_read_agf( + struct xfs_mount *mp, /* mount point structure */ + struct xfs_trans *tp, /* transaction pointer */ + xfs_agnumber_t agno, /* allocation group number */ + int flags, /* XFS_BUF_ */ + struct xfs_buf **bpp) /* buffer for the ag freelist header */ { - xfs_agf_t *agf; /* ag freelist header */ + struct xfs_agf *agf; /* ag freelist header */ int agf_ok; /* set if agf is consistent */ - xfs_buf_t *bp; /* return value */ - xfs_perag_t *pag; /* per allocation group data */ int error; ASSERT(agno != NULLAGNUMBER); error = xfs_trans_read_buf( mp, tp, mp->m_ddev_targp, XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)), - XFS_FSS_TO_BB(mp, 1), - (flags & XFS_ALLOC_FLAG_TRYLOCK) ? XFS_BUF_TRYLOCK : 0U, - &bp); + XFS_FSS_TO_BB(mp, 1), flags, bpp); if (error) return error; - ASSERT(!bp || !XFS_BUF_GETERROR(bp)); - if (!bp) { - *bpp = NULL; + if (!*bpp) return 0; - } + + ASSERT(!XFS_BUF_GETERROR(*bpp)); + agf = XFS_BUF_TO_AGF(*bpp); + /* * Validate the magic number of the agf block. */ - agf = XFS_BUF_TO_AGF(bp); agf_ok = be32_to_cpu(agf->agf_magicnum) == XFS_AGF_MAGIC && XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum)) && be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length) && be32_to_cpu(agf->agf_flfirst) < XFS_AGFL_SIZE(mp) && be32_to_cpu(agf->agf_fllast) < XFS_AGFL_SIZE(mp) && - be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp); + be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp) && + be32_to_cpu(agf->agf_seqno) == agno; if (unlikely(XFS_TEST_ERROR(!agf_ok, mp, XFS_ERRTAG_ALLOC_READ_AGF, XFS_RANDOM_ALLOC_READ_AGF))) { XFS_CORRUPTION_ERROR("xfs_alloc_read_agf", XFS_ERRLEVEL_LOW, mp, agf); - xfs_trans_brelse(tp, bp); + xfs_trans_brelse(tp, *bpp); return XFS_ERROR(EFSCORRUPTED); } + + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_AGF, XFS_AGF_REF); + return 0; +} + +/* + * Read in the allocation group header (free/alloc section). + */ +int /* error */ +xfs_alloc_read_agf( + struct xfs_mount *mp, /* mount point structure */ + struct xfs_trans *tp, /* transaction pointer */ + xfs_agnumber_t agno, /* allocation group number */ + int flags, /* XFS_ALLOC_FLAG_... */ + struct xfs_buf **bpp) /* buffer for the ag freelist header */ +{ + struct xfs_agf *agf; /* ag freelist header */ + struct xfs_perag *pag; /* per allocation group data */ + int error; + + ASSERT(agno != NULLAGNUMBER); + + error = xfs_read_agf(mp, tp, agno, + (flags & XFS_ALLOC_FLAG_TRYLOCK) ? XFS_BUF_TRYLOCK : 0, + bpp); + ASSERT(!*bpp || !XFS_BUF_GETERROR(*bpp)); + if (!*bpp) + return 0; + agf = XFS_BUF_TO_AGF(*bpp); pag = &mp->m_perag[agno]; if (!pag->pagf_init) { pag->pagf_freeblks = be32_to_cpu(agf->agf_freeblks); @@ -2221,8 +2247,6 @@ xfs_alloc_read_agf( be32_to_cpu(agf->agf_levels[XFS_BTNUM_CNTi])); } #endif - XFS_BUF_SET_VTYPE_REF(bp, B_FS_AGF, XFS_AGF_REF); - *bpp = bp; return 0; } Index: linux-2.6-xfs/fs/xfs/xfs_log_recover.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log_recover.c 2008-07-23 14:58:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log_recover.c 2008-07-23 14:59:05.000000000 +0200 @@ -4001,7 +4001,6 @@ xlog_recover_check_summary( xfs_agi_t *agip; xfs_buf_t *agfbp; xfs_buf_t *agibp; - xfs_daddr_t agfdaddr; xfs_buf_t *sbbp; #ifdef XFS_LOUD_RECOVERY xfs_sb_t *sbp; @@ -4018,21 +4017,18 @@ xlog_recover_check_summary( itotal = 0LL; ifree = 0LL; for (agno = 0; agno < mp->m_sb.sb_agcount; agno++) { - agfdaddr = XFS_AG_DADDR(mp, agno, XFS_AGF_DADDR(mp)); - agfbp = xfs_buf_read(mp->m_ddev_targp, agfdaddr, - XFS_FSS_TO_BB(mp, 1), 0); - if (XFS_BUF_ISERROR(agfbp)) { - xfs_ioerror_alert("xlog_recover_check_summary(agf)", - mp, agfbp, agfdaddr); + error = xfs_read_agf(mp, NULL, agno, 0, &agfbp); + if (error) { + xfs_fs_cmn_err(CE_ALERT, mp, + "xlog_recover_check_summary(agf)" + "agf read failed agno %d error %d", + agno, error); + } else { + agfp = XFS_BUF_TO_AGF(agfbp); + freeblks += be32_to_cpu(agfp->agf_freeblks) + + be32_to_cpu(agfp->agf_flcount); + xfs_buf_relse(agfbp); } - agfp = XFS_BUF_TO_AGF(agfbp); - ASSERT(XFS_AGF_MAGIC == be32_to_cpu(agfp->agf_magicnum)); - ASSERT(XFS_AGF_GOOD_VERSION(be32_to_cpu(agfp->agf_versionnum))); - ASSERT(be32_to_cpu(agfp->agf_seqno) == agno); - - freeblks += be32_to_cpu(agfp->agf_freeblks) + - be32_to_cpu(agfp->agf_flcount); - xfs_buf_relse(agfbp); error = xfs_read_agi(mp, NULL, agno, &agibp); if (error) { From owner-xfs@oss.sgi.com Wed Jul 23 13:07:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:07:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK7EbF015417 for ; Wed, 23 Jul 2008 13:07:15 -0700 X-ASG-Debug-ID: 1216843704-1482037c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F0B2D31C26C for ; Wed, 23 Jul 2008 13:08:24 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Aozsi4BGBMxdRcyb for ; Wed, 23 Jul 2008 13:08:24 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8ENg007416 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:15 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8ERD007414 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:14 +0200 Date: Wed, 23 Jul 2008 22:08:14 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 00/15] Btree cleanups and unification Subject: [PATCH 00/15] Btree cleanups and unification Message-ID: <20080723200814.GA7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843705 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17087 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs I've started reviewing and reshuffling the common btree implementations from Dave. This patch series is a status of the patches I have run successfully through XFSQA so far. All the really hairy operations are still missing, but I'm interested in some feedback on the approach. Patches 1 and 2 are rather trivial cleanups that could probably be applied ASAP. -- From owner-xfs@oss.sgi.com Wed Jul 23 13:07:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:07:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK7KWT015445 for ; Wed, 23 Jul 2008 13:07:21 -0700 X-ASG-Debug-ID: 1216843709-584d03500000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 60F05E8E5DF for ; Wed, 23 Jul 2008 13:08:30 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id bizUDCjcyDDRyy0m for ; Wed, 23 Jul 2008 13:08:30 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8KNg007430 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:20 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8KLV007428 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:20 +0200 Date: Wed, 23 Jul 2008 22:08:20 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 01/15] small cleanups in xfs_btree.c Subject: [PATCH 01/15] small cleanups in xfs_btree.c Message-ID: <20080723200820.GB7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-cleanup User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843711 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.659 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17088 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs - remove unneeded xfs_btree_get_block forward declaration - move xfs_btree_firstrec next to xfs_btree_lastrec Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-06 16:08:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-06 16:12:13.000000000 +0200 @@ -46,38 +46,11 @@ kmem_zone_t *xfs_btree_cur_zone; /* * Btree magic numbers. */ -const __uint32_t xfs_magics[XFS_BTNUM_MAX] = -{ +const __uint32_t xfs_magics[XFS_BTNUM_MAX] = { XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, XFS_BMAP_MAGIC, XFS_IBT_MAGIC }; /* - * Prototypes for internal routines. - */ - -/* - * Checking routine: return maxrecs for the block. - */ -STATIC int /* number of records fitting in block */ -xfs_btree_maxrecs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block);/* generic btree block pointer */ - -/* - * Internal routines. - */ - -/* - * Retrieve the block pointer from the cursor at the given level. - * This may be a bmap btree root or from a buffer. - */ -STATIC xfs_btree_block_t * /* generic btree block pointer */ -xfs_btree_get_block( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree */ - struct xfs_buf **bpp); /* buffer containing the block */ - -/* * Checking routine: return maxrecs for the block. */ STATIC int /* number of records fitting in block */ @@ -457,35 +430,6 @@ xfs_btree_dup_cursor( } /* - * Change the cursor to point to the first record at the given level. - * Other levels are unaffected. - */ -int /* success=1, failure=0 */ -xfs_btree_firstrec( - xfs_btree_cur_t *cur, /* btree cursor */ - int level) /* level to change */ -{ - xfs_btree_block_t *block; /* generic btree block pointer */ - xfs_buf_t *bp; /* buffer containing block */ - - /* - * Get the block pointer for this level. - */ - block = xfs_btree_get_block(cur, level, &bp); - xfs_btree_check_block(cur, block, level, bp); - /* - * It's empty, there is no such record. - */ - if (!block->bb_h.bb_numrecs) - return 0; - /* - * Set the ptr value to 1, that's the first record/key. - */ - cur->bc_ptrs[level] = 1; - return 1; -} - -/* * Retrieve the block pointer from the cursor at the given level. * This may be a bmap btree root or from a buffer. */ @@ -671,6 +615,35 @@ xfs_btree_islastblock( } /* + * Change the cursor to point to the first record at the given level. + * Other levels are unaffected. + */ +int /* success=1, failure=0 */ +xfs_btree_firstrec( + xfs_btree_cur_t *cur, /* btree cursor */ + int level) /* level to change */ +{ + xfs_btree_block_t *block; /* generic btree block pointer */ + xfs_buf_t *bp; /* buffer containing block */ + + /* + * Get the block pointer for this level. + */ + block = xfs_btree_get_block(cur, level, &bp); + xfs_btree_check_block(cur, block, level, bp); + /* + * It's empty, there is no such record. + */ + if (!block->bb_h.bb_numrecs) + return 0; + /* + * Set the ptr value to 1, that's the first record/key. + */ + cur->bc_ptrs[level] = 1; + return 1; +} + +/* * Change the cursor to point to the last record in the current block * at the given level. Other levels are unaffected. */ -- From owner-xfs@oss.sgi.com Wed Jul 23 13:07:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:07:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42, J_CHICKENPOX_43,J_CHICKENPOX_44,J_CHICKENPOX_45,J_CHICKENPOX_46, J_CHICKENPOX_47,J_CHICKENPOX_48,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK7QhV015503 for ; Wed, 23 Jul 2008 13:07:28 -0700 X-ASG-Debug-ID: 1216843715-2c4e02110000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C1E7C1B3ED41 for ; Wed, 23 Jul 2008 13:08:35 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 4vk7ZvOpByd9Y4WD for ; Wed, 23 Jul 2008 13:08:35 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8QNg007445 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:26 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8Q6S007443 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:26 +0200 Date: Wed, 23 Jul 2008 22:08:26 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 02/15] use the same btree_cur union member for alloc and inobt trees Subject: [PATCH 02/15] use the same btree_cur union member for alloc and inobt trees Message-ID: <20080723200826.GC7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-cur-unification User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843716 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17089 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs The alloc and inobt btree use the same agbp/agno pair in the btree_cur union. Make them use the same bc_private.a union member so that code for these two short form btree implementations can be shared. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-16 03:02:04.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-16 03:24:19.000000000 +0200 @@ -158,8 +158,8 @@ typedef struct xfs_btree_cur __uint8_t bc_blocklog; /* log2(blocksize) of btree blocks */ xfs_btnum_t bc_btnum; /* identifies which btree type */ union { - struct { /* needed for BNO, CNT */ - struct xfs_buf *agbp; /* agf buffer pointer */ + struct { /* needed for BNO, CNT, INO */ + struct xfs_buf *agbp; /* agf/agi buffer pointer */ xfs_agnumber_t agno; /* ag number */ } a; struct { /* needed for BMAP */ @@ -172,10 +172,6 @@ typedef struct xfs_btree_cur char flags; /* flags */ #define XFS_BTCUR_BPRV_WASDEL 1 /* was delayed */ } b; - struct { /* needed for INO */ - struct xfs_buf *agbp; /* agi buffer pointer */ - xfs_agnumber_t agno; /* ag number */ - } i; } bc_private; /* per-btree type data */ } xfs_btree_cur_t; Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-16 03:24:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-16 03:24:19.000000000 +0200 @@ -570,6 +570,13 @@ xfs_btree_init_cursor( cur->bc_private.a.agbp = agbp; cur->bc_private.a.agno = agno; break; + case XFS_BTNUM_INO: + /* + * Inode allocation btree fields. + */ + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + break; case XFS_BTNUM_BMAP: /* * Bmap btree fields. @@ -582,13 +589,6 @@ xfs_btree_init_cursor( cur->bc_private.b.flags = 0; cur->bc_private.b.whichfork = whichfork; break; - case XFS_BTNUM_INO: - /* - * Inode allocation btree fields. - */ - cur->bc_private.i.agbp = agbp; - cur->bc_private.i.agno = agno; - break; default: ASSERT(0); } @@ -863,12 +863,12 @@ xfs_btree_readahead_core( case XFS_BTNUM_INO: i = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[lev]); if ((lr & XFS_BTCUR_LEFTRA) && be32_to_cpu(i->bb_leftsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.i.agno, + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, be32_to_cpu(i->bb_leftsib), 1); rval++; } if ((lr & XFS_BTCUR_RIGHTRA) && be32_to_cpu(i->bb_rightsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.i.agno, + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, be32_to_cpu(i->bb_rightsib), 1); rval++; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-16 03:02:04.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-16 03:24:19.000000000 +0200 @@ -181,7 +181,7 @@ xfs_inobt_delrec( * then we can get rid of this level. */ if (numrecs == 1 && level > 0) { - agbp = cur->bc_private.i.agbp; + agbp = cur->bc_private.a.agbp; agi = XFS_BUF_TO_AGI(agbp); /* * pp is still set to the first pointer in the block. @@ -194,7 +194,7 @@ xfs_inobt_delrec( * Free the block. */ if ((error = xfs_free_extent(cur->bc_tp, - XFS_AGB_TO_FSB(mp, cur->bc_private.i.agno, bno), 1))) + XFS_AGB_TO_FSB(mp, cur->bc_private.a.agno, bno), 1))) return error; xfs_trans_binval(cur->bc_tp, bp); xfs_ialloc_log_agi(cur->bc_tp, agbp, @@ -379,7 +379,7 @@ xfs_inobt_delrec( rrecs = be16_to_cpu(right->bb_numrecs); rbp = bp; if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.i.agno, lbno, 0, &lbp, + cur->bc_private.a.agno, lbno, 0, &lbp, XFS_INO_BTREE_REF))) return error; left = XFS_BUF_TO_INOBT_BLOCK(lbp); @@ -401,7 +401,7 @@ xfs_inobt_delrec( lrecs = be16_to_cpu(left->bb_numrecs); lbp = bp; if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.i.agno, rbno, 0, &rbp, + cur->bc_private.a.agno, rbno, 0, &rbp, XFS_INO_BTREE_REF))) return error; right = XFS_BUF_TO_INOBT_BLOCK(rbp); @@ -484,7 +484,7 @@ xfs_inobt_delrec( xfs_buf_t *rrbp; if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.i.agno, be32_to_cpu(left->bb_rightsib), 0, + cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), 0, &rrbp, XFS_INO_BTREE_REF))) return error; rrblock = XFS_BUF_TO_INOBT_BLOCK(rrbp); @@ -497,7 +497,7 @@ xfs_inobt_delrec( * Free the deleting block. */ if ((error = xfs_free_extent(cur->bc_tp, XFS_AGB_TO_FSB(mp, - cur->bc_private.i.agno, rbno), 1))) + cur->bc_private.a.agno, rbno), 1))) return error; xfs_trans_binval(cur->bc_tp, rbp); /* @@ -854,7 +854,7 @@ xfs_inobt_lookup( { xfs_agi_t *agi; /* a.g. inode header */ - agi = XFS_BUF_TO_AGI(cur->bc_private.i.agbp); + agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); agno = be32_to_cpu(agi->agi_seqno); agbno = be32_to_cpu(agi->agi_root); } @@ -1089,7 +1089,7 @@ xfs_inobt_lshift( * Set up the left neighbor as "left". */ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.i.agno, be32_to_cpu(right->bb_leftsib), + cur->bc_private.a.agno, be32_to_cpu(right->bb_leftsib), 0, &lbp, XFS_INO_BTREE_REF))) return error; left = XFS_BUF_TO_INOBT_BLOCK(lbp); @@ -1207,10 +1207,10 @@ xfs_inobt_newroot( /* * Get a block & a buffer. */ - agi = XFS_BUF_TO_AGI(cur->bc_private.i.agbp); + agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); args.tp = cur->bc_tp; args.mp = cur->bc_mp; - args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.i.agno, + args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, be32_to_cpu(agi->agi_root)); args.mod = args.minleft = args.alignment = args.total = args.wasdel = args.isfl = args.userdata = args.minalignslop = 0; @@ -1233,7 +1233,7 @@ xfs_inobt_newroot( */ agi->agi_root = cpu_to_be32(args.agbno); be32_add(&agi->agi_level, 1); - xfs_ialloc_log_agi(args.tp, cur->bc_private.i.agbp, + xfs_ialloc_log_agi(args.tp, cur->bc_private.a.agbp, XFS_AGI_ROOT | XFS_AGI_LEVEL); /* * At the previous root level there are now two blocks: the old @@ -1376,7 +1376,7 @@ xfs_inobt_rshift( * Set up the right neighbor as "right". */ if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.i.agno, be32_to_cpu(left->bb_rightsib), + cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), 0, &rbp, XFS_INO_BTREE_REF))) return error; right = XFS_BUF_TO_INOBT_BLOCK(rbp); @@ -1492,7 +1492,7 @@ xfs_inobt_split( * Allocate the new block. * If we can't do it, we're toast. Give up. */ - args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.i.agno, lbno); + args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, lbno); args.mod = args.minleft = args.alignment = args.total = args.wasdel = args.isfl = args.userdata = args.minalignslop = 0; args.minlen = args.maxlen = args.prod = 1; @@ -1725,7 +1725,7 @@ xfs_inobt_decrement( agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.i.agno, agbno, 0, &bp, + cur->bc_private.a.agno, agbno, 0, &bp, XFS_INO_BTREE_REF))) return error; lev--; @@ -1897,7 +1897,7 @@ xfs_inobt_increment( agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.i.agno, agbno, 0, &bp, + cur->bc_private.a.agno, agbno, 0, &bp, XFS_INO_BTREE_REF))) return error; lev--; Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-16 03:29:49.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-16 03:30:17.000000000 +0200 @@ -4579,10 +4579,6 @@ xfsidbg_xbtcur(xfs_btree_cur_t *c) xfs_fmtfsblock(c->bc_private.b.firstblock, c->bc_mp), c->bc_private.b.flist, c->bc_private.b.allocated); - } else if (c->bc_btnum == XFS_BTNUM_INO) { - kdb_printf("private agbp 0x%p agno 0x%x\n", - c->bc_private.i.agbp, - c->bc_private.i.agno); } else { kdb_printf("private agbp 0x%p agno 0x%x\n", c->bc_private.a.agbp, -- From owner-xfs@oss.sgi.com Wed Jul 23 13:07:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:07:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK7aCB015644 for ; Wed, 23 Jul 2008 13:07:36 -0700 X-ASG-Debug-ID: 1216843724-1cbe03060000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 111E31B3ED43 for ; Wed, 23 Jul 2008 13:08:45 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id zJxsRedQ1bmuA8oB for ; Wed, 23 Jul 2008 13:08:45 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8ZNg007461 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:35 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8ZBG007459 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:35 +0200 Date: Wed, 23 Jul 2008 22:08:35 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 03/15] split up xfs_btree_init_cursor Subject: [PATCH 03/15] split up xfs_btree_init_cursor Message-ID: <20080723200835.GD7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-split-init-cursor User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843726 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17090 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs xfs_btree_init_cursor contains close to little shared code for the different btrees and will get even more non-common code in the future. Split it up into one routine per btree type. Because xfs_btree_dup_cursor needs to call the init routine for a generic btree cursor add a new btree operation vector that contains a dup_cursor method that initializes a new cursor based on an existing one. The btree operations vector is based on an idea and code from Dave Chinner and will be used for more operations later on. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -136,6 +136,11 @@ extern const __uint32_t xfs_magics[]; #define XFS_BTREE_MAXLEVELS 8 /* max of all btrees */ +struct xfs_btree_ops { + /* cursor operations */ + struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); +}; + /* * Btree cursor structure. * This collects all information needed by the btree code in one place. @@ -144,6 +149,7 @@ typedef struct xfs_btree_cur { struct xfs_trans *bc_tp; /* transaction we're in, if any */ struct xfs_mount *bc_mp; /* file system mount struct */ + const struct xfs_btree_ops *bc_ops; union { xfs_alloc_rec_incore_t a; xfs_bmbt_irec_t b; @@ -313,20 +319,6 @@ xfs_btree_get_bufs( uint lock); /* lock flags for get_buf */ /* - * Allocate a new btree cursor. - * The cursor is either for allocation (A) or bmap (B). - */ -xfs_btree_cur_t * /* new btree cursor */ -xfs_btree_init_cursor( - struct xfs_mount *mp, /* file system mount point */ - struct xfs_trans *tp, /* transaction pointer */ - struct xfs_buf *agbp, /* (A only) buffer for agf structure */ - xfs_agnumber_t agno, /* (A only) allocation group number */ - xfs_btnum_t btnum, /* btree identifier */ - struct xfs_inode *ip, /* (B only) inode owning the btree */ - int whichfork); /* (B only) data/attr fork */ - -/* * Check for the cursor referring to the last block at the given level. */ int /* 1=is last block, 0=not last block */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -387,16 +387,17 @@ xfs_btree_dup_cursor( tp = cur->bc_tp; mp = cur->bc_mp; + /* * Allocate a new cursor like the old one. */ - new = xfs_btree_init_cursor(mp, tp, cur->bc_private.a.agbp, - cur->bc_private.a.agno, cur->bc_btnum, cur->bc_private.b.ip, - cur->bc_private.b.whichfork); + new = cur->bc_ops->dup_cursor(cur); + /* * Copy the record currently in the cursor. */ new->bc_rec = cur->bc_rec; + /* * For each level current, re-get the buffer and copy the ptr value. */ @@ -416,15 +417,6 @@ xfs_btree_dup_cursor( } else new->bc_bufs[i] = NULL; } - /* - * For bmap btrees, copy the firstblock, flist, and flags values, - * since init cursor doesn't get them. - */ - if (new->bc_btnum == XFS_BTNUM_BMAP) { - new->bc_private.b.firstblock = cur->bc_private.b.firstblock; - new->bc_private.b.flist = cur->bc_private.b.flist; - new->bc_private.b.flags = cur->bc_private.b.flags; - } *ncur = new; return 0; } @@ -505,97 +497,6 @@ xfs_btree_get_bufs( } /* - * Allocate a new btree cursor. - * The cursor is either for allocation (A) or bmap (B) or inodes (I). - */ -xfs_btree_cur_t * /* new btree cursor */ -xfs_btree_init_cursor( - xfs_mount_t *mp, /* file system mount point */ - xfs_trans_t *tp, /* transaction pointer */ - xfs_buf_t *agbp, /* (A only) buffer for agf structure */ - /* (I only) buffer for agi structure */ - xfs_agnumber_t agno, /* (AI only) allocation group number */ - xfs_btnum_t btnum, /* btree identifier */ - xfs_inode_t *ip, /* (B only) inode owning the btree */ - int whichfork) /* (B only) data or attr fork */ -{ - xfs_agf_t *agf; /* (A) allocation group freespace */ - xfs_agi_t *agi; /* (I) allocation group inodespace */ - xfs_btree_cur_t *cur; /* return value */ - xfs_ifork_t *ifp; /* (I) inode fork pointer */ - int nlevels=0; /* number of levels in the btree */ - - ASSERT(xfs_btree_cur_zone != NULL); - /* - * Allocate a new cursor. - */ - cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); - /* - * Deduce the number of btree levels from the arguments. - */ - switch (btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - agf = XFS_BUF_TO_AGF(agbp); - nlevels = be32_to_cpu(agf->agf_levels[btnum]); - break; - case XFS_BTNUM_BMAP: - ifp = XFS_IFORK_PTR(ip, whichfork); - nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; - break; - case XFS_BTNUM_INO: - agi = XFS_BUF_TO_AGI(agbp); - nlevels = be32_to_cpu(agi->agi_level); - break; - default: - ASSERT(0); - } - /* - * Fill in the common fields. - */ - cur->bc_tp = tp; - cur->bc_mp = mp; - cur->bc_nlevels = nlevels; - cur->bc_btnum = btnum; - cur->bc_blocklog = mp->m_sb.sb_blocklog; - /* - * Fill in private fields. - */ - switch (btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - /* - * Allocation btree fields. - */ - cur->bc_private.a.agbp = agbp; - cur->bc_private.a.agno = agno; - break; - case XFS_BTNUM_INO: - /* - * Inode allocation btree fields. - */ - cur->bc_private.a.agbp = agbp; - cur->bc_private.a.agno = agno; - break; - case XFS_BTNUM_BMAP: - /* - * Bmap btree fields. - */ - cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); - cur->bc_private.b.ip = ip; - cur->bc_private.b.firstblock = NULLFSBLOCK; - cur->bc_private.b.flist = NULL; - cur->bc_private.b.allocated = 0; - cur->bc_private.b.flags = 0; - cur->bc_private.b.whichfork = whichfork; - break; - default: - ASSERT(0); - } - return cur; -} - -/* * Check for the cursor referring to the last block at the given level. */ int /* 1=is last block, 0=not last block */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -2608,3 +2608,62 @@ xfs_check_nostate_extents( } return 0; } + + +STATIC struct xfs_btree_cur * +xfs_bmbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + struct xfs_btree_cur *new; + + new = xfs_bmbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.b.ip, cur->bc_private.b.whichfork); + + /* + * Copy the firstblock, flist, and flags values, + * since init cursor doesn't get them. + */ + new->bc_private.b.firstblock = cur->bc_private.b.firstblock; + new->bc_private.b.flist = cur->bc_private.b.flist; + new->bc_private.b.flags = cur->bc_private.b.flags; + + return new; +} + +static const struct xfs_btree_ops xfs_bmbt_ops = { + .dup_cursor = xfs_bmbt_dup_cursor, +}; + +/* + * Allocate a new bmap btree cursor. + */ +struct xfs_btree_cur * /* new bmap btree cursor */ +xfs_bmbt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_inode *ip, /* inode owning the btree */ + int whichfork) /* data or attr fork */ +{ + struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); + struct xfs_btree_cur *cur; + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; + cur->bc_btnum = XFS_BTNUM_BMAP; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_bmbt_ops; + + cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); + cur->bc_private.b.ip = ip; + cur->bc_private.b.firstblock = NULLFSBLOCK; + cur->bc_private.b.flist = NULL; + cur->bc_private.b.allocated = 0; + cur->bc_private.b.flags = 0; + cur->bc_private.b.whichfork = whichfork; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -2076,3 +2076,44 @@ xfs_inobt_update( } return 0; } + +STATIC struct xfs_btree_cur * +xfs_inobt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno); +} + +static const struct xfs_btree_ops xfs_inobt_ops = { + .dup_cursor = xfs_inobt_dup_cursor, +}; + +/* + * Allocate a new inode btree cursor. + */ +struct xfs_btree_cur * /* new inode btree cursor */ +xfs_inobt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_buf *agbp, /* buffer for agi structure */ + xfs_agnumber_t agno) /* allocation group number */ +{ + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); + struct xfs_btree_cur *cur; + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be32_to_cpu(agi->agi_level); + cur->bc_btnum = XFS_BTNUM_INO; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_inobt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-14 17:26:11.000000000 +0200 @@ -640,8 +640,8 @@ xfs_alloc_ag_vextent_exact( /* * Allocate/initialize a cursor for the by-number freespace btree. */ - bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); /* * Lookup bno and minlen in the btree (minlen is irrelevant, really). * Look for the closest free block <= bno, it must contain bno @@ -696,8 +696,8 @@ xfs_alloc_ag_vextent_exact( * We are allocating agbno for rlen [agbno .. end] * Allocate/initialize a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); ASSERT(args->agbno + args->len <= be32_to_cpu(XFS_BUF_TO_AGF(args->agbp)->agf_length)); if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, @@ -759,8 +759,8 @@ xfs_alloc_ag_vextent_near( /* * Get a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); ltlen = 0; bno_cur_lt = bno_cur_gt = NULL; /* @@ -886,8 +886,8 @@ xfs_alloc_ag_vextent_near( /* * Set up a cursor for the by-bno tree. */ - bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, - args->agbp, args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur_lt = xfs_allocbt_init_cursor(args->mp, args->tp, + args->agbp, args->agno, XFS_BTNUM_BNO); /* * Fix up the btree entries. */ @@ -914,8 +914,8 @@ xfs_alloc_ag_vextent_near( /* * Allocate and initialize the cursor for the leftward search. */ - bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur_lt = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); /* * Lookup <= bno to find the leftward search's starting point. */ @@ -1267,8 +1267,8 @@ xfs_alloc_ag_vextent_size( /* * Allocate and initialize a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); bno_cur = NULL; /* * Look for an entry >= maxlen+alignment-1 blocks. @@ -1372,8 +1372,8 @@ xfs_alloc_ag_vextent_size( /* * Allocate and initialize a cursor for the by-block tree. */ - bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, rbno, rlen, XFSA_FIXUP_CNT_OK))) goto error0; @@ -1515,8 +1515,7 @@ xfs_free_ag_extent( /* * Allocate and initialize a cursor for the by-block btree. */ - bno_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO, NULL, - 0); + bno_cur = xfs_allocbt_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO); cnt_cur = NULL; /* * Look for a neighboring block on the left (lower block numbers) @@ -1575,8 +1574,7 @@ xfs_free_ag_extent( /* * Now allocate and initialize a cursor for the by-size tree. */ - cnt_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT, NULL, - 0); + cnt_cur = xfs_allocbt_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT); /* * Have both left and right contiguous neighbors. * Merge all three into a single free block. Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -2209,3 +2209,48 @@ xfs_alloc_update( } return 0; } + +STATIC struct xfs_btree_cur * +xfs_allocbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno, + cur->bc_btnum); +} + +static const struct xfs_btree_ops xfs_allocbt_ops = { + .dup_cursor = xfs_allocbt_dup_cursor, +}; + +/* + * Allocate a new allocation btree cursor. + */ +struct xfs_btree_cur * /* new alloc btree cursor */ +xfs_allocbt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_buf *agbp, /* buffer for agf structure */ + xfs_agnumber_t agno, /* allocation group number */ + xfs_btnum_t btnum) /* btree identifier */ +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + struct xfs_btree_cur *cur; + + ASSERT(btnum == XFS_BTNUM_BNO || btnum == XFS_BTNUM_CNT); + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be32_to_cpu(agf->agf_levels[btnum]); + cur->bc_btnum = btnum; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_allocbt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -152,4 +152,9 @@ extern int xfs_alloc_lookup_le(struct xf extern int xfs_alloc_update(struct xfs_btree_cur *cur, xfs_agblock_t bno, xfs_extlen_t len); + +extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_buf *, + xfs_agnumber_t, xfs_btnum_t); + #endif /* __XFS_ALLOC_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-14 17:26:11.000000000 +0200 @@ -422,8 +422,7 @@ xfs_bmap_add_attrfork_btree( if (ip->i_df.if_broot_bytes <= XFS_IFORK_DSIZE(ip)) *flags |= XFS_ILOG_DBROOT; else { - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - XFS_DATA_FORK); + cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK); cur->bc_private.b.flist = flist; cur->bc_private.b.firstblock = *firstblock; if ((error = xfs_bmbt_lookup_ge(cur, 0, 0, 0, &stat))) @@ -3441,8 +3440,7 @@ xfs_bmap_extents_to_btree( * Need a cursor. Can't allocate until bb_level is filled in. */ mp = ip->i_mount; - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - whichfork); + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; cur->bc_private.b.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0; @@ -5029,8 +5027,7 @@ xfs_bmapi( if (abno == NULLFSBLOCK) break; if ((ifp->if_flags & XFS_IFBROOT) && !cur) { - cur = xfs_btree_init_cursor(mp, - tp, NULL, 0, XFS_BTNUM_BMAP, + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; @@ -5147,9 +5144,8 @@ xfs_bmapi( */ ASSERT(mval->br_blockcount <= len); if ((ifp->if_flags & XFS_IFBROOT) && !cur) { - cur = xfs_btree_init_cursor(mp, - tp, NULL, 0, XFS_BTNUM_BMAP, - ip, whichfork); + cur = xfs_bmbt_init_cursor(mp, + tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; @@ -5440,8 +5436,7 @@ xfs_bunmapi( logflags = 0; if (ifp->if_flags & XFS_IFBROOT) { ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - whichfork); + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; cur->bc_private.b.flags = 0; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -24,6 +24,7 @@ struct xfs_btree_cur; struct xfs_btree_lblock; struct xfs_mount; struct xfs_inode; +struct xfs_trans; /* * Bmap root header, on-disk form only. @@ -300,6 +301,9 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_bl extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); +extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_inode *, int); + #endif /* __KERNEL__ */ #endif /* __XFS_BMAP_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-14 17:26:11.000000000 +0200 @@ -335,8 +335,7 @@ xfs_ialloc_ag_alloc( /* * Insert records describing the new inode chunk into the btree. */ - cur = xfs_btree_init_cursor(args.mp, tp, agbp, agno, - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(args.mp, tp, agbp, agno); for (thisino = newino; thisino < newino + newlen; thisino += XFS_INODES_PER_CHUNK) { @@ -676,8 +675,7 @@ nextag: */ agno = tagno; *IO_agbp = NULL; - cur = xfs_btree_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno), - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno)); /* * If pagino is 0 (this is the root inode allocation) use newino. * This must work because we've just allocated some. @@ -1022,8 +1020,7 @@ xfs_difree( /* * Initialize the cursor. */ - cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, agno); #ifdef DEBUG if (cur->bc_nlevels == 1) { int freecount = 0; @@ -1259,8 +1256,7 @@ xfs_dilocate( #endif /* DEBUG */ return error; } - cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, agno); if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i))) { #ifdef DEBUG xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: " Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -175,4 +175,8 @@ extern int xfs_inobt_lookup_le(struct xf extern int xfs_inobt_update(struct xfs_btree_cur *cur, xfs_agino_t ino, __int32_t fcnt, xfs_inofree_t free); + +extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); + #endif /* __XFS_IALLOC_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-14 17:26:11.000000000 +0200 @@ -418,8 +418,7 @@ xfs_bulkstat( /* * Allocate and initialize a btree cursor for ialloc btree. */ - cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); irbp = irbuf; irbufend = irbuf + nirbuf; end_of_ag = 0; @@ -844,8 +843,7 @@ xfs_inumbers( agino = 0; continue; } - cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp); if (error) { xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); -- From owner-xfs@oss.sgi.com Wed Jul 23 13:07:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:07:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK7flr015750 for ; Wed, 23 Jul 2008 13:07:41 -0700 X-ASG-Debug-ID: 1216843731-1728039f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 997D81B3ED45 for ; Wed, 23 Jul 2008 13:08:51 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id A25ZRE4rbZg0ZRUt for ; Wed, 23 Jul 2008 13:08:51 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8gNg007475 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:42 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8gfw007473 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:42 +0200 Date: Wed, 23 Jul 2008 22:08:42 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 04/15] add generic btree types Subject: [PATCH 04/15] add generic btree types Message-ID: <20080723200842.GE7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-add-generic-types User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843732 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17091 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Add generic union types for btree pointers, keys and records. The generic btree pointer contains a 32 and 64bit big endian type for short and long form btrees, and the key and record contain the relevant type for each possible btree. Split out from a bigger patch from Dave Chinner and simplified a little further. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 17:26:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 17:27:59.000000000 +0200 @@ -70,6 +70,12 @@ typedef struct xfs_btree_hdr __be16 bb_numrecs; /* current # of data records */ } xfs_btree_hdr_t; +/* + * Generic block, key, ptr and record wrapper structures + * These are disk format structures, and are converted where + * necessary be the btree specific code that needs to interpret + * them. + */ typedef struct xfs_btree_block { xfs_btree_hdr_t bb_h; /* header */ union { @@ -84,6 +90,25 @@ typedef struct xfs_btree_block { } bb_u; /* rest */ } xfs_btree_block_t; +union xfs_btree_ptr { + __be32 s; /* short form ptr */ + __be64 l; /* long form ptr */ +}; + +union xfs_btree_key { + xfs_bmbt_key_t bmbt; + xfs_bmdr_key_t bmbr; /* bmbt root block */ + xfs_alloc_key_t alloc; + xfs_inobt_key_t inobt; +}; + +union xfs_btree_rec { + xfs_bmbt_rec_t bmbt; + xfs_bmdr_rec_t bmbr; /* bmbt root block */ + xfs_alloc_rec_t alloc; + xfs_inobt_rec_t inobt; +}; + /* * For logging record fields. */ -- From owner-xfs@oss.sgi.com Wed Jul 23 13:07:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:07:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK7l7k015869 for ; Wed, 23 Jul 2008 13:07:48 -0700 X-ASG-Debug-ID: 1216843737-2c4e02140000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 85F3A1B3ED4B for ; Wed, 23 Jul 2008 13:08:57 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id WnArxj5x9WLgiyWs for ; Wed, 23 Jul 2008 13:08:57 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8mNg007488 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:48 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8miC007486 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:48 +0200 Date: Wed, 23 Jul 2008 22:08:48 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 05/15] make btree root in inode support generic Subject: [PATCH 05/15] make btree root in inode support generic Message-ID: <20080723200848.GF7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-generic-inode-root-support User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843738 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17092 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs The bmap btree is rooted in the inode and not in a single disk block. Make the support for this feature more generic by: (a) adding a btree flag to check for instead of the XFS_BTNUM_BMAP type (b) add a get_root_from_inode btree operation to get a btree block from the inode, with the implementation details left to the individual btree. Also clean up xfs_btree_get_block, which is the place these two features are used. The XFS_BTREE_ROOT_IN_INODE is based upon a patch from Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-08 20:05:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-08 20:41:49.000000000 +0200 @@ -2630,8 +2630,19 @@ xfs_bmbt_dup_cursor( return new; } +STATIC struct xfs_btree_block * +xfs_bmbt_get_root_from_inode( + struct xfs_btree_cur *cur) +{ + struct xfs_ifork *ifp; + + ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, cur->bc_private.b.whichfork); + return (struct xfs_btree_block *)ifp->if_broot; +} + static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, + .get_root_from_inode = xfs_bmbt_get_root_from_inode, }; /* @@ -2656,6 +2667,7 @@ xfs_bmbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_bmbt_ops; + cur->bc_flags = XFS_BTREE_ROOT_IN_INODE; cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); cur->bc_private.b.ip = ip; Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-08 20:05:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-08 20:42:43.000000000 +0200 @@ -425,29 +425,20 @@ xfs_btree_dup_cursor( * Retrieve the block pointer from the cursor at the given level. * This may be a bmap btree root or from a buffer. */ -STATIC xfs_btree_block_t * /* generic btree block pointer */ +STATIC struct xfs_btree_block * /* generic btree block pointer */ xfs_btree_get_block( - xfs_btree_cur_t *cur, /* btree cursor */ + struct xfs_btree_cur *cur, /* btree cursor */ int level, /* level in btree */ - xfs_buf_t **bpp) /* buffer containing the block */ + struct xfs_buf **bpp) /* buffer containing the block */ { - xfs_btree_block_t *block; /* return value */ - xfs_buf_t *bp; /* return buffer */ - xfs_ifork_t *ifp; /* inode fork pointer */ - int whichfork; /* data or attr fork */ - - if (cur->bc_btnum == XFS_BTNUM_BMAP && level == cur->bc_nlevels - 1) { - whichfork = cur->bc_private.b.whichfork; - ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, whichfork); - block = (xfs_btree_block_t *)ifp->if_broot; - bp = NULL; - } else { - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_BLOCK(bp); + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) { + *bpp = NULL; + return cur->bc_ops->get_root_from_inode(cur); } - ASSERT(block != NULL); - *bpp = bp; - return block; + + *bpp = cur->bc_bufs[level]; + return XFS_BUF_TO_BLOCK(*bpp); } /* Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-08 20:06:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-08 20:41:49.000000000 +0200 @@ -164,6 +164,9 @@ extern const __uint32_t xfs_magics[]; struct xfs_btree_ops { /* cursor operations */ struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); + + /* get inode rooted btree root */ + struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); }; /* @@ -175,6 +178,7 @@ typedef struct xfs_btree_cur struct xfs_trans *bc_tp; /* transaction we're in, if any */ struct xfs_mount *bc_mp; /* file system mount struct */ const struct xfs_btree_ops *bc_ops; + uint bc_flags; /* btree features - below */ union { xfs_alloc_rec_incore_t a; xfs_bmbt_irec_t b; @@ -206,6 +210,10 @@ typedef struct xfs_btree_cur } bc_private; /* per-btree type data */ } xfs_btree_cur_t; +/* cursor flags */ +#define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ + + #define XFS_BTREE_NOERROR 0 #define XFS_BTREE_ERROR 1 -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:01 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:08:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK7xWw016068 for ; Wed, 23 Jul 2008 13:08:01 -0700 X-ASG-Debug-ID: 1216843748-52e203920000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 96691E8E87B for ; Wed, 23 Jul 2008 13:09:09 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id oOlRyyA8KoznaftL for ; Wed, 23 Jul 2008 13:09:09 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8xNg007515 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:59 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8xIJ007513 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:59 +0200 Date: Wed, 23 Jul 2008 22:08:59 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 07/15] refactor xfs_btree_readahead Subject: [PATCH 07/15] refactor xfs_btree_readahead Message-ID: <20080723200859.GH7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-readahead-refactor User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843750 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.659 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17093 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Refactor xfs_btree_readahead to make it more readable: (a) remove the inline xfs_btree_readahead wrapper and move all checks out of line into the main routine. (b) factor out helpers for short/long form btrees (c) move check for root in inodes from the callers into xfs_btree_readahead [hch: split out from a big patch and minor cleanups] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-11 11:13:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-11 11:13:20.000000000 +0200 @@ -709,66 +709,84 @@ xfs_btree_reada_bufs( xfs_baread(mp->m_ddev_targp, d, mp->m_bsize * count); } +STATIC int +xfs_btree_reada_corel( + struct xfs_btree_cur *cur, + int lr, + struct xfs_btree_lblock *lb) +{ + int rval = 0; + xfs_fsblock_t left = be64_to_cpu(lb->bb_leftsib); + xfs_fsblock_t right = be64_to_cpu(lb->bb_rightsib); + + if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { + xfs_btree_reada_bufl(cur->bc_mp, left, 1); + rval++; + } + + if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLDFSBNO) { + xfs_btree_reada_bufl(cur->bc_mp, right, 1); + rval++; + } + + return rval; +} + +STATIC int +xfs_btree_reada_cores( + struct xfs_btree_cur *cur, + int lr, + struct xfs_btree_sblock *sb) +{ + int rval = 0; + xfs_agblock_t left = be32_to_cpu(sb->bb_leftsib); + xfs_agblock_t right = be32_to_cpu(sb->bb_rightsib); + + + if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) { + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, + left, 1); + rval++; + } + + if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) { + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, + right, 1); + rval++; + } + + return rval; +} + /* * Read-ahead btree blocks, at the given level. * Bits in lr are set from XFS_BTCUR_{LEFT,RIGHT}RA. */ int -xfs_btree_readahead_core( - xfs_btree_cur_t *cur, /* btree cursor */ +xfs_btree_readahead( + struct xfs_btree_cur *cur, /* btree cursor */ int lev, /* level in btree */ int lr) /* left/right bits */ { - xfs_alloc_block_t *a; - xfs_bmbt_block_t *b; - xfs_inobt_block_t *i; - int rval = 0; + struct xfs_buf *bp; + + /* + * No readahead needed if we are at the root level and the + * btree root is stored in the inode. + */ + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (lev == cur->bc_nlevels - 1)) + return 0; + + if ((cur->bc_ra[lev] | lr) == cur->bc_ra[lev]) + return 0; - ASSERT(cur->bc_bufs[lev] != NULL); cur->bc_ra[lev] |= lr; - switch (cur->bc_btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - a = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be32_to_cpu(a->bb_leftsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(a->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be32_to_cpu(a->bb_rightsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(a->bb_rightsib), 1); - rval++; - } - break; - case XFS_BTNUM_BMAP: - b = XFS_BUF_TO_BMBT_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be64_to_cpu(b->bb_leftsib) != NULLDFSBNO) { - xfs_btree_reada_bufl(cur->bc_mp, be64_to_cpu(b->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be64_to_cpu(b->bb_rightsib) != NULLDFSBNO) { - xfs_btree_reada_bufl(cur->bc_mp, be64_to_cpu(b->bb_rightsib), 1); - rval++; - } - break; - case XFS_BTNUM_INO: - i = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be32_to_cpu(i->bb_leftsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(i->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be32_to_cpu(i->bb_rightsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(i->bb_rightsib), 1); - rval++; - } - break; - default: - ASSERT(0); - } - return rval; + bp = cur->bc_bufs[lev]; + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + return xfs_btree_reada_corel(cur, lr, XFS_BUF_TO_LBLOCK(bp)); + return xfs_btree_reada_cores(cur, lr, XFS_BUF_TO_SBLOCK(bp)); } /* Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-11 11:13:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-11 11:13:20.000000000 +0200 @@ -429,23 +429,10 @@ xfs_btree_reada_bufs( * Bits in lr are set from XFS_BTCUR_{LEFT,RIGHT}RA. */ int /* readahead block count */ -xfs_btree_readahead_core( - xfs_btree_cur_t *cur, /* btree cursor */ - int lev, /* level in btree */ - int lr); /* left/right bits */ - -static inline int /* readahead block count */ xfs_btree_readahead( xfs_btree_cur_t *cur, /* btree cursor */ int lev, /* level in btree */ - int lr) /* left/right bits */ -{ - if ((cur->bc_ra[lev] | lr) == cur->bc_ra[lev]) - return 0; - - return xfs_btree_readahead_core(cur, lev, lr); -} - + int lr); /* left/right bits */ /* * Set the buffer for level "lev" in the cursor to bp, releasing Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:13:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:13:20.000000000 +0200 @@ -1721,8 +1721,9 @@ xfs_bmbt_decrement( XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, level); ASSERT(level < cur->bc_nlevels); - if (level < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + + xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + if (--cur->bc_ptrs[level] > 0) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); *stat = 1; @@ -1743,8 +1744,7 @@ xfs_bmbt_decrement( for (lev = level + 1; lev < cur->bc_nlevels; lev++) { if (--cur->bc_ptrs[lev] > 0) break; - if (lev < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); + xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); } if (lev == cur->bc_nlevels) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); @@ -1995,8 +1995,8 @@ xfs_bmbt_increment( XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, level); ASSERT(level < cur->bc_nlevels); - if (level < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); + + xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); block = xfs_bmbt_get_block(cur, level, &bp); #ifdef DEBUG if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { @@ -2024,8 +2024,7 @@ xfs_bmbt_increment( #endif if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) break; - if (lev < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); + xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); } if (lev == cur->bc_nlevels) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:08:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK86T2016198 for ; Wed, 23 Jul 2008 13:08:07 -0700 X-ASG-Debug-ID: 1216843746-148e037b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1B04C31C27D for ; Wed, 23 Jul 2008 13:09:15 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 2tdP4uSXisNhPxHO for ; Wed, 23 Jul 2008 13:09:15 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK8sNg007500 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:08:54 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK8r4k007498 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:08:53 +0200 Date: Wed, 23 Jul 2008 22:08:53 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 06/15] add a long pointers flag to xfs_btree_cur Subject: [PATCH 06/15] add a long pointers flag to xfs_btree_cur Message-ID: <20080723200853.GG7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-long-flag User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843757 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17095 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Add a flag to the xfs btree cursor when using long (64bit) block pointers instead of checking btnum == XFS_BTNUM_BMAP. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-11 11:13:15.000000000 +0200 @@ -90,7 +90,7 @@ xfs_btree_check_block( int level, /* level of the btree block */ xfs_buf_t *bp) /* buffer containing block, if any */ { - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level, bp); else @@ -500,7 +500,7 @@ xfs_btree_islastblock( block = xfs_btree_get_block(cur, level, &bp); xfs_btree_check_block(cur, block, level, bp); - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) return be64_to_cpu(block->bb_u.l.bb_rightsib) == NULLDFSBNO; else return be32_to_cpu(block->bb_u.s.bb_rightsib) == NULLAGBLOCK; @@ -792,7 +792,7 @@ xfs_btree_setbuf( if (!bp) return; b = XFS_BUF_TO_BLOCK(bp); - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) { + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { if (be64_to_cpu(b->bb_u.l.bb_leftsib) == NULLDFSBNO) cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA; if (be64_to_cpu(b->bb_u.l.bb_rightsib) == NULLDFSBNO) Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-11 11:13:15.000000000 +0200 @@ -121,11 +121,6 @@ union xfs_btree_rec { #define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1) /* - * Boolean to select which form of xfs_btree_block_t.bb_u to use. - */ -#define XFS_BTREE_LONG_PTRS(btnum) ((btnum) == XFS_BTNUM_BMAP) - -/* * Magic numbers for btree blocks. */ extern const __uint32_t xfs_magics[]; @@ -211,6 +206,7 @@ typedef struct xfs_btree_cur } xfs_btree_cur_t; /* cursor flags */ +#define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:13:15.000000000 +0200 @@ -2667,7 +2667,7 @@ xfs_bmbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_bmbt_ops; - cur->bc_flags = XFS_BTREE_ROOT_IN_INODE; + cur->bc_flags = XFS_BTREE_LONG_PTRS | XFS_BTREE_ROOT_IN_INODE; cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); cur->bc_private.b.ip = ip; -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:08 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:08:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK85A8016169 for ; Wed, 23 Jul 2008 13:08:07 -0700 X-ASG-Debug-ID: 1216843753-148003830000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0365531C27D for ; Wed, 23 Jul 2008 13:09:14 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id DAhwDqm5QRZlbjxO for ; Wed, 23 Jul 2008 13:09:14 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK94Ng007531 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:09:04 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK94Js007529 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:09:04 +0200 Date: Wed, 23 Jul 2008 22:09:04 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 08/15] refactor btree validation helpers Subject: [PATCH 08/15] refactor btree validation helpers Message-ID: <20080723200904.GI7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-check-refactor User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843756 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17094 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Move the various btree validation helpers around in xfs_btree.c so that they are close to each other and in common #ifdef DEBUG sections. Also add a new xfs_btree_check_ptr helper to check a btree ptr that can be either long or short form. Split out from a bigger patch from Dave Chinner with various small changes applied by me. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-14 18:02:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-14 18:08:27.000000000 +0200 @@ -81,24 +81,6 @@ xfs_btree_maxrecs( #ifdef DEBUG /* - * Debug routine: check that block header is ok. - */ -void -xfs_btree_check_block( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block, /* generic btree block pointer */ - int level, /* level of the btree block */ - xfs_buf_t *bp) /* buffer containing block, if any */ -{ - if (cur->bc_flags & XFS_BTREE_LONG_PTRS) - xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level, - bp); - else - xfs_btree_check_sblock(cur, (xfs_btree_sblock_t *)block, level, - bp); -} - -/* * Debug routine: check that keys are in the right order. */ void @@ -150,66 +132,8 @@ xfs_btree_check_key( ASSERT(0); } } -#endif /* DEBUG */ /* - * Checking routine: check that long form block header is ok. - */ -/* ARGSUSED */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lblock( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_lblock_t *block, /* btree long form block pointer */ - int level, /* level of the btree block */ - xfs_buf_t *bp) /* buffer for block, if any */ -{ - int lblock_ok; /* block passes checks */ - xfs_mount_t *mp; /* file system mount point */ - - mp = cur->bc_mp; - lblock_ok = - be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && - be16_to_cpu(block->bb_level) == level && - be16_to_cpu(block->bb_numrecs) <= - xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && - block->bb_leftsib && - (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || - XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && - block->bb_rightsib && - (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO || - XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_rightsib))); - if (unlikely(XFS_TEST_ERROR(!lblock_ok, mp, XFS_ERRTAG_BTREE_CHECK_LBLOCK, - XFS_RANDOM_BTREE_CHECK_LBLOCK))) { - if (bp) - xfs_buftrace("LBTREE ERROR", bp); - XFS_ERROR_REPORT("xfs_btree_check_lblock", XFS_ERRLEVEL_LOW, - mp); - return XFS_ERROR(EFSCORRUPTED); - } - return 0; -} - -/* - * Checking routine: check that (long) pointer is ok. - */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lptr( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_dfsbno_t ptr, /* btree block disk address */ - int level) /* btree block level */ -{ - xfs_mount_t *mp; /* file system mount point */ - - mp = cur->bc_mp; - XFS_WANT_CORRUPTED_RETURN( - level > 0 && - ptr != NULLDFSBNO && - XFS_FSB_SANITY_CHECK(mp, ptr)); - return 0; -} - -#ifdef DEBUG -/* * Debug routine: check that records are in the right order. */ void @@ -268,10 +192,39 @@ xfs_btree_check_rec( } #endif /* DEBUG */ -/* - * Checking routine: check that block header is ok. - */ -/* ARGSUSED */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_lblock( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_lblock_t *block, /* btree long form block pointer */ + int level, /* level of the btree block */ + xfs_buf_t *bp) /* buffer for block, if any */ +{ + int lblock_ok; /* block passes checks */ + xfs_mount_t *mp; /* file system mount point */ + + mp = cur->bc_mp; + lblock_ok = + be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && + be16_to_cpu(block->bb_level) == level && + be16_to_cpu(block->bb_numrecs) <= + xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && + block->bb_leftsib && + (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || + XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && + block->bb_rightsib && + (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO || + XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_rightsib))); + if (unlikely(XFS_TEST_ERROR(!lblock_ok, mp, XFS_ERRTAG_BTREE_CHECK_LBLOCK, + XFS_RANDOM_BTREE_CHECK_LBLOCK))) { + if (bp) + xfs_buftrace("LBTREE ERROR", bp); + XFS_ERROR_REPORT("xfs_btree_check_lblock", XFS_ERRLEVEL_LOW, + mp); + return XFS_ERROR(EFSCORRUPTED); + } + return 0; +} + int /* error (0 or EFSCORRUPTED) */ xfs_btree_check_sblock( xfs_btree_cur_t *cur, /* btree cursor */ @@ -311,27 +264,81 @@ xfs_btree_check_sblock( } /* - * Checking routine: check that (short) pointer is ok. + * Debug routine: check that block header is ok. + */ +int +xfs_btree_check_block( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_block_t *block, /* generic btree block pointer */ + int level, /* level of the btree block */ + xfs_buf_t *bp) /* buffer containing block, if any */ +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + return xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, + level, bp); + } + + return xfs_btree_check_sblock(cur, (xfs_btree_sblock_t *)block, + level, bp); +} + +/* + * Check that (long) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sptr( +xfs_btree_check_lptr( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t ptr, /* btree block disk address */ + xfs_dfsbno_t bno, /* btree block disk address */ int level) /* btree block level */ { - xfs_buf_t *agbp; /* buffer for ag. freespace struct */ - xfs_agf_t *agf; /* ag. freespace structure */ + xfs_mount_t *mp; /* file system mount point */ + + mp = cur->bc_mp; + XFS_WANT_CORRUPTED_RETURN( + level > 0 && + bno != NULLDFSBNO && + XFS_FSB_SANITY_CHECK(mp, bno)); + return 0; +} + +/* + * Check that (short) pointer is ok. + */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_sptr( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_agblock_t bno, /* btree block disk address */ + int level) /* btree block level */ +{ + xfs_agblock_t agblocks = cur->bc_mp->m_sb.sb_agblocks; - agbp = cur->bc_private.a.agbp; - agf = XFS_BUF_TO_AGF(agbp); XFS_WANT_CORRUPTED_RETURN( level > 0 && - ptr != NULLAGBLOCK && ptr != 0 && - ptr < be32_to_cpu(agf->agf_length)); + bno != NULLAGBLOCK && + bno != 0 && + bno < agblocks); return 0; } /* + * Check that block ptr is ok. + */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_ptr( + struct xfs_btree_cur *cur, /* btree cursor */ + union xfs_btree_ptr *ptr, /* btree block disk address */ + int index, /* offset from ptr to check */ + int level) /* btree block level */ +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + return xfs_btree_check_lptr(cur, + be64_to_cpu((&ptr->l)[index]), + level); + } + return xfs_btree_check_sptr(cur, be32_to_cpu((&ptr->s)[index]), level); +} + +/* * Delete the btree cursor. */ void Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 18:02:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 18:07:55.000000000 +0200 @@ -223,52 +223,38 @@ typedef struct xfs_btree_cur #ifdef __KERNEL__ -#ifdef DEBUG /* - * Debug routine: check that block header is ok. + * Check that long form block header is ok. */ -void -xfs_btree_check_block( +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_lblock( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block, /* generic btree block pointer */ + xfs_btree_lblock_t *block, /* btree long form block pointer */ int level, /* level of the btree block */ struct xfs_buf *bp); /* buffer containing block, if any */ /* - * Debug routine: check that keys are in the right order. - */ -void -xfs_btree_check_key( - xfs_btnum_t btnum, /* btree identifier */ - void *ak1, /* pointer to left (lower) key */ - void *ak2); /* pointer to right (higher) key */ - -/* - * Debug routine: check that records are in the right order. + * Check that short form block header is ok. */ -void -xfs_btree_check_rec( - xfs_btnum_t btnum, /* btree identifier */ - void *ar1, /* pointer to left (lower) record */ - void *ar2); /* pointer to right (higher) record */ -#else -#define xfs_btree_check_block(a,b,c,d) -#define xfs_btree_check_key(a,b,c) -#define xfs_btree_check_rec(a,b,c) -#endif /* DEBUG */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_sblock( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_sblock_t *block, /* btree short form block pointer */ + int level, /* level of the btree block */ + struct xfs_buf *bp); /* buffer containing block */ /* - * Checking routine: check that long form block header is ok. + * Check that block header is ok. */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lblock( +int +xfs_btree_check_block( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_lblock_t *block, /* btree long form block pointer */ + xfs_btree_block_t *block, /* generic btree block pointer */ int level, /* level of the btree block */ struct xfs_buf *bp); /* buffer containing block, if any */ /* - * Checking routine: check that (long) pointer is ok. + * Check that (long) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ xfs_btree_check_lptr( @@ -279,25 +265,50 @@ xfs_btree_check_lptr( #define xfs_btree_check_lptr_disk(cur, ptr, level) \ xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level) + /* - * Checking routine: check that short form block header is ok. + * Check that (short) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sblock( +xfs_btree_check_sptr( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_sblock_t *block, /* btree short form block pointer */ - int level, /* level of the btree block */ - struct xfs_buf *bp); /* buffer containing block */ + xfs_agblock_t ptr, /* btree block disk address */ + int level); /* btree block level */ /* - * Checking routine: check that (short) pointer is ok. + * Check that (short) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sptr( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t ptr, /* btree block disk address */ +xfs_btree_check_ptr( + struct xfs_btree_cur *cur, /* btree cursor */ + union xfs_btree_ptr *ptr, /* btree block disk address */ + int index, /* offset from ptr to check */ int level); /* btree block level */ +#ifdef DEBUG + +/* + * Debug routine: check that keys are in the right order. + */ +void +xfs_btree_check_key( + xfs_btnum_t btnum, /* btree identifier */ + void *ak1, /* pointer to left (lower) key */ + void *ak2); /* pointer to right (higher) key */ + +/* + * Debug routine: check that records are in the right order. + */ +void +xfs_btree_check_rec( + xfs_btnum_t btnum, /* btree identifier */ + void *ar1, /* pointer to left (lower) record */ + void *ar2); /* pointer to right (higher) record */ +#else +#define xfs_btree_check_key(a,b,c) +#define xfs_btree_check_rec(a,b,c) +#endif /* DEBUG */ + /* * Delete the btree cursor. */ -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:11 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:08:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK8AV2016269 for ; Wed, 23 Jul 2008 13:08:10 -0700 X-ASG-Debug-ID: 1216843759-23d302750000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 58B9831C281 for ; Wed, 23 Jul 2008 13:09:20 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id RF5UjtZq3MkYEjBG for ; Wed, 23 Jul 2008 13:09:20 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK9ANg007543 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 23 Jul 2008 22:09:10 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK9ARi007541; Wed, 23 Jul 2008 22:09:10 +0200 Date: Wed, 23 Jul 2008 22:09:10 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 09/15] add new btree statistics Subject: [PATCH 09/15] add new btree statistics Message-ID: <20080723200910.GJ7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-stats User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843761 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.92 X-Barracuda-Spam-Status: No, SCORE=-0.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA081 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.10 BSF_SC0_SA081 Custom Rule SA081 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17096 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Introduce statistics coverage of all the btrees and cover all the btree operations, not just some. Invaluable for determining test code coverage of all the btree operations.... Signed-off-by: Dave Chinner Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.c 2008-07-14 17:24:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c 2008-07-14 17:29:17.000000000 +0200 @@ -53,6 +53,10 @@ xfs_read_xfsstats( { "icluster", XFSSTAT_END_INODE_CLUSTER }, { "vnodes", XFSSTAT_END_VNODE_OPS }, { "buf", XFSSTAT_END_BUF }, + { "abtb2", XFSSTAT_END_ABTB_V2 }, + { "abtc2", XFSSTAT_END_ABTC_V2 }, + { "bmbt2", XFSSTAT_END_BMBT_V2 }, + { "ibt2", XFSSTAT_END_IBT_V2 }, }; /* Loop over all stats groups */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.h 2008-07-14 17:24:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h 2008-07-14 17:29:17.000000000 +0200 @@ -118,6 +118,71 @@ struct xfsstats { __uint32_t xb_page_retries; __uint32_t xb_page_found; __uint32_t xb_get_read; +/* Version 2 btree counters */ +#define XFSSTAT_END_ABTB_V2 (XFSSTAT_END_BUF+15) + __uint32_t xs_abtb_2_lookup; + __uint32_t xs_abtb_2_compare; + __uint32_t xs_abtb_2_insrec; + __uint32_t xs_abtb_2_delrec; + __uint32_t xs_abtb_2_newroot; + __uint32_t xs_abtb_2_killroot; + __uint32_t xs_abtb_2_increment; + __uint32_t xs_abtb_2_decrement; + __uint32_t xs_abtb_2_lshift; + __uint32_t xs_abtb_2_rshift; + __uint32_t xs_abtb_2_split; + __uint32_t xs_abtb_2_join; + __uint32_t xs_abtb_2_alloc; + __uint32_t xs_abtb_2_free; + __uint32_t xs_abtb_2_moves; +#define XFSSTAT_END_ABTC_V2 (XFSSTAT_END_ABTB_V2+15) + __uint32_t xs_abtc_2_lookup; + __uint32_t xs_abtc_2_compare; + __uint32_t xs_abtc_2_insrec; + __uint32_t xs_abtc_2_delrec; + __uint32_t xs_abtc_2_newroot; + __uint32_t xs_abtc_2_killroot; + __uint32_t xs_abtc_2_increment; + __uint32_t xs_abtc_2_decrement; + __uint32_t xs_abtc_2_lshift; + __uint32_t xs_abtc_2_rshift; + __uint32_t xs_abtc_2_split; + __uint32_t xs_abtc_2_join; + __uint32_t xs_abtc_2_alloc; + __uint32_t xs_abtc_2_free; + __uint32_t xs_abtc_2_moves; +#define XFSSTAT_END_BMBT_V2 (XFSSTAT_END_ABTC_V2+15) + __uint32_t xs_bmbt_2_lookup; + __uint32_t xs_bmbt_2_compare; + __uint32_t xs_bmbt_2_insrec; + __uint32_t xs_bmbt_2_delrec; + __uint32_t xs_bmbt_2_newroot; + __uint32_t xs_bmbt_2_killroot; + __uint32_t xs_bmbt_2_increment; + __uint32_t xs_bmbt_2_decrement; + __uint32_t xs_bmbt_2_lshift; + __uint32_t xs_bmbt_2_rshift; + __uint32_t xs_bmbt_2_split; + __uint32_t xs_bmbt_2_join; + __uint32_t xs_bmbt_2_alloc; + __uint32_t xs_bmbt_2_free; + __uint32_t xs_bmbt_2_moves; +#define XFSSTAT_END_IBT_V2 (XFSSTAT_END_BMBT_V2+15) + __uint32_t xs_ibt_2_lookup; + __uint32_t xs_ibt_2_compare; + __uint32_t xs_ibt_2_insrec; + __uint32_t xs_ibt_2_delrec; + __uint32_t xs_ibt_2_newroot; + __uint32_t xs_ibt_2_killroot; + __uint32_t xs_ibt_2_increment; + __uint32_t xs_ibt_2_decrement; + __uint32_t xs_ibt_2_lshift; + __uint32_t xs_ibt_2_rshift; + __uint32_t xs_ibt_2_split; + __uint32_t xs_ibt_2_join; + __uint32_t xs_ibt_2_alloc; + __uint32_t xs_ibt_2_free; + __uint32_t xs_ibt_2_moves; /* Extra precision counters */ __uint64_t xs_xstrat_bytes; __uint64_t xs_write_bytes; Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 17:28:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 17:29:17.000000000 +0200 @@ -126,6 +126,34 @@ union xfs_btree_rec { extern const __uint32_t xfs_magics[]; /* + * Generic stats interface + */ +#define __XFS_BTREE_STATS_INC(type, stat) \ + XFS_STATS_INC(xs_ ## type ## _2_ ## stat) +#define XFS_BTREE_STATS_INC(cur, stat) \ +do { \ + switch (cur->bc_btnum) { \ + case XFS_BTNUM_BNO: __XFS_BTREE_STATS_INC(abtb, stat); break; \ + case XFS_BTNUM_CNT: __XFS_BTREE_STATS_INC(abtc, stat); break; \ + case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(bmbt, stat); break; \ + case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(ibt, stat); break; \ + case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + } \ +} while (0) + +#define __XFS_BTREE_STATS_ADD(type, stat, val) \ + XFS_STATS_ADD(xs_ ## type ## _2_ ## stat, val) +#define XFS_BTREE_STATS_ADD(cur, stat, val) \ +do { \ + switch (cur->bc_btnum) { \ + case XFS_BTNUM_BNO: __XFS_BTREE_STATS_ADD(abtb, stat, val); break; \ + case XFS_BTNUM_CNT: __XFS_BTREE_STATS_ADD(abtc, stat, val); break; \ + case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_ADD(bmbt, stat, val); break; \ + case XFS_BTNUM_INO: __XFS_BTREE_STATS_ADD(ibt, stat, val); break; \ + case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + } \ +} while (0) +/* * Maximum and minimum records in a btree block. * Given block size, type prefix, and leaf flag (0 or 1). * The divisor below is equivalent to lf ? (e1) : (e2) but that produces -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:08:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK8Ho9016393 for ; Wed, 23 Jul 2008 13:08:18 -0700 X-ASG-Debug-ID: 1216843765-1fb802fd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0436B1B3ED5A for ; Wed, 23 Jul 2008 13:09:25 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id J7G5qf1ixsxaumx9 for ; Wed, 23 Jul 2008 13:09:25 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK9FNg007565 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:09:15 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK9F7u007563 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:09:15 +0200 Date: Wed, 23 Jul 2008 22:09:15 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 10/15] make btree tracing generic Subject: [PATCH 10/15] make btree tracing generic Message-ID: <20080723200915.GK7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-trace User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843767 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17097 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs make the existing bmap btree tracing generic so that it applies to all btree types. Some fragments lifted from a patch by Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 01:54:02.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 01:54:02.000000000 +0200 @@ -190,6 +190,25 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + + /* btree tracing */ +#ifdef XFS_BTREE_TRACE + void (*trace_enter)(struct xfs_btree_cur *, const char *, + char *, int, int, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t); + void (*trace_cursor)(struct xfs_btree_cur *, __uint32_t *, + __uint64_t *, __uint64_t *); + void (*trace_key)(struct xfs_btree_cur *, + union xfs_btree_key *, __uint64_t *, + __uint64_t *); + void (*trace_record)(struct xfs_btree_cur *, + union xfs_btree_rec *, __uint64_t *, + __uint64_t *, __uint64_t *); +#endif }; /* Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.c 2008-07-21 01:54:02.000000000 +0200 @@ -0,0 +1,203 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "xfs.h" +#include "xfs_types.h" +#include "xfs_inum.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_btree_trace.h" + + +/* + * Add a trace buffer entry for arguments, for a buffer & 1 integer arg. + */ +void +xfs_btree_trace_argbi( + const char *func, + struct xfs_btree_cur *cur, + struct xfs_buf *b, + int i, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGBI, + line, (__psunsigned_t)b, i, 0, 0, 0, 0, 0, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for a buffer & 2 integer args. + */ +void +xfs_btree_trace_argbii( + const char *func, + struct xfs_btree_cur *cur, + struct xfs_buf *b, + int i0, + int i1, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGBII, + line, (__psunsigned_t)b, i0, i1, 0, 0, 0, 0, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for 3 block-length args + * and an integer arg. + */ +void +xfs_btree_trace_argfffi( + const char *func, + struct xfs_btree_cur *cur, + xfs_dfiloff_t o, + xfs_dfsbno_t b, + xfs_dfilblks_t i, + int j, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGFFFI, line, + o >> 32, (int)o, b >> 32, (int)b, + i >> 32, (int)i, (int)j, 0, + 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for one integer arg. + */ +void +xfs_btree_trace_argi( + const char *func, + struct xfs_btree_cur *cur, + int i, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGI, + line, i, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, fsblock, key. + */ +void +xfs_btree_trace_argifk( + const char *func, + struct xfs_btree_cur *cur, + int i, + xfs_fsblock_t f, + xfs_dfiloff_t o, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIFK, + line, i, + (xfs_dfsbno_t)f >> 32, (int)f, + o >> 32, (int)o, + 0, 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, fsblock, rec. + */ +void +xfs_btree_trace_argifr( + const char *func, + struct xfs_btree_cur *cur, + int i, + xfs_fsblock_t f, + union xfs_btree_rec *rec, + int line) +{ + __uint64_t l0, l1, l2; + + cur->bc_ops->trace_record(cur, rec, &l0, &l1, &l2); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIFR, + line, i, + f >> 32, (int)f, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + l2 >> 32, (int)l2, + 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, key. + */ +void +xfs_btree_trace_argik( + const char *func, + struct xfs_btree_cur *cur, + int i, + union xfs_btree_key *key, + int line) +{ + __uint64_t l0, l1; + + cur->bc_ops->trace_key(cur, key, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIFK, + line, i, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + 0, 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for the cursor/operation. + */ +void +xfs_btree_trace_cursor( + const char *func, + struct xfs_btree_cur *cur, + int type, + int line) +{ + __uint32_t s0; + __uint64_t l0, l1; + char *s; + + switch (type) { + case XBT_ARGS: + s = "args"; + break; + case XBT_ENTRY: + s = "entry"; + break; + case XBT_ERROR: + s = "error"; + break; + case XBT_EXIT: + s = "exit"; + break; + default: + s = "unknown"; + break; + } + + cur->bc_ops->trace_cursor(cur, &s0, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, s, XFS_BTREE_KTRACE_CUR, line, + s0, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + (__psunsigned_t)cur->bc_bufs[0], + (__psunsigned_t)cur->bc_bufs[1], + (__psunsigned_t)cur->bc_bufs[2], + (__psunsigned_t)cur->bc_bufs[3], + (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], + (cur->bc_ptrs[2] << 16) | cur->bc_ptrs[3]); +} Index: linux-2.6-xfs/fs/xfs/Makefile =================================================================== --- linux-2.6-xfs.orig/fs/xfs/Makefile 2008-07-21 01:45:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/Makefile 2008-07-21 01:54:02.000000000 +0200 @@ -81,7 +81,8 @@ xfs-y += xfs_alloc.o \ xfs_dmops.o \ xfs_qmops.o -xfs-$(CONFIG_XFS_TRACE) += xfs_dir2_trace.o +xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \ + xfs_dir2_trace.o # Objects in linux/ xfs-y += $(addprefix $(XFS_LINUX)/, \ Index: linux-2.6-xfs/fs/xfs/xfs.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs.h 2008-07-21 01:35:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs.h 2008-07-21 01:54:02.000000000 +0200 @@ -30,7 +30,7 @@ #define XFS_ATTR_TRACE 1 #define XFS_BLI_TRACE 1 #define XFS_BMAP_TRACE 1 -#define XFS_BMBT_TRACE 1 +#define XFS_BTREE_TRACE 1 #define XFS_DIR2_TRACE 1 #define XFS_DQUOT_TRACE 1 #define XFS_ILOCK_TRACE 1 Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-21 01:54:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-21 01:54:02.000000000 +0200 @@ -37,16 +37,13 @@ #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_itable.h" #include "xfs_bmap.h" #include "xfs_error.h" #include "xfs_quota.h" -#if defined(XFS_BMBT_TRACE) -ktrace_t *xfs_bmbt_trace_buf; -#endif - /* * Prototypes for internal btree functions. */ @@ -61,245 +58,32 @@ STATIC int xfs_bmbt_split(xfs_btree_cur_ __uint64_t *, xfs_btree_cur_t **, int *); STATIC int xfs_bmbt_updkey(xfs_btree_cur_t *, xfs_bmbt_key_t *, int); - -#if defined(XFS_BMBT_TRACE) - -static char ARGS[] = "args"; -static char ENTRY[] = "entry"; -static char ERROR[] = "error"; #undef EXIT -static char EXIT[] = "exit"; -/* - * Add a trace buffer entry for the arguments given to the routine, - * generic form. - */ -STATIC void -xfs_bmbt_trace_enter( - const char *func, - xfs_btree_cur_t *cur, - char *s, - int type, - int line, - __psunsigned_t a0, - __psunsigned_t a1, - __psunsigned_t a2, - __psunsigned_t a3, - __psunsigned_t a4, - __psunsigned_t a5, - __psunsigned_t a6, - __psunsigned_t a7, - __psunsigned_t a8, - __psunsigned_t a9, - __psunsigned_t a10) -{ - xfs_inode_t *ip; - int whichfork; - - ip = cur->bc_private.b.ip; - whichfork = cur->bc_private.b.whichfork; - ktrace_enter(xfs_bmbt_trace_buf, - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), - (void *)func, (void *)s, (void *)ip, (void *)cur, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)a8, (void *)a9, (void *)a10); - ASSERT(ip->i_btrace); - ktrace_enter(ip->i_btrace, - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), - (void *)func, (void *)s, (void *)ip, (void *)cur, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)a8, (void *)a9, (void *)a10); -} -/* - * Add a trace buffer entry for arguments, for a buffer & 1 integer arg. - */ -STATIC void -xfs_bmbt_trace_argbi( - const char *func, - xfs_btree_cur_t *cur, - xfs_buf_t *b, - int i, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGBI, line, - (__psunsigned_t)b, i, 0, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for a buffer & 2 integer args. - */ -STATIC void -xfs_bmbt_trace_argbii( - const char *func, - xfs_btree_cur_t *cur, - xfs_buf_t *b, - int i0, - int i1, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGBII, line, - (__psunsigned_t)b, i0, i1, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for 3 block-length args - * and an integer arg. - */ -STATIC void -xfs_bmbt_trace_argfffi( - const char *func, - xfs_btree_cur_t *cur, - xfs_dfiloff_t o, - xfs_dfsbno_t b, - xfs_dfilblks_t i, - int j, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGFFFI, line, - o >> 32, (int)o, b >> 32, (int)b, - i >> 32, (int)i, (int)j, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for one integer arg. - */ -STATIC void -xfs_bmbt_trace_argi( - const char *func, - xfs_btree_cur_t *cur, - int i, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGI, line, - i, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, fsblock, key. - */ -STATIC void -xfs_bmbt_trace_argifk( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_fsblock_t f, - xfs_dfiloff_t o, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFK, line, - i, (xfs_dfsbno_t)f >> 32, (int)f, o >> 32, - (int)o, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, fsblock, rec. - */ -STATIC void -xfs_bmbt_trace_argifr( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_fsblock_t f, - xfs_bmbt_rec_t *r, - int line) -{ - xfs_dfsbno_t b; - xfs_dfilblks_t c; - xfs_dfsbno_t d; - xfs_dfiloff_t o; - xfs_bmbt_irec_t s; - - d = (xfs_dfsbno_t)f; - xfs_bmbt_disk_get_all(r, &s); - o = (xfs_dfiloff_t)s.br_startoff; - b = (xfs_dfsbno_t)s.br_startblock; - c = s.br_blockcount; - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFR, line, - i, d >> 32, (int)d, o >> 32, - (int)o, b >> 32, (int)b, c >> 32, - (int)c, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, key. - */ -STATIC void -xfs_bmbt_trace_argik( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_bmbt_key_t *k, - int line) -{ - xfs_dfiloff_t o; - - o = be64_to_cpu(k->br_startoff); - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFK, line, - i, o >> 32, (int)o, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for the cursor/operation. - */ -STATIC void -xfs_bmbt_trace_cursor( - const char *func, - xfs_btree_cur_t *cur, - char *s, - int line) -{ - xfs_bmbt_rec_host_t r; - - xfs_bmbt_set_all(&r, &cur->bc_rec.b); - xfs_bmbt_trace_enter(func, cur, s, XFS_BMBT_KTRACE_CUR, line, - (cur->bc_nlevels << 24) | (cur->bc_private.b.flags << 16) | - cur->bc_private.b.allocated, - r.l0 >> 32, (int)r.l0, - r.l1 >> 32, (int)r.l1, - (unsigned long)cur->bc_bufs[0], (unsigned long)cur->bc_bufs[1], - (unsigned long)cur->bc_bufs[2], (unsigned long)cur->bc_bufs[3], - (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], - (cur->bc_ptrs[2] << 16) | cur->bc_ptrs[3]); -} - -#define XFS_BMBT_TRACE_ARGBI(c,b,i) \ - xfs_bmbt_trace_argbi(__func__, c, b, i, __LINE__) -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ - xfs_bmbt_trace_argbii(__func__, c, b, i, j, __LINE__) -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ - xfs_bmbt_trace_argfffi(__func__, c, o, b, i, j, __LINE__) -#define XFS_BMBT_TRACE_ARGI(c,i) \ - xfs_bmbt_trace_argi(__func__, c, i, __LINE__) -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ - xfs_bmbt_trace_argifk(__func__, c, i, f, s, __LINE__) -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ - xfs_bmbt_trace_argifr(__func__, c, i, f, r, __LINE__) -#define XFS_BMBT_TRACE_ARGIK(c,i,k) \ - xfs_bmbt_trace_argik(__func__, c, i, k, __LINE__) -#define XFS_BMBT_TRACE_CURSOR(c,s) \ - xfs_bmbt_trace_cursor(__func__, c, s, __LINE__) -#else -#define XFS_BMBT_TRACE_ARGBI(c,b,i) -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) -#define XFS_BMBT_TRACE_ARGI(c,i) -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) -#define XFS_BMBT_TRACE_ARGIK(c,i,k) -#define XFS_BMBT_TRACE_CURSOR(c,s) -#endif /* XFS_BMBT_TRACE */ +#define ENTRY XBT_ENTRY +#define ERROR XBT_ERROR +#define EXIT XBT_EXIT + +/* + * Keep the XFS_BMBT_TRACE_ names around for now until all code using them + * is converted to be generic and thus switches to the XFS_BTREE_TRACE_ names. + */ +#define XFS_BMBT_TRACE_ARGBI(c,b,i) \ + XFS_BTREE_TRACE_ARGBI(c,b,i) +#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ + XFS_BTREE_TRACE_ARGBII(c,b,i,j) +#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ + XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) +#define XFS_BMBT_TRACE_ARGI(c,i) \ + XFS_BTREE_TRACE_ARGI(c,i) +#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ + XFS_BTREE_TRACE_ARGIFK(c,i,f,s) +#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ + XFS_BTREE_TRACE_ARGIFR(c,i,f,(union xfs_btree_rec *)r) +#define XFS_BMBT_TRACE_ARGIK(c,i,k) \ + XFS_BTREE_TRACE_ARGIK(c,i,(union xfs_btree_key *)k) +#define XFS_BMBT_TRACE_CURSOR(c,s) \ + XFS_BTREE_TRACE_CURSOR(c,s) /* @@ -2639,9 +2423,102 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_bmbt_trace_buf; + +STATIC void +xfs_bmbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + struct xfs_inode *ip = cur->bc_private.b.ip; + int whichfork = cur->bc_private.b.whichfork; + + ktrace_enter(xfs_bmbt_trace_buf, + (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), + (void *)func, (void *)s, (void *)ip, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); + ktrace_enter(ip->i_btrace, + (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), + (void *)func, (void *)s, (void *)ip, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_bmbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + struct xfs_bmbt_rec_host r; + + xfs_bmbt_set_all(&r, &cur->bc_rec.b); + + *s0 = (cur->bc_nlevels << 24) | + (cur->bc_private.b.flags << 16) | + cur->bc_private.b.allocated; + *l0 = r.l0; + *l1 = r.l1; +} + +STATIC void +xfs_bmbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be64_to_cpu(key->bmbt.br_startoff); + *l1 = 0; +} + +STATIC void +xfs_bmbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + struct xfs_bmbt_irec irec; + + xfs_bmbt_disk_get_all(&rec->bmbt, &irec); + *l0 = irec.br_startoff; + *l1 = irec.br_startblock; + *l2 = irec.br_blockcount; +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_bmbt_trace_enter, + .trace_cursor = xfs_bmbt_trace_cursor, + .trace_key = xfs_bmbt_trace_key, + .trace_record = xfs_bmbt_trace_record, +#endif }; /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-21 01:53:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-21 01:54:02.000000000 +0200 @@ -39,6 +39,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" #include "xfs_rtalloc.h" @@ -97,7 +98,9 @@ EXPORT_SYMBOL(xfs_alloc_trace_buf); #ifdef XFS_BMAP_TRACE EXPORT_SYMBOL(xfs_bmap_trace_buf); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE +EXPORT_SYMBOL(xfs_allocbt_trace_buf); +EXPORT_SYMBOL(xfs_inobt_trace_buf); EXPORT_SYMBOL(xfs_bmbt_trace_buf); #endif #ifdef XFS_ATTR_TRACE Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-21 01:53:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-21 01:54:02.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" #include "xfs_rtalloc.h" @@ -1760,10 +1761,18 @@ xfs_alloc_trace_bufs(void) if (!xfs_bmap_trace_buf) goto out_free_alloc_trace; #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE + xfs_allocbt_trace_buf = ktrace_alloc(XFS_ALLOCBT_TRACE_SIZE, KM_MAYFAIL); + if (!xfs_allocbt_trace_buf) + goto out_free_bmap_trace; + + xfs_inobt_trace_buf = ktrace_alloc(XFS_INOBT_TRACE_SIZE, KM_MAYFAIL); + if (!xfs_inobt_trace_buf) + goto out_free_allocbt_trace; + xfs_bmbt_trace_buf = ktrace_alloc(XFS_BMBT_TRACE_SIZE, KM_MAYFAIL); if (!xfs_bmbt_trace_buf) - goto out_free_bmap_trace; + goto out_free_inobt_trace; #endif #ifdef XFS_ATTR_TRACE xfs_attr_trace_buf = ktrace_alloc(XFS_ATTR_TRACE_SIZE, KM_MAYFAIL); @@ -1785,8 +1794,12 @@ xfs_alloc_trace_bufs(void) ktrace_free(xfs_attr_trace_buf); out_free_bmbt_trace: #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(xfs_bmbt_trace_buf); + out_free_inobt_trace: + ktrace_free(xfs_inobt_trace_buf); + out_free_allocbt_trace: + ktrace_free(xfs_allocbt_trace_buf); out_free_bmap_trace: #endif #ifdef XFS_BMAP_TRACE @@ -1809,8 +1822,10 @@ xfs_free_trace_bufs(void) #ifdef XFS_ATTR_TRACE ktrace_free(xfs_attr_trace_buf); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(xfs_bmbt_trace_buf); + ktrace_free(xfs_inobt_trace_buf); + ktrace_free(xfs_allocbt_trace_buf); #endif #ifdef XFS_BMAP_TRACE ktrace_free(xfs_bmap_trace_buf); Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-21 01:54:00.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-21 01:54:02.000000000 +0200 @@ -233,24 +233,6 @@ typedef struct xfs_btree_lblock xfs_bmbt #ifdef __KERNEL__ -#if defined(XFS_BMBT_TRACE) -/* - * Trace buffer entry types. - */ -#define XFS_BMBT_KTRACE_ARGBI 1 -#define XFS_BMBT_KTRACE_ARGBII 2 -#define XFS_BMBT_KTRACE_ARGFFFI 3 -#define XFS_BMBT_KTRACE_ARGI 4 -#define XFS_BMBT_KTRACE_ARGIFK 5 -#define XFS_BMBT_KTRACE_ARGIFR 6 -#define XFS_BMBT_KTRACE_ARGIK 7 -#define XFS_BMBT_KTRACE_CUR 8 - -#define XFS_BMBT_TRACE_SIZE 4096 /* size of global trace buffer */ -#define XFS_BMBT_KTRACE_SIZE 32 /* size of per-inode trace buffer */ -extern ktrace_t *xfs_bmbt_trace_buf; -#endif - /* * Prototypes for xfs_bmap.c to call. */ Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-21 01:45:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-21 01:54:02.000000000 +0200 @@ -41,6 +41,7 @@ #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_alloc.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" @@ -841,7 +842,7 @@ xfs_iread( #ifdef XFS_BMAP_TRACE ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_RW_TRACE @@ -2637,7 +2638,7 @@ xfs_idestroy( #ifdef XFS_BMAP_TRACE ktrace_free(ip->i_xtrace); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(ip->i_btrace); #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-21 01:45:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-21 01:54:02.000000000 +0200 @@ -252,7 +252,7 @@ typedef struct xfs_inode { #ifdef XFS_BMAP_TRACE struct ktrace *i_xtrace; /* inode extent list trace */ #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE struct ktrace *i_btrace; /* inode bmap btree trace */ #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-21 01:53:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-21 02:08:41.000000000 +0200 @@ -45,6 +45,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_extfree_item.h" @@ -88,7 +89,7 @@ static void xfsidbg_xattrtrace(int); static void xfsidbg_xblitrace(xfs_buf_log_item_t *); #endif #ifdef XFS_BMAP_TRACE -static void xfsidbg_xbmatrace(int); +static void xfsidbg_xbtatrace(int, struct ktrace *, int); static void xfsidbg_xbmitrace(xfs_inode_t *); static void xfsidbg_xbmstrace(xfs_inode_t *); static void xfsidbg_xbxatrace(int); @@ -133,7 +134,7 @@ static void xfsidbg_xattrleaf(xfs_attr_l static void xfsidbg_xattrsf(xfs_attr_shortform_t *); static void xfsidbg_xbirec(xfs_bmbt_irec_t *r); static void xfsidbg_xbmalla(xfs_bmalloca_t *); -static void xfsidbg_xbrec(xfs_bmbt_rec_host_t *); +static void xfsidbg_xbmbtrec(xfs_bmbt_rec_host_t *); static void xfsidbg_xbroot(xfs_inode_t *); static void xfsidbg_xbroota(xfs_inode_t *); static void xfsidbg_xbtcur(xfs_btree_cur_t *); @@ -199,9 +200,6 @@ static int xfs_attr_trace_entry(ktrace_e #ifdef XFS_BMAP_TRACE static int xfs_bmap_trace_entry(ktrace_entry_t *ktep); #endif -#ifdef XFS_BMAP_TRACE -static int xfs_bmbt_trace_entry(ktrace_entry_t *ktep); -#endif #ifdef XFS_DIR2_TRACE static int xfs_dir2_trace_entry(ktrace_entry_t *ktep); #endif @@ -422,10 +420,52 @@ static int kdbm_xfs_xbmatrace( if (diag) return diag; - xfsidbg_xbmatrace((int) addr); + xfsidbg_xbtatrace(XFS_BTNUM_BMAP, xfs_bmbt_trace_buf, (int)addr); return 0; } +static int kdbm_xfs_xbtaatrace( + int argc, + const char **argv) +{ + unsigned long addr; + int nextarg = 1; + long offset = 0; + int diag; + + if (argc != 1) + return KDB_ARGCOUNT; + + diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); + if (diag) + return diag; + + /* also contains XFS_BTNUM_CNT */ + xfsidbg_xbtatrace(XFS_BTNUM_BNO, xfs_allocbt_trace_buf, (int)addr); + return 0; +} + +static int kdbm_xfs_xbtiatrace( + int argc, + const char **argv) +{ + unsigned long addr; + int nextarg = 1; + long offset = 0; + int diag; + + if (argc != 1) + return KDB_ARGCOUNT; + + diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); + if (diag) + return diag; + + xfsidbg_xbtatrace(XFS_BTNUM_INO, xfs_inobt_trace_buf, (int)addr); + return 0; +} + + static int kdbm_xfs_xbmitrace( int argc, const char **argv) @@ -903,7 +943,7 @@ static int kdbm_xfs_xbrec( if (diag) return diag; - xfsidbg_xbrec((xfs_bmbt_rec_host_t *) addr); + xfsidbg_xbmbtrec((xfs_bmbt_rec_host_t *) addr); return 0; } @@ -2294,6 +2334,10 @@ static struct xif xfsidbg_funcs[] = { "Dump XFS bmap btree per-inode trace" }, { "xbmstrc", kdbm_xfs_xbmstrace, "", "Dump XFS bmap btree inode trace" }, + { "xbtaatrc", kdbm_xfs_xbtaatrace, "", + "Dump XFS alloc btree count trace" }, + { "xbtiatrc", kdbm_xfs_xbtiatrace, "", + "Dump XFS inobt btree count trace" }, #endif { "xbrec", kdbm_xfs_xbrec, "", "Dump XFS bmap record"}, @@ -2729,16 +2773,115 @@ xfs_bmap_trace_entry(ktrace_entry_t *kte return 1; } +static void +xfsidb_btree_trace_record( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3, + unsigned long l4, + unsigned long l5) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + { + struct xfs_bmbt_irec s; + + s.br_startoff = ((xfs_dfiloff_t)l0 << 32) | (xfs_dfiloff_t)l1; + s.br_startblock = ((xfs_dfsbno_t)l2 << 32) | (xfs_dfsbno_t)l3; + s.br_blockcount = ((xfs_dfilblks_t)l4 << 32) | (xfs_dfilblks_t)l5; + + xfsidbg_xbirec(&s); + break; + } + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" startblock = %d, blockcount = %d\n", + (unsigned int)l0, (unsigned int)l2); + break; + case XFS_BTNUM_INO: + qprintf(" startino = %d, freecount = %d, free = %lld\n", + (unsigned int)l0, (unsigned int)l2, + ((xfs_inofree_t)l4 << 32) | (xfs_inofree_t)l5); + break; + default: + break; + } +} + +static void +xfsidb_btree_trace_key( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + qprintf(" startoff 0x%x%08x\n", (unsigned int)l0, (unsigned int)l1); + break; + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" startblock %d blockcount %d\n", + (unsigned int)l0, (unsigned int)l3); + break; + case XFS_BTNUM_INO: + qprintf(" startino %d\n", (unsigned int)l0); + break; + default: + break; + } +} + +static void +xfsidb_btree_trace_cursor( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3, + unsigned long l4) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + { + struct xfs_bmbt_rec_host r; + + qprintf(" nlevels %ld flags %ld allocated %ld ", + (l0 >> 24) & 0xff, (l0 >> 16) & 0xff, l0 & 0xffff); + + r.l0 = (unsigned long long)l1 << 32 | l2; + r.l1 = (unsigned long long)l3 << 32 | l4; + + xfsidbg_xbmbtrec(&r); + break; + } + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" agno %d startblock %d blockcount %d\n", + (unsigned int)l0, (unsigned int)l1, (unsigned int)l3); + break; + case XFS_BTNUM_INO: + qprintf(" agno %d startino %d free %lld\n", + (unsigned int)l0, (unsigned int)l1, + ((xfs_inofree_t)l3 << 32) | (xfs_inofree_t)l4); + break; + default: + break; + } +} + /* * Print xfs bmap btree trace buffer entry. */ static int -xfs_bmbt_trace_entry( - ktrace_entry_t *ktep) +xfs_btree_trace_entry( + int btnum, + ktrace_entry_t *ktep) { int line; - xfs_bmbt_rec_host_t r; - xfs_bmbt_irec_t s; int type; int whichfork; @@ -2755,18 +2898,18 @@ xfs_bmbt_trace_entry( "da"[whichfork], (xfs_btree_cur_t *)ktep->val[4]); switch (type) { - case XFS_BMBT_KTRACE_ARGBI: + case XFS_BTREE_KTRACE_ARGBI: qprintf(" buf 0x%p i %ld\n", (xfs_buf_t *)ktep->val[5], (long)ktep->val[6]); break; - case XFS_BMBT_KTRACE_ARGBII: + case XFS_BTREE_KTRACE_ARGBII: qprintf(" buf 0x%p i0 %ld i1 %ld\n", (xfs_buf_t *)ktep->val[5], (long)ktep->val[6], (long)ktep->val[7]); break; - case XFS_BMBT_KTRACE_ARGFFFI: + case XFS_BTREE_KTRACE_ARGFFFI: qprintf(" o 0x%x%08x b 0x%x%08x i 0x%x%08x j %ld\n", (unsigned int)(long)ktep->val[5], (unsigned int)(long)ktep->val[6], @@ -2776,11 +2919,11 @@ xfs_bmbt_trace_entry( (unsigned int)(long)ktep->val[10], (long)ktep->val[11]); break; - case XFS_BMBT_KTRACE_ARGI: + case XFS_BTREE_KTRACE_ARGI: qprintf(" i 0x%lx\n", (long)ktep->val[5]); break; - case XFS_BMBT_KTRACE_ARGIFK: + case XFS_BTREE_KTRACE_ARGIFK: qprintf(" i 0x%lx f 0x%x%08x o 0x%x%08x\n", (long)ktep->val[5], (unsigned int)(long)ktep->val[6], @@ -2788,39 +2931,36 @@ xfs_bmbt_trace_entry( (unsigned int)(long)ktep->val[8], (unsigned int)(long)ktep->val[9]); break; - case XFS_BMBT_KTRACE_ARGIFR: + case XFS_BTREE_KTRACE_ARGIFR: qprintf(" i 0x%lx f 0x%x%08x ", (long)ktep->val[5], (unsigned int)(long)ktep->val[6], (unsigned int)(long)ktep->val[7]); - s.br_startoff = (xfs_fileoff_t) - (((xfs_dfiloff_t)(unsigned long)ktep->val[8] << 32) | - (xfs_dfiloff_t)(unsigned long)ktep->val[9]); - s.br_startblock = (xfs_fsblock_t) - (((xfs_dfsbno_t)(unsigned long)ktep->val[10] << 32) | - (xfs_dfsbno_t)(unsigned long)ktep->val[11]); - s.br_blockcount = (xfs_filblks_t) - (((xfs_dfilblks_t)(unsigned long)ktep->val[12] << 32) | - (xfs_dfilblks_t)(unsigned long)ktep->val[13]); - xfsidbg_xbirec(&s); - break; - case XFS_BMBT_KTRACE_ARGIK: - qprintf(" i 0x%lx o 0x%x%08x\n", - (long)ktep->val[5], - (unsigned int)(long)ktep->val[6], - (unsigned int)(long)ktep->val[7]); - break; - case XFS_BMBT_KTRACE_CUR: - qprintf(" nlevels %ld flags %ld allocated %ld ", - ((long)ktep->val[5] >> 24) & 0xff, - ((long)ktep->val[5] >> 16) & 0xff, - (long)ktep->val[5] & 0xffff); - r.l0 = (unsigned long long)(unsigned long)ktep->val[6] << 32 | - (unsigned long)ktep->val[7]; - r.l1 = (unsigned long long)(unsigned long)ktep->val[8] << 32 | - (unsigned long)ktep->val[9]; + xfsidb_btree_trace_record(btnum, + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9], + (unsigned long)ktep->val[10], + (unsigned long)ktep->val[11], + (unsigned long)ktep->val[12], + (unsigned long)ktep->val[13]); + break; + case XFS_BTREE_KTRACE_ARGIK: + qprintf(" i 0x%lx\n", (long)ktep->val[5]); + xfsidb_btree_trace_key(btnum, + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9]); + break; + case XFS_BTREE_KTRACE_CUR: + + xfsidb_btree_trace_cursor(btnum, + (unsigned long)ktep->val[5], + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9]); - xfsidbg_xbrec(&r); qprintf(" bufs 0x%p 0x%p 0x%p 0x%p ", (xfs_buf_t *)ktep->val[10], (xfs_buf_t *)ktep->val[11], @@ -4406,21 +4546,21 @@ xfsidbg_xbmalla(xfs_bmalloca_t *a) #ifdef XFS_BMAP_TRACE /* - * Print out the last "count" entries in the bmap btree trace buffer. + * Print out the last "count" entries in a btree trace buffer. * The "a" is for "all" inodes. */ static void -xfsidbg_xbmatrace(int count) +xfsidbg_xbtatrace(int btnum, struct ktrace *trace_buf, int count) { ktrace_entry_t *ktep; ktrace_snap_t kts; int nentries; int skip_entries; - if (xfs_bmbt_trace_buf == NULL) { + if (trace_buf == NULL) { qprintf("The xfs bmap btree trace buffer is not initialized\n"); return; } - nentries = ktrace_nentries(xfs_bmbt_trace_buf); + nentries = ktrace_nentries(trace_buf); if (count == -1) { count = nentries; } @@ -4429,23 +4569,23 @@ xfsidbg_xbmatrace(int count) return; } - ktep = ktrace_first(xfs_bmbt_trace_buf, &kts); + ktep = ktrace_first(trace_buf, &kts); if (count != nentries) { /* * Skip the total minus the number to look at minus one * for the entry returned by ktrace_first(). */ skip_entries = nentries - count - 1; - ktep = ktrace_skip(xfs_bmbt_trace_buf, skip_entries, &kts); + ktep = ktrace_skip(trace_buf, skip_entries, &kts); if (ktep == NULL) { qprintf("Skipped them all\n"); return; } } while (ktep != NULL) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(btnum, ktep)) qprintf("\n"); - ktep = ktrace_next(xfs_bmbt_trace_buf, &kts); + ktep = ktrace_next(trace_buf, &kts); } } @@ -4465,7 +4605,7 @@ xfsidbg_xbmitrace(xfs_inode_t *ip) ktep = ktrace_first(ip->i_btrace, &kts); while (ktep != NULL) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(XFS_BTNUM_BMAP, ktep)) qprintf("\n"); ktep = ktrace_next(ip->i_btrace, &kts); } @@ -4488,7 +4628,7 @@ xfsidbg_xbmstrace(xfs_inode_t *ip) ktep = ktrace_first(xfs_bmbt_trace_buf, &kts); while (ktep != NULL) { if ((xfs_inode_t *)(ktep->val[2]) == ip) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(XFS_BTNUM_BMAP, ktep)) qprintf("\n"); } ktep = ktrace_next(xfs_bmbt_trace_buf, &kts); @@ -4500,7 +4640,7 @@ xfsidbg_xbmstrace(xfs_inode_t *ip) * Print xfs bmap record */ static void -xfsidbg_xbrec(xfs_bmbt_rec_host_t *r) +xfsidbg_xbmbtrec(xfs_bmbt_rec_host_t *r) { xfs_bmbt_irec_t irec; @@ -6445,7 +6585,7 @@ xfsidbg_xnode(xfs_inode_t *ip) #ifdef XFS_BMAP_TRACE qprintf(" bmap_trace 0x%p\n", ip->i_xtrace); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE qprintf(" bmbt trace 0x%p\n", ip->i_btrace); #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.h 2008-07-21 01:54:02.000000000 +0200 @@ -0,0 +1,111 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __XFS_BTREE_TRACE_H__ +#define __XFS_BTREE_TRACE_H__ + +struct xfs_btree_cur; +struct xfs_buf; + + +/* + * Trace hooks. + * i,j = integer (32 bit) + * b = btree block buffer (xfs_buf_t) + * p = btree ptr + * r = btree record + * k = btree key + * f = fsblock + */ + +#ifdef XFS_BTREE_TRACE + +/* + * Trace buffer entry types. + */ +#define XFS_BTREE_KTRACE_ARGBI 1 +#define XFS_BTREE_KTRACE_ARGBII 2 +#define XFS_BTREE_KTRACE_ARGFFFI 3 +#define XFS_BTREE_KTRACE_ARGI 4 +#define XFS_BTREE_KTRACE_ARGIFK 5 +#define XFS_BTREE_KTRACE_ARGIFR 6 +#define XFS_BTREE_KTRACE_ARGIK 7 +#define XFS_BTREE_KTRACE_CUR 8 + +/* + * Sub-types for cursor traces. + */ +#define XBT_ARGS 0 +#define XBT_ENTRY 1 +#define XBT_ERROR 2 +#define XBT_EXIT 3 + +void xfs_btree_trace_argbi(const char *, struct xfs_btree_cur *, + struct xfs_buf *, int, int); +void xfs_btree_trace_argbii(const char *, struct xfs_btree_cur *, + struct xfs_buf *, int, int, int); +void xfs_btree_trace_argfffi(const char *, struct xfs_btree_cur *, + xfs_dfiloff_t, xfs_dfsbno_t, xfs_dfilblks_t, int, int); +void xfs_btree_trace_argi(const char *, struct xfs_btree_cur *, int, int); +void xfs_btree_trace_argifk(const char *, struct xfs_btree_cur *, int, + xfs_fsblock_t, xfs_dfiloff_t, int); +void xfs_btree_trace_argifr(const char *, struct xfs_btree_cur *, int, + xfs_fsblock_t, union xfs_btree_rec *, int); +void xfs_btree_trace_argik(const char *, struct xfs_btree_cur *, int, + union xfs_btree_key *, int); +void xfs_btree_trace_cursor(const char *, struct xfs_btree_cur *, int, int); + + +#define XFS_ALLOCBT_TRACE_SIZE 4096 /* size of global trace buffer */ +extern ktrace_t *xfs_allocbt_trace_buf; + +#define XFS_INOBT_TRACE_SIZE 4096 /* size of global trace buffer */ +extern ktrace_t *xfs_inobt_trace_buf; + +#define XFS_BMBT_TRACE_SIZE 4096 /* size of global trace buffer */ +#define XFS_BMBT_KTRACE_SIZE 32 /* size of per-inode trace buffer */ +extern ktrace_t *xfs_bmbt_trace_buf; + + +#define XFS_BTREE_TRACE_ARGBI(c,b,i) \ + xfs_btree_trace_argbi(__func__, c, b, i, __LINE__) +#define XFS_BTREE_TRACE_ARGBII(c,b,i,j) \ + xfs_btree_trace_argbii(__func__, c, b, i, j, __LINE__) +#define XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) \ + xfs_btree_trace_argfffi(__func__, c, o, b, i, j, __LINE__) +#define XFS_BTREE_TRACE_ARGI(c,i) \ + xfs_btree_trace_argi(__func__, c, i, __LINE__) +#define XFS_BTREE_TRACE_ARGIFK(c,i,f,s) \ + xfs_btree_trace_argifk(__func__, c, i, f, s, __LINE__) +#define XFS_BTREE_TRACE_ARGIFR(c,i,f,r) \ + xfs_btree_trace_argifr(__func__, c, i, f, r, __LINE__) +#define XFS_BTREE_TRACE_ARGIK(c,i,k) \ + xfs_btree_trace_argik(__func__, c, i, k, __LINE__) +#define XFS_BTREE_TRACE_CURSOR(c,t) \ + xfs_btree_trace_cursor(__func__, c, t, __LINE__) +#else +#define XFS_BTREE_TRACE_ARGBI(c,b,i) +#define XFS_BTREE_TRACE_ARGBII(c,b,i,j) +#define XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) +#define XFS_BTREE_TRACE_ARGI(c,i) +#define XFS_BTREE_TRACE_ARGIFK(c,i,f,s) +#define XFS_BTREE_TRACE_ARGIFR(c,i,f,r) +#define XFS_BTREE_TRACE_ARGIK(c,i,k) +#define XFS_BTREE_TRACE_CURSOR(c,t) +#endif /* XFS_BTREE_TRACE */ + +#endif /* __XFS_BTREE_TRACE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-21 01:54:00.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-21 01:54:02.000000000 +0200 @@ -2219,8 +2219,82 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_allocbt_trace_buf; + +STATIC void +xfs_allocbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + ktrace_enter(xfs_allocbt_trace_buf, (void *)(__psint_t)type, + (void *)func, (void *)s, NULL, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_allocbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.a.ar_startblock; + *l1 = cur->bc_rec.a.ar_blockcount; +} + +STATIC void +xfs_allocbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->alloc.ar_startblock); + *l1 = be32_to_cpu(key->alloc.ar_blockcount); +} + +STATIC void +xfs_allocbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(&rec->alloc.ar_startblock); + *l1 = be32_to_cpu(&rec->alloc.ar_blockcount); + *l2 = 0; +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_allocbt_trace_enter, + .trace_cursor = xfs_allocbt_trace_cursor, + .trace_key = xfs_allocbt_trace_key, + .trace_record = xfs_allocbt_trace_record, +#endif }; /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-21 01:54:00.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-21 01:54:02.000000000 +0200 @@ -2085,8 +2085,82 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_inobt_trace_buf; + +STATIC void +xfs_inobt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + ktrace_enter(xfs_inobt_trace_buf, (void *)(__psint_t)type, + (void *)func, (void *)s, NULL, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_inobt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.i.ir_startino; + *l1 = cur->bc_rec.i.ir_free; +} + +STATIC void +xfs_inobt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->inobt.ir_startino); + *l1 = 0; +} + +STATIC void +xfs_inobt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(rec->inobt.ir_startino); + *l1 = be32_to_cpu(rec->inobt.ir_freecount); + *l2 = be64_to_cpu(rec->inobt.ir_free); +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_inobt_trace_enter, + .trace_cursor = xfs_inobt_trace_cursor, + .trace_key = xfs_inobt_trace_key, + .trace_record = xfs_inobt_trace_record, +#endif }; /* -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:09:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_62,J_CHICKENPOX_63,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK8QIL016545 for ; Wed, 23 Jul 2008 13:08:29 -0700 X-ASG-Debug-ID: 1216843773-456300850000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 89EDC31C287 for ; Wed, 23 Jul 2008 13:09:34 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id fVT6CXehPIRM7Cuh for ; Wed, 23 Jul 2008 13:09:34 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK9ONg007586 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:09:24 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK9OZx007584 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:09:24 +0200 Date: Wed, 23 Jul 2008 22:09:23 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 11/15] implement generic xfs_btree_increment Subject: [PATCH 11/15] implement generic xfs_btree_increment Message-ID: <20080723200923.GL7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-increment User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843776 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17101 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Because this is the first major generic btree routine this patch includes some infrastrucure, fistly a few routines to deal with a btree block that can be either in short or long form, and secondly xfs_btree_read_buf_block, which is the new central routine to read a btree block given a cursor. [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Notes: - xfs_btree_read_buf_block now includes a xfs_btree_check_block, removed duplicate call Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -191,6 +191,10 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* return address of btree structures */ + union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + /* btree tracing */ #ifdef XFS_BTREE_TRACE void (*trace_enter)(struct xfs_btree_cur *, const char *, @@ -502,6 +506,23 @@ xfs_btree_setbuf( int lev, /* level in btree */ struct xfs_buf *bp); /* new buffer to set */ +/* + * Common btree core entry points. + */ + +int xfs_btree_increment(struct xfs_btree_cur *, int, int *); + + +/* + * Helpers. + */ + +static inline int +xfs_btree_get_numrecs(struct xfs_btree_block *block) +{ + return be16_to_cpu(block->bb_h.bb_numrecs); +} + #endif /* __KERNEL__ */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 04:41:51.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 06:47:21.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_error.h" @@ -829,3 +830,230 @@ xfs_btree_setbuf( cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA; } } + +STATIC int +xfs_btree_ptr_is_null( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + return be64_to_cpu(ptr->l) == NULLFSBLOCK; + else + return be32_to_cpu(ptr->s) == NULLAGBLOCK; +} + +/* + * Get/set/init sibling pointers + */ +STATIC void +xfs_btree_get_sibling( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_ptr *ptr, + int lr) +{ + ASSERT(lr == XFS_BB_LEFTSIB || lr == XFS_BB_RIGHTSIB); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + if (lr == XFS_BB_RIGHTSIB) + ptr->l = block->bb_u.l.bb_rightsib; + else + ptr->l = block->bb_u.l.bb_leftsib; + } else { + if (lr == XFS_BB_RIGHTSIB) + ptr->s = block->bb_u.s.bb_rightsib; + else + ptr->s = block->bb_u.s.bb_leftsib; + } +} + +STATIC struct xfs_btree_block * +xfs_btree_buf_to_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + if (!bp) { + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); + return cur->bc_ops->get_root_from_inode(cur); + } + return XFS_BUF_TO_BLOCK(bp); +} + +STATIC xfs_daddr_t +xfs_btree_ptr_to_daddr( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + ASSERT(be64_to_cpu(ptr->l) != NULLFSBLOCK); + + return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l)); + } else { + ASSERT(cur->bc_private.a.agno != NULLAGNUMBER); + ASSERT(be32_to_cpu(ptr->s) != NULLAGBLOCK); + + return XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_private.a.agno, + be32_to_cpu(ptr->s)); + } +} + +STATIC void +xfs_btree_set_refs( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + switch (cur->bc_btnum) { + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_ALLOC_BTREE_REF); + break; + case XFS_BTNUM_INO: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_INOMAP, XFS_INO_BTREE_REF); + break; + case XFS_BTNUM_BMAP: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_BMAP_BTREE_REF); + break; + default: + ASSERT(0); + } +} + +/* + * Read in the buffer at the given ptr and return the buffer and + * the block pointer within the buffer. + */ +STATIC int +xfs_btree_read_buf_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr, + int level, + int flags, + struct xfs_btree_block **block, + struct xfs_buf **bpp) +{ + struct xfs_mount *mp = cur->bc_mp; + xfs_daddr_t d; + int error; + + /* need to sort out how callers deal with failures first */ + ASSERT(!(flags & XFS_BUF_TRYLOCK)); + + d = xfs_btree_ptr_to_daddr(cur, ptr); + error = xfs_trans_read_buf(mp, cur->bc_tp, mp->m_ddev_targp, d, + mp->m_bsize, flags, bpp); + if (error) + return error; + + ASSERT(*bpp != NULL); + ASSERT(!XFS_BUF_GETERROR(*bpp)); + + xfs_btree_set_refs(cur, *bpp); + *block = XFS_BUF_TO_BLOCK(*bpp); + + return xfs_btree_check_block(cur, *block, level, *bpp); +} + +/* + * Increment cursor by one record at the level. + * For nonzero levels the leaf-ward information is untouched. + */ +int /* error */ +xfs_btree_increment( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; + union xfs_btree_ptr ptr; + struct xfs_buf *bp; + int error; /* error return value */ + int lev; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + ASSERT(level < cur->bc_nlevels); + + /* Read-ahead to the right at this level. */ + xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); + + /* Get a pointer to the btree block. */ + block = xfs_btree_get_block(cur, level, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* We're done if we remain in the block after the increment. */ + if (++cur->bc_ptrs[level] <= xfs_btree_get_numrecs(block)) + goto out1; + + /* Fail if we just went off the right edge of the tree. */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (xfs_btree_ptr_is_null(cur, &ptr)) + goto out0; + + XFS_BTREE_STATS_INC(cur, increment); + + /* + * March up the tree incrementing pointers. + * Stop when we don't go off the right edge of a block. + */ + for (lev = level + 1; lev < cur->bc_nlevels; lev++) { + block = xfs_btree_get_block(cur, lev, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, lev, bp); + if (error) + goto error0; +#endif + + if (++cur->bc_ptrs[lev] <= xfs_btree_get_numrecs(block)) + break; + + /* Read-ahead the right block for the next loop. */ + xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); + } + + /* + * If we went off the root then we are either seriously + * confused or have the tree root in an inode. + */ + if (lev == cur->bc_nlevels) { + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); + goto out0; + } + ASSERT(lev < cur->bc_nlevels); + + /* + * Now walk back down the tree, fixing up the cursor's buffer + * pointers and key numbers. + */ + for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { + union xfs_btree_ptr *ptrp; + + ptrp = cur->bc_ops->ptr_addr(cur, cur->bc_ptrs[lev], block); + error = xfs_btree_read_buf_block(cur, ptrp, --lev, + 0, &block, &bp); + if (error) + goto error0; + + xfs_btree_setbuf(cur, lev, bp); + cur->bc_ptrs[lev] = 1; + } +out1: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-21 06:46:13.000000000 +0200 @@ -303,7 +303,7 @@ xfs_alloc_delrec( */ i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_increment(tcur, level, &i))) + if ((error = xfs_btree_increment(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); i = xfs_btree_lastrec(tcur, level); @@ -517,7 +517,7 @@ xfs_alloc_delrec( * us, increment the cursor at that level. */ else if (level + 1 < cur->bc_nlevels && - (error = xfs_alloc_increment(cur, level + 1, &i))) + (error = xfs_btree_increment(cur, level + 1, &i))) return error; /* * Fix up the number of records in the surviving block. @@ -1134,7 +1134,7 @@ xfs_alloc_lookup( int i; cur->bc_ptrs[0] = keyno; - if ((error = xfs_alloc_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); *stat = 1; @@ -1570,7 +1570,7 @@ xfs_alloc_rshift( return error; i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_increment(tcur, level, &i)) || + if ((error = xfs_btree_increment(tcur, level, &i)) || (error = xfs_alloc_updkey(tcur, rkp, level + 1))) goto error0; xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); @@ -1943,97 +1943,6 @@ xfs_alloc_get_rec( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_alloc_increment( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* tree block buffer */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the right at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - /* - * Get a pointer to the btree block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Increment the ptr at this level. If we're still in the block - * then we're done. - */ - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - *stat = 1; - return 0; - } - /* - * If we just went off the right edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree incrementing pointers. - * Stop when we don't go off the right edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - bp = cur->bc_bufs[lev]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - /* - * Read-ahead the right block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (bp = cur->bc_bufs[lev], block = XFS_BUF_TO_ALLOC_BLOCK(bp); - lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_ALLOC_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = 1; - } - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ @@ -2219,6 +2128,16 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC union xfs_btree_ptr * +xfs_allocbt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *) + XFS_ALLOC_PTR_ADDR(&block->bb_h, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -2288,6 +2207,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .ptr_addr = xfs_allocbt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -114,12 +114,6 @@ extern int xfs_alloc_get_rec(struct xfs_ xfs_extlen_t *len, int *stat); /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_alloc_increment(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-21 06:46:13.000000000 +0200 @@ -818,7 +818,7 @@ xfs_alloc_ag_vextent_near( XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if (ltlen >= args->minlen) break; - if ((error = xfs_alloc_increment(cnt_cur, 0, &i))) + if ((error = xfs_btree_increment(cnt_cur, 0, &i))) goto error0; } while (i); ASSERT(ltlen >= args->minlen); @@ -828,7 +828,7 @@ xfs_alloc_ag_vextent_near( i = cnt_cur->bc_ptrs[0]; for (j = 1, blen = 0, bdiff = 0; !error && j && (blen < args->maxlen || bdiff > 0); - error = xfs_alloc_increment(cnt_cur, 0, &j)) { + error = xfs_btree_increment(cnt_cur, 0, &j)) { /* * For each entry, decide if it's better than * the previous best entry. @@ -938,7 +938,7 @@ xfs_alloc_ag_vextent_near( * Increment the cursor, so we will point at the entry just right * of the leftward entry if any, or to the leftmost entry. */ - if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) + if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) goto error0; if (!i) { /* @@ -977,7 +977,7 @@ xfs_alloc_ag_vextent_near( args->minlen, >bnoa, >lena); if (gtlena >= args->minlen) break; - if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) + if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) goto error0; if (!i) { xfs_btree_del_cursor(bno_cur_gt, @@ -1066,7 +1066,7 @@ xfs_alloc_ag_vextent_near( /* * Fell off the right end. */ - if ((error = xfs_alloc_increment( + if ((error = xfs_btree_increment( bno_cur_gt, 0, &i))) goto error0; if (!i) { @@ -1548,7 +1548,7 @@ xfs_free_ag_extent( * Look for a neighboring block on the right (higher block numbers) * that is contiguous with this space. */ - if ((error = xfs_alloc_increment(bno_cur, 0, &haveright))) + if ((error = xfs_btree_increment(bno_cur, 0, &haveright))) goto error0; if (haveright) { /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-21 06:46:13.000000000 +0200 @@ -253,7 +253,7 @@ xfs_inobt_delrec( */ i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_inobt_increment(tcur, level, &i))) + if ((error = xfs_btree_increment(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); i = xfs_btree_lastrec(tcur, level); @@ -463,7 +463,7 @@ xfs_inobt_delrec( * us, increment the cursor at that level. */ else if (level + 1 < cur->bc_nlevels && - (error = xfs_alloc_increment(cur, level + 1, &i))) + (error = xfs_btree_increment(cur, level + 1, &i))) return error; /* * Fix up the number of records in the surviving block. @@ -1014,7 +1014,7 @@ xfs_inobt_lookup( int i; cur->bc_ptrs[0] = keyno; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) return error; ASSERT(i == 1); *stat = 1; @@ -1443,7 +1443,7 @@ xfs_inobt_rshift( if ((error = xfs_btree_dup_cursor(cur, &tcur))) return error; xfs_btree_lastrec(tcur, level); - if ((error = xfs_inobt_increment(tcur, level, &i)) || + if ((error = xfs_btree_increment(tcur, level, &i)) || (error = xfs_inobt_updkey(tcur, rkp, level + 1))) { xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); return error; @@ -1821,97 +1821,6 @@ xfs_inobt_get_rec( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_inobt_increment( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_inobt_block_t *block; /* btree block */ - xfs_buf_t *bp; /* buffer containing btree block */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the right at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - /* - * Get a pointer to the btree block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Increment the ptr at this level. If we're still in the block - * then we're done. - */ - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - *stat = 1; - return 0; - } - /* - * If we just went off the right edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree incrementing pointers. - * Stop when we don't go off the right edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - bp = cur->bc_bufs[lev]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - /* - * Read-ahead the right block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (bp = cur->bc_bufs[lev], block = XFS_BUF_TO_INOBT_BLOCK(bp); - lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_INO_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = 1; - } - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ @@ -2085,6 +1994,16 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC union xfs_btree_ptr * +xfs_inobt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *) + XFS_INOBT_PTR_ADDR(&block->bb_h, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -2154,6 +2073,7 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .ptr_addr = xfs_inobt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-21 06:46:13.000000000 +0200 @@ -695,7 +695,7 @@ nextag: goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } while (i == 1); @@ -753,7 +753,7 @@ nextag: /* * Search right with cur, go forward 1 record. */ - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error1; doneright = !i; if (!doneright) { @@ -835,7 +835,7 @@ nextag: * further right. */ else { - if ((error = xfs_inobt_increment(cur, 0, + if ((error = xfs_btree_increment(cur, 0, &i))) goto error1; doneright = !i; @@ -890,7 +890,7 @@ nextag: XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if (rec.ir_freecount > 0) break; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); } @@ -924,7 +924,7 @@ nextag: goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } while (i == 1); ASSERT(freecount == be32_to_cpu(agi->agi_freecount) || @@ -1033,7 +1033,7 @@ xfs_difree( goto error0; if (i) { freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } } while (i == 1); @@ -1138,7 +1138,7 @@ xfs_difree( goto error0; if (i) { freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } } while (i == 1); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -136,12 +136,6 @@ extern int xfs_inobt_get_rec(struct xfs_ __int32_t *fcnt, xfs_inofree_t *free, int *stat); /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_inobt_increment(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-21 04:42:09.000000000 +0200 @@ -473,7 +473,7 @@ xfs_bulkstat( * In any case, increment to the next record. */ if (!error) - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); } else { /* * Start of ag. Lookup the first inode chunk. @@ -540,7 +540,7 @@ xfs_bulkstat( * Set agino to after this chunk and bump the cursor. */ agino = gino + XFS_INODES_PER_CHUNK; - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); cond_resched(); } /* @@ -887,7 +887,7 @@ xfs_inumbers( bufidx = 0; } if (left) { - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); if (error) { xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); cur = NULL; Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-21 06:46:13.000000000 +0200 @@ -1646,7 +1646,7 @@ xfs_bmap_add_extent_unwritten_real( PREV.br_blockcount - new->br_blockcount, oldext))) goto done; - if ((error = xfs_bmbt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto done; if ((error = xfs_bmbt_update(cur, new->br_startoff, new->br_startblock, @@ -3253,7 +3253,7 @@ xfs_bmap_del_extent( got.br_startblock, temp, got.br_state))) goto done; - if ((error = xfs_bmbt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto done; cur->bc_rec.b = new; error = xfs_bmbt_insert(cur, &i); Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-21 06:46:13.000000000 +0200 @@ -253,7 +253,7 @@ xfs_bmbt_delrec( if (rbno != NULLFSBLOCK) { i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_increment(tcur, level, &i))) { + if ((error = xfs_btree_increment(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -444,7 +444,7 @@ xfs_bmbt_delrec( cur->bc_bufs[level] = lbp; cur->bc_ptrs[level] += lrecs; cur->bc_ra[level] = 0; - } else if ((error = xfs_bmbt_increment(cur, level + 1, &i))) { + } else if ((error = xfs_btree_increment(cur, level + 1, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -928,7 +928,7 @@ xfs_bmbt_lookup( if (dir == XFS_LOOKUP_GE && keyno > be16_to_cpu(block->bb_numrecs) && be64_to_cpu(block->bb_rightsib) != NULLDFSBNO) { cur->bc_ptrs[0] = keyno; - if ((error = xfs_bmbt_increment(cur, 0, &i))) { + if ((error = xfs_btree_increment(cur, 0, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -1201,7 +1201,7 @@ xfs_bmbt_rshift( } i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_increment(tcur, level, &i))) { + if ((error = xfs_btree_increment(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(tcur, ERROR); goto error1; } @@ -1759,86 +1759,6 @@ xfs_bmbt_disk_get_startoff( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_bmbt_increment( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; /* error return value */ - xfs_fsblock_t fsbno; - int lev; - xfs_mount_t *mp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ASSERT(level < cur->bc_nlevels); - - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - if (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - block = xfs_bmbt_get_block(cur, lev, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - if (lev == cur->bc_nlevels) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - tp = cur->bc_tp; - mp = cur->bc_mp; - for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) { - fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[lev] = 1; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * * A multi-level split of the tree on insert will invalidate the original @@ -2423,6 +2343,16 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC union xfs_btree_ptr * +xfs_bmbt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *) + XFS_BMAP_PTR_IADDR(&block->bb_h, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2512,6 +2442,7 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .ptr_addr = xfs_bmbt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -251,7 +251,6 @@ extern void xfs_bmbt_disk_get_all(xfs_bm extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r); extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r); -extern int xfs_bmbt_increment(struct xfs_btree_cur *, int, int *); extern int xfs_bmbt_insert(struct xfs_btree_cur *, int *); extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:09:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK8nNV016954 for ; Wed, 23 Jul 2008 13:08:49 -0700 X-ASG-Debug-ID: 1216843796-577803600000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 21C07E8E89B for ; Wed, 23 Jul 2008 13:09:56 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id o8f0XO6f4pZNR39t for ; Wed, 23 Jul 2008 13:09:56 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK9kNg007658 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:09:46 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK9jIx007656 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:09:45 +0200 Date: Wed, 23 Jul 2008 22:09:45 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 15/15] implement generic xfs_btree_update Subject: [PATCH 15/15] implement generic xfs_btree_update Message-ID: <20080723200945.GP7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline; filename=xfs-common-btree-update Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843799 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.659 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17102 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner The most complicated part here is the lastrec tracking for the alloc btree. Most logic is in the update_lastrec method which has to do some hopefully good enough dirty magic to maintain it. [hch: split out from bigger patch and a rework of the lastrec logic] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 05:10:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 05:24:20.000000000 +0200 @@ -867,6 +867,30 @@ xfs_btree_get_sibling( } } +/* + * Return true if ptr is the last record in the btree and + * we need to track updateÑ• to this record. The decision + * will be further refined in the update_lastrec method. + */ +STATIC int +xfs_btree_is_lastrec( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + int level) +{ + union xfs_btree_ptr ptr; + + if (level > 0) + return 0; + if (!(cur->bc_flags & XFS_BTREE_LASTREC_UPDATE)) + return 0; + + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (!xfs_btree_ptr_is_null(cur, &ptr)) + return 0; + return 1; +} + STATIC struct xfs_btree_block * xfs_btree_buf_to_block( struct xfs_btree_cur *cur, @@ -1417,3 +1441,66 @@ xfs_btree_updkey( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); return 0; } + +/* + * Update the record referred to by cur to the value in the + * given record. This either works (return 0) or gets an + * EFSCORRUPTED error. + */ +int +xfs_btree_update( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + struct xfs_btree_block *block; + struct xfs_buf *bp; + int error; + int ptr; + union xfs_btree_rec *rp; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGR(cur, rec); + + /* Pick up the current block. */ + block = xfs_btree_get_block(cur, 0, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, 0, bp); + if (error) + goto error0; +#endif + /* Get the address of the rec to be updated. */ + ptr = cur->bc_ptrs[0]; + rp = cur->bc_ops->rec_addr(cur, ptr, block); + + /* Fill in the new contents and log them. */ + cur->bc_ops->copy_recs(cur, rec, rp, 1); + cur->bc_ops->log_recs(cur, bp, ptr, ptr); + + /* + * If we are tracking the last record in the tree and + * we are at the far right edge of the tree, update it. + */ + if (xfs_btree_is_lastrec(cur, block, 0)) { + cur->bc_ops->update_lastrec(cur, block, rec, + ptr, LASTREC_UPDATE); + } + + /* Updating first rec in leaf. Pass new key value up to our parent. */ + if (ptr == 1) { + union xfs_btree_key key; + + cur->bc_ops->init_key_from_rec(cur, &key, rec); + error = xfs_btree_updkey(cur, &key, 1); + if (error) + goto error0; + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-21 05:10:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-21 05:45:02.000000000 +0200 @@ -49,7 +49,9 @@ STATIC void xfs_allocbt_log_keys(xfs_btr #define xfs_alloc_log_keys(c, b, i, j) \ xfs_allocbt_log_keys(c, b, i, j) STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_alloc_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); +STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); +#define xfs_alloc_log_recs(c, b, i, j) \ + xfs_allocbt_log_recs(c, b, i, j) STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); @@ -883,41 +885,6 @@ xfs_alloc_log_ptrs( } /* - * Log records from a btree block (leaf). - */ -STATIC void -xfs_alloc_log_recs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int rfirst, /* index of first record to log */ - int rlast) /* index of last record to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_alloc_rec_t *rp; /* record pointer for btree block */ - - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - rp = XFS_ALLOC_REC_ADDR(block, 1, cur); -#ifdef DEBUG - { - xfs_agf_t *agf; - xfs_alloc_rec_t *p; - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - for (p = &rp[rfirst - 1]; p <= &rp[rlast - 1]; p++) - ASSERT(be32_to_cpu(p->ar_startblock) + - be32_to_cpu(p->ar_blockcount) <= - be32_to_cpu(agf->agf_length)); - } -#endif - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1642,83 +1609,50 @@ xfs_alloc_insert( return 0; } +STATIC struct xfs_btree_cur * +xfs_allocbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno, + cur->bc_btnum); +} + /* - * Update the record referred to by cur, to the value given by [bno, len]. - * This either works (return 0) or gets an EFSCORRUPTED error. + * Update the longest extent in the AGF */ -int /* error */ -xfs_alloc_update( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len) /* length of extent */ +STATIC void +xfs_allocbt_update_lastrec( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_rec *rec, + int ptr, + int reason) { - xfs_alloc_block_t *block; /* btree block to update */ - int error; /* error return value */ - int ptr; /* current record number (updating) */ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); + __be32 len; - ASSERT(len > 0); - /* - * Pick up the a.g. freelist struct and the current block. - */ - block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[0]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0]))) - return error; -#endif - /* - * Get the address of the rec to be updated. - */ - ptr = cur->bc_ptrs[0]; - { - xfs_alloc_rec_t *rp; /* pointer to updated record */ + ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); - rp = XFS_ALLOC_REC_ADDR(block, ptr, cur); + switch (reason) { + case LASTREC_UPDATE: /* - * Fill in the new contents and log them. + * If this is the last leaf block and it's the last record, + * then update the size of the longest extent in the AG. */ - rp->ar_startblock = cpu_to_be32(bno); - rp->ar_blockcount = cpu_to_be32(len); - xfs_alloc_log_recs(cur, cur->bc_bufs[0], ptr, ptr); + if (ptr != xfs_btree_get_numrecs(block)) + return; + len = rec->alloc.ar_blockcount; + break; + default: + ASSERT(0); + return; } - /* - * If it's the by-size btree and it's the last leaf block and - * it's the last record... then update the size of the longest - * extent in the a.g., which we cache in the a.g. freelist header. - */ - if (cur->bc_btnum == XFS_BTNUM_CNT && - be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK && - ptr == be16_to_cpu(block->bb_numrecs)) { - xfs_agf_t *agf; /* a.g. freespace header */ - xfs_agnumber_t seqno; - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - seqno = be32_to_cpu(agf->agf_seqno); - cur->bc_mp->m_perag[seqno].pagf_longest = len; - agf->agf_longest = cpu_to_be32(len); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_LONGEST); - } - /* - * Updating first record in leaf. Pass new key value up to our parent. - */ - if (ptr == 1) { - xfs_alloc_key_t key; /* key containing [bno, len] */ - - key.ar_startblock = cpu_to_be32(bno); - key.ar_blockcount = cpu_to_be32(len); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) - return error; - } - return 0; -} -STATIC struct xfs_btree_cur * -xfs_allocbt_dup_cursor( - struct xfs_btree_cur *cur) -{ - return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agbp, cur->bc_private.a.agno, - cur->bc_btnum); + agf->agf_longest = len; + cur->bc_mp->m_perag[seqno].pagf_longest = be32_to_cpu(len); + xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST); } STATIC void @@ -1808,6 +1742,17 @@ xfs_allocbt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_alloc_key_t)); } +STATIC void +xfs_allocbt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_alloc_rec_t)); +} + /* * Log keys from a btree block (nonleaf). */ @@ -1835,6 +1780,44 @@ xfs_allocbt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log records from a btree block (leaf). + */ +STATIC void +xfs_alloc_log_recs( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int rfirst, /* index of first record to log */ + int rlast) /* index of last record to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + int last; /* last byte offset logged */ + xfs_alloc_rec_t *rp; /* record pointer for btree block */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, rfirst, rlast); + + block = XFS_BUF_TO_SBLOCK(bp); + rp = XFS_ALLOC_REC_ADDR(block, 1, cur); +#ifdef DEBUG + { + struct xfs_agf *agf; + xfs_alloc_rec_t *p; + + agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + for (p = &rp[rfirst - 1]; p <= &rp[rlast - 1]; p++) + ASSERT(be32_to_cpu(p->ar_startblock) + + be32_to_cpu(p->ar_blockcount) <= + be32_to_cpu(agf->agf_length)); + } +#endif + first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} #ifdef XFS_BTREE_TRACE @@ -1905,6 +1888,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .update_lastrec = xfs_allocbt_update_lastrec, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, @@ -1912,7 +1896,9 @@ static const struct xfs_btree_ops xfs_al .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, .copy_keys = xfs_allocbt_copy_keys, + .copy_recs = xfs_allocbt_copy_recs, .log_keys = xfs_allocbt_log_keys, + .log_recs = xfs_allocbt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, @@ -1947,6 +1933,8 @@ xfs_allocbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_allocbt_ops; + if (btnum == XFS_BTNUM_CNT) + cur->bc_flags = XFS_BTREE_LASTREC_UPDATE; cur->bc_private.a.agbp = agbp; cur->bc_private.a.agno = agno; Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 05:11:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 05:23:07.000000000 +0200 @@ -191,6 +191,11 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* updated last record information */ + void (*update_lastrec)(struct xfs_btree_cur *, + struct xfs_btree_block *, + union xfs_btree_rec *, int, int); + /* return address of btree structures */ union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); @@ -214,11 +219,15 @@ struct xfs_btree_ops { void (*copy_keys)(struct xfs_btree_cur *cur, union xfs_btree_key *src_key, union xfs_btree_key *dst_key, int numkeys); + void (*copy_recs)(struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, int numkeys); /* log changes to btree structures */ void (*log_keys)(struct xfs_btree_cur *cur, struct xfs_buf *bp, int first, int last); - + void (*log_recs)(struct xfs_btree_cur *cur, struct xfs_buf *bp, + int first, int last); /* btree tracing */ #ifdef XFS_BTREE_TRACE @@ -241,6 +250,12 @@ struct xfs_btree_ops { }; /* + * Reasons for the update_lastrec method to be called. + */ +#define LASTREC_UPDATE 0 + + +/* * Btree cursor structure. * This collects all information needed by the btree code in one place. */ @@ -284,6 +299,7 @@ typedef struct xfs_btree_cur /* cursor flags */ #define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ +#define XFS_BTREE_LASTREC_UPDATE (1<<2) /* track last rec externally */ #define XFS_BTREE_NOERROR 0 @@ -539,6 +555,7 @@ int xfs_btree_increment(struct xfs_btree int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); +int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); /* Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree_trace.c 2008-07-21 05:08:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.c 2008-07-21 05:17:12.000000000 +0200 @@ -158,6 +158,27 @@ xfs_btree_trace_argik( } /* + * Add a trace buffer entry for arguments, for record. + */ +void +xfs_btree_trace_argr( + const char *func, + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + int line) +{ + __uint64_t l0, l1, l2; + + cur->bc_ops->trace_record(cur, rec, &l0, &l1, &l2); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGR, + line, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + l2 >> 32, (int)l2, + 0, 0, 0, 0, 0); +} + +/* * Add a trace buffer entry for the cursor/operation. */ void Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree_trace.h 2008-07-21 05:08:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.h 2008-07-21 05:17:12.000000000 +0200 @@ -44,7 +44,8 @@ struct xfs_buf; #define XFS_BTREE_KTRACE_ARGIFK 5 #define XFS_BTREE_KTRACE_ARGIFR 6 #define XFS_BTREE_KTRACE_ARGIK 7 -#define XFS_BTREE_KTRACE_CUR 8 +#define XFS_BTREE_KTRACE_ARGR 8 +#define XFS_BTREE_KTRACE_CUR 9 /* * Sub-types for cursor traces. @@ -67,6 +68,8 @@ void xfs_btree_trace_argifr(const char * xfs_fsblock_t, union xfs_btree_rec *, int); void xfs_btree_trace_argik(const char *, struct xfs_btree_cur *, int, union xfs_btree_key *, int); +void xfs_btree_trace_argr(const char *, struct xfs_btree_cur *, + union xfs_btree_rec *, int); void xfs_btree_trace_cursor(const char *, struct xfs_btree_cur *, int, int); @@ -95,6 +98,8 @@ extern ktrace_t *xfs_bmbt_trace_buf; xfs_btree_trace_argifr(__func__, c, i, f, r, __LINE__) #define XFS_BTREE_TRACE_ARGIK(c,i,k) \ xfs_btree_trace_argik(__func__, c, i, k, __LINE__) +#define XFS_BTREE_TRACE_ARGR(c,r) \ + xfs_btree_trace_argr(__func__, c, r, __LINE__) #define XFS_BTREE_TRACE_CURSOR(c,t) \ xfs_btree_trace_cursor(__func__, c, t, __LINE__) #else @@ -105,6 +110,7 @@ extern ktrace_t *xfs_bmbt_trace_buf; #define XFS_BTREE_TRACE_ARGIFK(c,i,f,s) #define XFS_BTREE_TRACE_ARGIFR(c,i,f,r) #define XFS_BTREE_TRACE_ARGIK(c,i,k) +#define XFS_BTREE_TRACE_ARGR(c,r) #define XFS_BTREE_TRACE_CURSOR(c,t) #endif /* XFS_BTREE_TRACE */ Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-21 05:08:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-21 05:17:12.000000000 +0200 @@ -2952,6 +2952,15 @@ xfs_btree_trace_entry( (unsigned long)ktep->val[8], (unsigned long)ktep->val[9]); break; + case XFS_BTREE_KTRACE_ARGR: + xfsidb_btree_trace_record(btnum, + (unsigned long)ktep->val[5], + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9], + (unsigned long)ktep->val[10]); + break; case XFS_BTREE_KTRACE_CUR: xfsidb_btree_trace_cursor(btnum, Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-21 05:08:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-21 05:22:00.000000000 +0200 @@ -136,6 +136,23 @@ xfs_alloc_lookup_le( return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); } +/* + * Update the record referred to by cur to the value given + * by [bno, len]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_alloc_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len) /* length of extent */ +{ + union xfs_btree_rec rec; + + rec.alloc.ar_startblock = cpu_to_be32(bno); + rec.alloc.ar_blockcount = cpu_to_be32(len); + return xfs_btree_update(cur, &rec); +} /* * Compute aligned version of the found extent. Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-21 05:08:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-21 05:17:12.000000000 +0200 @@ -113,13 +113,6 @@ extern int xfs_alloc_get_rec(struct xfs_ */ extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat); -/* - * Update the record referred to by cur, to the value given by [bno, len]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -extern int xfs_alloc_update(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len); - extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-21 05:25:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-21 05:30:09.000000000 +0200 @@ -172,6 +172,26 @@ xfs_inobt_lookup_le( } /* + * Update the record referred to by cur to the value given + * by [ino, fcnt, free]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_inobt_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free) /* free inode mask */ +{ + union xfs_btree_rec rec; + + rec.inobt.ir_startino = cpu_to_be32(ino); + rec.inobt.ir_freecount = cpu_to_be32(fcnt); + rec.inobt.ir_free = cpu_to_be64(free); + return xfs_btree_update(cur, &rec); +} + +/* * Allocate new inodes in the allocation group specified by agbp. * Return 0 for success, else error code. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-21 05:25:48.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-21 05:44:35.000000000 +0200 @@ -785,28 +785,6 @@ xfs_inobt_log_ptrs( } /* - * Log records from a btree block (leaf). - */ -STATIC void -xfs_inobt_log_recs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int rfirst, /* index of first record to log */ - int rlast) /* index of last record to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_inobt_rec_t *rp; /* record pointer for btree block */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - rp = XFS_INOBT_REC_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1530,58 +1508,6 @@ xfs_inobt_insert( return 0; } -/* - * Update the record referred to by cur, to the value given - * by [ino, fcnt, free]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -int /* error */ -xfs_inobt_update( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free) /* free inode mask */ -{ - xfs_inobt_block_t *block; /* btree block to update */ - xfs_buf_t *bp; /* buffer containing btree block */ - int error; /* error return value */ - int ptr; /* current record number (updating) */ - xfs_inobt_rec_t *rp; /* pointer to updated record */ - - /* - * Pick up the current block. - */ - bp = cur->bc_bufs[0]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, 0, bp))) - return error; -#endif - /* - * Get the address of the rec to be updated. - */ - ptr = cur->bc_ptrs[0]; - rp = XFS_INOBT_REC_ADDR(block, ptr, cur); - /* - * Fill in the new contents and log them. - */ - rp->ir_startino = cpu_to_be32(ino); - rp->ir_freecount = cpu_to_be32(fcnt); - rp->ir_free = cpu_to_be64(free); - xfs_inobt_log_recs(cur, bp, ptr, ptr); - /* - * Updating first record in leaf. Pass new key value up to our parent. - */ - if (ptr == 1) { - xfs_inobt_key_t key; /* key containing [ino] */ - - key.ir_startino = cpu_to_be32(ino); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) - return error; - } - return 0; -} - STATIC struct xfs_btree_cur * xfs_inobt_dup_cursor( struct xfs_btree_cur *cur) @@ -1664,6 +1590,17 @@ xfs_inobt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_inobt_key_t)); } +STATIC void +xfs_inobt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_inobt_rec_t)); +} + /* * Log keys from a btree block (nonleaf). */ @@ -1691,6 +1628,34 @@ xfs_inobt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log records from a btree block (leaf). + */ +STATIC void +xfs_inobt_log_recs( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_buf_t *bp, /* buffer containing btree block */ + int rfirst, /* index of first record to log */ + int rlast) /* index of last record to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + int last; /* last byte offset logged */ + xfs_inobt_rec_t *rp; /* record pointer for btree block */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, rfirst, rlast); + + block = XFS_BUF_TO_SBLOCK(bp); + rp = XFS_INOBT_REC_ADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1767,7 +1732,9 @@ static const struct xfs_btree_ops xfs_in .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, .copy_keys = xfs_inobt_copy_keys, + .copy_recs = xfs_inobt_copy_recs, .log_keys = xfs_inobt_log_keys, + .log_recs = xfs_inobt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-21 05:25:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-21 05:25:47.000000000 +0200 @@ -135,14 +135,6 @@ extern int xfs_inobt_get_rec(struct xfs_ */ extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat); -/* - * Update the record referred to by cur, to the value given - * by [ino, fcnt, free]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -extern int xfs_inobt_update(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free); - extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-21 05:27:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-21 05:29:42.000000000 +0200 @@ -430,6 +430,24 @@ xfs_bmbt_lookup_ge( return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); } +/* +* Update the record referred to by cur to the value given + * by [off, bno, len, state]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int +xfs_bmbt_update( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + xfs_exntst_t state) +{ + union xfs_btree_rec rec; + + xfs_bmbt_disk_set_allf(&rec.bmbt, off, bno, len, state); + return xfs_btree_update(cur, &rec); +} /* * Called from xfs_bmap_add_attrfork to handle btree format files. Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-21 05:27:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-21 05:49:46.000000000 +0200 @@ -1565,34 +1565,6 @@ xfs_bmbt_log_block( } /* - * Log record values from the btree block. - */ -void -xfs_bmbt_log_recs( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int rfirst, - int rlast) -{ - xfs_bmbt_block_t *block; - int first; - int last; - xfs_bmbt_rec_t *rp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, rfirst, rlast); - ASSERT(bp); - tp = cur->bc_tp; - block = XFS_BUF_TO_BMBT_BLOCK(bp); - rp = XFS_BMAP_REC_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* * Give the bmap btree a new root block. Copy the old broot contents * down into a real block and make the broot point to it. */ @@ -1926,51 +1898,6 @@ xfs_bmbt_to_bmdr( } /* - * Update the record to the passed values. - */ -int -xfs_bmbt_update( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - xfs_exntst_t state) -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; - xfs_bmbt_key_t key; - int ptr; - xfs_bmbt_rec_t *rp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGFFFI(cur, (xfs_dfiloff_t)off, (xfs_dfsbno_t)bno, - (xfs_dfilblks_t)len, (int)state); - block = xfs_bmbt_get_block(cur, 0, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, 0, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - ptr = cur->bc_ptrs[0]; - rp = XFS_BMAP_REC_IADDR(block, ptr, cur); - xfs_bmbt_disk_set_allf(rp, off, bno, len, state); - xfs_bmbt_log_recs(cur, bp, ptr, ptr); - if (ptr > 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; - } - key.br_startoff = cpu_to_be64(off); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; -} - -/* * Check extent records, which have just been read, for * any bit in the extent flag field. ASSERT on debug * kernels, as this condition should not occur. @@ -2094,6 +2021,17 @@ xfs_bmbt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_bmbt_key_t)); } +STATIC void +xfs_bmbt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_bmbt_rec_t)); +} + /* * Log key values from the btree block. */ @@ -2126,6 +2064,33 @@ xfs_bmbt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log record values from the btree block. + */ +void +xfs_bmbt_log_recs( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int rfirst, + int rlast) +{ + struct xfs_btree_lblock *block; + int first; + int last; + xfs_bmbt_rec_t *rp; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, rfirst, rlast); + + block = XFS_BUF_TO_LBLOCK(bp); + rp = XFS_BMAP_REC_DADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2222,7 +2187,9 @@ static const struct xfs_btree_ops xfs_bm .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, .copy_keys = xfs_bmbt_copy_keys, + .copy_recs = xfs_bmbt_copy_recs, .log_keys = xfs_bmbt_log_keys, + .log_recs = xfs_bmbt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-21 05:27:31.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-21 05:27:35.000000000 +0200 @@ -274,8 +274,6 @@ extern void xfs_bmbt_disk_set_allf(xfs_b xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v); extern void xfs_bmbt_to_bmdr(xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int); -extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, int); -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:09:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63, J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK8WnR016643 for ; Wed, 23 Jul 2008 13:08:34 -0700 X-ASG-Debug-ID: 1216843780-410c00b80000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B124F31C28D for ; Wed, 23 Jul 2008 13:09:40 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id jxf1Sq86l1UVECsI for ; Wed, 23 Jul 2008 13:09:40 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK9UNg007599 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:09:30 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK9UJB007597 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:09:30 +0200 Date: Wed, 23 Jul 2008 22:09:30 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 12/15] implement generic xfs_btree_decrement Subject: [PATCH 12/15] implement generic xfs_btree_decrement Message-ID: <20080723200930.GM7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-decrement User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843782 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17098 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-15 17:51:36.000000000 +0200 @@ -1057,3 +1057,99 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +/* + * Decrement cursor by one record at the level. + * For nonzero levels the leaf-ward information is untouched. + */ +int /* error */ +xfs_btree_decrement( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; + xfs_buf_t *bp; + int error; /* error return value */ + int lev; + union xfs_btree_ptr ptr; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + ASSERT(level < cur->bc_nlevels); + + /* Read-ahead to the left at this level. */ + xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + + /* We're done if we remain in the block after the decrement. */ + if (--cur->bc_ptrs[level] > 0) + goto out1; + + /* Get a pointer to the btree block. */ + block = xfs_btree_get_block(cur, level, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* Fail if we just went off the left edge of the tree. */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); + if (xfs_btree_ptr_is_null(cur, &ptr)) + goto out0; + + XFS_BTREE_STATS_INC(cur, decrement); + + /* + * March up the tree decrementing pointers. + * Stop when we don't go off the left edge of a block. + */ + for (lev = level + 1; lev < cur->bc_nlevels; lev++) { + if (--cur->bc_ptrs[lev] > 0) + break; + /* Read-ahead the left block for the next loop. */ + xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); + } + + /* + * If we went off the root then we are seriously confused. + * or the root of the tree is in an inode. + */ + if (lev == cur->bc_nlevels) { + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); + goto out0; + } + ASSERT(lev < cur->bc_nlevels); + + /* + * Now walk back down the tree, fixing up the cursor's buffer + * pointers and key numbers. + */ + for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { + union xfs_btree_ptr *ptrp; + + ptrp = cur->bc_ops->ptr_addr(cur, cur->bc_ptrs[lev], block); + error = xfs_btree_read_buf_block(cur, ptrp, --lev, + 0, &block, &bp); + if (error) + goto error0; + xfs_btree_setbuf(cur, lev, bp); + cur->bc_ptrs[lev] = xfs_btree_get_numrecs(block); + } +out1: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-15 17:46:52.000000000 +0200 @@ -961,7 +961,7 @@ xfs_alloc_ag_vextent_near( args->minlen, <bnoa, <lena); if (ltlena >= args->minlen) break; - if ((error = xfs_alloc_decrement(bno_cur_lt, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur_lt, 0, &i))) goto error0; if (!i) { xfs_btree_del_cursor(bno_cur_lt, @@ -1162,7 +1162,7 @@ xfs_alloc_ag_vextent_near( /* * Fell off the left end. */ - if ((error = xfs_alloc_decrement( + if ((error = xfs_btree_decrement( bno_cur_lt, 0, &i))) goto error0; if (!i) { @@ -1321,7 +1321,7 @@ xfs_alloc_ag_vextent_size( bestflen = flen; bestfbno = fbno; for (;;) { - if ((error = xfs_alloc_decrement(cnt_cur, 0, &i))) + if ((error = xfs_btree_decrement(cnt_cur, 0, &i))) goto error0; if (i == 0) break; @@ -1416,7 +1416,7 @@ xfs_alloc_ag_vextent_small( xfs_extlen_t flen; int i; - if ((error = xfs_alloc_decrement(ccur, 0, &i))) + if ((error = xfs_btree_decrement(ccur, 0, &i))) goto error0; if (i) { if ((error = xfs_alloc_get_rec(ccur, &fbno, &flen, &i))) @@ -1607,7 +1607,7 @@ xfs_free_ag_extent( /* * Move the by-block cursor back to the left neighbor. */ - if ((error = xfs_alloc_decrement(bno_cur, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); #ifdef DEBUG @@ -1653,7 +1653,7 @@ xfs_free_ag_extent( * Back up the by-block cursor to the left neighbor, and * update its length. */ - if ((error = xfs_alloc_decrement(bno_cur, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); nbno = ltbno; Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:46:52.000000000 +0200 @@ -256,7 +256,7 @@ xfs_alloc_delrec( xfs_btree_setbuf(cur, level, NULL); cur->bc_nlevels--; } else if (level > 0 && - (error = xfs_alloc_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -272,7 +272,7 @@ xfs_alloc_delrec( * the minimum, we're done. */ if (numrecs >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -336,7 +336,7 @@ xfs_alloc_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); if (level > 0 && - (error = xfs_alloc_decrement(cur, level, + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; @@ -352,7 +352,7 @@ xfs_alloc_delrec( if (lbno != NULLAGBLOCK) { i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); } @@ -368,7 +368,7 @@ xfs_alloc_delrec( */ i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); xfs_btree_firstrec(tcur, level); @@ -468,7 +468,7 @@ xfs_alloc_delrec( * Just return. This is probably a logic error, but it's not fatal. */ else { - if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -1780,90 +1780,6 @@ xfs_alloc_updkey( */ /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_alloc_decrement( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_alloc_block_t *block; /* btree block */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the left at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - /* - * Decrement the ptr at this level. If we're still in the block - * then we're done. - */ - if (--cur->bc_ptrs[level] > 0) { - *stat = 1; - return 0; - } - /* - * Get a pointer to the btree block. - */ - block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[level]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, - cur->bc_bufs[level]))) - return error; -#endif - /* - * If we just went off the left edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree decrementing pointers. - * Stop when we don't go off the left edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - /* - * Read-ahead the left block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - xfs_buf_t *bp; /* buffer pointer for block */ - - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_ALLOC_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. @@ -1889,7 +1805,7 @@ xfs_alloc_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_alloc_decrement(cur, level, &i))) + if ((error = xfs_btree_decrement(cur, level, &i))) return error; break; } Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -95,12 +95,6 @@ typedef struct xfs_btree_sblock xfs_allo XFS_BTREE_PTR_ADDR(xfs_alloc, bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur)) /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_alloc_decrement(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-15 17:46:52.000000000 +0200 @@ -820,7 +820,7 @@ xfs_bmap_add_extent_delay_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1381,13 +1381,13 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1430,7 +1430,7 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1473,7 +1473,7 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, new->br_startoff, @@ -1556,7 +1556,7 @@ xfs_bmap_add_extent_unwritten_real( PREV.br_blockcount - new->br_blockcount, oldext))) goto done; - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; if (xfs_bmbt_update(cur, LEFT.br_startoff, LEFT.br_startblock, @@ -2108,7 +2108,7 @@ xfs_bmap_add_extent_hole_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, left.br_startoff, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:46:52.000000000 +0200 @@ -202,7 +202,7 @@ xfs_bmbt_delrec( XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &j))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -215,7 +215,7 @@ xfs_bmbt_delrec( goto error0; } if (numrecs >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &j))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -236,7 +236,7 @@ xfs_bmbt_delrec( XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &i))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -281,7 +281,7 @@ xfs_bmbt_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); tcur = NULL; if (level > 0) { - if ((error = xfs_bmbt_decrement(cur, + if ((error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); @@ -297,7 +297,7 @@ xfs_bmbt_delrec( if (lbno != NULLFSBLOCK) { i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_decrement(tcur, level, &i))) { + if ((error = xfs_btree_decrement(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -310,7 +310,7 @@ xfs_bmbt_delrec( /* * decrement to last in block */ - if ((error = xfs_bmbt_decrement(tcur, level, &i))) { + if ((error = xfs_btree_decrement(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -382,7 +382,7 @@ xfs_bmbt_delrec( } lrecs = be16_to_cpu(left->bb_numrecs); } else { - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &i))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -1485,80 +1485,6 @@ xfs_bmdr_to_bmbt( } /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_bmbt_decrement( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; /* error return value */ - xfs_fsblock_t fsbno; - int lev; - xfs_mount_t *mp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ASSERT(level < cur->bc_nlevels); - - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - - if (--cur->bc_ptrs[level] > 0) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - if (lev == cur->bc_nlevels) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - tp = cur->bc_tp; - mp = cur->bc_mp; - for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) { - fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. */ int /* error */ @@ -1580,7 +1506,7 @@ xfs_bmbt_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_bmbt_decrement(cur, level, + if ((error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -237,7 +237,6 @@ typedef struct xfs_btree_lblock xfs_bmbt * Prototypes for xfs_bmap.c to call. */ extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int); -extern int xfs_bmbt_decrement(struct xfs_btree_cur *, int, int *); extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *); extern void xfs_bmbt_get_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-15 17:46:52.000000000 +0200 @@ -739,7 +739,7 @@ nextag: /* * Search left with tcur, back up 1 record. */ - if ((error = xfs_inobt_decrement(tcur, 0, &i))) + if ((error = xfs_btree_decrement(tcur, 0, &i))) goto error1; doneleft = !i; if (!doneleft) { @@ -815,7 +815,7 @@ nextag: * further left. */ if (useleft) { - if ((error = xfs_inobt_decrement(tcur, 0, + if ((error = xfs_btree_decrement(tcur, 0, &i))) goto error1; doneleft = !i; Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:46:52.000000000 +0200 @@ -205,7 +205,7 @@ xfs_inobt_delrec( cur->bc_bufs[level] = NULL; cur->bc_nlevels--; } else if (level > 0 && - (error = xfs_inobt_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -222,7 +222,7 @@ xfs_inobt_delrec( */ if (numrecs >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { if (level > 0 && - (error = xfs_inobt_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -286,7 +286,7 @@ xfs_inobt_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); if (level > 0 && - (error = xfs_inobt_decrement(cur, level, + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; @@ -301,7 +301,7 @@ xfs_inobt_delrec( rrecs = be16_to_cpu(right->bb_numrecs); if (lbno != NULLAGBLOCK) { xfs_btree_firstrec(tcur, level); - if ((error = xfs_inobt_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; } } @@ -315,7 +315,7 @@ xfs_inobt_delrec( * previous block. */ xfs_btree_firstrec(tcur, level); - if ((error = xfs_inobt_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; xfs_btree_firstrec(tcur, level); /* @@ -414,7 +414,7 @@ xfs_inobt_delrec( * Just return. This is probably a logic error, but it's not fatal. */ else { - if (level > 0 && (error = xfs_inobt_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -1656,90 +1656,6 @@ xfs_inobt_updkey( */ /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_inobt_decrement( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_inobt_block_t *block; /* btree block */ - int error; - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the left at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - /* - * Decrement the ptr at this level. If we're still in the block - * then we're done. - */ - if (--cur->bc_ptrs[level] > 0) { - *stat = 1; - return 0; - } - /* - * Get a pointer to the btree block. - */ - block = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[level]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, - cur->bc_bufs[level]))) - return error; -#endif - /* - * If we just went off the left edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree decrementing pointers. - * Stop when we don't go off the left edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - /* - * Read-ahead the left block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (block = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[lev]); lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - xfs_buf_t *bp; /* buffer containing btree block */ - - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_INO_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. @@ -1765,7 +1681,7 @@ xfs_inobt_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_inobt_decrement(cur, level, &i))) + if ((error = xfs_btree_decrement(cur, level, &i))) return error; break; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -117,12 +117,6 @@ typedef struct xfs_btree_sblock xfs_inob i, XFS_INOBT_BLOCK_MAXRECS(1, cur))) /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_inobt_decrement(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -511,6 +511,7 @@ xfs_btree_setbuf( */ int xfs_btree_increment(struct xfs_btree_cur *, int, int *); +int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); /* -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:09:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_65,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK8bkN016727 for ; Wed, 23 Jul 2008 13:08:40 -0700 X-ASG-Debug-ID: 1216843785-1616039e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DA9BF1B3ED61 for ; Wed, 23 Jul 2008 13:09:45 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id YMzW0BRl9nUdXK0e for ; Wed, 23 Jul 2008 13:09:45 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK9ZNg007614 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:09:35 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK9ZAe007612 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:09:35 +0200 Date: Wed, 23 Jul 2008 22:09:35 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 13/15] implement generic xfs_btree_lookup Subject: [PATCH 13/15] implement generic xfs_btree_lookup Message-ID: <20080723200935.GN7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-lookup User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843786 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17099 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-15 17:51:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-15 18:24:15.000000000 +0200 @@ -1153,3 +1153,220 @@ error0: return error; } + +STATIC int +xfs_btree_lookup_get_block( + struct xfs_btree_cur *cur, /* btree cursor */ + int level, /* level in the btree */ + union xfs_btree_ptr *pp, /* ptr to btree block */ + struct xfs_btree_block **blkp) /* return btree block */ +{ + struct xfs_buf *bp; /* buffer pointer for btree block */ + int error = 0; + + /* special case the root block if in an inode */ + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) { + *blkp = cur->bc_ops->get_root_from_inode(cur); + return 0; + } + + /* + * If the old buffer at this level for the disk address we are + * looking for re-use it. + * + * Otherwise throw it away and get a new one. + */ + bp = cur->bc_bufs[level]; + if (bp && XFS_BUF_ADDR(bp) == xfs_btree_ptr_to_daddr(cur, pp)) { + *blkp = XFS_BUF_TO_BLOCK(bp); + return 0; + } + + error = xfs_btree_read_buf_block(cur, pp, level, 0, blkp, &bp); + if (error) + return error; + + xfs_btree_setbuf(cur, level, bp); + return 0; +} + +/* + * Get current search key. For level 0 we don't actually have a key + * structure so we make one up from the record. For all other levels + * we just return the right key. + */ +STATIC union xfs_btree_key * +xfs_lookup_get_search_key( + struct xfs_btree_cur *cur, + int level, + int keyno, + struct xfs_btree_block *block, + union xfs_btree_key *kp) +{ + if (level == 0) { + union xfs_btree_rec *krp; + + krp = cur->bc_ops->rec_addr(cur, keyno, block); + cur->bc_ops->init_key_from_rec(cur, kp, krp); + return kp; + } + + return cur->bc_ops->key_addr(cur, keyno, block); +} + +/* + * Lookup the record. The cursor is made to point to it, based on dir. + * Return 0 if can't find any such record, 1 for success. + */ +int /* error */ +xfs_btree_lookup( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_lookup_t dir, /* <=, ==, or >= */ + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; /* current btree block */ + __int64_t diff; /* difference for the current key */ + int error; /* error return value */ + int keyno; /* current key number */ + int level; /* level in the btree */ + union xfs_btree_ptr *pp; /* ptr to btree block */ + union xfs_btree_ptr ptr; /* ptr to btree block */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, dir); + + XFS_BTREE_STATS_INC(cur, lookup); + + block = NULL; + keyno = 0; + + /* initialise start pointer from cursor */ + cur->bc_ops->init_ptr_from_cur(cur, &ptr); + pp = &ptr; + + /* + * Iterate over each level in the btree, starting at the root. + * For each level above the leaves, find the key we need, based + * on the lookup record, then follow the corresponding block + * pointer down to the next level. + */ + for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { + /* Get the block we need to do the lookup on. */ + error = xfs_btree_lookup_get_block(cur, level, pp, &block); + if (error) + goto error0; + + /* + * If we already had a key match at a higher level, we know + * we need to use the first entry in this block. + */ + if (diff == 0) + keyno = 1; + + /* Otherwise search this block. Do a binary search. */ + else { + int high; /* high entry number */ + int low; /* low entry number */ + + /* Set low and high entry numbers, 1-based. */ + low = 1; + high = xfs_btree_get_numrecs(block); + if (!high) { + /* Block is empty, must be an empty leaf. */ + ASSERT(level == 0 && cur->bc_nlevels == 1); + cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + /* Binary search the block. */ + while (low <= high) { + union xfs_btree_key key; + union xfs_btree_key *kp; + + XFS_BTREE_STATS_INC(cur, compare); + + /* keyno is average of low and high. */ + keyno = (low + high) >> 1; + + /* Get current search key */ + kp = xfs_lookup_get_search_key(cur, level, + keyno, block, &key); + + /* + * Compute difference to get next direction: + * - less than, move right + * - greater than, move left + * - equal, we're done + */ + diff = cur->bc_ops->key_diff(cur, kp); + if (diff < 0) + low = keyno + 1; + else if (diff > 0) + high = keyno - 1; + else + break; + } + } + + /* + * If there are more levels, set up for the next level + * by getting the block number and filling in the cursor. + */ + if (level > 0) { + /* + * If we moved left, need the previous key number, + * unless there isn't one. + */ + if (diff > 0 && --keyno < 1) + keyno = 1; + pp = cur->bc_ops->ptr_addr(cur, keyno, block); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, pp, 0, level); + if (error) + goto error0; +#endif + cur->bc_ptrs[level] = keyno; + } + } + + /* Done with the search. See if we need to adjust the results. */ + if (dir != XFS_LOOKUP_LE && diff < 0) { + keyno++; + /* + * If ge search and we went off the end of the block, but it's + * not the last block, we're in the wrong block. + */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (dir == XFS_LOOKUP_GE && + keyno > xfs_btree_get_numrecs(block) && + !xfs_btree_ptr_is_null(cur, &ptr)) { + int i; + + cur->bc_ptrs[0] = keyno; + error = xfs_btree_increment(cur, 0, &i); + if (error) + goto error0; + XFS_WANT_CORRUPTED_RETURN(i == 1); + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + } + } else if (dir == XFS_LOOKUP_LE && diff > 0) + keyno--; + cur->bc_ptrs[0] = keyno; + + /* Return if we succeeded or not. */ + if (keyno == 0 || keyno > xfs_btree_get_numrecs(block)) + *stat = 0; + else + *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -194,6 +194,21 @@ struct xfs_btree_ops { /* return address of btree structures */ union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); + union xfs_btree_key *(*key_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + union xfs_btree_rec *(*rec_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + + /* init values of btree structures */ + void (*init_key_from_rec)(struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec); + void (*init_ptr_from_cur)(struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr); + + /* difference between key value and cursor value */ + __int64_t (*key_diff)(struct xfs_btree_cur *cur, + union xfs_btree_key *key); /* btree tracing */ #ifdef XFS_BTREE_TRACE @@ -512,6 +527,7 @@ xfs_btree_setbuf( int xfs_btree_increment(struct xfs_btree_cur *, int, int *); int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); +int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:51:41.000000000 +0200 @@ -938,223 +938,6 @@ xfs_alloc_log_recs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - * Return 0 if can't find any such record, 1 for success. - */ -STATIC int /* error */ -xfs_alloc_lookup( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_lookup_t dir, /* <=, ==, or >= */ - int *stat) /* success/failure */ -{ - xfs_agblock_t agbno; /* a.g. relative btree block number */ - xfs_agnumber_t agno; /* allocation group number */ - xfs_alloc_block_t *block=NULL; /* current btree block */ - int diff; /* difference for the current key */ - int error; /* error return value */ - int keyno=0; /* current key number */ - int level; /* level in the btree */ - xfs_mount_t *mp; /* file system mount point */ - - XFS_STATS_INC(xs_abt_lookup); - /* - * Get the allocation group header, and the root block number. - */ - mp = cur->bc_mp; - - { - xfs_agf_t *agf; /* a.g. freespace header */ - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - agno = be32_to_cpu(agf->agf_seqno); - agbno = be32_to_cpu(agf->agf_roots[cur->bc_btnum]); - } - /* - * Iterate over each level in the btree, starting at the root. - * For each level above the leaves, find the key we need, based - * on the lookup record, then follow the corresponding block - * pointer down to the next level. - */ - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - xfs_buf_t *bp; /* buffer pointer for btree block */ - xfs_daddr_t d; /* disk address of btree block */ - - /* - * Get the disk address we're looking for. - */ - d = XFS_AGB_TO_DADDR(mp, agno, agbno); - /* - * If the old buffer at this level is for a different block, - * throw it away, otherwise just use it. - */ - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - /* - * Need to get a new buffer. Read it, then - * set it in the cursor, releasing the old one. - */ - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, agno, - agbno, 0, &bp, XFS_ALLOC_BTREE_REF))) - return error; - xfs_btree_setbuf(cur, level, bp); - /* - * Point to the btree block, now that we have the buffer - */ - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, level, - bp))) - return error; - } else - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - /* - * If we already had a key match at a higher level, we know - * we need to use the first entry in this block. - */ - if (diff == 0) - keyno = 1; - /* - * Otherwise we need to search this block. Do a binary search. - */ - else { - int high; /* high entry number */ - xfs_alloc_key_t *kkbase=NULL;/* base of keys in block */ - xfs_alloc_rec_t *krbase=NULL;/* base of records in block */ - int low; /* low entry number */ - - /* - * Get a pointer to keys or records. - */ - if (level > 0) - kkbase = XFS_ALLOC_KEY_ADDR(block, 1, cur); - else - krbase = XFS_ALLOC_REC_ADDR(block, 1, cur); - /* - * Set low and high entry numbers, 1-based. - */ - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - /* - * If the block is empty, the tree must - * be an empty leaf. - */ - ASSERT(level == 0 && cur->bc_nlevels == 1); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - *stat = 0; - return 0; - } - /* - * Binary search the block. - */ - while (low <= high) { - xfs_extlen_t blockcount; /* key value */ - xfs_agblock_t startblock; /* key value */ - - XFS_STATS_INC(xs_abt_compare); - /* - * keyno is average of low and high. - */ - keyno = (low + high) >> 1; - /* - * Get startblock & blockcount. - */ - if (level > 0) { - xfs_alloc_key_t *kkp; - - kkp = kkbase + keyno - 1; - startblock = be32_to_cpu(kkp->ar_startblock); - blockcount = be32_to_cpu(kkp->ar_blockcount); - } else { - xfs_alloc_rec_t *krp; - - krp = krbase + keyno - 1; - startblock = be32_to_cpu(krp->ar_startblock); - blockcount = be32_to_cpu(krp->ar_blockcount); - } - /* - * Compute difference to get next direction. - */ - if (cur->bc_btnum == XFS_BTNUM_BNO) - diff = (int)startblock - - (int)cur->bc_rec.a.ar_startblock; - else if (!(diff = (int)blockcount - - (int)cur->bc_rec.a.ar_blockcount)) - diff = (int)startblock - - (int)cur->bc_rec.a.ar_startblock; - /* - * Less than, move right. - */ - if (diff < 0) - low = keyno + 1; - /* - * Greater than, move left. - */ - else if (diff > 0) - high = keyno - 1; - /* - * Equal, we're done. - */ - else - break; - } - } - /* - * If there are more levels, set up for the next level - * by getting the block number and filling in the cursor. - */ - if (level > 0) { - /* - * If we moved left, need the previous key number, - * unless there isn't one. - */ - if (diff > 0 && --keyno < 1) - keyno = 1; - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, keyno, cur)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, agbno, level))) - return error; -#endif - cur->bc_ptrs[level] = keyno; - } - } - /* - * Done with the search. - * See if we need to adjust the results. - */ - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && - keyno > be16_to_cpu(block->bb_numrecs) && - be32_to_cpu(block->bb_rightsib) != NULLAGBLOCK) { - int i; - - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) - return error; - XFS_WANT_CORRUPTED_RETURN(i == 1); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - /* - * Return if we succeeded or not. - */ - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) - *stat = 0; - else - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1919,53 +1702,6 @@ xfs_alloc_insert( } /* - * Lookup the record equal to [bno, len] in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_eq( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -/* - * Lookup the first record greater than or equal to [bno, len] - * in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_ge( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_GE, stat); -} - -/* - * Lookup the first record less than or equal to [bno, len] - * in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_le( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_LE, stat); -} - -/* * Update the record referred to by cur, to the value given by [bno, len]. * This either works (return 0) or gets an EFSCORRUPTED error. */ @@ -2044,6 +1780,31 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC void +xfs_allocbt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + ASSERT(rec->alloc.ar_startblock != 0); + + key->alloc.ar_startblock = rec->alloc.ar_startblock; + key->alloc.ar_blockcount = rec->alloc.ar_blockcount; +} + +STATIC void +xfs_allocbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); + ASSERT(agf->agf_roots[cur->bc_btnum] != 0); + + ptr->s = agf->agf_roots[cur->bc_btnum]; +} + STATIC union xfs_btree_ptr * xfs_allocbt_ptr_addr( struct xfs_btree_cur *cur, @@ -2054,6 +1815,47 @@ xfs_allocbt_ptr_addr( XFS_ALLOC_PTR_ADDR(&block->bb_h, index, cur); } +STATIC union xfs_btree_key * +xfs_allocbt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *) + XFS_ALLOC_KEY_ADDR(&block->bb_h, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_allocbt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *) + XFS_ALLOC_REC_ADDR(&block->bb_h, index, cur); +} + +STATIC __int64_t +xfs_allocbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a; + xfs_alloc_key_t *kp = &key->alloc; + __int64_t diff; + + if (cur->bc_btnum == XFS_BTNUM_BNO) { + return (__int64_t)be32_to_cpu(kp->ar_startblock) - + rec->ar_startblock; + } + + diff = (__int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount; + if (diff) + return diff; + + return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -2123,7 +1925,12 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .init_key_from_rec = xfs_allocbt_init_key_from_rec, + .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, + .key_addr = xfs_allocbt_key_addr, + .rec_addr = xfs_allocbt_rec_addr, + .key_diff = xfs_allocbt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:51:41.000000000 +0200 @@ -829,212 +829,6 @@ xfs_inobt_log_recs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - * Return 0 if can't find any such record, 1 for success. - */ -STATIC int /* error */ -xfs_inobt_lookup( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_lookup_t dir, /* <=, ==, or >= */ - int *stat) /* success/failure */ -{ - xfs_agblock_t agbno; /* a.g. relative btree block number */ - xfs_agnumber_t agno; /* allocation group number */ - xfs_inobt_block_t *block=NULL; /* current btree block */ - __int64_t diff; /* difference for the current key */ - int error; /* error return value */ - int keyno=0; /* current key number */ - int level; /* level in the btree */ - xfs_mount_t *mp; /* file system mount point */ - - /* - * Get the allocation group header, and the root block number. - */ - mp = cur->bc_mp; - { - xfs_agi_t *agi; /* a.g. inode header */ - - agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); - agno = be32_to_cpu(agi->agi_seqno); - agbno = be32_to_cpu(agi->agi_root); - } - /* - * Iterate over each level in the btree, starting at the root. - * For each level above the leaves, find the key we need, based - * on the lookup record, then follow the corresponding block - * pointer down to the next level. - */ - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - xfs_buf_t *bp; /* buffer pointer for btree block */ - xfs_daddr_t d; /* disk address of btree block */ - - /* - * Get the disk address we're looking for. - */ - d = XFS_AGB_TO_DADDR(mp, agno, agbno); - /* - * If the old buffer at this level is for a different block, - * throw it away, otherwise just use it. - */ - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - /* - * Need to get a new buffer. Read it, then - * set it in the cursor, releasing the old one. - */ - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - agno, agbno, 0, &bp, XFS_INO_BTREE_REF))) - return error; - xfs_btree_setbuf(cur, level, bp); - /* - * Point to the btree block, now that we have the buffer - */ - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, level, - bp))) - return error; - } else - block = XFS_BUF_TO_INOBT_BLOCK(bp); - /* - * If we already had a key match at a higher level, we know - * we need to use the first entry in this block. - */ - if (diff == 0) - keyno = 1; - /* - * Otherwise we need to search this block. Do a binary search. - */ - else { - int high; /* high entry number */ - xfs_inobt_key_t *kkbase=NULL;/* base of keys in block */ - xfs_inobt_rec_t *krbase=NULL;/* base of records in block */ - int low; /* low entry number */ - - /* - * Get a pointer to keys or records. - */ - if (level > 0) - kkbase = XFS_INOBT_KEY_ADDR(block, 1, cur); - else - krbase = XFS_INOBT_REC_ADDR(block, 1, cur); - /* - * Set low and high entry numbers, 1-based. - */ - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - /* - * If the block is empty, the tree must - * be an empty leaf. - */ - ASSERT(level == 0 && cur->bc_nlevels == 1); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - *stat = 0; - return 0; - } - /* - * Binary search the block. - */ - while (low <= high) { - xfs_agino_t startino; /* key value */ - - /* - * keyno is average of low and high. - */ - keyno = (low + high) >> 1; - /* - * Get startino. - */ - if (level > 0) { - xfs_inobt_key_t *kkp; - - kkp = kkbase + keyno - 1; - startino = be32_to_cpu(kkp->ir_startino); - } else { - xfs_inobt_rec_t *krp; - - krp = krbase + keyno - 1; - startino = be32_to_cpu(krp->ir_startino); - } - /* - * Compute difference to get next direction. - */ - diff = (__int64_t) - startino - cur->bc_rec.i.ir_startino; - /* - * Less than, move right. - */ - if (diff < 0) - low = keyno + 1; - /* - * Greater than, move left. - */ - else if (diff > 0) - high = keyno - 1; - /* - * Equal, we're done. - */ - else - break; - } - } - /* - * If there are more levels, set up for the next level - * by getting the block number and filling in the cursor. - */ - if (level > 0) { - /* - * If we moved left, need the previous key number, - * unless there isn't one. - */ - if (diff > 0 && --keyno < 1) - keyno = 1; - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, keyno, cur)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, agbno, level))) - return error; -#endif - cur->bc_ptrs[level] = keyno; - } - } - /* - * Done with the search. - * See if we need to adjust the results. - */ - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && - keyno > be16_to_cpu(block->bb_numrecs) && - be32_to_cpu(block->bb_rightsib) != NULLAGBLOCK) { - int i; - - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) - return error; - ASSERT(i == 1); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - /* - * Return if we succeeded or not. - */ - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) - *stat = 0; - else - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1798,59 +1592,6 @@ xfs_inobt_insert( } /* - * Lookup the record equal to ino in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_eq( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -/* - * Lookup the first record greater than or equal to ino - * in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_ge( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_GE, stat); -} - -/* - * Lookup the first record less than or equal to ino - * in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_le( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_LE, stat); -} - -/* * Update the record referred to by cur, to the value given * by [ino, fcnt, free]. * This either works (return 0) or gets an EFSCORRUPTED error. @@ -1910,6 +1651,30 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC void +xfs_inobt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->inobt.ir_startino = rec->inobt.ir_startino; +} + +/* + * intial value of ptr for lookup + */ +STATIC void +xfs_inobt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agi *agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno)); + + ptr->s = agi->agi_root; +} + STATIC union xfs_btree_ptr * xfs_inobt_ptr_addr( struct xfs_btree_cur *cur, @@ -1920,6 +1685,35 @@ xfs_inobt_ptr_addr( XFS_INOBT_PTR_ADDR(&block->bb_h, index, cur); } +STATIC union xfs_btree_key * +xfs_inobt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *) + XFS_INOBT_KEY_ADDR(&block->bb_h, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_inobt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *) + XFS_INOBT_REC_ADDR(&block->bb_h, index, cur); +} + +STATIC __int64_t +xfs_inobt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + return (__int64_t)be32_to_cpu(key->inobt.ir_startino) - + cur->bc_rec.i.ir_startino; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1989,7 +1783,12 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .init_key_from_rec = xfs_inobt_init_key_from_rec, + .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, .ptr_addr = xfs_inobt_ptr_addr, + .key_addr = xfs_inobt_key_addr, + .rec_addr = xfs_inobt_rec_addr, + .key_diff = xfs_inobt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:51:41.000000000 +0200 @@ -812,146 +812,6 @@ xfs_bmbt_log_ptrs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - */ -STATIC int /* error */ -xfs_bmbt_lookup( - xfs_btree_cur_t *cur, - xfs_lookup_t dir, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block=NULL; - xfs_buf_t *bp; - xfs_daddr_t d; - xfs_sfiloff_t diff; - int error; /* error return value */ - xfs_fsblock_t fsbno=0; - int high; - int i; - int keyno=0; - xfs_bmbt_key_t *kkbase=NULL; - xfs_bmbt_key_t *kkp; - xfs_bmbt_rec_t *krbase=NULL; - xfs_bmbt_rec_t *krp; - int level; - int low; - xfs_mount_t *mp; - xfs_bmbt_ptr_t *pp; - xfs_bmbt_irec_t *rp; - xfs_fileoff_t startoff; - xfs_trans_t *tp; - - XFS_STATS_INC(xs_bmbt_lookup); - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, (int)dir); - tp = cur->bc_tp; - mp = cur->bc_mp; - rp = &cur->bc_rec.b; - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - if (level < cur->bc_nlevels - 1) { - d = XFS_FSB_TO_DADDR(mp, fsbno); - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, - 0, &bp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - xfs_btree_setbuf(cur, level, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, - level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } else - block = XFS_BUF_TO_BMBT_BLOCK(bp); - } else - block = xfs_bmbt_get_block(cur, level, &bp); - if (diff == 0) - keyno = 1; - else { - if (level > 0) - kkbase = XFS_BMAP_KEY_IADDR(block, 1, cur); - else - krbase = XFS_BMAP_REC_IADDR(block, 1, cur); - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - ASSERT(level == 0); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - while (low <= high) { - XFS_STATS_INC(xs_bmbt_compare); - keyno = (low + high) >> 1; - if (level > 0) { - kkp = kkbase + keyno - 1; - startoff = be64_to_cpu(kkp->br_startoff); - } else { - krp = krbase + keyno - 1; - startoff = xfs_bmbt_disk_get_startoff(krp); - } - diff = (xfs_sfiloff_t) - (startoff - rp->br_startoff); - if (diff < 0) - low = keyno + 1; - else if (diff > 0) - high = keyno - 1; - else - break; - } - } - if (level > 0) { - if (diff > 0 && --keyno < 1) - keyno = 1; - pp = XFS_BMAP_PTR_IADDR(block, keyno, cur); - fsbno = be64_to_cpu(*pp); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr(cur, fsbno, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - cur->bc_ptrs[level] = keyno; - } - } - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && keyno > be16_to_cpu(block->bb_numrecs) && - be64_to_cpu(block->bb_rightsib) != NULLDFSBNO) { - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - XFS_WANT_CORRUPTED_RETURN(i == 1); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - } else { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - } - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1807,34 +1667,6 @@ xfs_bmbt_log_recs( XFS_BMBT_TRACE_CURSOR(cur, EXIT); } -int /* error */ -xfs_bmbt_lookup_eq( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - int *stat) /* success/failure */ -{ - cur->bc_rec.b.br_startoff = off; - cur->bc_rec.b.br_startblock = bno; - cur->bc_rec.b.br_blockcount = len; - return xfs_bmbt_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -int /* error */ -xfs_bmbt_lookup_ge( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - int *stat) /* success/failure */ -{ - cur->bc_rec.b.br_startoff = off; - cur->bc_rec.b.br_startblock = bno; - cur->bc_rec.b.br_blockcount = len; - return xfs_bmbt_lookup(cur, XFS_LOOKUP_GE, stat); -} - /* * Give the bmap btree a new root block. Copy the old broot contents * down into a real block and make the broot point to it. @@ -2269,6 +2101,24 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC void +xfs_bmbt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->bmbt.br_startoff = + cpu_to_be64(xfs_bmbt_disk_get_startoff(&rec->bmbt)); +} + +STATIC void +xfs_bmbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + ptr->l = 0; +} + STATIC union xfs_btree_ptr * xfs_bmbt_ptr_addr( struct xfs_btree_cur *cur, @@ -2279,6 +2129,35 @@ xfs_bmbt_ptr_addr( XFS_BMAP_PTR_IADDR(&block->bb_h, index, cur); } +STATIC union xfs_btree_key * +xfs_bmbt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *) + XFS_BMAP_KEY_IADDR(&block->bb_h, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_bmbt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *) + XFS_BMAP_REC_IADDR(&block->bb_h, index, cur); +} + +STATIC __int64_t +xfs_bmbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + return (__int64_t)be64_to_cpu(key->bmbt.br_startoff) - + cur->bc_rec.b.br_startoff; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2366,7 +2245,12 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .init_key_from_rec = xfs_bmbt_init_key_from_rec, + .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, .ptr_addr = xfs_bmbt_ptr_addr, + .key_addr = xfs_bmbt_key_addr, + .rec_addr = xfs_bmbt_rec_addr, + .key_diff = xfs_bmbt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-15 17:51:41.000000000 +0200 @@ -90,6 +90,54 @@ STATIC int xfs_alloc_ag_vextent_small(xf */ /* + * Lookup the record equal to [bno, len] in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + + +/* * Compute aligned version of the found extent. * Takes alignment and min length into account. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -114,26 +114,6 @@ extern int xfs_alloc_get_rec(struct xfs_ extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat); /* - * Lookup the record equal to [bno, len] in the btree given by cur. - */ -extern int xfs_alloc_lookup_eq(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* - * Lookup the first record greater than or equal to [bno, len] - * in the btree given by cur. - */ -extern int xfs_alloc_lookup_ge(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* - * Lookup the first record less than or equal to [bno, len] - * in the btree given by cur. - */ -extern int xfs_alloc_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* * Update the record referred to by cur, to the value given by [bno, len]. * This either works (return 0) or gets an EFSCORRUPTED error. */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-15 17:51:41.000000000 +0200 @@ -402,6 +402,35 @@ xfs_bmap_disk_count_leaves( * Bmap internal routines. */ +STATIC int /* error */ +xfs_bmbt_lookup_eq( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + int *stat) /* success/failure */ +{ + cur->bc_rec.b.br_startoff = off; + cur->bc_rec.b.br_startblock = bno; + cur->bc_rec.b.br_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +STATIC int /* error */ +xfs_bmbt_lookup_ge( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + int *stat) /* success/failure */ +{ + cur->bc_rec.b.br_startoff = off; + cur->bc_rec.b.br_startblock = bno; + cur->bc_rec.b.br_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + + /* * Called from xfs_bmap_add_attrfork to handle btree format files. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-15 17:51:41.000000000 +0200 @@ -119,6 +119,59 @@ xfs_ialloc_cluster_alignment( } /* + * Lookup the record equal to ino in the btree given by cur. + */ +STATIC int /* error */ +xfs_inobt_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to ino + * in the btree given by cur. + */ +int /* error */ +xfs_inobt_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to ino + * in the btree given by cur. + */ +int /* error */ +xfs_inobt_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + +/* * Allocate new inodes in the allocation group specified by agbp. * Return 0 for success, else error code. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.h 2008-07-15 15:11:29.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.h 2008-07-15 17:51:41.000000000 +0200 @@ -154,6 +154,21 @@ xfs_ialloc_pagi_init( struct xfs_trans *tp, /* transaction pointer */ xfs_agnumber_t agno); /* allocation group number */ +/* + * Lookup the first record greater than or equal to ino + * in the btree given by cur. + */ +int xfs_inobt_lookup_ge(struct xfs_btree_cur *cur, xfs_agino_t ino, + __int32_t fcnt, xfs_inofree_t free, int *stat); + +/* + * Lookup the first record less than or equal to ino + * in the btree given by cur. + */ +int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino, + __int32_t fcnt, xfs_inofree_t free, int *stat); + + #endif /* __KERNEL__ */ #endif /* __XFS_IALLOC_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -136,26 +136,6 @@ extern int xfs_inobt_get_rec(struct xfs_ extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat); /* - * Lookup the record equal to ino in the btree given by cur. - */ -extern int xfs_inobt_lookup_eq(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* - * Lookup the first record greater than or equal to ino - * in the btree given by cur. - */ -extern int xfs_inobt_lookup_ge(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* - * Lookup the first record less than or equal to ino - * in the btree given by cur. - */ -extern int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* * Update the record referred to by cur, to the value given * by [ino, fcnt, free]. * This either works (return 0) or gets an EFSCORRUPTED error. Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -254,10 +254,6 @@ extern int xfs_bmbt_insert(struct xfs_bt extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int); -extern int xfs_bmbt_lookup_eq(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, int *); -extern int xfs_bmbt_lookup_ge(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, int *); /* * Give the bmap btree a new root block. Copy the old broot contents -- From owner-xfs@oss.sgi.com Wed Jul 23 13:08:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:09:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NK8g8O016837 for ; Wed, 23 Jul 2008 13:08:43 -0700 X-ASG-Debug-ID: 1216843790-419100bb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 57EE931C28D for ; Wed, 23 Jul 2008 13:09:51 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 4wPR1EgLyG2uqGyb for ; Wed, 23 Jul 2008 13:09:51 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NK9fNg007633 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:09:41 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NK9eki007631 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:09:40 +0200 Date: Wed, 23 Jul 2008 22:09:40 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 14/15] implement generic xfs_btree_updkey Subject: [PATCH 14/15] implement generic xfs_btree_updkey Message-ID: <20080723200940.GO7401@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-updkey User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216843793 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.658 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17100 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Note that there are many > 80 char lines introduced due to the xfs_btree_key casts. But the places where this happens is throw-away code once the whole btree code gets merged into a common implementation. The same is true for the temporary xfs_alloc_log_keys define to the new name. All old users will be gone after a few patches. [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 05:10:43.000000000 +0200 @@ -1370,3 +1370,50 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +/* + * Update keys at all levels from here to the root along the cursor's path. + */ +int +xfs_btree_updkey( + struct xfs_btree_cur *cur, + union xfs_btree_key *keyp, + int level) +{ + struct xfs_btree_block *block; + struct xfs_buf *bp; + union xfs_btree_key *kp; + int ptr; +#ifdef DEBUG + int error; +#endif + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGIK(cur, level, keyp); + + ASSERT(!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) || level >= 1); + + /* + * Go up the tree from this level toward the root. + * At each level, update the key value to the value input. + * Stop when we reach a level where the cursor isn't pointing + * at the first entry in the block. + */ + for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { + block = xfs_btree_get_block(cur, level, &bp); +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } +#endif + ptr = cur->bc_ptrs[level]; + kp = cur->bc_ops->key_addr(cur, ptr, block); + cur->bc_ops->copy_keys(cur, keyp, kp, 1); + cur->bc_ops->log_keys(cur, bp, ptr, ptr); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 05:11:01.000000000 +0200 @@ -210,6 +210,16 @@ struct xfs_btree_ops { __int64_t (*key_diff)(struct xfs_btree_cur *cur, union xfs_btree_key *key); + /* copy bits of btree blocks between blocks */ + void (*copy_keys)(struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, int numkeys); + + /* log changes to btree structures */ + void (*log_keys)(struct xfs_btree_cur *cur, struct xfs_buf *bp, + int first, int last); + + /* btree tracing */ #ifdef XFS_BTREE_TRACE void (*trace_enter)(struct xfs_btree_cur *, const char *, @@ -528,6 +538,7 @@ xfs_btree_setbuf( int xfs_btree_increment(struct xfs_btree_cur *, int, int *); int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); +int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-21 05:10:35.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" @@ -44,7 +45,9 @@ */ STATIC void xfs_alloc_log_block(xfs_trans_t *, xfs_buf_t *, int); -STATIC void xfs_alloc_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); +STATIC void xfs_allocbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); +#define xfs_alloc_log_keys(c, b, i, j) \ + xfs_allocbt_log_keys(c, b, i, j) STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_alloc_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); @@ -52,7 +55,6 @@ STATIC int xfs_alloc_newroot(xfs_btree_c STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_alloc_updkey(xfs_btree_cur_t *, xfs_alloc_key_t *, int); /* * Internal functions. @@ -265,7 +267,7 @@ xfs_alloc_delrec( * If we deleted the leftmost entry in the block, update the * key values above us in the tree. */ - if (ptr == 1 && (error = xfs_alloc_updkey(cur, lkp, level + 1))) + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)lkp, level + 1))) return error; /* * If the number of records remaining in the block is at least @@ -798,7 +800,7 @@ xfs_alloc_insrec( /* * If we inserted at the start of a block, update the parents' keys. */ - if (optr == 1 && (error = xfs_alloc_updkey(cur, &key, level + 1))) + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) return error; /* * Look to see if the longest extent in the allocation group @@ -859,28 +861,6 @@ xfs_alloc_log_block( } /* - * Log keys from a btree block (nonleaf). - */ -STATIC void -xfs_alloc_log_keys( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int kfirst, /* index of first key to log */ - int klast) /* index of last key to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - xfs_alloc_key_t *kp; /* key pointer in btree block */ - int last; /* last byte offset logged */ - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Log block pointer fields from a btree block (nonleaf). */ STATIC void @@ -1068,7 +1048,7 @@ xfs_alloc_lshift( /* * Update the parent key values of right. */ - if ((error = xfs_alloc_updkey(cur, rkp, level + 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) return error; /* * Slide the cursor value left one. @@ -1354,7 +1334,7 @@ xfs_alloc_rshift( i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_alloc_updkey(tcur, rkp, level + 1))) + (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) goto error0; xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); *stat = 1; @@ -1520,45 +1500,6 @@ xfs_alloc_split( } /* - * Update keys at all levels from here to the root along the cursor's path. - */ -STATIC int /* error */ -xfs_alloc_updkey( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_alloc_key_t *keyp, /* new key value to update to */ - int level) /* starting level for update */ -{ - int ptr; /* index of key in block */ - - /* - * Go up the tree from this level toward the root. - * At each level, update the key value to the value input. - * Stop when we reach a level where the cursor isn't pointing - * at the first entry in the block. - */ - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* buffer for block */ -#ifdef DEBUG - int error; /* error return value */ -#endif - xfs_alloc_key_t *kp; /* ptr to btree block keys */ - - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_ALLOC_KEY_ADDR(block, ptr, cur); - *kp = *keyp; - xfs_alloc_log_keys(cur, bp, ptr, ptr); - } - return 0; -} - -/* * Externally visible routines. */ @@ -1765,7 +1706,7 @@ xfs_alloc_update( key.ar_startblock = cpu_to_be32(bno); key.ar_blockcount = cpu_to_be32(len); - if ((error = xfs_alloc_updkey(cur, &key, 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) return error; } return 0; @@ -1856,6 +1797,45 @@ xfs_allocbt_key_diff( return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; } +STATIC void +xfs_allocbt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_alloc_key_t)); +} + +/* + * Log keys from a btree block (nonleaf). + */ +STATIC void +xfs_allocbt_log_keys( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int kfirst, /* index of first key to log */ + int klast) /* index of last key to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + xfs_alloc_key_t *kp; /* key pointer in btree block */ + int last; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, kfirst, klast); + + block = XFS_BUF_TO_SBLOCK(bp); + kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -1931,6 +1911,8 @@ static const struct xfs_btree_ops xfs_al .key_addr = xfs_allocbt_key_addr, .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, + .copy_keys = xfs_allocbt_copy_keys, + .log_keys = xfs_allocbt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-21 05:16:01.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" @@ -48,7 +49,6 @@ STATIC int xfs_inobt_newroot(xfs_btree_c STATIC int xfs_inobt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_inobt_key_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_inobt_updkey(xfs_btree_cur_t *, xfs_inobt_key_t *, int); /* * Single level of the xfs_inobt_delete record deletion routine. @@ -214,7 +214,7 @@ xfs_inobt_delrec( * If we deleted the leftmost entry in the block, update the * key values above us in the tree. */ - if (ptr == 1 && (error = xfs_inobt_updkey(cur, kp, level + 1))) + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) return error; /* * If the number of records remaining in the block is at least @@ -723,7 +723,7 @@ xfs_inobt_insrec( /* * If we inserted at the start of a block, update the parents' keys. */ - if (optr == 1 && (error = xfs_inobt_updkey(cur, &key, level + 1))) + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) return error; /* * Return the new block number, if any. @@ -763,28 +763,6 @@ xfs_inobt_log_block( } /* - * Log keys from a btree block (nonleaf). - */ -STATIC void -xfs_inobt_log_keys( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int kfirst, /* index of first key to log */ - int klast) /* index of last key to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - xfs_inobt_key_t *kp; /* key pointer in btree block */ - int last; /* last byte offset logged */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - kp = XFS_INOBT_KEY_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Log block pointer fields from a btree block (nonleaf). */ STATIC void @@ -960,7 +938,7 @@ xfs_inobt_lshift( /* * Update the parent key values of right. */ - if ((error = xfs_inobt_updkey(cur, rkp, level + 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) return error; /* * Slide the cursor value left one. @@ -1238,7 +1216,7 @@ xfs_inobt_rshift( return error; xfs_btree_lastrec(tcur, level); if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_inobt_updkey(tcur, rkp, level + 1))) { + (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); return error; } @@ -1407,45 +1385,6 @@ xfs_inobt_split( } /* - * Update keys at all levels from here to the root along the cursor's path. - */ -STATIC int /* error */ -xfs_inobt_updkey( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_inobt_key_t *keyp, /* new key value to update to */ - int level) /* starting level for update */ -{ - int ptr; /* index of key in block */ - - /* - * Go up the tree from this level toward the root. - * At each level, update the key value to the value input. - * Stop when we reach a level where the cursor isn't pointing - * at the first entry in the block. - */ - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - xfs_buf_t *bp; /* buffer for block */ - xfs_inobt_block_t *block; /* btree block */ -#ifdef DEBUG - int error; /* error return value */ -#endif - xfs_inobt_key_t *kp; /* ptr to btree block keys */ - - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_INOBT_KEY_ADDR(block, ptr, cur); - *kp = *keyp; - xfs_inobt_log_keys(cur, bp, ptr, ptr); - } - return 0; -} - -/* * Externally visible routines. */ @@ -1637,7 +1576,7 @@ xfs_inobt_update( xfs_inobt_key_t key; /* key containing [ino] */ key.ir_startino = cpu_to_be32(ino); - if ((error = xfs_inobt_updkey(cur, &key, 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) return error; } return 0; @@ -1714,6 +1653,44 @@ xfs_inobt_key_diff( cur->bc_rec.i.ir_startino; } +STATIC void +xfs_inobt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_inobt_key_t)); +} + +/* + * Log keys from a btree block (nonleaf). + */ +STATIC void +xfs_inobt_log_keys( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int kfirst, /* index of first key to log */ + int klast) /* index of last key to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + xfs_inobt_key_t *kp; /* key pointer in btree block */ + int last; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, kfirst, klast); + + block = XFS_BUF_TO_SBLOCK(bp); + kp = XFS_INOBT_KEY_ADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1789,6 +1766,8 @@ static const struct xfs_btree_ops xfs_in .key_addr = xfs_inobt_key_addr, .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, + .copy_keys = xfs_inobt_copy_keys, + .log_keys = xfs_inobt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-21 05:15:11.000000000 +0200 @@ -56,7 +56,6 @@ STATIC int xfs_bmbt_lshift(xfs_btree_cur STATIC int xfs_bmbt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, __uint64_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_bmbt_updkey(xfs_btree_cur_t *, xfs_bmbt_key_t *, int); #undef EXIT @@ -210,7 +209,7 @@ xfs_bmbt_delrec( *stat = 1; return 0; } - if (ptr == 1 && (error = xfs_bmbt_updkey(cur, kp, level + 1))) { + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -634,7 +633,7 @@ xfs_bmbt_insrec( kp + ptr); } #endif - if (optr == 1 && (error = xfs_bmbt_updkey(cur, &key, level + 1))) { + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -740,42 +739,6 @@ xfs_bmbt_killroot( } /* - * Log key values from the btree block. - */ -STATIC void -xfs_bmbt_log_keys( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int kfirst, - int klast) -{ - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, kfirst, klast); - tp = cur->bc_tp; - if (bp) { - xfs_bmbt_block_t *block; - int first; - xfs_bmbt_key_t *kp; - int last; - - block = XFS_BUF_TO_BMBT_BLOCK(bp); - kp = XFS_BMAP_KEY_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - } else { - xfs_inode_t *ip; - - ip = cur->bc_private.b.ip; - xfs_trans_log_inode(tp, ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* * Log pointer values from the btree block. */ STATIC void @@ -934,7 +897,7 @@ xfs_bmbt_lshift( key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(rrp)); rkp = &key; } - if ((error = xfs_bmbt_updkey(cur, rkp, level + 1))) { + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -1066,7 +1029,7 @@ xfs_bmbt_rshift( goto error1; } XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_updkey(tcur, rkp, level + 1))) { + if ((error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { XFS_BMBT_TRACE_CURSOR(tcur, ERROR); goto error1; } @@ -1274,44 +1237,6 @@ xfs_bmbt_split( return 0; } - -/* - * Update keys for the record. - */ -STATIC int -xfs_bmbt_updkey( - xfs_btree_cur_t *cur, - xfs_bmbt_key_t *keyp, /* on-disk format */ - int level) -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; -#ifdef DEBUG - int error; -#endif - xfs_bmbt_key_t *kp; - int ptr; - - ASSERT(level >= 1); - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGIK(cur, level, keyp); - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_BMAP_KEY_IADDR(block, ptr, cur); - *kp = *keyp; - xfs_bmbt_log_keys(cur, bp, ptr, ptr); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; -} - /* * Convert on-disk form of btree root to in-memory form. */ @@ -2037,7 +1962,7 @@ xfs_bmbt_update( return 0; } key.br_startoff = cpu_to_be64(off); - if ((error = xfs_bmbt_updkey(cur, &key, 1))) { + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -2158,6 +2083,49 @@ xfs_bmbt_key_diff( cur->bc_rec.b.br_startoff; } +STATIC void +xfs_bmbt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_bmbt_key_t)); +} + +/* + * Log key values from the btree block. + */ +STATIC void +xfs_bmbt_log_keys( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int kfirst, + int klast) +{ + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, kfirst, klast); + + if (bp) { + struct xfs_btree_lblock *block; + int first; + xfs_bmbt_key_t *kp; + int last; + + block = XFS_BUF_TO_LBLOCK(bp); + kp = XFS_BMAP_KEY_DADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + } else { + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2253,6 +2221,8 @@ static const struct xfs_btree_ops xfs_bm .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, + .copy_keys = xfs_bmbt_copy_keys, + .log_keys = xfs_bmbt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, -- From owner-xfs@oss.sgi.com Wed Jul 23 13:18:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:18:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64, J_CHICKENPOX_66 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NKIkMf020232 for ; Wed, 23 Jul 2008 13:18:46 -0700 X-ASG-Debug-ID: 1216844391-287502810000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 692B231BF5E for ; Wed, 23 Jul 2008 13:19:52 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id oyKPyNTz030cUqLR for ; Wed, 23 Jul 2008 13:19:52 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NKJeNg008037 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 22:19:40 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NKJepg008035 for xfs@oss.sgi.com; Wed, 23 Jul 2008 22:19:40 +0200 Date: Wed, 23 Jul 2008 22:19:40 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] use generic posix ACL code, enable ACL caching Subject: Re: [PATCH] use generic posix ACL code, enable ACL caching Message-ID: <20080723201940.GA7908@lst.de> References: <20080614160127.GA15404@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080614160127.GA15404@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216844395 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.659 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17103 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Sat, Jun 14, 2008 at 06:01:27PM +0200, Christoph Hellwig wrote: > Switch XFS to use the generic ACL code and enable caching the ACL values > in the XFS inode. > > Compared to the last post various bugs have been fixed and a locking > strategy has been designed and implemented. This now passes XFSQA. > > You'll need my various attr-related patches applies before this one. With various recent changes going in it needed another rediff. I also moved the xfs_acl_chmod call into xfs_setattr from xfs_vn_setattr because we would miss it for updates from dmapi. While doing this I found out that xfs_acl_chmod is non-atomic vs the setattr which is probably a bad thing, but also done that way in all other filesystems. Maybe we want to delay this patch until Niv's infrastructure to piggy-back an attr_set ontop of an existing transaction is done so that this issue could be solved. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_acl.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_acl.c 2008-07-23 22:13:10.000000000 +0200 @@ -0,0 +1,517 @@ +/* + * Copyright (C) 2008 Christoph Hellwig. + * Released under GPL v2. + */ +#include "xfs.h" +#include "xfs_acl.h" +#include "xfs_attr.h" +#include "xfs_bmap_btree.h" +#include "xfs_inode.h" +#include "xfs_vnodeops.h" +#include +#include + + +#define XFS_ACL_NOT_CACHED ((void *)-1) + +/* + * Locking scheme: + * - all ACL updates are protected by inode->i_mutex, which is taken before + * calling into this file. + * - access and updates to the ip->i_acl and ip->i_default_acl pointers are + * protected by inode->i_lock. + */ + +static struct posix_acl * +xfs_acl_from_disk(struct xfs_acl *aclp) +{ + struct posix_acl_entry *acl_e; + struct posix_acl *acl; + struct xfs_acl_entry *ace; + int count, i; + + count = be32_to_cpu(aclp->acl_cnt); + + acl = posix_acl_alloc(count, GFP_KERNEL); + if (!acl) + return ERR_PTR(-ENOMEM); + + for (i = 0; i < count; i++) { + acl_e = &acl->a_entries[i]; + ace = &aclp->acl_entry[i]; + + /* + * The tag is 32 bits on disk and 16 bits in core. + * + * Because every access to it goes through the core + * format first this is not a problem. + */ + acl_e->e_tag = be32_to_cpu(ace->ae_tag); + acl_e->e_perm = be16_to_cpu(ace->ae_perm); + + switch (acl_e->e_tag) { + case ACL_USER: + case ACL_GROUP: + acl_e->e_id = be32_to_cpu(ace->ae_id); + break; + case ACL_USER_OBJ: + case ACL_GROUP_OBJ: + case ACL_MASK: + case ACL_OTHER: + acl_e->e_id = ACL_UNDEFINED_ID; + break; + default: + goto fail; + } + } + return acl; + +fail: + posix_acl_release(acl); + return ERR_PTR(-EINVAL); +} + +static void +xfs_acl_to_disk(struct xfs_acl *aclp, const struct posix_acl *acl) +{ + const struct posix_acl_entry *acl_e; + struct xfs_acl_entry *ace; + int i; + + aclp->acl_cnt = cpu_to_be32(acl->a_count); + for (i = 0; i < acl->a_count; i++) { + ace = &aclp->acl_entry[i]; + acl_e = &acl->a_entries[i]; + + ace->ae_tag = cpu_to_be32(acl_e->e_tag); + ace->ae_id = cpu_to_be32(acl_e->e_id); + ace->ae_perm = cpu_to_be16(acl_e->e_perm); + } +} + +/* + * Update the cached ACL pointer in the inode. + * + * Because we don't hold any locks while reading/writing the attribute + * from/to disk another thread could have raced and updated the cached + * ACL value before us. In that case we release the previous cached value + * and update it with our new value. + */ +static void +xfs_update_cached_acl(struct inode *inode, struct posix_acl **p_acl, + struct posix_acl *acl) +{ + spin_lock(&inode->i_lock); + if (*p_acl && *p_acl != XFS_ACL_NOT_CACHED) + posix_acl_release(*p_acl); + *p_acl = posix_acl_dup(acl); + spin_unlock(&inode->i_lock); +} + +struct posix_acl * +xfs_get_acl(struct inode *inode, int type) +{ + struct xfs_inode *ip = XFS_I(inode); + struct posix_acl *acl = NULL, **p_acl; + struct xfs_acl *xfs_acl; + int len = sizeof(struct xfs_acl); + char *ea_name; + int error; + + switch (type) { + case ACL_TYPE_ACCESS: + ea_name = SGI_ACL_FILE; + p_acl = &ip->i_acl; + break; + case ACL_TYPE_DEFAULT: + ea_name = SGI_ACL_DEFAULT; + p_acl = &ip->i_default_acl; + break; + default: + return ERR_PTR(-EINVAL); + } + + spin_lock(&inode->i_lock); + if (*p_acl != XFS_ACL_NOT_CACHED) + acl = posix_acl_dup(*p_acl); + spin_unlock(&inode->i_lock); + + /* + * If we have a cached ACLs value just return it, not need to + * go out to the disk. + */ + if (acl) + return acl; + + xfs_acl = kzalloc(sizeof(struct xfs_acl), GFP_KERNEL); + if (!xfs_acl) + return ERR_PTR(-ENOMEM); + + error = -xfs_attr_get(ip, ea_name, (char *)xfs_acl, &len, ATTR_ROOT); + if (error) { + /* + * If the attribute doesn't exist make sure we have a negative + * cache entry, for any other error assume it is transient and + * leave the cache entry as XFS_ACL_NOT_CACHED. + */ + if (error == -ENOATTR) { + acl = NULL; + goto out_update_cache; + } + goto out; + } + + acl = xfs_acl_from_disk(xfs_acl); + if (IS_ERR(acl)) + goto out; + + out_update_cache: + xfs_update_cached_acl(inode, p_acl, acl); + out: + kfree(xfs_acl); + return acl; +} + +static int +xfs_set_acl(struct inode *inode, int type, struct posix_acl *acl) +{ + struct xfs_inode *ip = XFS_I(inode); + struct posix_acl **p_acl; + char *ea_name; + int error; + + if (S_ISLNK(inode->i_mode)) + return -EOPNOTSUPP; + + switch (type) { + case ACL_TYPE_ACCESS: + ea_name = SGI_ACL_FILE; + p_acl = &ip->i_acl; + break; + case ACL_TYPE_DEFAULT: + if (!S_ISDIR(inode->i_mode)) + return acl ? -EACCES : 0; + ea_name = SGI_ACL_DEFAULT; + p_acl = &ip->i_default_acl; + break; + default: + return -EINVAL; + } + + if (acl) { + struct xfs_acl *xfs_acl; + int len; + + xfs_acl = kzalloc(sizeof(struct xfs_acl), GFP_KERNEL); + if (!xfs_acl) + return -ENOMEM; + + xfs_acl_to_disk(xfs_acl, acl); + len = sizeof(struct xfs_acl) - + (sizeof(struct xfs_acl_entry) * + (XFS_ACL_MAX_ENTRIES - acl->a_count)); + + error = -xfs_attr_set(ip, ea_name, (char *)xfs_acl, + len, ATTR_ROOT); + + kfree(xfs_acl); + } else { + /* + * A NULL ACL argument means we want to remove the ACL. + */ + error = -xfs_attr_remove(ip, ea_name, ATTR_ROOT); + + /* + * If the attribute didn't exist to start with that's fine. + */ + if (error == -ENOATTR) + error = 0; + } + + if (!error) + xfs_update_cached_acl(inode, p_acl, acl); + return error; +} + +static int +xfs_check_acl(struct inode *inode, int mask) +{ + struct xfs_inode *ip = XFS_I(inode); + struct posix_acl *acl; + int error = -EAGAIN; + + xfs_itrace_entry(ip); + + /* + * If there is no attribute fork no ACL exists on this inode and + * we can skip the whole exercise. + */ + if (!XFS_IFORK_Q(ip)) + return -EAGAIN; + + acl = xfs_get_acl(inode, ACL_TYPE_ACCESS); + if (IS_ERR(acl)) + return PTR_ERR(acl); + if (acl) { + error = posix_acl_permission(inode, acl, mask); + posix_acl_release(acl); + } + + return error; +} + +int +xfs_vn_permission(struct inode *inode, int mask, struct nameidata *nd) +{ + return generic_permission(inode, mask, xfs_check_acl); +} + +static int +xfs_set_mode(struct inode *inode, mode_t mode) +{ + int error = 0; + + if (mode != inode->i_mode) { + struct iattr iattr; + + iattr.ia_valid = ATTR_MODE; + iattr.ia_mode = mode; + + error = -xfs_setattr(XFS_I(inode), &iattr, XFS_ATTR_NOACL, + sys_cred); + } + + return error; +} + +static int +xfs_acl_exists(struct inode *inode, char *name) +{ + int len = sizeof(struct xfs_acl); + + return (xfs_attr_get(XFS_I(inode), name, NULL, &len, + ATTR_ROOT|ATTR_KERNOVAL) == 0); +} + +int +posix_acl_access_exists(struct inode *inode) +{ + return xfs_acl_exists(inode, SGI_ACL_FILE); +} + +int +posix_acl_default_exists(struct inode *inode) +{ + if (!S_ISDIR(inode->i_mode)) + return 0; + return xfs_acl_exists(inode, SGI_ACL_DEFAULT); +} + +/* + * No need for i_mutex because the inode is not yet exposed to the VFS. + */ +int +xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl) +{ + struct posix_acl *clone; + mode_t mode; + int error = 0, inherit = 0; + + if (S_ISDIR(inode->i_mode)) { + error = xfs_set_acl(inode, ACL_TYPE_DEFAULT, default_acl); + if (error) + return error; + } + + clone = posix_acl_clone(default_acl, GFP_KERNEL); + if (!clone) + return -ENOMEM; + + mode = inode->i_mode; + error = posix_acl_create_masq(clone, &mode); + if (error < 0) + goto out_release_clone; + + /* + * If posix_acl_create_masq returns a positive value we need to + * inherit a permission that can't be represented using the Unix + * mode bits and we actually need to set an ACL. + */ + if (error > 0) + inherit = 1; + + error = xfs_set_mode(inode, mode); + if (error) + goto out_release_clone; + + if (inherit) + error = xfs_set_acl(inode, ACL_TYPE_ACCESS, clone); + + out_release_clone: + posix_acl_release(clone); + return error; +} + +int +xfs_acl_chmod(struct inode *inode) +{ + struct posix_acl *acl, *clone; + int error; + + if (S_ISLNK(inode->i_mode)) + return -EOPNOTSUPP; + + acl = xfs_get_acl(inode, ACL_TYPE_ACCESS); + if (IS_ERR(acl) || !acl) + return PTR_ERR(acl); + + clone = posix_acl_clone(acl, GFP_KERNEL); + posix_acl_release(acl); + if (!clone) + return -ENOMEM; + + error = posix_acl_chmod_masq(clone, inode->i_mode); + if (!error) + error = xfs_set_acl(inode, ACL_TYPE_ACCESS, clone); + + posix_acl_release(clone); + return error; +} + +void +xfs_inode_init_acls(struct xfs_inode *ip) +{ + /* + * No need for locking, inode is not live yet. + */ + ip->i_acl = XFS_ACL_NOT_CACHED; + ip->i_default_acl = XFS_ACL_NOT_CACHED; +} + +void +xfs_inode_clear_acls(struct xfs_inode *ip) +{ + /* + * No need for locking here, the inode is not live anymore + * and just about to be freed. + */ + if (ip->i_acl != XFS_ACL_NOT_CACHED) + posix_acl_release(ip->i_acl); + if (ip->i_default_acl != XFS_ACL_NOT_CACHED) + posix_acl_release(ip->i_default_acl); +} + + +/* + * System xattr handlers. + * + * Currently Posix ACLs are the only system namespace extended attribute + * handlers supported by XFS, so we just implement the handlers here. + * If we ever support other system extended attributes this will need + * some refactoring. + */ + +static int +xfs_decode_acl(const char *name) +{ + if (strcmp(name, "posix_acl_access") == 0) + return ACL_TYPE_ACCESS; + else if (strcmp(name, "posix_acl_default") == 0) + return ACL_TYPE_DEFAULT; + return -EINVAL; +} + +static int +xfs_xattr_system_get(struct inode *inode, const char *name, + void *value, size_t size) +{ + struct posix_acl *acl; + int type, error; + + type = xfs_decode_acl(name); + if (type < 0) + return type; + + acl = xfs_get_acl(inode, type); + if (IS_ERR(acl)) + return PTR_ERR(acl); + if (acl == NULL) + return -ENODATA; + + error = posix_acl_to_xattr(acl, value, size); + posix_acl_release(acl); + + return error; +} + +static int +xfs_xattr_system_set(struct inode *inode, const char *name, + const void *value, size_t size, int flags) +{ + struct posix_acl *acl = NULL; + int error = 0, type; + + type = xfs_decode_acl(name); + if (type < 0) + return type; + if (flags & XATTR_CREATE) + return -EINVAL; + if (type == ACL_TYPE_DEFAULT && !S_ISDIR(inode->i_mode)) + return value ? -EACCES : 0; + if ((current->fsuid != inode->i_uid) && !capable(CAP_FOWNER)) + return -EPERM; + + if (!value) + goto set_acl; + + acl = posix_acl_from_xattr(value, size); + if (!acl) { + /* + * acl_set_file(3) may request that we set default ACLs with + * zero length -- defend (gracefully) against that here. + */ + goto out; + } + if (IS_ERR(acl)) { + error = PTR_ERR(acl); + goto out; + } + + error = posix_acl_valid(acl); + if (error) + goto out_release; + + error = -EINVAL; + if (acl->a_count > XFS_ACL_MAX_ENTRIES) + goto out_release; + + if (type == ACL_TYPE_ACCESS) { + mode_t mode = inode->i_mode; + error = posix_acl_equiv_mode(acl, &mode); + + if (error <= 0) { + posix_acl_release(acl); + acl = NULL; + + if (error < 0) + return error; + } + + error = xfs_set_mode(inode, mode); + if (error) + goto out_release; + } + + set_acl: + error = xfs_set_acl(inode, type, acl); + out_release: + posix_acl_release(acl); + out: + return error; +} + +struct xattr_handler xfs_xattr_system_handler = { + .prefix = XATTR_SYSTEM_PREFIX, + .get = xfs_xattr_system_get, + .set = xfs_xattr_system_set, +}; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 19:47:32.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 22:13:35.000000000 +0200 @@ -51,6 +51,7 @@ #include #include #include +#include #include #include @@ -257,9 +258,8 @@ xfs_vn_mknod( { struct inode *inode; struct xfs_inode *ip = NULL; - xfs_acl_t *default_acl = NULL; + struct posix_acl *default_acl = NULL; struct xfs_name name; - int (*test_default_acl)(struct inode *) = _ACL_DEFAULT_EXISTS; int error; /* @@ -269,21 +269,17 @@ xfs_vn_mknod( if (unlikely(!sysv_valid_dev(rdev) || MAJOR(rdev) & ~0x1ff)) return -EINVAL; - if (test_default_acl && test_default_acl(dir)) { - if (!_ACL_ALLOC(default_acl)) { - return -ENOMEM; - } - if (!_ACL_GET_DEFAULT(dir, default_acl)) { - _ACL_FREE(default_acl); - default_acl = NULL; - } + if (IS_POSIXACL(dir)) { + default_acl = xfs_get_acl(dir, ACL_TYPE_DEFAULT); + if (IS_ERR(default_acl)) + return -PTR_ERR(default_acl); + + if (!default_acl) + mode &= ~current->fs->umask; } xfs_dentry_to_name(&name, dentry); - if (IS_POSIXACL(dir) && !default_acl) - mode &= ~current->fs->umask; - switch (mode & S_IFMT) { case S_IFCHR: case S_IFBLK: @@ -311,10 +307,10 @@ xfs_vn_mknod( goto out_cleanup_inode; if (default_acl) { - error = _ACL_INHERIT(inode, mode, default_acl); + error = -xfs_inherit_acl(inode, default_acl); if (unlikely(error)) goto out_cleanup_inode; - _ACL_FREE(default_acl); + posix_acl_release(default_acl); } @@ -324,8 +320,7 @@ xfs_vn_mknod( out_cleanup_inode: xfs_cleanup_inode(dir, inode, dentry); out_free_acl: - if (default_acl) - _ACL_FREE(default_acl); + posix_acl_release(default_acl); return -error; } @@ -558,38 +553,6 @@ xfs_vn_put_link( kfree(s); } -#ifdef CONFIG_XFS_POSIX_ACL -STATIC int -xfs_check_acl( - struct inode *inode, - int mask) -{ - struct xfs_inode *ip = XFS_I(inode); - int error; - - xfs_itrace_entry(ip); - - if (XFS_IFORK_Q(ip)) { - error = xfs_acl_iaccess(ip, mask, NULL); - if (error != -1) - return -error; - } - - return -EAGAIN; -} - -STATIC int -xfs_vn_permission( - struct inode *inode, - int mask, - struct nameidata *nd) -{ - return generic_permission(inode, mask, xfs_check_acl); -} -#else -#define xfs_vn_permission NULL -#endif - STATIC int xfs_vn_getattr( struct vfsmount *mnt, Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h 2008-07-23 19:42:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h 2008-07-23 22:14:02.000000000 +0200 @@ -31,4 +31,10 @@ extern void xfs_ichgtime_fast(struct xfs extern void xfs_setup_inode(struct xfs_inode *); +#ifdef CONFIG_XFS_POSIX_ACL +int xfs_vn_permission(struct inode *inode, int mask, struct nameidata *nd); +#else +#define xfs_vn_permission NULL +#endif + #endif /* __XFS_IOPS_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_acl.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.h 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.h 2008-07-23 22:13:10.000000000 +0200 @@ -18,82 +18,84 @@ #ifndef __XFS_ACL_H__ #define __XFS_ACL_H__ -/* - * Access Control Lists - */ -typedef __uint16_t xfs_acl_perm_t; -typedef __int32_t xfs_acl_type_t; -typedef __int32_t xfs_acl_tag_t; -typedef __int32_t xfs_acl_id_t; +struct inode; +struct posix_acl; +struct xfs_inode; + #define XFS_ACL_MAX_ENTRIES 25 #define XFS_ACL_NOT_PRESENT (-1) -typedef struct xfs_acl_entry { - xfs_acl_tag_t ae_tag; - xfs_acl_id_t ae_id; - xfs_acl_perm_t ae_perm; -} xfs_acl_entry_t; - -typedef struct xfs_acl { - __int32_t acl_cnt; - xfs_acl_entry_t acl_entry[XFS_ACL_MAX_ENTRIES]; -} xfs_acl_t; +struct xfs_acl { + __be32 acl_cnt; + struct xfs_acl_entry { + __be32 ae_tag; + __be32 ae_id; + __be16 ae_perm; + } acl_entry[XFS_ACL_MAX_ENTRIES]; +}; /* On-disk XFS extended attribute names */ -#define SGI_ACL_FILE "SGI_ACL_FILE" -#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT" +#define SGI_ACL_FILE "SGI_ACL_FILE" +#define SGI_ACL_DEFAULT "SGI_ACL_DEFAULT" #define SGI_ACL_FILE_SIZE (sizeof(SGI_ACL_FILE)-1) #define SGI_ACL_DEFAULT_SIZE (sizeof(SGI_ACL_DEFAULT)-1) -#define _ACL_TYPE_ACCESS 1 -#define _ACL_TYPE_DEFAULT 2 #ifdef CONFIG_XFS_POSIX_ACL -struct vattr; -struct xfs_inode; - -extern struct kmem_zone *xfs_acl_zone; -#define xfs_acl_zone_init(zone, name) \ - (zone) = kmem_zone_init(sizeof(xfs_acl_t), (name)) -#define xfs_acl_zone_destroy(zone) kmem_zone_destroy(zone) - -extern int xfs_acl_inherit(bhv_vnode_t *, mode_t mode, xfs_acl_t *); -extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *); -extern int xfs_acl_vtoacl(bhv_vnode_t *, xfs_acl_t *, xfs_acl_t *); -extern int xfs_acl_vhasacl_access(bhv_vnode_t *); -extern int xfs_acl_vhasacl_default(bhv_vnode_t *); -extern int xfs_acl_vset(bhv_vnode_t *, void *, size_t, int); -extern int xfs_acl_vget(bhv_vnode_t *, void *, size_t, int); -extern int xfs_acl_vremove(bhv_vnode_t *, int); - -#define _ACL_PERM_INVALID(perm) ((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE)) - -#define _ACL_INHERIT(c,m,d) (xfs_acl_inherit(c,m,d)) -#define _ACL_GET_ACCESS(pv,pa) (xfs_acl_vtoacl(pv,pa,NULL) == 0) -#define _ACL_GET_DEFAULT(pv,pd) (xfs_acl_vtoacl(pv,NULL,pd) == 0) -#define _ACL_ACCESS_EXISTS xfs_acl_vhasacl_access -#define _ACL_DEFAULT_EXISTS xfs_acl_vhasacl_default +struct posix_acl *xfs_get_acl(struct inode *inode, int type); +int xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl); +int xfs_acl_chmod(struct inode *inode); +void xfs_inode_init_acls(struct xfs_inode *ip); +void xfs_inode_clear_acls(struct xfs_inode *ip); +int posix_acl_access_exists(struct inode *inode); +int posix_acl_default_exists(struct inode *inode); -#define _ACL_ALLOC(a) ((a) = kmem_zone_alloc(xfs_acl_zone, KM_SLEEP)) -#define _ACL_FREE(a) ((a)? kmem_zone_free(xfs_acl_zone, (a)):(void)0) +extern struct xattr_handler xfs_xattr_system_handler; #else -#define xfs_acl_zone_init(zone,name) -#define xfs_acl_zone_destroy(zone) -#define xfs_acl_vset(v,p,sz,t) (-EOPNOTSUPP) -#define xfs_acl_vget(v,p,sz,t) (-EOPNOTSUPP) -#define xfs_acl_vremove(v,t) (-EOPNOTSUPP) -#define xfs_acl_vhasacl_access(v) (0) -#define xfs_acl_vhasacl_default(v) (0) -#define _ACL_ALLOC(a) (1) /* successfully allocate nothing */ -#define _ACL_FREE(a) ((void)0) -#define _ACL_INHERIT(c,m,d) (0) -#define _ACL_GET_ACCESS(pv,pa) (0) -#define _ACL_GET_DEFAULT(pv,pd) (0) -#define _ACL_ACCESS_EXISTS (NULL) -#define _ACL_DEFAULT_EXISTS (NULL) -#endif +static inline struct posix_acl * +xfs_get_acl(struct inode *inode, int type) +{ + BUG(); + return NULL; +} + +static inline int +xfs_inherit_acl(struct inode *inode, struct posix_acl *default_acl) +{ + BUG(); + return 0; +} + +static inline int +xfs_acl_chmod(struct inode *inode) +{ + return 0; +} + +static inline void +xfs_inode_init_acls(struct xfs_inode *ip) +{ +} + +static inline void +xfs_inode_clear_acls(struct xfs_inode *ip) +{ +} + +static inline int +posix_acl_access_exists(struct inode *inode) +{ + return 0; +} + +static inline int +posix_acl_default_exists(struct inode *inode) +{ + return 0; +} +#endif /* CONFIG_XFS_POSIX_ACL */ #endif /* __XFS_ACL_H__ */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-23 19:48:40.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-23 22:13:10.000000000 +0200 @@ -51,7 +51,6 @@ #include "xfs_dir2_block.h" #include "xfs_dir2_node.h" #include "xfs_dir2_trace.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_inode_item.h" @@ -179,10 +178,6 @@ EXPORT_SYMBOL(uuid_hash64); EXPORT_SYMBOL(uuid_is_nil); EXPORT_SYMBOL(uuid_table_remove); -#if defined(CONFIG_XFS_POSIX_ACL) -EXPORT_SYMBOL(xfs_acl_vtoacl); -EXPORT_SYMBOL(xfs_acl_inherit); -#endif EXPORT_SYMBOL(xfs_alloc_buftarg); EXPORT_SYMBOL(xfs_flush_buftarg); EXPORT_SYMBOL(xfs_free_buftarg); Index: linux-2.6-xfs/fs/xfs/Makefile =================================================================== --- linux-2.6-xfs.orig/fs/xfs/Makefile 2008-07-23 19:48:40.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/Makefile 2008-07-23 22:13:10.000000000 +0200 @@ -29,7 +29,7 @@ obj-$(CONFIG_XFS_QUOTA) += quota/ obj-$(CONFIG_XFS_DMAPI) += dmapi/ xfs-$(CONFIG_XFS_RT) += xfs_rtalloc.o -xfs-$(CONFIG_XFS_POSIX_ACL) += xfs_acl.o +xfs-$(CONFIG_XFS_POSIX_ACL) += $(XFS_LINUX)/xfs_acl.o xfs-$(CONFIG_PROC_FS) += $(XFS_LINUX)/xfs_stats.o xfs-$(CONFIG_SYSCTL) += $(XFS_LINUX)/xfs_sysctl.o xfs-$(CONFIG_COMPAT) += $(XFS_LINUX)/xfs_ioctl32.o Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 19:48:40.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 22:13:10.000000000 +0200 @@ -817,6 +817,7 @@ xfs_iread( ip->i_mount = mp; atomic_set(&ip->i_iocount, 0); spin_lock_init(&ip->i_flags_lock); + xfs_inode_init_acls(ip); /* * Get pointer's to the on-disk inode and the buffer containing it. @@ -2627,6 +2628,8 @@ xfs_idestroy( } xfs_inode_item_destroy(ip); } + + xfs_inode_clear_acls(ip); kmem_zone_free(xfs_inode_zone, ip); } Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-23 19:48:40.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-23 22:13:10.000000000 +0200 @@ -18,6 +18,7 @@ #ifndef __XFS_INODE_H__ #define __XFS_INODE_H__ +struct posix_acl; struct xfs_dinode; struct xfs_dinode_core; @@ -239,6 +240,11 @@ typedef struct xfs_inode { xfs_fsize_t i_size; /* in-memory size */ xfs_fsize_t i_new_size; /* size when write completes */ atomic_t i_iocount; /* outstanding I/O count */ + +#ifdef CONFIG_XFS_POSIX_ACL + struct posix_acl *i_acl; + struct posix_acl *i_default_acl; +#endif /* Trace buffers per inode. */ #ifdef XFS_INODE_TRACE struct ktrace *i_trace; /* general inode trace */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_xattr.c 2008-07-23 22:13:10.000000000 +0200 @@ -29,67 +29,6 @@ #include -/* - * ACL handling. Should eventually be moved into xfs_acl.c - */ - -static int -xfs_decode_acl(const char *name) -{ - if (strcmp(name, "posix_acl_access") == 0) - return _ACL_TYPE_ACCESS; - else if (strcmp(name, "posix_acl_default") == 0) - return _ACL_TYPE_DEFAULT; - return -EINVAL; -} - -/* - * Get system extended attributes which at the moment only - * includes Posix ACLs. - */ -static int -xfs_xattr_system_get(struct inode *inode, const char *name, - void *buffer, size_t size) -{ - int acl; - - acl = xfs_decode_acl(name); - if (acl < 0) - return acl; - - return xfs_acl_vget(inode, buffer, size, acl); -} - -static int -xfs_xattr_system_set(struct inode *inode, const char *name, - const void *value, size_t size, int flags) -{ - int acl; - - acl = xfs_decode_acl(name); - if (acl < 0) - return acl; - if (flags & XATTR_CREATE) - return -EINVAL; - - if (!value) - return xfs_acl_vremove(inode, acl); - - return xfs_acl_vset(inode, (void *)value, size, acl); -} - -static struct xattr_handler xfs_xattr_system_handler = { - .prefix = XATTR_SYSTEM_PREFIX, - .get = xfs_xattr_system_get, - .set = xfs_xattr_system_set, -}; - - -/* - * Real xattr handling. The only difference between the namespaces is - * a flag passed to the low-level attr code. - */ - static int __xfs_xattr_get(struct inode *inode, const char *name, void *value, size_t size, int xflags) @@ -199,7 +138,9 @@ struct xattr_handler *xfs_xattr_handlers &xfs_xattr_user_handler, &xfs_xattr_trusted_handler, &xfs_xattr_security_handler, +#ifdef CONFIG_XFS_POSIX_ACL &xfs_xattr_system_handler, +#endif NULL }; @@ -310,7 +251,7 @@ xfs_vn_listxattr(struct dentry *dentry, /* * Then add the two synthetic ACL attributes. */ - if (xfs_acl_vhasacl_access(inode)) { + if (posix_acl_access_exists(inode)) { error = list_one_attr(POSIX_ACL_XATTR_ACCESS, strlen(POSIX_ACL_XATTR_ACCESS) + 1, data, size, &context.count); @@ -318,7 +259,7 @@ xfs_vn_listxattr(struct dentry *dentry, return error; } - if (xfs_acl_vhasacl_default(inode)) { + if (posix_acl_default_exists(inode)) { error = list_one_attr(POSIX_ACL_XATTR_DEFAULT, strlen(POSIX_ACL_XATTR_DEFAULT) + 1, data, size, &context.count); Index: linux-2.6-xfs/fs/xfs/Kconfig =================================================================== --- linux-2.6-xfs.orig/fs/xfs/Kconfig 2008-07-23 15:11:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/Kconfig 2008-07-23 22:13:10.000000000 +0200 @@ -51,6 +51,7 @@ config XFS_DMAPI config XFS_POSIX_ACL bool "XFS POSIX ACL support" depends on XFS_FS + select FS_POSIX_ACL help POSIX Access Control Lists (ACLs) support permissions for users and groups beyond the owner/group/world scheme. Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:48:40.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:13:10.000000000 +0200 @@ -43,7 +43,6 @@ #include "xfs_itable.h" #include "xfs_fsops.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_utils.h" @@ -1921,18 +1920,8 @@ xfs_init_zones(void) if (!xfs_ili_zone) goto out_destroy_inode_zone; -#ifdef CONFIG_XFS_POSIX_ACL - xfs_acl_zone = kmem_zone_init(sizeof(xfs_acl_t), "xfs_acl"); - if (!xfs_acl_zone) - goto out_destroy_ili_zone; -#endif - return 0; -#ifdef CONFIG_XFS_POSIX_ACL - out_destroy_ili_zone: -#endif - kmem_zone_destroy(xfs_ili_zone); out_destroy_inode_zone: kmem_zone_destroy(xfs_inode_zone); out_destroy_efi_zone: @@ -1968,9 +1957,6 @@ xfs_init_zones(void) STATIC void xfs_destroy_zones(void) { -#ifdef CONFIG_XFS_POSIX_ACL - kmem_zone_destroy(xfs_acl_zone); -#endif kmem_zone_destroy(xfs_ili_zone); kmem_zone_destroy(xfs_inode_zone); kmem_zone_destroy(xfs_efi_zone); Index: linux-2.6-xfs/fs/xfs/xfs_attr.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_attr.c 2008-07-23 19:28:07.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_attr.c 2008-07-23 22:13:10.000000000 +0200 @@ -45,7 +45,6 @@ #include "xfs_error.h" #include "xfs_quota.h" #include "xfs_trans_space.h" -#include "xfs_acl.h" #include "xfs_rw.h" #include "xfs_vnodeops.h" Index: linux-2.6-xfs/fs/xfs/xfs_iomap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iomap.c 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iomap.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h" Index: linux-2.6-xfs/fs/xfs/xfs_rw.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rw.c 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_rw.c 2008-07-23 22:13:10.000000000 +0200 @@ -41,7 +41,6 @@ #include "xfs_ialloc.h" #include "xfs_attr.h" #include "xfs_bmap.h" -#include "xfs_acl.h" #include "xfs_error.h" #include "xfs_buf_item.h" #include "xfs_rw.h" Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 19:47:27.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 22:13:10.000000000 +0200 @@ -47,7 +47,6 @@ #include "xfs_log_priv.h" #include "xfs_dir2_trace.h" #include "xfs_extfree_item.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_mru_cache.h" #include "xfs_filestream.h" Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-23 19:47:32.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-23 22:13:10.000000000 +0200 @@ -41,7 +41,6 @@ #include "xfs_itable.h" #include "xfs_bmap.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_attr_leaf.h" #include "xfs_inode_item.h" Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-23 19:28:08.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ioctl.c 2008-07-23 22:13:10.000000000 +0200 @@ -40,7 +40,6 @@ #include "xfs_itable.h" #include "xfs_error.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_bmap.h" #include "xfs_buf_item.h" Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2008-07-23 19:28:08.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_inode_item.h" #include "xfs_buf_item.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_dquot.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_dquot.c 2008-07-23 19:40:42.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_dquot.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_dquot_item.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_dquot_item.c 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_dquot_item.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_error.h" #include "xfs_itable.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.c 2008-07-23 19:47:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_error.h" #include "xfs_bmap.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_trans_space.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_bhv.c 2008-07-23 19:47:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_qm.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_stats.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_stats.c 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_stats.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_qm.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c 2008-07-23 19:28:08.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c 2008-07-23 22:13:10.000000000 +0200 @@ -45,7 +45,6 @@ #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_utils.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_trans_dquot.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_trans_dquot.c 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_trans_dquot.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,7 +42,6 @@ #include "xfs_rtalloc.h" #include "xfs_error.h" #include "xfs_rw.h" -#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_buf_item.h" #include "xfs_trans_priv.h" Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 19:47:02.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 22:13:10.000000000 +0200 @@ -42,6 +42,7 @@ #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_bmap.h" +#include "xfs_acl.h" #include "xfs_attr.h" #include "xfs_rw.h" #include "xfs_error.h" @@ -576,8 +577,20 @@ xfs_setattr( XFS_QM_DQRELE(mp, udqp); XFS_QM_DQRELE(mp, gdqp); - if (code) { + if (code) return code; + + /* + * XXX(hch): Updating the ACL entries is not atomic vs the i_mode + * update. We could avoid this with linked transactions + * and an passing down the transaction pointer all the + * way to attr_set. No previous user of the generic + * Posix ACL code seems to care about this issue either. + */ + if ((mask & ATTR_MODE) && !(flags & XFS_ATTR_NOACL)) { + code = xfs_acl_chmod(inode); + if (code) + return code; } if (DM_EVENT_ENABLED(ip, DM_EVENT_ATTRIBUTE) && Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.h 2008-07-23 15:11:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.h 2008-07-23 22:13:10.000000000 +0200 @@ -20,6 +20,7 @@ int xfs_setattr(struct xfs_inode *ip, st #define XFS_ATTR_DMI 0x01 /* invocation from a DMI function */ #define XFS_ATTR_NONBLOCK 0x02 /* return EAGAIN if operation would block */ #define XFS_ATTR_NOLOCK 0x04 /* Don't grab any conflicting locks */ +#define XFS_ATTR_NOACL 0x08 /* Don't call xfs_acl_chmod */ int xfs_readlink(struct xfs_inode *ip, char *link); int xfs_fsync(struct xfs_inode *ip); Index: linux-2.6-xfs/fs/xfs/xfs_acl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-23 19:40:42.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,875 +0,0 @@ -/* - * Copyright (c) 2001-2002,2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#include "xfs.h" -#include "xfs_fs.h" -#include "xfs_types.h" -#include "xfs_bit.h" -#include "xfs_inum.h" -#include "xfs_ag.h" -#include "xfs_dir2.h" -#include "xfs_bmap_btree.h" -#include "xfs_alloc_btree.h" -#include "xfs_ialloc_btree.h" -#include "xfs_dir2_sf.h" -#include "xfs_attr_sf.h" -#include "xfs_dinode.h" -#include "xfs_inode.h" -#include "xfs_btree.h" -#include "xfs_acl.h" -#include "xfs_attr.h" -#include "xfs_vnodeops.h" - -#include -#include - -STATIC int xfs_acl_setmode(bhv_vnode_t *, xfs_acl_t *, int *); -STATIC void xfs_acl_filter_mode(mode_t, xfs_acl_t *); -STATIC void xfs_acl_get_endian(xfs_acl_t *); -STATIC int xfs_acl_access(uid_t, gid_t, xfs_acl_t *, mode_t, cred_t *); -STATIC int xfs_acl_invalid(xfs_acl_t *); -STATIC void xfs_acl_sync_mode(mode_t, xfs_acl_t *); -STATIC void xfs_acl_get_attr(bhv_vnode_t *, xfs_acl_t *, int, int, int *); -STATIC void xfs_acl_set_attr(bhv_vnode_t *, xfs_acl_t *, int, int *); -STATIC int xfs_acl_allow_set(bhv_vnode_t *, int); - -kmem_zone_t *xfs_acl_zone; - - -/* - * Test for existence of access ACL attribute as efficiently as possible. - */ -int -xfs_acl_vhasacl_access( - bhv_vnode_t *vp) -{ - int error; - - xfs_acl_get_attr(vp, NULL, _ACL_TYPE_ACCESS, ATTR_KERNOVAL, &error); - return (error == 0); -} - -/* - * Test for existence of default ACL attribute as efficiently as possible. - */ -int -xfs_acl_vhasacl_default( - bhv_vnode_t *vp) -{ - int error; - - if (!S_ISDIR(vp->i_mode)) - return 0; - xfs_acl_get_attr(vp, NULL, _ACL_TYPE_DEFAULT, ATTR_KERNOVAL, &error); - return (error == 0); -} - -/* - * Convert from extended attribute representation to in-memory for XFS. - */ -STATIC int -posix_acl_xattr_to_xfs( - posix_acl_xattr_header *src, - size_t size, - xfs_acl_t *dest) -{ - posix_acl_xattr_entry *src_entry; - xfs_acl_entry_t *dest_entry; - int n; - - if (!src || !dest) - return EINVAL; - - if (size < sizeof(posix_acl_xattr_header)) - return EINVAL; - - if (src->a_version != cpu_to_le32(POSIX_ACL_XATTR_VERSION)) - return EOPNOTSUPP; - - memset(dest, 0, sizeof(xfs_acl_t)); - dest->acl_cnt = posix_acl_xattr_count(size); - if (dest->acl_cnt < 0 || dest->acl_cnt > XFS_ACL_MAX_ENTRIES) - return EINVAL; - - /* - * acl_set_file(3) may request that we set default ACLs with - * zero length -- defend (gracefully) against that here. - */ - if (!dest->acl_cnt) - return 0; - - src_entry = (posix_acl_xattr_entry *)((char *)src + sizeof(*src)); - dest_entry = &dest->acl_entry[0]; - - for (n = 0; n < dest->acl_cnt; n++, src_entry++, dest_entry++) { - dest_entry->ae_perm = le16_to_cpu(src_entry->e_perm); - if (_ACL_PERM_INVALID(dest_entry->ae_perm)) - return EINVAL; - dest_entry->ae_tag = le16_to_cpu(src_entry->e_tag); - switch(dest_entry->ae_tag) { - case ACL_USER: - case ACL_GROUP: - dest_entry->ae_id = le32_to_cpu(src_entry->e_id); - break; - case ACL_USER_OBJ: - case ACL_GROUP_OBJ: - case ACL_MASK: - case ACL_OTHER: - dest_entry->ae_id = ACL_UNDEFINED_ID; - break; - default: - return EINVAL; - } - } - if (xfs_acl_invalid(dest)) - return EINVAL; - - return 0; -} - -/* - * Comparison function called from xfs_sort(). - * Primary key is ae_tag, secondary key is ae_id. - */ -STATIC int -xfs_acl_entry_compare( - const void *va, - const void *vb) -{ - xfs_acl_entry_t *a = (xfs_acl_entry_t *)va, - *b = (xfs_acl_entry_t *)vb; - - if (a->ae_tag == b->ae_tag) - return (a->ae_id - b->ae_id); - return (a->ae_tag - b->ae_tag); -} - -/* - * Convert from in-memory XFS to extended attribute representation. - */ -STATIC int -posix_acl_xfs_to_xattr( - xfs_acl_t *src, - posix_acl_xattr_header *dest, - size_t size) -{ - int n; - size_t new_size = posix_acl_xattr_size(src->acl_cnt); - posix_acl_xattr_entry *dest_entry; - xfs_acl_entry_t *src_entry; - - if (size < new_size) - return -ERANGE; - - /* Need to sort src XFS ACL by */ - xfs_sort(src->acl_entry, src->acl_cnt, sizeof(src->acl_entry[0]), - xfs_acl_entry_compare); - - dest->a_version = cpu_to_le32(POSIX_ACL_XATTR_VERSION); - dest_entry = &dest->a_entries[0]; - src_entry = &src->acl_entry[0]; - for (n = 0; n < src->acl_cnt; n++, dest_entry++, src_entry++) { - dest_entry->e_perm = cpu_to_le16(src_entry->ae_perm); - if (_ACL_PERM_INVALID(src_entry->ae_perm)) - return -EINVAL; - dest_entry->e_tag = cpu_to_le16(src_entry->ae_tag); - switch (src_entry->ae_tag) { - case ACL_USER: - case ACL_GROUP: - dest_entry->e_id = cpu_to_le32(src_entry->ae_id); - break; - case ACL_USER_OBJ: - case ACL_GROUP_OBJ: - case ACL_MASK: - case ACL_OTHER: - dest_entry->e_id = cpu_to_le32(ACL_UNDEFINED_ID); - break; - default: - return -EINVAL; - } - } - return new_size; -} - -int -xfs_acl_vget( - bhv_vnode_t *vp, - void *acl, - size_t size, - int kind) -{ - int error; - xfs_acl_t *xfs_acl = NULL; - posix_acl_xattr_header *ext_acl = acl; - int flags = 0; - - if(size) { - if (!(_ACL_ALLOC(xfs_acl))) { - error = ENOMEM; - goto out; - } - memset(xfs_acl, 0, sizeof(xfs_acl_t)); - } else - flags = ATTR_KERNOVAL; - - xfs_acl_get_attr(vp, xfs_acl, kind, flags, &error); - if (error) - goto out; - - if (!size) { - error = -posix_acl_xattr_size(XFS_ACL_MAX_ENTRIES); - } else { - if (xfs_acl_invalid(xfs_acl)) { - error = EINVAL; - goto out; - } - if (kind == _ACL_TYPE_ACCESS) - xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, xfs_acl); - error = -posix_acl_xfs_to_xattr(xfs_acl, ext_acl, size); - } -out: - if(xfs_acl) - _ACL_FREE(xfs_acl); - return -error; -} - -int -xfs_acl_vremove( - bhv_vnode_t *vp, - int kind) -{ - int error; - - error = xfs_acl_allow_set(vp, kind); - if (!error) { - error = xfs_attr_remove(XFS_I(vp), - kind == _ACL_TYPE_DEFAULT? - SGI_ACL_DEFAULT: SGI_ACL_FILE, - ATTR_ROOT); - if (error == ENOATTR) - error = 0; /* 'scool */ - } - return -error; -} - -int -xfs_acl_vset( - bhv_vnode_t *vp, - void *acl, - size_t size, - int kind) -{ - posix_acl_xattr_header *ext_acl = acl; - xfs_acl_t *xfs_acl; - int error; - int basicperms = 0; /* more than std unix perms? */ - - if (!acl) - return -EINVAL; - - if (!(_ACL_ALLOC(xfs_acl))) - return -ENOMEM; - - error = posix_acl_xattr_to_xfs(ext_acl, size, xfs_acl); - if (error) { - _ACL_FREE(xfs_acl); - return -error; - } - if (!xfs_acl->acl_cnt) { - _ACL_FREE(xfs_acl); - return 0; - } - - error = xfs_acl_allow_set(vp, kind); - - /* Incoming ACL exists, set file mode based on its value */ - if (!error && kind == _ACL_TYPE_ACCESS) - error = xfs_acl_setmode(vp, xfs_acl, &basicperms); - - if (error) - goto out; - - /* - * If we have more than std unix permissions, set up the actual attr. - * Otherwise, delete any existing attr. This prevents us from - * having actual attrs for permissions that can be stored in the - * standard permission bits. - */ - if (!basicperms) { - xfs_acl_set_attr(vp, xfs_acl, kind, &error); - } else { - error = -xfs_acl_vremove(vp, _ACL_TYPE_ACCESS); - } - -out: - _ACL_FREE(xfs_acl); - return -error; -} - -int -xfs_acl_iaccess( - xfs_inode_t *ip, - mode_t mode, - cred_t *cr) -{ - xfs_acl_t *acl; - int rval; - struct xfs_name acl_name = {SGI_ACL_FILE, SGI_ACL_FILE_SIZE}; - - if (!(_ACL_ALLOC(acl))) - return -1; - - /* If the file has no ACL return -1. */ - rval = sizeof(xfs_acl_t); - if (xfs_attr_fetch(ip, &acl_name, (char *)acl, &rval, ATTR_ROOT)) { - _ACL_FREE(acl); - return -1; - } - xfs_acl_get_endian(acl); - - /* If the file has an empty ACL return -1. */ - if (acl->acl_cnt == XFS_ACL_NOT_PRESENT) { - _ACL_FREE(acl); - return -1; - } - - /* Synchronize ACL with mode bits */ - xfs_acl_sync_mode(ip->i_d.di_mode, acl); - - rval = xfs_acl_access(ip->i_d.di_uid, ip->i_d.di_gid, acl, mode, cr); - _ACL_FREE(acl); - return rval; -} - -STATIC int -xfs_acl_allow_set( - bhv_vnode_t *vp, - int kind) -{ - if (vp->i_flags & (S_IMMUTABLE|S_APPEND)) - return EPERM; - if (kind == _ACL_TYPE_DEFAULT && !S_ISDIR(vp->i_mode)) - return ENOTDIR; - if (vp->i_sb->s_flags & MS_RDONLY) - return EROFS; - if (XFS_I(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER)) - return EPERM; - return 0; -} - -/* - * Note: cr is only used here for the capability check if the ACL test fails. - * It is not used to find out the credentials uid or groups etc, as was - * done in IRIX. It is assumed that the uid and groups for the current - * thread are taken from "current" instead of the cr parameter. - */ -STATIC int -xfs_acl_access( - uid_t fuid, - gid_t fgid, - xfs_acl_t *fap, - mode_t md, - cred_t *cr) -{ - xfs_acl_entry_t matched; - int i, allows; - int maskallows = -1; /* true, but not 1, either */ - int seen_userobj = 0; - - matched.ae_tag = 0; /* Invalid type */ - matched.ae_perm = 0; - - for (i = 0; i < fap->acl_cnt; i++) { - /* - * Break out if we've got a user_obj entry or - * a user entry and the mask (and have processed USER_OBJ) - */ - if (matched.ae_tag == ACL_USER_OBJ) - break; - if (matched.ae_tag == ACL_USER) { - if (maskallows != -1 && seen_userobj) - break; - if (fap->acl_entry[i].ae_tag != ACL_MASK && - fap->acl_entry[i].ae_tag != ACL_USER_OBJ) - continue; - } - /* True if this entry allows the requested access */ - allows = ((fap->acl_entry[i].ae_perm & md) == md); - - switch (fap->acl_entry[i].ae_tag) { - case ACL_USER_OBJ: - seen_userobj = 1; - if (fuid != current->fsuid) - continue; - matched.ae_tag = ACL_USER_OBJ; - matched.ae_perm = allows; - break; - case ACL_USER: - if (fap->acl_entry[i].ae_id != current->fsuid) - continue; - matched.ae_tag = ACL_USER; - matched.ae_perm = allows; - break; - case ACL_GROUP_OBJ: - if ((matched.ae_tag == ACL_GROUP_OBJ || - matched.ae_tag == ACL_GROUP) && !allows) - continue; - if (!in_group_p(fgid)) - continue; - matched.ae_tag = ACL_GROUP_OBJ; - matched.ae_perm = allows; - break; - case ACL_GROUP: - if ((matched.ae_tag == ACL_GROUP_OBJ || - matched.ae_tag == ACL_GROUP) && !allows) - continue; - if (!in_group_p(fap->acl_entry[i].ae_id)) - continue; - matched.ae_tag = ACL_GROUP; - matched.ae_perm = allows; - break; - case ACL_MASK: - maskallows = allows; - break; - case ACL_OTHER: - if (matched.ae_tag != 0) - continue; - matched.ae_tag = ACL_OTHER; - matched.ae_perm = allows; - break; - } - } - /* - * First possibility is that no matched entry allows access. - * The capability to override DAC may exist, so check for it. - */ - switch (matched.ae_tag) { - case ACL_OTHER: - case ACL_USER_OBJ: - if (matched.ae_perm) - return 0; - break; - case ACL_USER: - case ACL_GROUP_OBJ: - case ACL_GROUP: - if (maskallows && matched.ae_perm) - return 0; - break; - case 0: - break; - } - - /* EACCES tells generic_permission to check for capability overrides */ - return EACCES; -} -EXPORT_SYMBOL(xfs_acl_access); - -/* - * ACL validity checker. - * This acl validation routine checks each ACL entry read in makes sense. - */ -STATIC int -xfs_acl_invalid( - xfs_acl_t *aclp) -{ - xfs_acl_entry_t *entry, *e; - int user = 0, group = 0, other = 0, mask = 0; - int mask_required = 0; - int i, j; - - if (!aclp) - goto acl_invalid; - - if (aclp->acl_cnt > XFS_ACL_MAX_ENTRIES) - goto acl_invalid; - - for (i = 0; i < aclp->acl_cnt; i++) { - entry = &aclp->acl_entry[i]; - switch (entry->ae_tag) { - case ACL_USER_OBJ: - if (user++) - goto acl_invalid; - break; - case ACL_GROUP_OBJ: - if (group++) - goto acl_invalid; - break; - case ACL_OTHER: - if (other++) - goto acl_invalid; - break; - case ACL_USER: - case ACL_GROUP: - for (j = i + 1; j < aclp->acl_cnt; j++) { - e = &aclp->acl_entry[j]; - if (e->ae_id == entry->ae_id && - e->ae_tag == entry->ae_tag) - goto acl_invalid; - } - mask_required++; - break; - case ACL_MASK: - if (mask++) - goto acl_invalid; - break; - default: - goto acl_invalid; - } - } - if (!user || !group || !other || (mask_required && !mask)) - goto acl_invalid; - else - return 0; -acl_invalid: - return EINVAL; -} - -/* - * Do ACL endian conversion. - */ -STATIC void -xfs_acl_get_endian( - xfs_acl_t *aclp) -{ - xfs_acl_entry_t *ace, *end; - - INT_SET(aclp->acl_cnt, ARCH_CONVERT, aclp->acl_cnt); - end = &aclp->acl_entry[0]+aclp->acl_cnt; - for (ace = &aclp->acl_entry[0]; ace < end; ace++) { - INT_SET(ace->ae_tag, ARCH_CONVERT, ace->ae_tag); - INT_SET(ace->ae_id, ARCH_CONVERT, ace->ae_id); - INT_SET(ace->ae_perm, ARCH_CONVERT, ace->ae_perm); - } -} - -/* - * Get the ACL from the EA and do endian conversion. - */ -STATIC void -xfs_acl_get_attr( - bhv_vnode_t *vp, - xfs_acl_t *aclp, - int kind, - int flags, - int *error) -{ - int len = sizeof(xfs_acl_t); - - ASSERT((flags & ATTR_KERNOVAL) ? (aclp == NULL) : 1); - flags |= ATTR_ROOT; - *error = xfs_attr_get(XFS_I(vp), - kind == _ACL_TYPE_ACCESS ? - SGI_ACL_FILE : SGI_ACL_DEFAULT, - (char *)aclp, &len, flags); - if (*error || (flags & ATTR_KERNOVAL)) - return; - xfs_acl_get_endian(aclp); -} - -/* - * Set the EA with the ACL and do endian conversion. - */ -STATIC void -xfs_acl_set_attr( - bhv_vnode_t *vp, - xfs_acl_t *aclp, - int kind, - int *error) -{ - xfs_acl_entry_t *ace, *newace, *end; - xfs_acl_t *newacl; - int len; - - if (!(_ACL_ALLOC(newacl))) { - *error = ENOMEM; - return; - } - - len = sizeof(xfs_acl_t) - - (sizeof(xfs_acl_entry_t) * (XFS_ACL_MAX_ENTRIES - aclp->acl_cnt)); - end = &aclp->acl_entry[0]+aclp->acl_cnt; - for (ace = &aclp->acl_entry[0], newace = &newacl->acl_entry[0]; - ace < end; - ace++, newace++) { - INT_SET(newace->ae_tag, ARCH_CONVERT, ace->ae_tag); - INT_SET(newace->ae_id, ARCH_CONVERT, ace->ae_id); - INT_SET(newace->ae_perm, ARCH_CONVERT, ace->ae_perm); - } - INT_SET(newacl->acl_cnt, ARCH_CONVERT, aclp->acl_cnt); - *error = xfs_attr_set(XFS_I(vp), - kind == _ACL_TYPE_ACCESS ? - SGI_ACL_FILE: SGI_ACL_DEFAULT, - (char *)newacl, len, ATTR_ROOT); - _ACL_FREE(newacl); -} - -int -xfs_acl_vtoacl( - bhv_vnode_t *vp, - xfs_acl_t *access_acl, - xfs_acl_t *default_acl) -{ - int error = 0; - - if (access_acl) { - /* - * Get the Access ACL and the mode. If either cannot - * be obtained for some reason, invalidate the access ACL. - */ - xfs_acl_get_attr(vp, access_acl, _ACL_TYPE_ACCESS, 0, &error); - if (error) - access_acl->acl_cnt = XFS_ACL_NOT_PRESENT; - else /* We have a good ACL and the file mode, synchronize. */ - xfs_acl_sync_mode(XFS_I(vp)->i_d.di_mode, access_acl); - } - - if (default_acl) { - xfs_acl_get_attr(vp, default_acl, _ACL_TYPE_DEFAULT, 0, &error); - if (error) - default_acl->acl_cnt = XFS_ACL_NOT_PRESENT; - } - return error; -} - -/* - * This function retrieves the parent directory's acl, processes it - * and lets the child inherit the acl(s) that it should. - */ -int -xfs_acl_inherit( - bhv_vnode_t *vp, - mode_t mode, - xfs_acl_t *pdaclp) -{ - xfs_acl_t *cacl; - int error = 0; - int basicperms = 0; - - /* - * If the parent does not have a default ACL, or it's an - * invalid ACL, we're done. - */ - if (!vp) - return 0; - if (!pdaclp || xfs_acl_invalid(pdaclp)) - return 0; - - /* - * Copy the default ACL of the containing directory to - * the access ACL of the new file and use the mode that - * was passed in to set up the correct initial values for - * the u::,g::[m::], and o:: entries. This is what makes - * umask() "work" with ACL's. - */ - - if (!(_ACL_ALLOC(cacl))) - return ENOMEM; - - memcpy(cacl, pdaclp, sizeof(xfs_acl_t)); - xfs_acl_filter_mode(mode, cacl); - error = xfs_acl_setmode(vp, cacl, &basicperms); - if (error) - goto out_error; - - /* - * Set the Default and Access ACL on the file. The mode is already - * set on the file, so we don't need to worry about that. - * - * If the new file is a directory, its default ACL is a copy of - * the containing directory's default ACL. - */ - if (S_ISDIR(vp->i_mode)) - xfs_acl_set_attr(vp, pdaclp, _ACL_TYPE_DEFAULT, &error); - if (!error && !basicperms) - xfs_acl_set_attr(vp, cacl, _ACL_TYPE_ACCESS, &error); -out_error: - _ACL_FREE(cacl); - return error; -} - -/* - * Set up the correct mode on the file based on the supplied ACL. This - * makes sure that the mode on the file reflects the state of the - * u::,g::[m::], and o:: entries in the ACL. Since the mode is where - * the ACL is going to get the permissions for these entries, we must - * synchronize the mode whenever we set the ACL on a file. - */ -STATIC int -xfs_acl_setmode( - bhv_vnode_t *vp, - xfs_acl_t *acl, - int *basicperms) -{ - struct iattr iattr; - xfs_acl_entry_t *ap; - xfs_acl_entry_t *gap = NULL; - int i, nomask = 1; - - *basicperms = 1; - - if (acl->acl_cnt == XFS_ACL_NOT_PRESENT) - return 0; - - /* - * Copy the u::, g::, o::, and m:: bits from the ACL into the - * mode. The m:: bits take precedence over the g:: bits. - */ - iattr.ia_valid = ATTR_MODE; - iattr.ia_mode = XFS_I(vp)->i_d.di_mode; - iattr.ia_mode &= ~(S_IRWXU|S_IRWXG|S_IRWXO); - ap = acl->acl_entry; - for (i = 0; i < acl->acl_cnt; ++i) { - switch (ap->ae_tag) { - case ACL_USER_OBJ: - iattr.ia_mode |= ap->ae_perm << 6; - break; - case ACL_GROUP_OBJ: - gap = ap; - break; - case ACL_MASK: /* more than just standard modes */ - nomask = 0; - iattr.ia_mode |= ap->ae_perm << 3; - *basicperms = 0; - break; - case ACL_OTHER: - iattr.ia_mode |= ap->ae_perm; - break; - default: /* more than just standard modes */ - *basicperms = 0; - break; - } - ap++; - } - - /* Set the group bits from ACL_GROUP_OBJ if there's no ACL_MASK */ - if (gap && nomask) - iattr.ia_mode |= gap->ae_perm << 3; - - return xfs_setattr(XFS_I(vp), &iattr, 0, sys_cred); -} - -/* - * The permissions for the special ACL entries (u::, g::[m::], o::) are - * actually stored in the file mode (if there is both a group and a mask, - * the group is stored in the ACL entry and the mask is stored on the file). - * This allows the mode to remain automatically in sync with the ACL without - * the need for a call-back to the ACL system at every point where the mode - * could change. This function takes the permissions from the specified mode - * and places it in the supplied ACL. - * - * This implementation draws its validity from the fact that, when the ACL - * was assigned, the mode was copied from the ACL. - * If the mode did not change, therefore, the mode remains exactly what was - * taken from the special ACL entries at assignment. - * If a subsequent chmod() was done, the POSIX spec says that the change in - * mode must cause an update to the ACL seen at user level and used for - * access checks. Before and after a mode change, therefore, the file mode - * most accurately reflects what the special ACL entries should permit/deny. - * - * CAVEAT: If someone sets the SGI_ACL_FILE attribute directly, - * the existing mode bits will override whatever is in the - * ACL. Similarly, if there is a pre-existing ACL that was - * never in sync with its mode (owing to a bug in 6.5 and - * before), it will now magically (or mystically) be - * synchronized. This could cause slight astonishment, but - * it is better than inconsistent permissions. - * - * The supplied ACL is a template that may contain any combination - * of special entries. These are treated as place holders when we fill - * out the ACL. This routine does not add or remove special entries, it - * simply unites each special entry with its associated set of permissions. - */ -STATIC void -xfs_acl_sync_mode( - mode_t mode, - xfs_acl_t *acl) -{ - int i, nomask = 1; - xfs_acl_entry_t *ap; - xfs_acl_entry_t *gap = NULL; - - /* - * Set ACL entries. POSIX1003.1eD16 requires that the MASK - * be set instead of the GROUP entry, if there is a MASK. - */ - for (ap = acl->acl_entry, i = 0; i < acl->acl_cnt; ap++, i++) { - switch (ap->ae_tag) { - case ACL_USER_OBJ: - ap->ae_perm = (mode >> 6) & 0x7; - break; - case ACL_GROUP_OBJ: - gap = ap; - break; - case ACL_MASK: - nomask = 0; - ap->ae_perm = (mode >> 3) & 0x7; - break; - case ACL_OTHER: - ap->ae_perm = mode & 0x7; - break; - default: - break; - } - } - /* Set the ACL_GROUP_OBJ if there's no ACL_MASK */ - if (gap && nomask) - gap->ae_perm = (mode >> 3) & 0x7; -} - -/* - * When inheriting an Access ACL from a directory Default ACL, - * the ACL bits are set to the intersection of the ACL default - * permission bits and the file permission bits in mode. If there - * are no permission bits on the file then we must not give them - * the ACL. This is what what makes umask() work with ACLs. - */ -STATIC void -xfs_acl_filter_mode( - mode_t mode, - xfs_acl_t *acl) -{ - int i, nomask = 1; - xfs_acl_entry_t *ap; - xfs_acl_entry_t *gap = NULL; - - /* - * Set ACL entries. POSIX1003.1eD16 requires that the MASK - * be merged with GROUP entry, if there is a MASK. - */ - for (ap = acl->acl_entry, i = 0; i < acl->acl_cnt; ap++, i++) { - switch (ap->ae_tag) { - case ACL_USER_OBJ: - ap->ae_perm &= (mode >> 6) & 0x7; - break; - case ACL_GROUP_OBJ: - gap = ap; - break; - case ACL_MASK: - nomask = 0; - ap->ae_perm &= (mode >> 3) & 0x7; - break; - case ACL_OTHER: - ap->ae_perm &= mode & 0x7; - break; - default: - break; - } - } - /* Set the ACL_GROUP_OBJ if there's no ACL_MASK */ - if (gap && nomask) - gap->ae_perm &= (mode >> 3) & 0x7; -} From owner-xfs@oss.sgi.com Wed Jul 23 13:45:58 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:46:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NKjwUO021933 for ; Wed, 23 Jul 2008 13:45:58 -0700 X-ASG-Debug-ID: 1216846007-288703dd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E3DF631C396 for ; Wed, 23 Jul 2008 13:46:47 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id xwp8iLKMvCFsiZa4 for ; Wed, 23 Jul 2008 13:46:47 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLlET-0000sr-NP; Wed, 23 Jul 2008 20:46:45 +0000 Date: Wed, 23 Jul 2008 16:46:45 -0400 From: Christoph Hellwig To: Dave Chinner Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] XFS: remove the mount inode list Subject: Re: [PATCH 4/4] XFS: remove the mount inode list Message-ID: <20080723204645.GA8421@infradead.org> References: <1216773673-3620-1-git-send-email-david@fromorbit.com> <1216773673-3620-5-git-send-email-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1216773673-3620-5-git-send-email-david@fromorbit.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216846007 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.662 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17104 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:41:13AM +1000, Dave Chinner wrote: > Now we've removed all users of the mount inode list, > we can kill it. This reduces the size of the xfs_inode > by 2 pointers. With this m_ilock can also become a spinlock. Might not be worth depending on how soon you want to kill m_del_inodes. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 15:18:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 15:19:28.000000000 +0200 @@ -1554,7 +1554,7 @@ xfs_fs_fill_super( goto out; spin_lock_init(&mp->m_sb_lock); - mutex_init(&mp->m_ilock); + spin_lock_init(&mp->m_ilock); mutex_init(&mp->m_growlock); atomic_set(&mp->m_active_trans, 0); INIT_LIST_HEAD(&mp->m_sync_list); Index: linux-2.6-xfs/fs/xfs/xfs_iget.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2008-07-23 15:18:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2008-07-23 15:19:28.000000000 +0200 @@ -144,9 +144,9 @@ again: xfs_iflags_clear(ip, XFS_IRECLAIMABLE); read_unlock(&pag->pag_ici_lock); - XFS_MOUNT_ILOCK(mp); + spin_lock(&mp->m_ilock); list_del_init(&ip->i_reclaim); - XFS_MOUNT_IUNLOCK(mp); + spin_unlock(&mp->m_ilock); goto finish_inode; @@ -484,10 +484,10 @@ xfs_iextract( xfs_put_perag(mp, pag); /* Deal with the deleted inodes list */ - XFS_MOUNT_ILOCK(mp); + spin_lock(&mp->m_ilock); list_del_init(&ip->i_reclaim); mp->m_ireclaims++; - XFS_MOUNT_IUNLOCK(mp); + spin_unlock(&mp->m_ilock); } /* Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-23 15:18:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-23 15:19:28.000000000 +0200 @@ -142,7 +142,7 @@ xfs_mount_free( spinlock_destroy(&mp->m_ail_lock); spinlock_destroy(&mp->m_sb_lock); - mutex_destroy(&mp->m_ilock); + spinlock_destroy(&mp->m_ilock); mutex_destroy(&mp->m_growlock); if (mp->m_quotainfo) XFS_QM_DONE(mp); Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2008-07-23 15:18:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2008-07-23 15:19:28.000000000 +0200 @@ -248,7 +248,7 @@ typedef struct xfs_mount { spinlock_t m_agirotor_lock;/* .. and lock protecting it */ xfs_agnumber_t m_maxagi; /* highest inode alloc group */ struct list_head m_del_inodes; /* inodes to reclaim */ - mutex_t m_ilock; /* inode list mutex */ + spinlock_t m_ilock; /* synchronize m_del_inodes */ uint m_ireclaims; /* count of calls to reclaim*/ uint m_readio_log; /* min read size log bytes */ uint m_readio_blocks; /* min read size blocks */ @@ -509,9 +509,6 @@ typedef struct xfs_mod_sb { int64_t msb_delta; /* Change to make to specified field */ } xfs_mod_sb_t; -#define XFS_MOUNT_ILOCK(mp) mutex_lock(&((mp)->m_ilock)) -#define XFS_MOUNT_IUNLOCK(mp) mutex_unlock(&((mp)->m_ilock)) - extern void xfs_mod_sb(xfs_trans_t *, __int64_t); extern int xfs_log_sbcount(xfs_mount_t *, uint); extern int xfs_mountfs(xfs_mount_t *mp, int); Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 15:18:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 15:19:28.000000000 +0200 @@ -2834,14 +2834,14 @@ xfs_reclaim( xfs_mount_t *mp = ip->i_mount; /* Protect sync and unpin from us */ - XFS_MOUNT_ILOCK(mp); + spin_lock(&mp->m_ilock); spin_lock(&ip->i_flags_lock); __xfs_iflags_set(ip, XFS_IRECLAIMABLE); vn_to_inode(vp)->i_private = NULL; ip->i_vnode = NULL; spin_unlock(&ip->i_flags_lock); list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); - XFS_MOUNT_IUNLOCK(mp); + spin_unlock(&mp->m_ilock); } return 0; } @@ -2922,7 +2922,7 @@ xfs_finish_reclaim_all( xfs_inode_t *ip, *n; restart: - XFS_MOUNT_ILOCK(mp); + spin_lock(&mp->m_ilock); list_for_each_entry_safe(ip, n, &mp->m_del_inodes, i_reclaim) { if (noblock) { if (xfs_ilock_nowait(ip, XFS_ILOCK_EXCL) == 0) @@ -2933,12 +2933,12 @@ restart: continue; } } - XFS_MOUNT_IUNLOCK(mp); + spin_unlock(&mp->m_ilock); if (xfs_finish_reclaim(ip, noblock, mode)) delay(1); goto restart; } - XFS_MOUNT_IUNLOCK(mp); + spin_unlock(&mp->m_ilock); return 0; } From owner-xfs@oss.sgi.com Wed Jul 23 13:48:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 13:48:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NKmNCw022358 for ; Wed, 23 Jul 2008 13:48:24 -0700 X-ASG-Debug-ID: 1216846168-6e4a01300000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8504E1B3EC32; Wed, 23 Jul 2008 13:49:28 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id RpUEp6fDEa3zSylm; Wed, 23 Jul 2008 13:49:28 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLlH5-00065S-Sh; Wed, 23 Jul 2008 20:49:27 +0000 Date: Wed, 23 Jul 2008 16:49:27 -0400 From: Christoph Hellwig To: Mark Goodwin Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080723204927.GB8421@infradead.org> References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <488692FB.1010101@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216846168 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.662 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17105 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 12:10:03PM +1000, Mark Goodwin wrote: > [getting off-topic for this thread, but anyway ..] > This is already a big issue, obviously, and has been for some time. > > Internally, we're attempting to refine our patch acceptance processes, > (e.g. gitify our internal dev tree and mirror it on oss so it's much > easier to push back out to oss). But the QA overhead remains a stubborn > problem. I think we're going to have to ask for QA tests (both regression > and performance) to be written as part of the patch acceptance policy - > under this policy, merely passing existing QA will not be sufficient. > Comments? For most patches that just clean things up or change internal implementations adding new testcases doesn't make much sense. The only case is when you suspect/know the testcase don't cover this area enough. What would be nice is if we'd add more testcases for user reported regressions. Btw, does anyone have recent gcov data for XFS? From owner-xfs@oss.sgi.com Wed Jul 23 14:46:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 14:46:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NLkcHG026064 for ; Wed, 23 Jul 2008 14:46:38 -0700 X-ASG-Debug-ID: 1216849666-086300950000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4D4E9E8F496 for ; Wed, 23 Jul 2008 14:47:47 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ywVTKUDsKCsJwSRy for ; Wed, 23 Jul 2008 14:47:47 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NLlbNg010775 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 23:47:37 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NLlbff010773 for xfs@oss.sgi.com; Wed, 23 Jul 2008 23:47:37 +0200 Date: Wed, 23 Jul 2008 23:47:37 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 0/2] kill bhv_vnode_t Subject: [PATCH 0/2] kill bhv_vnode_t Message-ID: <20080723214737.GA10655@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216849669 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.665 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17106 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Dave complained today that the fate of bhv_vnode_t isn't entirely clear yet, so I've prepared these two patches to kill it in a minimally invasive way. While it causes churn in a lot of areas it does not affect the generated code at all. From owner-xfs@oss.sgi.com Wed Jul 23 14:46:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 14:46:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NLkifE026122 for ; Wed, 23 Jul 2008 14:46:45 -0700 X-ASG-Debug-ID: 1216849674-0233031f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8D484191E1DD for ; Wed, 23 Jul 2008 14:47:54 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id JkwsUw58lvSDwVpj for ; Wed, 23 Jul 2008 14:47:54 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NLljNg010803 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 23:47:45 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NLljbT010801 for xfs@oss.sgi.com; Wed, 23 Jul 2008 23:47:45 +0200 Date: Wed, 23 Jul 2008 23:47:45 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 2/2] kill bhv_vnode_t Subject: [PATCH 2/2] kill bhv_vnode_t Message-ID: <20080723214745.GC10655@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216849675 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.664 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17108 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs All remaining bhv_vnode_t instance are in code that's more or less Linux specific. (Well, for xfs_acl.c that could be argued, but that code is on the removal list, too). So just do an s/bhv_vnode_t/struct inode/ over the whole tree. We can clean up variable naming and some useless helpers later. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:58.000000000 +0200 @@ -1818,7 +1818,7 @@ xfs_free_trace_bufs(void) STATIC int __init xfs_init_zones(void) { - xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode", + xfs_vnode_zone = kmem_zone_init_flags(sizeof(struct inode), "xfs_vnode", KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | KM_ZONE_SPREAD, xfs_fs_inode_init_once); Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c 2008-07-23 22:33:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c 2008-07-23 22:33:58.000000000 +0200 @@ -1034,7 +1034,7 @@ xfs_qm_dqrele_all_inodes( { xfs_inode_t *ip, *topino; uint ireclaims; - bhv_vnode_t *vp; + struct inode *vp; boolean_t vnode_refd; ASSERT(mp->m_quotainfo); Index: linux-2.6-xfs/fs/xfs/xfs_acl.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-23 22:33:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-23 22:33:58.000000000 +0200 @@ -37,15 +37,15 @@ #include #include -STATIC int xfs_acl_setmode(bhv_vnode_t *, xfs_acl_t *, int *); +STATIC int xfs_acl_setmode(struct inode *, xfs_acl_t *, int *); STATIC void xfs_acl_filter_mode(mode_t, xfs_acl_t *); STATIC void xfs_acl_get_endian(xfs_acl_t *); STATIC int xfs_acl_access(uid_t, gid_t, xfs_acl_t *, mode_t, cred_t *); STATIC int xfs_acl_invalid(xfs_acl_t *); STATIC void xfs_acl_sync_mode(mode_t, xfs_acl_t *); -STATIC void xfs_acl_get_attr(bhv_vnode_t *, xfs_acl_t *, int, int, int *); -STATIC void xfs_acl_set_attr(bhv_vnode_t *, xfs_acl_t *, int, int *); -STATIC int xfs_acl_allow_set(bhv_vnode_t *, int); +STATIC void xfs_acl_get_attr(struct inode *, xfs_acl_t *, int, int, int *); +STATIC void xfs_acl_set_attr(struct inode *, xfs_acl_t *, int, int *); +STATIC int xfs_acl_allow_set(struct inode *, int); kmem_zone_t *xfs_acl_zone; @@ -55,7 +55,7 @@ kmem_zone_t *xfs_acl_zone; */ int xfs_acl_vhasacl_access( - bhv_vnode_t *vp) + struct inode *vp) { int error; @@ -68,7 +68,7 @@ xfs_acl_vhasacl_access( */ int xfs_acl_vhasacl_default( - bhv_vnode_t *vp) + struct inode *vp) { int error; @@ -207,7 +207,7 @@ posix_acl_xfs_to_xattr( int xfs_acl_vget( - bhv_vnode_t *vp, + struct inode *vp, void *acl, size_t size, int kind) @@ -249,7 +249,7 @@ out: int xfs_acl_vremove( - bhv_vnode_t *vp, + struct inode *vp, int kind) { int error; @@ -268,7 +268,7 @@ xfs_acl_vremove( int xfs_acl_vset( - bhv_vnode_t *vp, + struct inode *vp, void *acl, size_t size, int kind) @@ -357,7 +357,7 @@ xfs_acl_iaccess( STATIC int xfs_acl_allow_set( - bhv_vnode_t *vp, + struct inode *vp, int kind) { if (vp->i_flags & (S_IMMUTABLE|S_APPEND)) @@ -561,7 +561,7 @@ xfs_acl_get_endian( */ STATIC void xfs_acl_get_attr( - bhv_vnode_t *vp, + struct inode *vp, xfs_acl_t *aclp, int kind, int flags, @@ -585,7 +585,7 @@ xfs_acl_get_attr( */ STATIC void xfs_acl_set_attr( - bhv_vnode_t *vp, + struct inode *vp, xfs_acl_t *aclp, int kind, int *error) @@ -619,7 +619,7 @@ xfs_acl_set_attr( int xfs_acl_vtoacl( - bhv_vnode_t *vp, + struct inode *vp, xfs_acl_t *access_acl, xfs_acl_t *default_acl) { @@ -651,7 +651,7 @@ xfs_acl_vtoacl( */ int xfs_acl_inherit( - bhv_vnode_t *vp, + struct inode *vp, mode_t mode, xfs_acl_t *pdaclp) { @@ -710,7 +710,7 @@ out_error: */ STATIC int xfs_acl_setmode( - bhv_vnode_t *vp, + struct inode *vp, xfs_acl_t *acl, int *basicperms) { Index: linux-2.6-xfs/fs/xfs/xfs_acl.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.h 2008-07-23 22:33:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_acl.h 2008-07-23 22:33:58.000000000 +0200 @@ -59,14 +59,14 @@ extern struct kmem_zone *xfs_acl_zone; (zone) = kmem_zone_init(sizeof(xfs_acl_t), (name)) #define xfs_acl_zone_destroy(zone) kmem_zone_destroy(zone) -extern int xfs_acl_inherit(bhv_vnode_t *, mode_t mode, xfs_acl_t *); +extern int xfs_acl_inherit(struct inode *, mode_t mode, xfs_acl_t *); extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *); -extern int xfs_acl_vtoacl(bhv_vnode_t *, xfs_acl_t *, xfs_acl_t *); -extern int xfs_acl_vhasacl_access(bhv_vnode_t *); -extern int xfs_acl_vhasacl_default(bhv_vnode_t *); -extern int xfs_acl_vset(bhv_vnode_t *, void *, size_t, int); -extern int xfs_acl_vget(bhv_vnode_t *, void *, size_t, int); -extern int xfs_acl_vremove(bhv_vnode_t *, int); +extern int xfs_acl_vtoacl(struct inode *, xfs_acl_t *, xfs_acl_t *); +extern int xfs_acl_vhasacl_access(struct inode *); +extern int xfs_acl_vhasacl_default(struct inode *); +extern int xfs_acl_vset(struct inode *, void *, size_t, int); +extern int xfs_acl_vget(struct inode *, void *, size_t, int); +extern int xfs_acl_vremove(struct inode *, int); #define _ACL_PERM_INVALID(perm) ((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE)) Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-23 22:33:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-23 22:33:58.000000000 +0200 @@ -204,7 +204,7 @@ typedef struct xfs_inode { struct xfs_inode *i_mprev; /* ptr to prev inode */ struct xfs_mount *i_mount; /* fs mount struct ptr */ struct list_head i_reclaim; /* reclaim list */ - bhv_vnode_t *i_vnode; /* vnode backpointer */ + struct inode *i_vnode; /* vnode backpointer */ struct xfs_dquot *i_udquot; /* user dquot */ struct xfs_dquot *i_gdquot; /* group dquot */ Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 22:33:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 22:35:36.000000000 +0200 @@ -282,7 +282,7 @@ xfs_sync_inodes( int *bypassed) { xfs_inode_t *ip = NULL; - bhv_vnode_t *vp = NULL; + struct inode *vp = NULL; int error; int last_error; uint64_t fflag; Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 22:33:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 22:33:58.000000000 +0200 @@ -2850,7 +2850,7 @@ xfs_finish_reclaim( int sync_mode) { xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); - bhv_vnode_t *vp = VFS_I(ip); + struct inode *vp = VFS_I(ip); if (vp && VN_BAD(vp)) goto reclaim; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 22:34:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 22:34:31.000000000 +0200 @@ -90,7 +90,7 @@ vn_ioerror( */ static inline int xfs_icount(struct xfs_inode *ip) { - bhv_vnode_t *vp = VFS_I(ip); + struct inode *vp = VFS_I(ip); if (vp) return vn_count(vp); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 22:34:40.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 22:36:29.000000000 +0200 @@ -22,8 +22,6 @@ struct file; struct xfs_iomap; struct attrlist_cursor_kern; -typedef struct inode bhv_vnode_t; - /* * Return values for xfs_inactive. A return value of * VN_INACTIVE_NOCACHE implies that the file system behavior @@ -64,7 +62,7 @@ extern void vn_iowait(struct xfs_inode * extern void vn_iowake(struct xfs_inode *ip); extern void vn_ioerror(struct xfs_inode *ip, int error, char *f, int l); -static inline int vn_count(bhv_vnode_t *vp) +static inline int vn_count(struct inode *vp) { return atomic_read(&vp->i_count); } @@ -81,7 +79,7 @@ do { \ iput(VFS_I(ip)); \ } while (0) -static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) +static inline struct inode *vn_grab(struct inode *vp) { return igrab(vp); } @@ -89,7 +87,7 @@ static inline bhv_vnode_t *vn_grab(bhv_v /* * Dealing with bad inodes */ -static inline int VN_BAD(bhv_vnode_t *vp) +static inline int VN_BAD(struct inode *vp) { return is_bad_inode(vp); } @@ -97,18 +95,18 @@ static inline int VN_BAD(bhv_vnode_t *vp /* * Extracting atime values in various formats */ -static inline void vn_atime_to_bstime(bhv_vnode_t *vp, xfs_bstime_t *bs_atime) +static inline void vn_atime_to_bstime(struct inode *vp, xfs_bstime_t *bs_atime) { bs_atime->tv_sec = vp->i_atime.tv_sec; bs_atime->tv_nsec = vp->i_atime.tv_nsec; } -static inline void vn_atime_to_timespec(bhv_vnode_t *vp, struct timespec *ts) +static inline void vn_atime_to_timespec(struct inode *vp, struct timespec *ts) { *ts = vp->i_atime; } -static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt) +static inline void vn_atime_to_time_t(struct inode *vp, time_t *tt) { *tt = vp->i_atime.tv_sec; } From owner-xfs@oss.sgi.com Wed Jul 23 14:46:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 14:46:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FUZZY_VPILL, J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NLkffq026083 for ; Wed, 23 Jul 2008 14:46:41 -0700 X-ASG-Debug-ID: 1216849670-6f0d03310000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8067231CA2A for ; Wed, 23 Jul 2008 14:47:50 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id o24hD1DR3JI0XLF3 for ; Wed, 23 Jul 2008 14:47:50 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NLlfNg010789 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Wed, 23 Jul 2008 23:47:41 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NLlfO6010787 for xfs@oss.sgi.com; Wed, 23 Jul 2008 23:47:41 +0200 Date: Wed, 23 Jul 2008 23:47:41 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/2] remove some easy bhv_vnode_t instances Subject: [PATCH 1/2] remove some easy bhv_vnode_t instances Message-ID: <20080723214741.GB10655@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216849672 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=FUZZY_VPILL X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.666 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 FUZZY_VPILL BODY: Attempt to obfuscate words in spam X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17107 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs In various places we can just move a VFS_I call into the argument list of called functions/macros instead of having a local bhv_vnode_t. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dfrag.c 2008-07-23 22:25:42.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dfrag.c 2008-07-23 22:26:16.000000000 +0200 @@ -130,7 +130,6 @@ xfs_swap_extents( xfs_mount_t *mp; xfs_trans_t *tp; xfs_bstat_t *sbp = &sxp->sx_stat; - bhv_vnode_t *vp, *tvp; xfs_ifork_t *tempifp, *ifp, *tifp; int ilf_fields, tilf_fields; static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; @@ -149,8 +148,6 @@ xfs_swap_extents( } sbp = &sxp->sx_stat; - vp = VFS_I(ip); - tvp = VFS_I(tip); xfs_lock_two_inodes(ip, tip, lock_flags); locked = 1; @@ -174,7 +171,7 @@ xfs_swap_extents( goto error0; } - if (VN_CACHED(tvp) != 0) { + if (VN_CACHED(VFS_I(tip)) != 0) { xfs_inval_cached_trace(tip, 0, -1, 0, -1); error = xfs_flushinval_pages(tip, 0, -1, FI_REMAPF_LOCKED); @@ -183,7 +180,7 @@ xfs_swap_extents( } /* Verify O_DIRECT for ftmp */ - if (VN_CACHED(tvp) != 0) { + if (VN_CACHED(VFS_I(tip)) != 0) { error = XFS_ERROR(EINVAL); goto error0; } @@ -227,7 +224,7 @@ xfs_swap_extents( * vop_read (or write in the case of autogrow) they block on the iolock * until we have switched the extents. */ - if (VN_MAPPED(vp)) { + if (VN_MAPPED(VFS_I(ip))) { error = XFS_ERROR(EBUSY); goto error0; } Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 22:22:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 22:29:36.000000000 +0200 @@ -1397,7 +1397,6 @@ xfs_itruncate_start( xfs_fsize_t last_byte; xfs_off_t toss_start; xfs_mount_t *mp; - bhv_vnode_t *vp; int error = 0; ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); @@ -1406,7 +1405,6 @@ xfs_itruncate_start( (flags == XFS_ITRUNC_MAYBE)); mp = ip->i_mount; - vp = VFS_I(ip); /* wait for the completion of any pending DIOs */ if (new_size < ip->i_size) @@ -1455,7 +1453,7 @@ xfs_itruncate_start( #ifdef DEBUG if (new_size == 0) { - ASSERT(VN_CACHED(vp) == 0); + ASSERT(VN_CACHED(VFS_I(ip)) == 0); } #endif return error; @@ -3421,7 +3419,6 @@ xfs_iflush_all( xfs_mount_t *mp) { xfs_inode_t *ip; - bhv_vnode_t *vp; again: XFS_MOUNT_ILOCK(mp); @@ -3436,14 +3433,13 @@ xfs_iflush_all( continue; } - vp = VFS_I(ip); - if (!vp) { + if (!VFS_I(ip)) { XFS_MOUNT_IUNLOCK(mp); xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); goto again; } - ASSERT(vn_count(vp) == 0); + ASSERT(vn_count(VFS_I(ip)) == 0); ip = ip->i_mnext; } while (ip != mp->m_inodes); Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-23 22:26:29.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-23 22:26:45.000000000 +0200 @@ -59,7 +59,6 @@ xfs_bulkstat_one_iget( { xfs_icdinode_t *dic; /* dinode core info pointer */ xfs_inode_t *ip; /* incore inode pointer */ - bhv_vnode_t *vp; int error; error = xfs_iget(mp, NULL, ino, @@ -72,7 +71,6 @@ xfs_bulkstat_one_iget( ASSERT(ip != NULL); ASSERT(ip->i_blkno != (xfs_daddr_t)0); - vp = VFS_I(ip); dic = &ip->i_d; /* xfs_iget returns the following without needing @@ -85,7 +83,7 @@ xfs_bulkstat_one_iget( buf->bs_uid = dic->di_uid; buf->bs_gid = dic->di_gid; buf->bs_size = dic->di_size; - vn_atime_to_bstime(vp, &buf->bs_atime); + vn_atime_to_bstime(VFS_I(ip), &buf->bs_atime); buf->bs_mtime.tv_sec = dic->di_mtime.t_sec; buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec; buf->bs_ctime.tv_sec = dic->di_ctime.t_sec; Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 22:23:16.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 22:33:43.000000000 +0200 @@ -1160,7 +1160,6 @@ int xfs_release( xfs_inode_t *ip) { - bhv_vnode_t *vp = VFS_I(ip); xfs_mount_t *mp = ip->i_mount; int error; @@ -1195,13 +1194,13 @@ xfs_release( * be exposed to that problem. */ truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED); - if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0) + if (truncated && VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > 0) xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE); } if (ip->i_d.di_nlink != 0) { if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && - ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || + ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || ip->i_delayed_blks > 0)) && (ip->i_df.if_flags & XFS_IFEXTENTS)) && (!(ip->i_d.di_flags & @@ -1227,7 +1226,6 @@ int xfs_inactive( xfs_inode_t *ip) { - bhv_vnode_t *vp = VFS_I(ip); xfs_bmap_free_t free_list; xfs_fsblock_t first_block; int committed; @@ -1242,7 +1240,7 @@ xfs_inactive( * If the inode is already free, then there can be nothing * to clean up here. */ - if (ip->i_d.di_mode == 0 || VN_BAD(vp)) { + if (ip->i_d.di_mode == 0 || VN_BAD(VFS_I(ip))) { ASSERT(ip->i_df.if_real_bytes == 0); ASSERT(ip->i_df.if_broot_bytes == 0); return VN_INACTIVE_CACHE; @@ -1272,7 +1270,7 @@ xfs_inactive( if (ip->i_d.di_nlink != 0) { if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && - ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || + ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || ip->i_delayed_blks > 0)) && (ip->i_df.if_flags & XFS_IFEXTENTS) && (!(ip->i_d.di_flags & @@ -2793,14 +2791,13 @@ int xfs_reclaim( xfs_inode_t *ip) { - bhv_vnode_t *vp = VFS_I(ip); xfs_itrace_entry(ip); - ASSERT(!VN_MAPPED(vp)); + ASSERT(!VN_MAPPED(VFS_I(ip))); /* bad inode, get out here ASAP */ - if (VN_BAD(vp)) { + if (VN_BAD(VFS_I(ip))) { xfs_ireclaim(ip); return 0; } @@ -2837,7 +2834,7 @@ xfs_reclaim( XFS_MOUNT_ILOCK(mp); spin_lock(&ip->i_flags_lock); __xfs_iflags_set(ip, XFS_IRECLAIMABLE); - vp->i_private = NULL; + VFS_I(ip)->i_private = NULL; ip->i_vnode = NULL; spin_unlock(&ip->i_flags_lock); list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); @@ -3241,7 +3238,6 @@ xfs_free_file_space( xfs_off_t len, int attr_flags) { - bhv_vnode_t *vp; int committed; int done; xfs_off_t end_dmi_offset; @@ -3261,7 +3257,6 @@ xfs_free_file_space( xfs_trans_t *tp; int need_iolock = 1; - vp = VFS_I(ip); mp = ip->i_mount; xfs_itrace_entry(ip); @@ -3298,7 +3293,7 @@ xfs_free_file_space( rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); ioffset = offset & ~(rounding - 1); - if (VN_CACHED(vp) != 0) { + if (VN_CACHED(VFS_I(ip)) != 0) { xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1); error = xfs_flushinval_pages(ip, ioffset, -1, FI_REMAPF_LOCKED); if (error) Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 22:28:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 22:33:43.000000000 +0200 @@ -127,7 +127,6 @@ xfs_unmount_flush( xfs_inode_t *rip = mp->m_rootip; xfs_inode_t *rbmip; xfs_inode_t *rsumip = NULL; - bhv_vnode_t *rvp = VFS_I(rip); int error; xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); @@ -166,7 +165,7 @@ xfs_unmount_flush( if (error == EFSCORRUPTED) goto fscorrupt_out2; - if (vn_count(rvp) != 1 && !relocation) { + if (vn_count(VFS_I(rip)) != 1 && !relocation) { xfs_iunlock(rip, XFS_ILOCK_EXCL); return XFS_ERROR(EBUSY); } Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:54.000000000 +0200 @@ -922,12 +922,7 @@ STATIC struct inode * xfs_fs_alloc_inode( struct super_block *sb) { - bhv_vnode_t *vp; - - vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); - if (unlikely(!vp)) - return NULL; - return vp; + return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); } STATIC void From owner-xfs@oss.sgi.com Wed Jul 23 14:52:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 14:52:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NLqHcn027335 for ; Wed, 23 Jul 2008 14:52:18 -0700 X-ASG-Debug-ID: 1216850007-086300ef0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 658C1E8F51B for ; Wed, 23 Jul 2008 14:53:27 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id 5HB7qpFH23dlHSNa for ; Wed, 23 Jul 2008 14:53:27 -0700 (PDT) Received: from funky.thebarn.com (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6NLrHqW040822; Wed, 23 Jul 2008 16:53:18 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <4887A84D.90701@thebarn.com> Date: Wed, 23 Jul 2008 16:53:17 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/2] kill bhv_vnode_t Subject: Re: [PATCH 0/2] kill bhv_vnode_t References: <20080723214737.GA10655@lst.de> In-Reply-To: <20080723214737.GA10655@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7800/Wed Jul 23 14:23:28 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1216850008 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0206 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.665 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 17109 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Dave complained today that the fate of bhv_vnode_t isn't entirely clear > yet, so I've prepared these two patches to kill it in a minimally > invasive way. While it causes churn in a lot of areas it does not > affect the generated code at all. > > I know a bunch of stuff has gone in that is not very portable, which is fine since they can be dealt with individually since they are not that intrusive. Changing bhv_vnode_t to struct inode throughout the code is a pretty big change and would be a major pain to work around. -Russell From owner-xfs@oss.sgi.com Wed Jul 23 14:56:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 14:56:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NLuL5x027865 for ; Wed, 23 Jul 2008 14:56:21 -0700 X-ASG-Debug-ID: 1216850250-096700c60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 83494E8F5A9 for ; Wed, 23 Jul 2008 14:57:31 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id uUSYVyZfpmJCWyQ2 for ; Wed, 23 Jul 2008 14:57:31 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6NLvLNg011157 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 23 Jul 2008 23:57:21 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6NLvL6e011155; Wed, 23 Jul 2008 23:57:21 +0200 Date: Wed, 23 Jul 2008 23:57:21 +0200 From: Christoph Hellwig To: Russell Cattelan Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/2] kill bhv_vnode_t Subject: Re: [PATCH 0/2] kill bhv_vnode_t Message-ID: <20080723215721.GA11049@lst.de> References: <20080723214737.GA10655@lst.de> <4887A84D.90701@thebarn.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4887A84D.90701@thebarn.com> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216850252 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.665 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17110 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 04:53:17PM -0500, Russell Cattelan wrote: > Christoph Hellwig wrote: > >Dave complained today that the fate of bhv_vnode_t isn't entirely clear > >yet, so I've prepared these two patches to kill it in a minimally > >invasive way. While it causes churn in a lot of areas it does not > >affect the generated code at all. > > > > > I know a bunch of stuff has gone in that is not very portable, which is > fine since > they can be dealt with individually since they are not that intrusive. > > Changing bhv_vnode_t to struct inode throughout the code is a pretty big > change and would be a major pain to work around. Have you actually looed at the patches? The only places where we use struct inode outside of linux-2.6/ are: - xfs_finish_reclaim: Distangles the xfs_inode from Linux inode. Per defintion OS-specific. - xfs_sync_inodes: Sync code that is quite OS specific. Dave will move it to linux-2.6/ pretty soon. - quota/xfs_qm_syscalls.c: Similar sync code. - xfs_acl.c: ACL code with some OS dependencies, and pretty dead with my pending patch to use the generic ACL code. And no, it's not actually a big change. From owner-xfs@oss.sgi.com Wed Jul 23 15:42:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 15:42:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NMguOR030812 for ; Wed, 23 Jul 2008 15:42:56 -0700 X-ASG-Debug-ID: 1216853045-6170013c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8885116130FF for ; Wed, 23 Jul 2008 15:44:06 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id yfRfcIo33paSOh3U for ; Wed, 23 Jul 2008 15:44:06 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAKhPh0h5LFxAiGdsb2JhbACSUAEBAQ8goGM X-IronPort-AV: E=Sophos;i="4.31,240,1215354600"; d="scan'208";a="156207349" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 08:14:03 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLn3w-0004FS-9y; Thu, 24 Jul 2008 08:44:00 +1000 Date: Thu, 24 Jul 2008 08:43:59 +1000 From: Dave Chinner To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: Syncing up libxfs to kernel source Subject: Re: Syncing up libxfs to kernel source Message-ID: <20080723224359.GN6761@disturbed> Mail-Followup-To: Barry Naujok , "xfs@oss.sgi.com" References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216853047 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.667 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17111 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 05:52:24PM +1000, Barry Naujok wrote: > This one is mainly for Dave... > > In xfs_alloc_read_agf() in xfs_alloc.c, the current user-space version > checks: > > agf_ok = ... > be32_to_cpu(agf->agf_btreeblks) <= be32_to_cpu(agf->agf_length) && > ... > > but the kernel version doesn't. > > Is this an oversight with the lazy-counter code in the kernel, remove from > user-space or leave them different? Oversight in the kernel code. Patch below. Cheers, Dave. -- Dave Chinner david@fromorbit.com Check that the number of AGF btree blocks is within a sane bound when reading the AGF. Noticed by Barry Naujok. Signed-off-by: Dave Chinner --- fs/xfs/xfs_alloc.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 1956f83..a85bf20 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c @@ -2185,6 +2185,7 @@ xfs_alloc_read_agf( be32_to_cpu(agf->agf_magicnum) == XFS_AGF_MAGIC && XFS_AGF_GOOD_VERSION(be32_to_cpu(agf->agf_versionnum)) && be32_to_cpu(agf->agf_freeblks) <= be32_to_cpu(agf->agf_length) && + be32_to_cpu(agf->agf_btreeblks) <= be32_to_cpu(agf->agf_length) && be32_to_cpu(agf->agf_flfirst) < XFS_AGFL_SIZE(mp) && be32_to_cpu(agf->agf_fllast) < XFS_AGFL_SIZE(mp) && be32_to_cpu(agf->agf_flcount) <= XFS_AGFL_SIZE(mp); From owner-xfs@oss.sgi.com Wed Jul 23 15:54:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 15:54:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NMseOa031668 for ; Wed, 23 Jul 2008 15:54:41 -0700 X-ASG-Debug-ID: 1216853750-4b0b014e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E8C4131D31A for ; Wed, 23 Jul 2008 15:55:50 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Z4HFm3zfNTLShY2U for ; Wed, 23 Jul 2008 15:55:50 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCADJTh0h5LFxAiGdsb2JhbACSUAEBAQ8goEw X-IronPort-AV: E=Sophos;i="4.31,240,1215354600"; d="scan'208";a="156213570" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 08:25:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLnFM-0004WC-N6; Thu, 24 Jul 2008 08:55:48 +1000 Date: Thu, 24 Jul 2008 08:55:48 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 5/5] implement IHOLD/IRELE directly Subject: Re: [PATCH 5/5] implement IHOLD/IRELE directly Message-ID: <20080723225548.GO6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723194950.GF6188@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723194950.GF6188@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216853751 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.670 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17112 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 09:49:50PM +0200, Christoph Hellwig wrote: > Now that all direct calls to VN_HOLD/VN_RELE are gone we can implement > IHOLD/IRELE directly. > > For the IHOLD case also replace igrab with a direct increment of i_count > because we are guaranteed to already have a live and referenced inode > by the VFS. Also remove the vn_hold statistic because it's been rather > meaningless for some time with most references done by other callers. Seeing as you are changing from an igrab() to a straight atomic_inc(), can you put an: ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) into the IHOLD macro so we catch screwups in reference counting as quickly as possible? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 23 16:25:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 16:25:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NNPt4B005899 for ; Wed, 23 Jul 2008 16:25:55 -0700 X-ASG-Debug-ID: 1216855624-75a101ab0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0AA64191E685 for ; Wed, 23 Jul 2008 16:27:05 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Rvh0gtwUduGTIKxY for ; Wed, 23 Jul 2008 16:27:05 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCADlah0h5LFxAiGdsb2JhbACSUAEBAQ8goDM X-IronPort-AV: E=Sophos;i="4.31,240,1215354600"; d="scan'208";a="156232984" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 08:57:03 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLnja-0005VF-LR; Thu, 24 Jul 2008 09:27:02 +1000 Date: Thu, 24 Jul 2008 09:27:02 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/5] more vnode related macro cleanups Subject: Re: [PATCH 0/5] more vnode related macro cleanups Message-ID: <20080723232702.GP6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723194930.GA6188@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723194930.GA6188@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216855626 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0208 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.671 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17113 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 09:49:30PM +0200, Christoph Hellwig wrote: > As Dave's cleanups got in so fast (thanks Niv!) I'll give these patches > a spin to. They are all over so I'd love to get them in fast too and > get the leftover bhv_vnode_t bits sorted out ASAP. This series applies on a pristine tree? Not on top of your other changes (like the sanitize init vnode one)? Several of the patches won't apply to my incoming branch because of that. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 23 16:57:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 16:58:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6NNvuwZ007801 for ; Wed, 23 Jul 2008 16:57:57 -0700 X-ASG-Debug-ID: 1216857546-75ac03250000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 76080191E87F for ; Wed, 23 Jul 2008 16:59:06 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id kn43MClujJ03FUnZ for ; Wed, 23 Jul 2008 16:59:06 -0700 (PDT) Received: from funky.thebarn.com (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6NNwwe6044136; Wed, 23 Jul 2008 18:58:58 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <4887C5C2.7080500@thebarn.com> Date: Wed, 23 Jul 2008 18:58:58 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/2] kill bhv_vnode_t Subject: Re: [PATCH 0/2] kill bhv_vnode_t References: <20080723214737.GA10655@lst.de> <4887A84D.90701@thebarn.com> <20080723215721.GA11049@lst.de> In-Reply-To: <20080723215721.GA11049@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7803/Wed Jul 23 16:00:36 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1216857547 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.674 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 17114 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Wed, Jul 23, 2008 at 04:53:17PM -0500, Russell Cattelan wrote: > >> Christoph Hellwig wrote: >> >>> Dave complained today that the fate of bhv_vnode_t isn't entirely clear >>> yet, so I've prepared these two patches to kill it in a minimally >>> invasive way. While it causes churn in a lot of areas it does not >>> affect the generated code at all. >>> >>> >>> >> I know a bunch of stuff has gone in that is not very portable, which is >> fine since >> they can be dealt with individually since they are not that intrusive. >> >> Changing bhv_vnode_t to struct inode throughout the code is a pretty big >> change and would be a major pain to work around. >> > > Have you actually looed at the patches? The only places where we use > struct inode outside of linux-2.6/ are: > > - xfs_finish_reclaim: > > Distangles the xfs_inode from Linux inode. Per defintion > OS-specific. > > - xfs_sync_inodes: > > Sync code that is quite OS specific. Dave will move it > to linux-2.6/ pretty soon. > > - quota/xfs_qm_syscalls.c: > > Similar sync code. > > - xfs_acl.c: > > ACL code with some OS dependencies, and pretty dead with my > pending patch to use the generic ACL code. > > And no, it's not actually a big change. > > I guess it's not that big of a change anymore. I really need to find some time and get fbsd synced up with the latest xfs code. -Russell From owner-xfs@oss.sgi.com Wed Jul 23 18:11:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 18:11:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=BAYES_50,MIME_8BIT_HEADER autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O1BUUQ012302 for ; Wed, 23 Jul 2008 18:11:30 -0700 X-ASG-Debug-ID: 1216861957-21d2038f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from hu-out-0506.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 44B7A31E4EE for ; Wed, 23 Jul 2008 18:12:38 -0700 (PDT) Received: from hu-out-0506.google.com (hu-out-0506.google.com [72.14.214.225]) by cuda.sgi.com with ESMTP id wwCaEDXw4Ei3bM8l for ; Wed, 23 Jul 2008 18:12:38 -0700 (PDT) Received: by hu-out-0506.google.com with SMTP id 27so8077136hub.17 for ; Wed, 23 Jul 2008 18:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=AVF5aeIlnGwT0kEvOHfFHZozFhkjkcqctT1X+53rJHI=; b=MQrtRYIWsttlEJEOPu35uKmpq8sO8qWlrOkHoLGUSqj46kd9YyavYDeTJYjO/oTQAE k/4Vef4R9KYqkbiFhJwMhAS5zSn6xmqKZ2DqzLNvTm3x9fwOw6eGYar5xNXlCqASm3dL k8SBmxOtrgez4lFzws/5SL2VM4t9fkTgok3mo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=PXKzR0pGivUBaxy6ZWjjVP7U1XlW3hpWKg4bK3Ixeut9vSDjJE1S/MakypJlBflJmy ghwmkYt9KC8R0wIzCioZ19nH8g1RzaPOy2Ddh6HXxgplftWyoiLlSECDev1w5kTx7RTE xNS55QT8v1V+J9z7iBpCGiBZdAX2A6NGiiWQU= Received: by 10.180.254.18 with SMTP id b18mr40718bki.43.1216861957141; Wed, 23 Jul 2008 18:12:37 -0700 (PDT) Received: by 10.181.6.5 with HTTP; Wed, 23 Jul 2008 18:12:36 -0700 (PDT) Message-ID: Date: Wed, 23 Jul 2008 18:12:36 -0700 From: "=?BIG5?B?vbGmQLxi?=" To: "=?BIG5?B?p/W8YrBh?=" , "=?BIG5?B?trWl9KpO?=" , "=?BIG5?B?tOWq/Lr7?=" , "=?BIG5?B?rkymyrhz?=" , "=?BIG5?B?tr6y+sRf?=" , "=?BIG5?B?vbKs/KzD?=" , "=?BIG5?B?tsCqUa3r?=" , "=?BIG5?B?s6+n07K7?=" <1huai.min@msa.hinet.net>, "=?BIG5?B?urWyUa5T?=" , "=?BIG5?B?s6+rRsBz?=" , "=?BIG5?B?pr+ozrl0?=" , "=?BIG5?B?v/qqRqaw?=" , "=?BIG5?B?vkeq2qh9?=" , "=?BIG5?B?s6/Ocqrh?=" , "=?BIG5?B?pP2o2K91?=" , "=?BIG5?B?s6+2rqdn?=" , "=?BIG5?B?s6Kpe7zW?=" , "=?BIG5?B?p2Sr5KZ3?=" , "=?BIG5?B?w9O1pKWt?=" , "=?BIG5?B?uK3Cp7+z?=" , "=?BIG5?B?s6+n096z?=" X-ASG-Orig-Subj: =?UTF-8?B?44qjIDUwMOeoruiQrOeUqOihqOagvOWkp+WFqCDjgqrOoOKWhuKGlg==?= Subject: =?UTF-8?B?44qjIDUwMOeoruiQrOeUqOihqOagvOWkp+WFqCDjgqrOoOKWhuKGlg==?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Barracuda-Connect: hu-out-0506.google.com[72.14.214.225] X-Barracuda-Start-Time: 1216861959 X-Barracuda-Bayes: INNOCENT GLOBAL 0.7132 1.0000 1.4708 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 1.67 X-Barracuda-Spam-Status: No, SCORE=1.67 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC2_SA022 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.678 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC2_SA022 Geocities Spam Site X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by oss.sgi.com id m6O1BUUQ012304 X-archive-position: 17115 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: ncqseqtct@gmail.com Precedence: bulk X-list: xfs YAHOOæ‹è³£è‡ªæŠ“å單第二集 ξケ㆙ãŸâ†˜â—¤ï¹¤ã„Šï¹£â—¢â•«Ë㆗︶ã‚┴〣︿ミ{╴▲ょㄑ﹚₥∞ã—﹥◣ å…¨é¢é™é‡ä¾›æ‡‰ä¸­!! http://www.geocities.jp/sfnzkdmnas â•©ã¢ã†•︴ν┤〢︾マ_╳※よã„も₤∟ã–ヤタδ╓ιスã†ã›âˆ–₫﹞ã„ã‚◇╰£ヘ︺〧┠葛林育德奚宜婷å³ç§‹è¯æžå„’王建宇ç«å–„〨許怡芬陳欣誠慕æŸéˆžä¿å²³å¼µäºŽå€«ä½©éŸ‹å¯Œç‡æ¹–潔邱ç®å¦‚ç¶­æºå·¦èˆœï¸¹å®œç«¹ä¿ä»»éº»æ€¡å›å³é›…èŠ³æˆ´æ€¡æ„æ˜€æ¬£éº—旺武芸è¢è¿æ³°æ­¡çœŸå† æµ·å®å»ºã„¨ 曾淑洋林æ€å©·é–å€«é¦™ä¿¡ç«¥æ…§å›æŽç¾Žç››æ¬£èª ï¿ ç¿°ç¾Žåˆå“²æ–‡æ¾è¬ä½³å®œä¼Šå—æŽå¿—è»’ç¾½è˜‹é™³æ’æœ¨ç¾…培方林天臻惟學黃慧芬國æ¾é„­å‹‡ä¼¶èª ç«¹é™³å¯§å­£å¨Ÿæ›¸â•®æŽåšæ–‡ç¾©åšé¾è²¡å®‡å®¸æ˜ŒéŠ˜æ˜¥è™¹â—† From owner-xfs@oss.sgi.com Wed Jul 23 22:23:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 22:24:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O5NeVP032685 for ; Wed, 23 Jul 2008 22:23:42 -0700 X-ASG-Debug-ID: 1216877090-451100450000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 87E24E919CA for ; Wed, 23 Jul 2008 22:24:50 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id bFhmQhUX2d5We471 for ; Wed, 23 Jul 2008 22:24:50 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6O5OeNg024692 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Jul 2008 07:24:41 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6O5Oekf024690; Thu, 24 Jul 2008 07:24:40 +0200 Date: Thu, 24 Jul 2008 07:24:40 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 0/5] more vnode related macro cleanups Subject: Re: [PATCH 0/5] more vnode related macro cleanups Message-ID: <20080724052440.GA24613@lst.de> References: <20080723194930.GA6188@lst.de> <20080723232702.GP6761@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723232702.GP6761@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216877091 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.695 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17116 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 09:27:02AM +1000, Dave Chinner wrote: > On Wed, Jul 23, 2008 at 09:49:30PM +0200, Christoph Hellwig wrote: > > As Dave's cleanups got in so fast (thanks Niv!) I'll give these patches > > a spin to. They are all over so I'd love to get them in fast too and > > get the leftover bhv_vnode_t bits sorted out ASAP. > > This series applies on a pristine tree? Not on top of your > other changes (like the sanitize init vnode one)? Several of > the patches won't apply to my incoming branch because of that. Yes, this applies straight ontop of your patches. Interestingly I only had to rediff '[PATCH] sanitize xfs_initialize_vnode' and the generic ACL patch for these - I expected a lot more. From owner-xfs@oss.sgi.com Wed Jul 23 22:41:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 22:41:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O5fECO002579 for ; Wed, 23 Jul 2008 22:41:16 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA05977; Thu, 24 Jul 2008 15:42:21 +1000 Message-ID: <48881788.7010709@sgi.com> Date: Thu, 24 Jul 2008 15:47:52 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs-dev , xfs-oss Subject: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks References: <48857EFB.3030301@sgi.com> <20080723112154.GA17338@infradead.org> In-Reply-To: <20080723112154.GA17338@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17117 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Tue, Jul 22, 2008 at 04:32:27PM +1000, Lachlan McIlroy wrote: >> This changes xfs_inode_item_push() to use XFS_IFLUSH_ASYNC_NOBLOCK when >> flushing an inode so the flush wont block on inode cluster buffer lock. >> Also change the prototype of the IOP_PUSH operation so that xfsaild_push() >> can bump it's stuck count. >> >> This change was prompted by a deadlock that would only occur on a debug >> XFS where a thread creating an inode had the buffer locked and was trying >> to allocate space for the inode tracing facility. That recursed back into >> the filesystem to flush data which created a transaction and needed log >> space which wasn't available. > > The stuck propagation looks good, but I don't think this should be > blindly done for all errors. The only error where it makes sense is > the EAGAIN from xfs_iflush. All other returns inside the item_push > handlers basically indicate filesystem corruption. Good point. Regardless of the error it's still an item that could not be pushed and is effectively 'stuck'. What do you recommend I do for other errors? Shutdown the filesystem? From owner-xfs@oss.sgi.com Wed Jul 23 22:44:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 22:44:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O5iM6N003292 for ; Wed, 23 Jul 2008 22:44:24 -0700 X-ASG-Debug-ID: 1216878331-665301570000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DC3AD191F65D; Wed, 23 Jul 2008 22:45:31 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id zDUAlRkPpsq5pk91; Wed, 23 Jul 2008 22:45:31 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KLtdr-0004r0-M7; Thu, 24 Jul 2008 05:45:31 +0000 Date: Thu, 24 Jul 2008 01:45:31 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: Christoph Hellwig , xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks Subject: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks Message-ID: <20080724054531.GA17215@infradead.org> References: <48857EFB.3030301@sgi.com> <20080723112154.GA17338@infradead.org> <48881788.7010709@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48881788.7010709@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216878332 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.696 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17118 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 03:47:52PM +1000, Lachlan McIlroy wrote: >> The stuck propagation looks good, but I don't think this should be >> blindly done for all errors. The only error where it makes sense is >> the EAGAIN from xfs_iflush. All other returns inside the item_push >> handlers basically indicate filesystem corruption. > > Good point. Regardless of the error it's still an item that could not > be pushed and is effectively 'stuck'. What do you recommend I do for > other errors? Shutdown the filesystem? Good questions. When I did a quick audit many error do in fact come from tests for shutdown filesystems, so they shouldn't ever happens. So maybe add an assert that we're never getting here for shut down filesystems and otherwise shut it down. But all this is getting a little complicated and riksy, so I'd say push your original patch in first and make the error handling a second one. From owner-xfs@oss.sgi.com Wed Jul 23 22:50:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 22:50:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FUZZY_VPILL, J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O5otIJ004490 for ; Wed, 23 Jul 2008 22:50:55 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA06312; Thu, 24 Jul 2008 15:52:02 +1000 Message-ID: <488819CC.5060100@sgi.com> Date: Thu, 24 Jul 2008 15:57:32 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 1/2] remove some easy bhv_vnode_t instances References: <20080723214741.GB10655@lst.de> In-Reply-To: <20080723214741.GB10655@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17119 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs All looks good to me. Christoph Hellwig wrote: > In various places we can just move a VFS_I call into the argument list > of called functions/macros instead of having a local bhv_vnode_t. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_dfrag.c 2008-07-23 22:25:42.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_dfrag.c 2008-07-23 22:26:16.000000000 +0200 > @@ -130,7 +130,6 @@ xfs_swap_extents( > xfs_mount_t *mp; > xfs_trans_t *tp; > xfs_bstat_t *sbp = &sxp->sx_stat; > - bhv_vnode_t *vp, *tvp; > xfs_ifork_t *tempifp, *ifp, *tifp; > int ilf_fields, tilf_fields; > static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; > @@ -149,8 +148,6 @@ xfs_swap_extents( > } > > sbp = &sxp->sx_stat; > - vp = VFS_I(ip); > - tvp = VFS_I(tip); > > xfs_lock_two_inodes(ip, tip, lock_flags); > locked = 1; > @@ -174,7 +171,7 @@ xfs_swap_extents( > goto error0; > } > > - if (VN_CACHED(tvp) != 0) { > + if (VN_CACHED(VFS_I(tip)) != 0) { > xfs_inval_cached_trace(tip, 0, -1, 0, -1); > error = xfs_flushinval_pages(tip, 0, -1, > FI_REMAPF_LOCKED); > @@ -183,7 +180,7 @@ xfs_swap_extents( > } > > /* Verify O_DIRECT for ftmp */ > - if (VN_CACHED(tvp) != 0) { > + if (VN_CACHED(VFS_I(tip)) != 0) { > error = XFS_ERROR(EINVAL); > goto error0; > } > @@ -227,7 +224,7 @@ xfs_swap_extents( > * vop_read (or write in the case of autogrow) they block on the iolock > * until we have switched the extents. > */ > - if (VN_MAPPED(vp)) { > + if (VN_MAPPED(VFS_I(ip))) { > error = XFS_ERROR(EBUSY); > goto error0; > } > Index: linux-2.6-xfs/fs/xfs/xfs_inode.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 22:22:20.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 22:29:36.000000000 +0200 > @@ -1397,7 +1397,6 @@ xfs_itruncate_start( > xfs_fsize_t last_byte; > xfs_off_t toss_start; > xfs_mount_t *mp; > - bhv_vnode_t *vp; > int error = 0; > > ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); > @@ -1406,7 +1405,6 @@ xfs_itruncate_start( > (flags == XFS_ITRUNC_MAYBE)); > > mp = ip->i_mount; > - vp = VFS_I(ip); > > /* wait for the completion of any pending DIOs */ > if (new_size < ip->i_size) > @@ -1455,7 +1453,7 @@ xfs_itruncate_start( > > #ifdef DEBUG > if (new_size == 0) { > - ASSERT(VN_CACHED(vp) == 0); > + ASSERT(VN_CACHED(VFS_I(ip)) == 0); > } > #endif > return error; > @@ -3421,7 +3419,6 @@ xfs_iflush_all( > xfs_mount_t *mp) > { > xfs_inode_t *ip; > - bhv_vnode_t *vp; > > again: > XFS_MOUNT_ILOCK(mp); > @@ -3436,14 +3433,13 @@ xfs_iflush_all( > continue; > } > > - vp = VFS_I(ip); > - if (!vp) { > + if (!VFS_I(ip)) { > XFS_MOUNT_IUNLOCK(mp); > xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); > goto again; > } > > - ASSERT(vn_count(vp) == 0); > + ASSERT(vn_count(VFS_I(ip)) == 0); > > ip = ip->i_mnext; > } while (ip != mp->m_inodes); > Index: linux-2.6-xfs/fs/xfs/xfs_itable.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-23 22:26:29.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-23 22:26:45.000000000 +0200 > @@ -59,7 +59,6 @@ xfs_bulkstat_one_iget( > { > xfs_icdinode_t *dic; /* dinode core info pointer */ > xfs_inode_t *ip; /* incore inode pointer */ > - bhv_vnode_t *vp; > int error; > > error = xfs_iget(mp, NULL, ino, > @@ -72,7 +71,6 @@ xfs_bulkstat_one_iget( > ASSERT(ip != NULL); > ASSERT(ip->i_blkno != (xfs_daddr_t)0); > > - vp = VFS_I(ip); > dic = &ip->i_d; > > /* xfs_iget returns the following without needing > @@ -85,7 +83,7 @@ xfs_bulkstat_one_iget( > buf->bs_uid = dic->di_uid; > buf->bs_gid = dic->di_gid; > buf->bs_size = dic->di_size; > - vn_atime_to_bstime(vp, &buf->bs_atime); > + vn_atime_to_bstime(VFS_I(ip), &buf->bs_atime); > buf->bs_mtime.tv_sec = dic->di_mtime.t_sec; > buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec; > buf->bs_ctime.tv_sec = dic->di_ctime.t_sec; > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 22:23:16.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 22:33:43.000000000 +0200 > @@ -1160,7 +1160,6 @@ int > xfs_release( > xfs_inode_t *ip) > { > - bhv_vnode_t *vp = VFS_I(ip); > xfs_mount_t *mp = ip->i_mount; > int error; > > @@ -1195,13 +1194,13 @@ xfs_release( > * be exposed to that problem. > */ > truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED); > - if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0) > + if (truncated && VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > 0) > xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE); > } > > if (ip->i_d.di_nlink != 0) { > if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && > - ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || > + ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || > ip->i_delayed_blks > 0)) && > (ip->i_df.if_flags & XFS_IFEXTENTS)) && > (!(ip->i_d.di_flags & > @@ -1227,7 +1226,6 @@ int > xfs_inactive( > xfs_inode_t *ip) > { > - bhv_vnode_t *vp = VFS_I(ip); > xfs_bmap_free_t free_list; > xfs_fsblock_t first_block; > int committed; > @@ -1242,7 +1240,7 @@ xfs_inactive( > * If the inode is already free, then there can be nothing > * to clean up here. > */ > - if (ip->i_d.di_mode == 0 || VN_BAD(vp)) { > + if (ip->i_d.di_mode == 0 || VN_BAD(VFS_I(ip))) { > ASSERT(ip->i_df.if_real_bytes == 0); > ASSERT(ip->i_df.if_broot_bytes == 0); > return VN_INACTIVE_CACHE; > @@ -1272,7 +1270,7 @@ xfs_inactive( > > if (ip->i_d.di_nlink != 0) { > if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && > - ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || > + ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || > ip->i_delayed_blks > 0)) && > (ip->i_df.if_flags & XFS_IFEXTENTS) && > (!(ip->i_d.di_flags & > @@ -2793,14 +2791,13 @@ int > xfs_reclaim( > xfs_inode_t *ip) > { > - bhv_vnode_t *vp = VFS_I(ip); > > xfs_itrace_entry(ip); > > - ASSERT(!VN_MAPPED(vp)); > + ASSERT(!VN_MAPPED(VFS_I(ip))); > > /* bad inode, get out here ASAP */ > - if (VN_BAD(vp)) { > + if (VN_BAD(VFS_I(ip))) { > xfs_ireclaim(ip); > return 0; > } > @@ -2837,7 +2834,7 @@ xfs_reclaim( > XFS_MOUNT_ILOCK(mp); > spin_lock(&ip->i_flags_lock); > __xfs_iflags_set(ip, XFS_IRECLAIMABLE); > - vp->i_private = NULL; > + VFS_I(ip)->i_private = NULL; > ip->i_vnode = NULL; > spin_unlock(&ip->i_flags_lock); > list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); > @@ -3241,7 +3238,6 @@ xfs_free_file_space( > xfs_off_t len, > int attr_flags) > { > - bhv_vnode_t *vp; > int committed; > int done; > xfs_off_t end_dmi_offset; > @@ -3261,7 +3257,6 @@ xfs_free_file_space( > xfs_trans_t *tp; > int need_iolock = 1; > > - vp = VFS_I(ip); > mp = ip->i_mount; > > xfs_itrace_entry(ip); > @@ -3298,7 +3293,7 @@ xfs_free_file_space( > rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); > ioffset = offset & ~(rounding - 1); > > - if (VN_CACHED(vp) != 0) { > + if (VN_CACHED(VFS_I(ip)) != 0) { > xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1); > error = xfs_flushinval_pages(ip, ioffset, -1, FI_REMAPF_LOCKED); > if (error) > Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 22:28:36.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 22:33:43.000000000 +0200 > @@ -127,7 +127,6 @@ xfs_unmount_flush( > xfs_inode_t *rip = mp->m_rootip; > xfs_inode_t *rbmip; > xfs_inode_t *rsumip = NULL; > - bhv_vnode_t *rvp = VFS_I(rip); > int error; > > xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); > @@ -166,7 +165,7 @@ xfs_unmount_flush( > if (error == EFSCORRUPTED) > goto fscorrupt_out2; > > - if (vn_count(rvp) != 1 && !relocation) { > + if (vn_count(VFS_I(rip)) != 1 && !relocation) { > xfs_iunlock(rip, XFS_ILOCK_EXCL); > return XFS_ERROR(EBUSY); > } > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:47.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:54.000000000 +0200 > @@ -922,12 +922,7 @@ STATIC struct inode * > xfs_fs_alloc_inode( > struct super_block *sb) > { > - bhv_vnode_t *vp; > - > - vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); > - if (unlikely(!vp)) > - return NULL; > - return vp; > + return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); > } > > STATIC void > > > From owner-xfs@oss.sgi.com Wed Jul 23 22:53:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 22:53:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O5rALe005054 for ; Wed, 23 Jul 2008 22:53:11 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA06396; Thu, 24 Jul 2008 15:54:18 +1000 Message-ID: <48881A55.7010909@sgi.com> Date: Thu, 24 Jul 2008 15:59:49 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 2/2] kill bhv_vnode_t References: <20080723214745.GC10655@lst.de> In-Reply-To: <20080723214745.GC10655@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17120 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Same again, all looks good. Christoph Hellwig wrote: > All remaining bhv_vnode_t instance are in code that's more or less Linux > specific. (Well, for xfs_acl.c that could be argued, but that code is > on the removal list, too). So just do an s/bhv_vnode_t/struct inode/ > over the whole tree. We can clean up variable naming and some useless > helpers later. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:54.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 22:33:58.000000000 +0200 > @@ -1818,7 +1818,7 @@ xfs_free_trace_bufs(void) > STATIC int __init > xfs_init_zones(void) > { > - xfs_vnode_zone = kmem_zone_init_flags(sizeof(bhv_vnode_t), "xfs_vnode", > + xfs_vnode_zone = kmem_zone_init_flags(sizeof(struct inode), "xfs_vnode", > KM_ZONE_HWALIGN | KM_ZONE_RECLAIM | > KM_ZONE_SPREAD, > xfs_fs_inode_init_once); > Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_syscalls.c 2008-07-23 22:33:43.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_syscalls.c 2008-07-23 22:33:58.000000000 +0200 > @@ -1034,7 +1034,7 @@ xfs_qm_dqrele_all_inodes( > { > xfs_inode_t *ip, *topino; > uint ireclaims; > - bhv_vnode_t *vp; > + struct inode *vp; > boolean_t vnode_refd; > > ASSERT(mp->m_quotainfo); > Index: linux-2.6-xfs/fs/xfs/xfs_acl.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.c 2008-07-23 22:33:43.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_acl.c 2008-07-23 22:33:58.000000000 +0200 > @@ -37,15 +37,15 @@ > #include > #include > > -STATIC int xfs_acl_setmode(bhv_vnode_t *, xfs_acl_t *, int *); > +STATIC int xfs_acl_setmode(struct inode *, xfs_acl_t *, int *); > STATIC void xfs_acl_filter_mode(mode_t, xfs_acl_t *); > STATIC void xfs_acl_get_endian(xfs_acl_t *); > STATIC int xfs_acl_access(uid_t, gid_t, xfs_acl_t *, mode_t, cred_t *); > STATIC int xfs_acl_invalid(xfs_acl_t *); > STATIC void xfs_acl_sync_mode(mode_t, xfs_acl_t *); > -STATIC void xfs_acl_get_attr(bhv_vnode_t *, xfs_acl_t *, int, int, int *); > -STATIC void xfs_acl_set_attr(bhv_vnode_t *, xfs_acl_t *, int, int *); > -STATIC int xfs_acl_allow_set(bhv_vnode_t *, int); > +STATIC void xfs_acl_get_attr(struct inode *, xfs_acl_t *, int, int, int *); > +STATIC void xfs_acl_set_attr(struct inode *, xfs_acl_t *, int, int *); > +STATIC int xfs_acl_allow_set(struct inode *, int); > > kmem_zone_t *xfs_acl_zone; > > @@ -55,7 +55,7 @@ kmem_zone_t *xfs_acl_zone; > */ > int > xfs_acl_vhasacl_access( > - bhv_vnode_t *vp) > + struct inode *vp) > { > int error; > > @@ -68,7 +68,7 @@ xfs_acl_vhasacl_access( > */ > int > xfs_acl_vhasacl_default( > - bhv_vnode_t *vp) > + struct inode *vp) > { > int error; > > @@ -207,7 +207,7 @@ posix_acl_xfs_to_xattr( > > int > xfs_acl_vget( > - bhv_vnode_t *vp, > + struct inode *vp, > void *acl, > size_t size, > int kind) > @@ -249,7 +249,7 @@ out: > > int > xfs_acl_vremove( > - bhv_vnode_t *vp, > + struct inode *vp, > int kind) > { > int error; > @@ -268,7 +268,7 @@ xfs_acl_vremove( > > int > xfs_acl_vset( > - bhv_vnode_t *vp, > + struct inode *vp, > void *acl, > size_t size, > int kind) > @@ -357,7 +357,7 @@ xfs_acl_iaccess( > > STATIC int > xfs_acl_allow_set( > - bhv_vnode_t *vp, > + struct inode *vp, > int kind) > { > if (vp->i_flags & (S_IMMUTABLE|S_APPEND)) > @@ -561,7 +561,7 @@ xfs_acl_get_endian( > */ > STATIC void > xfs_acl_get_attr( > - bhv_vnode_t *vp, > + struct inode *vp, > xfs_acl_t *aclp, > int kind, > int flags, > @@ -585,7 +585,7 @@ xfs_acl_get_attr( > */ > STATIC void > xfs_acl_set_attr( > - bhv_vnode_t *vp, > + struct inode *vp, > xfs_acl_t *aclp, > int kind, > int *error) > @@ -619,7 +619,7 @@ xfs_acl_set_attr( > > int > xfs_acl_vtoacl( > - bhv_vnode_t *vp, > + struct inode *vp, > xfs_acl_t *access_acl, > xfs_acl_t *default_acl) > { > @@ -651,7 +651,7 @@ xfs_acl_vtoacl( > */ > int > xfs_acl_inherit( > - bhv_vnode_t *vp, > + struct inode *vp, > mode_t mode, > xfs_acl_t *pdaclp) > { > @@ -710,7 +710,7 @@ out_error: > */ > STATIC int > xfs_acl_setmode( > - bhv_vnode_t *vp, > + struct inode *vp, > xfs_acl_t *acl, > int *basicperms) > { > Index: linux-2.6-xfs/fs/xfs/xfs_acl.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_acl.h 2008-07-23 22:33:43.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_acl.h 2008-07-23 22:33:58.000000000 +0200 > @@ -59,14 +59,14 @@ extern struct kmem_zone *xfs_acl_zone; > (zone) = kmem_zone_init(sizeof(xfs_acl_t), (name)) > #define xfs_acl_zone_destroy(zone) kmem_zone_destroy(zone) > > -extern int xfs_acl_inherit(bhv_vnode_t *, mode_t mode, xfs_acl_t *); > +extern int xfs_acl_inherit(struct inode *, mode_t mode, xfs_acl_t *); > extern int xfs_acl_iaccess(struct xfs_inode *, mode_t, cred_t *); > -extern int xfs_acl_vtoacl(bhv_vnode_t *, xfs_acl_t *, xfs_acl_t *); > -extern int xfs_acl_vhasacl_access(bhv_vnode_t *); > -extern int xfs_acl_vhasacl_default(bhv_vnode_t *); > -extern int xfs_acl_vset(bhv_vnode_t *, void *, size_t, int); > -extern int xfs_acl_vget(bhv_vnode_t *, void *, size_t, int); > -extern int xfs_acl_vremove(bhv_vnode_t *, int); > +extern int xfs_acl_vtoacl(struct inode *, xfs_acl_t *, xfs_acl_t *); > +extern int xfs_acl_vhasacl_access(struct inode *); > +extern int xfs_acl_vhasacl_default(struct inode *); > +extern int xfs_acl_vset(struct inode *, void *, size_t, int); > +extern int xfs_acl_vget(struct inode *, void *, size_t, int); > +extern int xfs_acl_vremove(struct inode *, int); > > #define _ACL_PERM_INVALID(perm) ((perm) & ~(ACL_READ|ACL_WRITE|ACL_EXECUTE)) > > Index: linux-2.6-xfs/fs/xfs/xfs_inode.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-23 22:33:43.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-23 22:33:58.000000000 +0200 > @@ -204,7 +204,7 @@ typedef struct xfs_inode { > struct xfs_inode *i_mprev; /* ptr to prev inode */ > struct xfs_mount *i_mount; /* fs mount struct ptr */ > struct list_head i_reclaim; /* reclaim list */ > - bhv_vnode_t *i_vnode; /* vnode backpointer */ > + struct inode *i_vnode; /* vnode backpointer */ > struct xfs_dquot *i_udquot; /* user dquot */ > struct xfs_dquot *i_gdquot; /* group dquot */ > > Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 22:33:43.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 22:35:36.000000000 +0200 > @@ -282,7 +282,7 @@ xfs_sync_inodes( > int *bypassed) > { > xfs_inode_t *ip = NULL; > - bhv_vnode_t *vp = NULL; > + struct inode *vp = NULL; > int error; > int last_error; > uint64_t fflag; > Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 22:33:43.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 22:33:58.000000000 +0200 > @@ -2850,7 +2850,7 @@ xfs_finish_reclaim( > int sync_mode) > { > xfs_perag_t *pag = xfs_get_perag(ip->i_mount, ip->i_ino); > - bhv_vnode_t *vp = VFS_I(ip); > + struct inode *vp = VFS_I(ip); > > if (vp && VN_BAD(vp)) > goto reclaim; > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 22:34:05.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-23 22:34:31.000000000 +0200 > @@ -90,7 +90,7 @@ vn_ioerror( > */ > static inline int xfs_icount(struct xfs_inode *ip) > { > - bhv_vnode_t *vp = VFS_I(ip); > + struct inode *vp = VFS_I(ip); > > if (vp) > return vn_count(vp); > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 22:34:40.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 22:36:29.000000000 +0200 > @@ -22,8 +22,6 @@ struct file; > struct xfs_iomap; > struct attrlist_cursor_kern; > > -typedef struct inode bhv_vnode_t; > - > /* > * Return values for xfs_inactive. A return value of > * VN_INACTIVE_NOCACHE implies that the file system behavior > @@ -64,7 +62,7 @@ extern void vn_iowait(struct xfs_inode * > extern void vn_iowake(struct xfs_inode *ip); > extern void vn_ioerror(struct xfs_inode *ip, int error, char *f, int l); > > -static inline int vn_count(bhv_vnode_t *vp) > +static inline int vn_count(struct inode *vp) > { > return atomic_read(&vp->i_count); > } > @@ -81,7 +79,7 @@ do { \ > iput(VFS_I(ip)); \ > } while (0) > > -static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) > +static inline struct inode *vn_grab(struct inode *vp) > { > return igrab(vp); > } > @@ -89,7 +87,7 @@ static inline bhv_vnode_t *vn_grab(bhv_v > /* > * Dealing with bad inodes > */ > -static inline int VN_BAD(bhv_vnode_t *vp) > +static inline int VN_BAD(struct inode *vp) > { > return is_bad_inode(vp); > } > @@ -97,18 +95,18 @@ static inline int VN_BAD(bhv_vnode_t *vp > /* > * Extracting atime values in various formats > */ > -static inline void vn_atime_to_bstime(bhv_vnode_t *vp, xfs_bstime_t *bs_atime) > +static inline void vn_atime_to_bstime(struct inode *vp, xfs_bstime_t *bs_atime) > { > bs_atime->tv_sec = vp->i_atime.tv_sec; > bs_atime->tv_nsec = vp->i_atime.tv_nsec; > } > > -static inline void vn_atime_to_timespec(bhv_vnode_t *vp, struct timespec *ts) > +static inline void vn_atime_to_timespec(struct inode *vp, struct timespec *ts) > { > *ts = vp->i_atime; > } > > -static inline void vn_atime_to_time_t(bhv_vnode_t *vp, time_t *tt) > +static inline void vn_atime_to_time_t(struct inode *vp, time_t *tt) > { > *tt = vp->i_atime.tv_sec; > } > > > From owner-xfs@oss.sgi.com Wed Jul 23 23:01:37 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 23:01:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O61ZXr006489 for ; Wed, 23 Jul 2008 23:01:36 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA06652; Thu, 24 Jul 2008 16:02:42 +1000 Message-ID: <48881B02.20900@sgi.com> Date: Thu, 24 Jul 2008 16:02:42 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.14 (Windows/20080421) MIME-Version: 1.0 To: Russell Cattelan CC: xfs@oss.sgi.com Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <48875040.9090400@thebarn.com> In-Reply-To: <48875040.9090400@thebarn.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17121 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Russell Cattelan wrote: >> Internally, we're attempting to refine our patch acceptance processes, >> (e.g. gitify our internal dev tree and mirror it on oss so it's much >> easier to push back out to oss). > I'm sure you have seen this before: > http://oss.sgi.com/cgi-bin/gitweb.cgi?p=cattelan/xfs-import/.git;a=summary' > That is a running mirror of the ptools tree into git. (via the cvs tree) yes. But it's git -> ptools scripts that we need, preserving history, etc. Niv has some scripts for this - they're not production quality yet, but we're getting there. Once this transitions, it'll be a *lot* easier for us to pull in patches from external developer branches because we'll all be using git for checkin. > It would be really nice to move all xfs development to git finally shut > down > the whole ptools -> cvs update process. once our internal dev tree is git based and internal git->ptools merging is fully automatic, there is no actual need to shutdown the cvs crons. It's worked for years and can stay running, no harm. > This would help facilitate creation of more "experimental" trees and/or > branches > so there would not be such a long delay of getting patches distributed. I think we'd just end up with a git dev branch on oss, maybe with a daily pull from the internal dev tree (Russell, that would render your cvs->git mirror obsolete I guess). In any case, patch flow and turn-around should be greatly improved. Anyone have comments on any of the above? Cheers -- Mark From owner-xfs@oss.sgi.com Wed Jul 23 23:15:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 23:15:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O6FPgI008742 for ; Wed, 23 Jul 2008 23:15:25 -0700 X-ASG-Debug-ID: 1216880194-450c017e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 123FCE92098 for ; Wed, 23 Jul 2008 23:16:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id sFGTUdoU4ndIBQJD for ; Wed, 23 Jul 2008 23:16:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAB+5h0h5LFxAiGdsb2JhbACSUQEBAQ8gnig X-IronPort-AV: E=Sophos;i="4.31,244,1215354600"; d="scan'208";a="156515091" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 15:46:20 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLu7b-0006sA-ND; Thu, 24 Jul 2008 16:16:15 +1000 Date: Thu, 24 Jul 2008 16:16:15 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] sanitize xfs_initialize_vnode Subject: Re: [PATCH] sanitize xfs_initialize_vnode Message-ID: <20080724061615.GR6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080502105215.GA17870@lst.de> <20080723195110.GA6645@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723195110.GA6645@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216880196 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0014 1.0000 -2.0117 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.698 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17122 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 09:51:10PM +0200, Christoph Hellwig wrote: > On Fri, May 02, 2008 at 12:52:15PM +0200, Christoph Hellwig wrote: > > Sanitize setting up the Linux indode. > > > > Setting up the xfs_inode <-> inode link is opencoded in xfs_iget_core > > now because that's the only place it needs to be done, > > xfs_initialize_vnode is renamed to xfs_setup_inode and loses all > > superflous paramaters. The check for I_NEW is removed because it always > > is true and the di_mode check moves into xfs_iget_core because it's only > > needed there. > > > > xfs_set_inodeops and xfs_revalidate_inode are merged into > > xfs_setup_inode and the whole things is moved into xfs_iops.c where it > > belongs. > > Rediffed to apply ontop of Dave's and my vnode helper cleanups: Looks good and has been passing testing here for the past week... One question, though: > + } > + > + xfs_iflags_clear(ip, XFS_INEW); > + barrier(); > + > + unlock_new_inode(inode); > +} Do we still need that barrier()? Or has the reason for it existing been lost in the mists of time? Regardless, it was there before so this is not a reason to stop the patch from going in... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 23 23:19:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 23:19:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O6J2be009590 for ; Wed, 23 Jul 2008 23:19:02 -0700 X-ASG-Debug-ID: 1216880411-451e01850000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3B58FE9210E for ; Wed, 23 Jul 2008 23:20:12 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 4VSbcX8BxeFmVRLU for ; Wed, 23 Jul 2008 23:20:12 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6O6K2Ng027012 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Jul 2008 08:20:02 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6O6K2nb027009; Thu, 24 Jul 2008 08:20:02 +0200 Date: Thu, 24 Jul 2008 08:20:02 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] sanitize xfs_initialize_vnode Subject: Re: [PATCH] sanitize xfs_initialize_vnode Message-ID: <20080724062002.GA26938@lst.de> References: <20080502105215.GA17870@lst.de> <20080723195110.GA6645@lst.de> <20080724061615.GR6761@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080724061615.GR6761@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216880413 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.698 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17123 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 04:16:15PM +1000, Dave Chinner wrote: > > + } > > + > > + xfs_iflags_clear(ip, XFS_INEW); > > + barrier(); > > + > > + unlock_new_inode(inode); > > +} > > Do we still need that barrier()? Or has the reason for it > existing been lost in the mists of time? Regardless, it was > there before so this is not a reason to stop the patch from > going in... Good question. I wonder why it's there in the first place. From owner-xfs@oss.sgi.com Wed Jul 23 23:21:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 23:21:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O6LKPo010239 for ; Wed, 23 Jul 2008 23:21:20 -0700 X-ASG-Debug-ID: 1216880549-513003450000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 87BD131FDBE for ; Wed, 23 Jul 2008 23:22:29 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 1JpBXCIU0AKS0v8c for ; Wed, 23 Jul 2008 23:22:29 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6O6MKNg027093 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Jul 2008 08:22:20 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6O6MKYH027091; Thu, 24 Jul 2008 08:22:20 +0200 Date: Thu, 24 Jul 2008 08:22:20 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 5/5] implement IHOLD/IRELE directly Subject: Re: [PATCH 5/5] implement IHOLD/IRELE directly Message-ID: <20080724062220.GB26938@lst.de> References: <20080723194950.GF6188@lst.de> <20080723225548.GO6761@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723225548.GO6761@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216880551 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.698 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17124 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 08:55:48AM +1000, Dave Chinner wrote: > On Wed, Jul 23, 2008 at 09:49:50PM +0200, Christoph Hellwig wrote: > > Now that all direct calls to VN_HOLD/VN_RELE are gone we can implement > > IHOLD/IRELE directly. > > > > For the IHOLD case also replace igrab with a direct increment of i_count > > because we are guaranteed to already have a live and referenced inode > > by the VFS. Also remove the vn_hold statistic because it's been rather > > meaningless for some time with most references done by other callers. > > Seeing as you are changing from an igrab() to a straight > atomic_inc(), can you put an: > > ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) > > into the IHOLD macro so we catch screwups in reference counting as > quickly as possible? Makes sense, updated patch below. (Half-way through xfsqa with a debug kernel so far) Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-24 07:32:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-24 07:32:26.000000000 +0200 @@ -179,7 +179,6 @@ EXPORT_SYMBOL(uuid_getnodeuniq); EXPORT_SYMBOL(uuid_hash64); EXPORT_SYMBOL(uuid_is_nil); EXPORT_SYMBOL(uuid_table_remove); -EXPORT_SYMBOL(vn_hold); #if defined(CONFIG_XFS_POSIX_ACL) EXPORT_SYMBOL(xfs_acl_vtoacl); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-24 07:32:10.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.c 2008-07-24 07:32:26.000000000 +0200 @@ -82,24 +82,6 @@ vn_ioerror( xfs_do_force_shutdown(ip->i_mount, SHUTDOWN_DEVICE_REQ, f, l); } - -/* - * Add a reference to a referenced vnode. - */ -bhv_vnode_t * -vn_hold( - bhv_vnode_t *vp) -{ - struct inode *inode; - - XFS_STATS_INC(vn_hold); - - inode = igrab(vp); - ASSERT(inode); - - return vp; -} - #ifdef XFS_INODE_TRACE /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-24 07:32:10.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-24 07:32:32.000000000 +0200 @@ -69,22 +69,18 @@ static inline int vn_count(bhv_vnode_t * return atomic_read(&vp->i_count); } -/* - * Vnode reference counting functions (and macros for compatibility). - */ -extern bhv_vnode_t *vn_hold(bhv_vnode_t *); - -#if defined(XFS_INODE_TRACE) -#define VN_HOLD(vp) \ - ((void)vn_hold(vp), \ - xfs_itrace_hold(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address)) -#define VN_RELE(vp) \ - (xfs_itrace_rele(XFS_I(vp), __FILE__, __LINE__, (inst_t *)__return_address), \ - iput(vp)) -#else -#define VN_HOLD(vp) ((void)vn_hold(vp)) -#define VN_RELE(vp) (iput(vp)) -#endif +#define IHOLD(ip) \ +do { \ + ASSERT(atomic_read(&VFS_I(ip)->i_count) > 0) ; \ + atomic_inc(&(VFS_I(ip)->i_count)); \ + xfs_itrace_hold((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ +} while (0) + +#define IRELE(ip) \ +do { \ + xfs_itrace_rele((ip), __FILE__, __LINE__, (inst_t *)__return_address); \ + iput(VFS_I(ip)); \ +} while (0) static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) { Index: linux-2.6-xfs/fs/xfs/xfs_utils.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_utils.h 2008-07-24 07:32:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_utils.h 2008-07-24 07:32:26.000000000 +0200 @@ -18,9 +18,6 @@ #ifndef __XFS_UTILS_H__ #define __XFS_UTILS_H__ -#define IRELE(ip) VN_RELE(VFS_I(ip)) -#define IHOLD(ip) VN_HOLD(VFS_I(ip)) - extern int xfs_truncate_file(xfs_mount_t *, xfs_inode_t *); extern int xfs_dir_ialloc(xfs_trans_t **, xfs_inode_t *, mode_t, xfs_nlink_t, xfs_dev_t, cred_t *, prid_t, int, From owner-xfs@oss.sgi.com Wed Jul 23 23:31:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 23:31:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FUZZY_VPILL, J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O6VfgB011854 for ; Wed, 23 Jul 2008 23:31:41 -0700 X-ASG-Debug-ID: 1216881170-450d022f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F3A17E927C3; Wed, 23 Jul 2008 23:32:50 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id jqmKHvNCXbGCUiBD; Wed, 23 Jul 2008 23:32:50 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6O6WfNg027530 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Jul 2008 08:32:41 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6O6Wf3f027528; Thu, 24 Jul 2008 08:32:41 +0200 Date: Thu, 24 Jul 2008 08:32:40 +0200 From: Christoph Hellwig To: Lachlan McIlroy Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/2] remove some easy bhv_vnode_t instances Subject: Re: [PATCH 1/2] remove some easy bhv_vnode_t instances Message-ID: <20080724063240.GC26938@lst.de> References: <20080723214741.GB10655@lst.de> <488819CC.5060100@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <488819CC.5060100@sgi.com> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216881171 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=FUZZY_VPILL X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.698 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 FUZZY_VPILL BODY: Attempt to obfuscate words in spam X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17125 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Thanks for the review. Bote that these patches need the 5 vnode helper cleanup patches and '[PATCH] sanitize xfs_initialize_vnode' previously applied. On Thu, Jul 24, 2008 at 03:57:32PM +1000, Lachlan McIlroy wrote: > All looks good to me. > > Christoph Hellwig wrote: > >In various places we can just move a VFS_I call into the argument list > >of called functions/macros instead of having a local bhv_vnode_t. > > > > > >Signed-off-by: Christoph Hellwig > > > >Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c > >=================================================================== > >--- linux-2.6-xfs.orig/fs/xfs/xfs_dfrag.c 2008-07-23 > >22:25:42.000000000 +0200 > >+++ linux-2.6-xfs/fs/xfs/xfs_dfrag.c 2008-07-23 22:26:16.000000000 +0200 > >@@ -130,7 +130,6 @@ xfs_swap_extents( > > xfs_mount_t *mp; > > xfs_trans_t *tp; > > xfs_bstat_t *sbp = &sxp->sx_stat; > >- bhv_vnode_t *vp, *tvp; > > xfs_ifork_t *tempifp, *ifp, *tifp; > > int ilf_fields, tilf_fields; > > static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; > >@@ -149,8 +148,6 @@ xfs_swap_extents( > > } > > > > sbp = &sxp->sx_stat; > >- vp = VFS_I(ip); > >- tvp = VFS_I(tip); > > > > xfs_lock_two_inodes(ip, tip, lock_flags); > > locked = 1; > >@@ -174,7 +171,7 @@ xfs_swap_extents( > > goto error0; > > } > > > >- if (VN_CACHED(tvp) != 0) { > >+ if (VN_CACHED(VFS_I(tip)) != 0) { > > xfs_inval_cached_trace(tip, 0, -1, 0, -1); > > error = xfs_flushinval_pages(tip, 0, -1, > > FI_REMAPF_LOCKED); > >@@ -183,7 +180,7 @@ xfs_swap_extents( > > } > > > > /* Verify O_DIRECT for ftmp */ > >- if (VN_CACHED(tvp) != 0) { > >+ if (VN_CACHED(VFS_I(tip)) != 0) { > > error = XFS_ERROR(EINVAL); > > goto error0; > > } > >@@ -227,7 +224,7 @@ xfs_swap_extents( > > * vop_read (or write in the case of autogrow) they block on the > > iolock > > * until we have switched the extents. > > */ > >- if (VN_MAPPED(vp)) { > >+ if (VN_MAPPED(VFS_I(ip))) { > > error = XFS_ERROR(EBUSY); > > goto error0; > > } > >Index: linux-2.6-xfs/fs/xfs/xfs_inode.c > >=================================================================== > >--- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 > >22:22:20.000000000 +0200 > >+++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 22:29:36.000000000 +0200 > >@@ -1397,7 +1397,6 @@ xfs_itruncate_start( > > xfs_fsize_t last_byte; > > xfs_off_t toss_start; > > xfs_mount_t *mp; > >- bhv_vnode_t *vp; > > int error = 0; > > > > ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); > >@@ -1406,7 +1405,6 @@ xfs_itruncate_start( > > (flags == XFS_ITRUNC_MAYBE)); > > > > mp = ip->i_mount; > >- vp = VFS_I(ip); > > > > /* wait for the completion of any pending DIOs */ > > if (new_size < ip->i_size) > >@@ -1455,7 +1453,7 @@ xfs_itruncate_start( > > > > #ifdef DEBUG > > if (new_size == 0) { > >- ASSERT(VN_CACHED(vp) == 0); > >+ ASSERT(VN_CACHED(VFS_I(ip)) == 0); > > } > > #endif > > return error; > >@@ -3421,7 +3419,6 @@ xfs_iflush_all( > > xfs_mount_t *mp) > > { > > xfs_inode_t *ip; > >- bhv_vnode_t *vp; > > > > again: > > XFS_MOUNT_ILOCK(mp); > >@@ -3436,14 +3433,13 @@ xfs_iflush_all( > > continue; > > } > > > >- vp = VFS_I(ip); > >- if (!vp) { > >+ if (!VFS_I(ip)) { > > XFS_MOUNT_IUNLOCK(mp); > > xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); > > goto again; > > } > > > >- ASSERT(vn_count(vp) == 0); > >+ ASSERT(vn_count(VFS_I(ip)) == 0); > > > > ip = ip->i_mnext; > > } while (ip != mp->m_inodes); > >Index: linux-2.6-xfs/fs/xfs/xfs_itable.c > >=================================================================== > >--- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-23 > >22:26:29.000000000 +0200 > >+++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-23 22:26:45.000000000 +0200 > >@@ -59,7 +59,6 @@ xfs_bulkstat_one_iget( > > { > > xfs_icdinode_t *dic; /* dinode core info pointer */ > > xfs_inode_t *ip; /* incore inode pointer */ > >- bhv_vnode_t *vp; > > int error; > > > > error = xfs_iget(mp, NULL, ino, > >@@ -72,7 +71,6 @@ xfs_bulkstat_one_iget( > > ASSERT(ip != NULL); > > ASSERT(ip->i_blkno != (xfs_daddr_t)0); > > > >- vp = VFS_I(ip); > > dic = &ip->i_d; > > > > /* xfs_iget returns the following without needing > >@@ -85,7 +83,7 @@ xfs_bulkstat_one_iget( > > buf->bs_uid = dic->di_uid; > > buf->bs_gid = dic->di_gid; > > buf->bs_size = dic->di_size; > >- vn_atime_to_bstime(vp, &buf->bs_atime); > >+ vn_atime_to_bstime(VFS_I(ip), &buf->bs_atime); > > buf->bs_mtime.tv_sec = dic->di_mtime.t_sec; > > buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec; > > buf->bs_ctime.tv_sec = dic->di_ctime.t_sec; > >Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c > >=================================================================== > >--- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 > >22:23:16.000000000 +0200 > >+++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 > >22:33:43.000000000 +0200 > >@@ -1160,7 +1160,6 @@ int > > xfs_release( > > xfs_inode_t *ip) > > { > >- bhv_vnode_t *vp = VFS_I(ip); > > xfs_mount_t *mp = ip->i_mount; > > int error; > > > >@@ -1195,13 +1194,13 @@ xfs_release( > > * be exposed to that problem. > > */ > > truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED); > >- if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0) > >+ if (truncated && VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > > >0) > > xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE); > > } > > > > if (ip->i_d.di_nlink != 0) { > > if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && > >- ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || > >+ ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || > > ip->i_delayed_blks > 0)) && > > (ip->i_df.if_flags & XFS_IFEXTENTS)) && > > (!(ip->i_d.di_flags & > >@@ -1227,7 +1226,6 @@ int > > xfs_inactive( > > xfs_inode_t *ip) > > { > >- bhv_vnode_t *vp = VFS_I(ip); > > xfs_bmap_free_t free_list; > > xfs_fsblock_t first_block; > > int committed; > >@@ -1242,7 +1240,7 @@ xfs_inactive( > > * If the inode is already free, then there can be nothing > > * to clean up here. > > */ > >- if (ip->i_d.di_mode == 0 || VN_BAD(vp)) { > >+ if (ip->i_d.di_mode == 0 || VN_BAD(VFS_I(ip))) { > > ASSERT(ip->i_df.if_real_bytes == 0); > > ASSERT(ip->i_df.if_broot_bytes == 0); > > return VN_INACTIVE_CACHE; > >@@ -1272,7 +1270,7 @@ xfs_inactive( > > > > if (ip->i_d.di_nlink != 0) { > > if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && > >- ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || > >+ ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || > > ip->i_delayed_blks > 0)) && > > (ip->i_df.if_flags & XFS_IFEXTENTS) && > > (!(ip->i_d.di_flags & > >@@ -2793,14 +2791,13 @@ int > > xfs_reclaim( > > xfs_inode_t *ip) > > { > >- bhv_vnode_t *vp = VFS_I(ip); > > > > xfs_itrace_entry(ip); > > > >- ASSERT(!VN_MAPPED(vp)); > >+ ASSERT(!VN_MAPPED(VFS_I(ip))); > > > > /* bad inode, get out here ASAP */ > >- if (VN_BAD(vp)) { > >+ if (VN_BAD(VFS_I(ip))) { > > xfs_ireclaim(ip); > > return 0; > > } > >@@ -2837,7 +2834,7 @@ xfs_reclaim( > > XFS_MOUNT_ILOCK(mp); > > spin_lock(&ip->i_flags_lock); > > __xfs_iflags_set(ip, XFS_IRECLAIMABLE); > >- vp->i_private = NULL; > >+ VFS_I(ip)->i_private = NULL; > > ip->i_vnode = NULL; > > spin_unlock(&ip->i_flags_lock); > > list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); > >@@ -3241,7 +3238,6 @@ xfs_free_file_space( > > xfs_off_t len, > > int attr_flags) > > { > >- bhv_vnode_t *vp; > > int committed; > > int done; > > xfs_off_t end_dmi_offset; > >@@ -3261,7 +3257,6 @@ xfs_free_file_space( > > xfs_trans_t *tp; > > int need_iolock = 1; > > > >- vp = VFS_I(ip); > > mp = ip->i_mount; > > > > xfs_itrace_entry(ip); > >@@ -3298,7 +3293,7 @@ xfs_free_file_space( > > rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); > > ioffset = offset & ~(rounding - 1); > > > >- if (VN_CACHED(vp) != 0) { > >+ if (VN_CACHED(VFS_I(ip)) != 0) { > > xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1); > > error = xfs_flushinval_pages(ip, ioffset, -1, > > FI_REMAPF_LOCKED); > > if (error) > >Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c > >=================================================================== > >--- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 > >22:28:36.000000000 +0200 > >+++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 22:33:43.000000000 +0200 > >@@ -127,7 +127,6 @@ xfs_unmount_flush( > > xfs_inode_t *rip = mp->m_rootip; > > xfs_inode_t *rbmip; > > xfs_inode_t *rsumip = NULL; > >- bhv_vnode_t *rvp = VFS_I(rip); > > int error; > > > > xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); > >@@ -166,7 +165,7 @@ xfs_unmount_flush( > > if (error == EFSCORRUPTED) > > goto fscorrupt_out2; > > > >- if (vn_count(rvp) != 1 && !relocation) { > >+ if (vn_count(VFS_I(rip)) != 1 && !relocation) { > > xfs_iunlock(rip, XFS_ILOCK_EXCL); > > return XFS_ERROR(EBUSY); > > } > >Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > >=================================================================== > >--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 > >22:33:47.000000000 +0200 > >+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 > >22:33:54.000000000 +0200 > >@@ -922,12 +922,7 @@ STATIC struct inode * > > xfs_fs_alloc_inode( > > struct super_block *sb) > > { > >- bhv_vnode_t *vp; > >- > >- vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); > >- if (unlikely(!vp)) > >- return NULL; > >- return vp; > >+ return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); > > } > > > > STATIC void > > > > > > ---end quoted text--- From owner-xfs@oss.sgi.com Wed Jul 23 23:54:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 23 Jul 2008 23:54:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O6sNhl014937 for ; Wed, 23 Jul 2008 23:54:23 -0700 X-ASG-Debug-ID: 1216882533-475a00380000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5B0C1191F8BA for ; Wed, 23 Jul 2008 23:55:33 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id XHc4bFE3BZHC8dWJ for ; Wed, 23 Jul 2008 23:55:33 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAHTDh0h5LFxAiGdsb2JhbACSUQEBAQ8gnjU X-IronPort-AV: E=Sophos;i="4.31,244,1215354600"; d="scan'208";a="156543208" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 16:25:31 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLuDA-000725-8a; Thu, 24 Jul 2008 16:22:00 +1000 Date: Thu, 24 Jul 2008 16:22:00 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/2] kill xfs_lock_dir_and_entry Subject: Re: [PATCH 2/2] kill xfs_lock_dir_and_entry Message-ID: <20080724062200.GS6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080502105803.GC17870@lst.de> <20080520063639.GC8869@lst.de> <20080627130627.GC23431@lst.de> <20080723081315.GA3863@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723081315.GA3863@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216882534 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.701 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17126 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:13:15AM +0200, Christoph Hellwig wrote: > ping^3 - this time for real :) > > On Fri, Jun 27, 2008 at 03:06:27PM +0200, Christoph Hellwig wrote: > > ping^2 > > > > On Tue, May 20, 2008 at 08:36:39AM +0200, Christoph Hellwig wrote: > > > ping? > > > > > > On Fri, May 02, 2008 at 12:58:03PM +0200, Christoph Hellwig wrote: > > > > When multiple inodes are locked in XFS it happens in order of the inode > > > > number, with the everything but the first inode trylocked if any of > > > > the previous inodes is in the AIL. > > > > > > > > Except for the sorting of the inodes this logic is implemented in > > > > xfs_lock_inodes, but also partially duplicated in xfs_lock_dir_and_entry > > > > in a particularly stupid way adds a lock roundtrip if the inode ordering > > > > is not optimal. > > > > > > > > This patch adds a new helper xfs_lock_two_inodes that takes two inodes > > > > and locks them in the most optimal way according to the above locking > > > > protocol and uses it for all places that want to lock two inodes. > > > > > > > > The only caller of xfs_lock_inodes is xfs_rename which might lock up to > > > > four inodes. Looks good and passes xfsqa here.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 00:04:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 00:05:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O74u0U018766 for ; Thu, 24 Jul 2008 00:04:57 -0700 X-ASG-Debug-ID: 1216883166-450803820000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0C62AE91DD3 for ; Thu, 24 Jul 2008 00:06:07 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id DKzixzD7XmRGm6Bt for ; Thu, 24 Jul 2008 00:06:07 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCADHHh0h5LFxAiGdsb2JhbACSUQEBAQ8gnjY X-IronPort-AV: E=Sophos;i="4.31,245,1215354600"; d="scan'208";a="156549427" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 16:35:49 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLutS-00084v-98; Thu, 24 Jul 2008 17:05:42 +1000 Date: Thu, 24 Jul 2008 17:05:42 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] kill struct xfs_mount_args Subject: Re: [PATCH 2/4] kill struct xfs_mount_args Message-ID: <20080724070541.GT6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080525190741.GB13372@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190741.GB13372@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216883168 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.702 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17127 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sun, May 25, 2008 at 09:07:41PM +0200, Christoph Hellwig wrote: > No need to parse the mount option into a structure before applying it > to struct xfs_mount. > > The content of xfs_start_flags gets merged into xfs_parseargs. Calls > inbetween don't care and can use mount members instead of the args > struct. > > This patch uncovered that the mount option for shared filesystems wasn't > ever exposed on Linux. The code to handle it is #if 0'ed in this patch > pending a decision on this feature. I'll send a writeup about it to > the list soon. Overall is good - cleans up a lot of mess, but a couple of things need fixing: > @@ -228,7 +231,9 @@ xfs_parseargs( > this_char); > return EINVAL; > } > - strncpy(args->mtpt, value, MAXNAMELEN); > + *mtpt = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > + if (!*mtpt) > + return ENOMEM; It's a double ptr that dup'd the mtpt= value to successfully. we check we have a string, but it still count be a null string. > - if ((args->flags & XFSMNT_DMAPI) && *args->mtpt == '\0') { > + if ((mp->m_flags & XFS_MOUNT_DMAPI) && !mtpt) { Which means that check is not doing the same thing. Did you mean to check it was not a null string like the original code (i.e !**mtpt)? Also, a comment needs to be made in the function header that mtpt needs to be freed by the caller. > @@ -131,9 +130,11 @@ static struct xfs_qmops xfs_qmcore_stub > }; > > int > -xfs_qmops_get(struct xfs_mount *mp, struct xfs_mount_args *args) > +xfs_qmops_get(struct xfs_mount *mp) > { > - if (args->flags & (XFSMNT_UQUOTA | XFSMNT_PQUOTA | XFSMNT_GQUOTA)) { > + if (mp->m_qflags & (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > + XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > + XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) { > struct xfs_qmops *ops; > > ops = symbol_get(xfs_qmcore_xfs); I think *QUOTA_ACTIVE implies *QUOTA_ACCT. i.e. the quota can't be active if we are not accounting it. Hence I think this can be simplified to : if (XFS_IS_QUOTA_RUNNING(mp)) { Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 00:06:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 00:06:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O76OKK019297 for ; Thu, 24 Jul 2008 00:06:24 -0700 X-ASG-Debug-ID: 1216883254-0ba000f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AD42FE91E0F for ; Thu, 24 Jul 2008 00:07:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id J92VG8Au3irB718W for ; Thu, 24 Jul 2008 00:07:35 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCADHHh0h5LFxAiGdsb2JhbACSUQEBAQ8gnjY X-IronPort-AV: E=Sophos;i="4.31,245,1215354600"; d="scan'208";a="156550363" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 16:37:33 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLuvF-00087K-4p; Thu, 24 Jul 2008 17:07:33 +1000 Date: Thu, 24 Jul 2008 17:07:32 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/4] fix the noquota mount option Subject: Re: [PATCH 3/4] fix the noquota mount option Message-ID: <20080724070732.GU6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080525190750.GC13372@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190750.GC13372@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216883255 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0005 1.0000 -2.0176 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.702 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17128 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sun, May 25, 2008 at 09:07:50PM +0200, Christoph Hellwig wrote: > Noquota should clear all mount options, and not just user and group > quota. Probably doesn't matter very much in real life. ACK. I noticed this discrepency reviewing the previous patch and wondered about it. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 00:14:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 00:14:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O7EHF8021075 for ; Thu, 24 Jul 2008 00:14:18 -0700 X-ASG-Debug-ID: 1216883727-0b9f018e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 49031E93189 for ; Thu, 24 Jul 2008 00:15:27 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 327dAbE2TibWLc6H for ; Thu, 24 Jul 2008 00:15:27 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCADHHh0h5LFxAiGdsb2JhbACSUQEBAQ8gnjY X-IronPort-AV: E=Sophos;i="4.31,245,1215354600"; d="scan'208";a="156554541" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 16:45:25 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLv2q-0008Hd-PM; Thu, 24 Jul 2008 17:15:24 +1000 Date: Thu, 24 Jul 2008 17:15:19 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] fix biosize option Subject: Re: [PATCH 4/4] fix biosize option Message-ID: <20080724071519.GV6761@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080525190754.GD13372@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080525190754.GD13372@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216883728 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0209 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.702 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17129 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sun, May 25, 2008 at 09:07:54PM +0200, Christoph Hellwig wrote: > iosizelog shouldn't be the same as iosize but the logarithm of it. Then > again the current biosize option doesn't make much sense to me as it > doesn't set the preferred I/O size as mentioned in the comment next to That's a hold-over from irix - biosize set the basic chunk size the cache used for mapping writes, so was effectively the size of write to use to avoid RMW cycles as well as the unit of delayed allocation. > it but rather the allocation size and thus is identical to the allocsize > option (except for the missing logarithm). It's also not documented in > Documentation/filesystems/xfs.txt or the mount manpage. So when it was first added (probably for compatibility) the allocation part was noticed and not the rest. Maybe we should hook it up to xfs_preferred_iosize() rather than allocation now that it exists... Apart from that, yes it should be the logarithm, so ACK for this minor mod... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 00:42:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 00:42:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FUZZY_VPILL, J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O7gh2p027634 for ; Thu, 24 Jul 2008 00:42:44 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA09037; Thu, 24 Jul 2008 17:43:51 +1000 Message-ID: <48883402.2050905@sgi.com> Date: Thu, 24 Jul 2008 17:49:22 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 1/2] remove some easy bhv_vnode_t instances References: <20080723214741.GB10655@lst.de> <488819CC.5060100@sgi.com> <20080724063240.GC26938@lst.de> In-Reply-To: <20080724063240.GC26938@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17130 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > Thanks for the review. Bote that these patches need the 5 vnode helper > cleanup patches and '[PATCH] sanitize xfs_initialize_vnode' previously > applied. Yeah, found that out the hard way. > > On Thu, Jul 24, 2008 at 03:57:32PM +1000, Lachlan McIlroy wrote: >> All looks good to me. >> >> Christoph Hellwig wrote: >>> In various places we can just move a VFS_I call into the argument list >>> of called functions/macros instead of having a local bhv_vnode_t. >>> >>> >>> Signed-off-by: Christoph Hellwig >>> >>> Index: linux-2.6-xfs/fs/xfs/xfs_dfrag.c >>> =================================================================== >>> --- linux-2.6-xfs.orig/fs/xfs/xfs_dfrag.c 2008-07-23 >>> 22:25:42.000000000 +0200 >>> +++ linux-2.6-xfs/fs/xfs/xfs_dfrag.c 2008-07-23 22:26:16.000000000 +0200 >>> @@ -130,7 +130,6 @@ xfs_swap_extents( >>> xfs_mount_t *mp; >>> xfs_trans_t *tp; >>> xfs_bstat_t *sbp = &sxp->sx_stat; >>> - bhv_vnode_t *vp, *tvp; >>> xfs_ifork_t *tempifp, *ifp, *tifp; >>> int ilf_fields, tilf_fields; >>> static uint lock_flags = XFS_ILOCK_EXCL | XFS_IOLOCK_EXCL; >>> @@ -149,8 +148,6 @@ xfs_swap_extents( >>> } >>> >>> sbp = &sxp->sx_stat; >>> - vp = VFS_I(ip); >>> - tvp = VFS_I(tip); >>> >>> xfs_lock_two_inodes(ip, tip, lock_flags); >>> locked = 1; >>> @@ -174,7 +171,7 @@ xfs_swap_extents( >>> goto error0; >>> } >>> >>> - if (VN_CACHED(tvp) != 0) { >>> + if (VN_CACHED(VFS_I(tip)) != 0) { >>> xfs_inval_cached_trace(tip, 0, -1, 0, -1); >>> error = xfs_flushinval_pages(tip, 0, -1, >>> FI_REMAPF_LOCKED); >>> @@ -183,7 +180,7 @@ xfs_swap_extents( >>> } >>> >>> /* Verify O_DIRECT for ftmp */ >>> - if (VN_CACHED(tvp) != 0) { >>> + if (VN_CACHED(VFS_I(tip)) != 0) { >>> error = XFS_ERROR(EINVAL); >>> goto error0; >>> } >>> @@ -227,7 +224,7 @@ xfs_swap_extents( >>> * vop_read (or write in the case of autogrow) they block on the >>> iolock >>> * until we have switched the extents. >>> */ >>> - if (VN_MAPPED(vp)) { >>> + if (VN_MAPPED(VFS_I(ip))) { >>> error = XFS_ERROR(EBUSY); >>> goto error0; >>> } >>> Index: linux-2.6-xfs/fs/xfs/xfs_inode.c >>> =================================================================== >>> --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 >>> 22:22:20.000000000 +0200 >>> +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 22:29:36.000000000 +0200 >>> @@ -1397,7 +1397,6 @@ xfs_itruncate_start( >>> xfs_fsize_t last_byte; >>> xfs_off_t toss_start; >>> xfs_mount_t *mp; >>> - bhv_vnode_t *vp; >>> int error = 0; >>> >>> ASSERT(xfs_isilocked(ip, XFS_IOLOCK_EXCL)); >>> @@ -1406,7 +1405,6 @@ xfs_itruncate_start( >>> (flags == XFS_ITRUNC_MAYBE)); >>> >>> mp = ip->i_mount; >>> - vp = VFS_I(ip); >>> >>> /* wait for the completion of any pending DIOs */ >>> if (new_size < ip->i_size) >>> @@ -1455,7 +1453,7 @@ xfs_itruncate_start( >>> >>> #ifdef DEBUG >>> if (new_size == 0) { >>> - ASSERT(VN_CACHED(vp) == 0); >>> + ASSERT(VN_CACHED(VFS_I(ip)) == 0); >>> } >>> #endif >>> return error; >>> @@ -3421,7 +3419,6 @@ xfs_iflush_all( >>> xfs_mount_t *mp) >>> { >>> xfs_inode_t *ip; >>> - bhv_vnode_t *vp; >>> >>> again: >>> XFS_MOUNT_ILOCK(mp); >>> @@ -3436,14 +3433,13 @@ xfs_iflush_all( >>> continue; >>> } >>> >>> - vp = VFS_I(ip); >>> - if (!vp) { >>> + if (!VFS_I(ip)) { >>> XFS_MOUNT_IUNLOCK(mp); >>> xfs_finish_reclaim(ip, 0, XFS_IFLUSH_ASYNC); >>> goto again; >>> } >>> >>> - ASSERT(vn_count(vp) == 0); >>> + ASSERT(vn_count(VFS_I(ip)) == 0); >>> >>> ip = ip->i_mnext; >>> } while (ip != mp->m_inodes); >>> Index: linux-2.6-xfs/fs/xfs/xfs_itable.c >>> =================================================================== >>> --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-23 >>> 22:26:29.000000000 +0200 >>> +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-23 22:26:45.000000000 +0200 >>> @@ -59,7 +59,6 @@ xfs_bulkstat_one_iget( >>> { >>> xfs_icdinode_t *dic; /* dinode core info pointer */ >>> xfs_inode_t *ip; /* incore inode pointer */ >>> - bhv_vnode_t *vp; >>> int error; >>> >>> error = xfs_iget(mp, NULL, ino, >>> @@ -72,7 +71,6 @@ xfs_bulkstat_one_iget( >>> ASSERT(ip != NULL); >>> ASSERT(ip->i_blkno != (xfs_daddr_t)0); >>> >>> - vp = VFS_I(ip); >>> dic = &ip->i_d; >>> >>> /* xfs_iget returns the following without needing >>> @@ -85,7 +83,7 @@ xfs_bulkstat_one_iget( >>> buf->bs_uid = dic->di_uid; >>> buf->bs_gid = dic->di_gid; >>> buf->bs_size = dic->di_size; >>> - vn_atime_to_bstime(vp, &buf->bs_atime); >>> + vn_atime_to_bstime(VFS_I(ip), &buf->bs_atime); >>> buf->bs_mtime.tv_sec = dic->di_mtime.t_sec; >>> buf->bs_mtime.tv_nsec = dic->di_mtime.t_nsec; >>> buf->bs_ctime.tv_sec = dic->di_ctime.t_sec; >>> Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c >>> =================================================================== >>> --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 >>> 22:23:16.000000000 +0200 >>> +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 >>> 22:33:43.000000000 +0200 >>> @@ -1160,7 +1160,6 @@ int >>> xfs_release( >>> xfs_inode_t *ip) >>> { >>> - bhv_vnode_t *vp = VFS_I(ip); >>> xfs_mount_t *mp = ip->i_mount; >>> int error; >>> >>> @@ -1195,13 +1194,13 @@ xfs_release( >>> * be exposed to that problem. >>> */ >>> truncated = xfs_iflags_test_and_clear(ip, XFS_ITRUNCATED); >>> - if (truncated && VN_DIRTY(vp) && ip->i_delayed_blks > 0) >>> + if (truncated && VN_DIRTY(VFS_I(ip)) && ip->i_delayed_blks > >>> 0) >>> xfs_flush_pages(ip, 0, -1, XFS_B_ASYNC, FI_NONE); >>> } >>> >>> if (ip->i_d.di_nlink != 0) { >>> if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && >>> - ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || >>> + ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || >>> ip->i_delayed_blks > 0)) && >>> (ip->i_df.if_flags & XFS_IFEXTENTS)) && >>> (!(ip->i_d.di_flags & >>> @@ -1227,7 +1226,6 @@ int >>> xfs_inactive( >>> xfs_inode_t *ip) >>> { >>> - bhv_vnode_t *vp = VFS_I(ip); >>> xfs_bmap_free_t free_list; >>> xfs_fsblock_t first_block; >>> int committed; >>> @@ -1242,7 +1240,7 @@ xfs_inactive( >>> * If the inode is already free, then there can be nothing >>> * to clean up here. >>> */ >>> - if (ip->i_d.di_mode == 0 || VN_BAD(vp)) { >>> + if (ip->i_d.di_mode == 0 || VN_BAD(VFS_I(ip))) { >>> ASSERT(ip->i_df.if_real_bytes == 0); >>> ASSERT(ip->i_df.if_broot_bytes == 0); >>> return VN_INACTIVE_CACHE; >>> @@ -1272,7 +1270,7 @@ xfs_inactive( >>> >>> if (ip->i_d.di_nlink != 0) { >>> if ((((ip->i_d.di_mode & S_IFMT) == S_IFREG) && >>> - ((ip->i_size > 0) || (VN_CACHED(vp) > 0 || >>> + ((ip->i_size > 0) || (VN_CACHED(VFS_I(ip)) > 0 || >>> ip->i_delayed_blks > 0)) && >>> (ip->i_df.if_flags & XFS_IFEXTENTS) && >>> (!(ip->i_d.di_flags & >>> @@ -2793,14 +2791,13 @@ int >>> xfs_reclaim( >>> xfs_inode_t *ip) >>> { >>> - bhv_vnode_t *vp = VFS_I(ip); >>> >>> xfs_itrace_entry(ip); >>> >>> - ASSERT(!VN_MAPPED(vp)); >>> + ASSERT(!VN_MAPPED(VFS_I(ip))); >>> >>> /* bad inode, get out here ASAP */ >>> - if (VN_BAD(vp)) { >>> + if (VN_BAD(VFS_I(ip))) { >>> xfs_ireclaim(ip); >>> return 0; >>> } >>> @@ -2837,7 +2834,7 @@ xfs_reclaim( >>> XFS_MOUNT_ILOCK(mp); >>> spin_lock(&ip->i_flags_lock); >>> __xfs_iflags_set(ip, XFS_IRECLAIMABLE); >>> - vp->i_private = NULL; >>> + VFS_I(ip)->i_private = NULL; >>> ip->i_vnode = NULL; >>> spin_unlock(&ip->i_flags_lock); >>> list_add_tail(&ip->i_reclaim, &mp->m_del_inodes); >>> @@ -3241,7 +3238,6 @@ xfs_free_file_space( >>> xfs_off_t len, >>> int attr_flags) >>> { >>> - bhv_vnode_t *vp; >>> int committed; >>> int done; >>> xfs_off_t end_dmi_offset; >>> @@ -3261,7 +3257,6 @@ xfs_free_file_space( >>> xfs_trans_t *tp; >>> int need_iolock = 1; >>> >>> - vp = VFS_I(ip); >>> mp = ip->i_mount; >>> >>> xfs_itrace_entry(ip); >>> @@ -3298,7 +3293,7 @@ xfs_free_file_space( >>> rounding = max_t(uint, 1 << mp->m_sb.sb_blocklog, PAGE_CACHE_SIZE); >>> ioffset = offset & ~(rounding - 1); >>> >>> - if (VN_CACHED(vp) != 0) { >>> + if (VN_CACHED(VFS_I(ip)) != 0) { >>> xfs_inval_cached_trace(ip, ioffset, -1, ioffset, -1); >>> error = xfs_flushinval_pages(ip, ioffset, -1, >>> FI_REMAPF_LOCKED); >>> if (error) >>> Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c >>> =================================================================== >>> --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-23 >>> 22:28:36.000000000 +0200 >>> +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-23 22:33:43.000000000 +0200 >>> @@ -127,7 +127,6 @@ xfs_unmount_flush( >>> xfs_inode_t *rip = mp->m_rootip; >>> xfs_inode_t *rbmip; >>> xfs_inode_t *rsumip = NULL; >>> - bhv_vnode_t *rvp = VFS_I(rip); >>> int error; >>> >>> xfs_ilock(rip, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); >>> @@ -166,7 +165,7 @@ xfs_unmount_flush( >>> if (error == EFSCORRUPTED) >>> goto fscorrupt_out2; >>> >>> - if (vn_count(rvp) != 1 && !relocation) { >>> + if (vn_count(VFS_I(rip)) != 1 && !relocation) { >>> xfs_iunlock(rip, XFS_ILOCK_EXCL); >>> return XFS_ERROR(EBUSY); >>> } >>> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c >>> =================================================================== >>> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 >>> 22:33:47.000000000 +0200 >>> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 >>> 22:33:54.000000000 +0200 >>> @@ -922,12 +922,7 @@ STATIC struct inode * >>> xfs_fs_alloc_inode( >>> struct super_block *sb) >>> { >>> - bhv_vnode_t *vp; >>> - >>> - vp = kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); >>> - if (unlikely(!vp)) >>> - return NULL; >>> - return vp; >>> + return kmem_zone_alloc(xfs_vnode_zone, KM_SLEEP); >>> } >>> >>> STATIC void >>> >>> >>> > ---end quoted text--- > > > From owner-xfs@oss.sgi.com Thu Jul 24 00:51:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 00:51:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O7p463028482 for ; Thu, 24 Jul 2008 00:51:06 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA09252; Thu, 24 Jul 2008 17:52:12 +1000 Message-ID: <488835F7.3040007@sgi.com> Date: Thu, 24 Jul 2008 17:57:43 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 1/5] kill vn_from_inode References: <20080723194934.GB6188@lst.de> In-Reply-To: <20080723194934.GB6188@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17131 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Yep, good stuff. Christoph Hellwig wrote: > bhv_vnode_t is just a typedef for struct inode, so there's no need for > a helper to convert between the two. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:29:16.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-23 19:29:22.000000000 +0200 > @@ -994,7 +994,7 @@ STATIC void > xfs_fs_destroy_inode( > struct inode *inode) > { > - kmem_zone_free(xfs_vnode_zone, vn_from_inode(inode)); > + kmem_zone_free(xfs_vnode_zone, inode); > } > > STATIC void > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:29:26.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_vnode.h 2008-07-23 19:29:52.000000000 +0200 > @@ -27,10 +27,6 @@ typedef struct inode bhv_vnode_t; > /* > * Vnode to Linux inode mapping. > */ > -static inline bhv_vnode_t *vn_from_inode(struct inode *inode) > -{ > - return inode; > -} > static inline struct inode *vn_to_inode(bhv_vnode_t *vnode) > { > return vnode; > @@ -100,8 +96,7 @@ extern bhv_vnode_t *vn_hold(bhv_vnode_t > > static inline bhv_vnode_t *vn_grab(bhv_vnode_t *vp) > { > - struct inode *inode = igrab(vn_to_inode(vp)); > - return inode ? vn_from_inode(inode) : NULL; > + return igrab(vn_to_inode(vp)); > } > > /* > > > From owner-xfs@oss.sgi.com Thu Jul 24 01:06:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:06:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6O86R4i029919 for ; Thu, 24 Jul 2008 01:06:27 -0700 X-ASG-Debug-ID: 1216886856-3f9b01670000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D4DD931FD76 for ; Thu, 24 Jul 2008 01:07:37 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Cf9TOO8K15C7NCYj for ; Thu, 24 Jul 2008 01:07:37 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6O87RNg031673 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Jul 2008 10:07:27 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6O87RgB031671; Thu, 24 Jul 2008 10:07:27 +0200 Date: Thu, 24 Jul 2008 10:07:27 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 5/5] implement IHOLD/IRELE directly Subject: Re: [PATCH 5/5] implement IHOLD/IRELE directly Message-ID: <20080724080727.GA31612@lst.de> References: <20080723194950.GF6188@lst.de> <20080723225548.GO6761@disturbed> <20080724062220.GB26938@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080724062220.GB26938@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216886858 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.705 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17132 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 08:22:20AM +0200, Christoph Hellwig wrote: > Makes sense, updated patch below. (Half-way through xfsqa with a debug > kernel so far) xfsqa passed fine with this patch applied. From owner-xfs@oss.sgi.com Thu Jul 24 01:14:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:14:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O8EqmP031086 for ; Thu, 24 Jul 2008 01:14:53 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA10187; Thu, 24 Jul 2008 18:16:00 +1000 Message-ID: <48883B8B.9090802@sgi.com> Date: Thu, 24 Jul 2008 18:21:31 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.14 (X11/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 5/5] implement IHOLD/IRELE directly References: <20080723194950.GF6188@lst.de> <20080723225548.GO6761@disturbed> <20080724062220.GB26938@lst.de> <20080724080727.GA31612@lst.de> In-Reply-To: <20080724080727.GA31612@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17133 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Thu, Jul 24, 2008 at 08:22:20AM +0200, Christoph Hellwig wrote: >> Makes sense, updated patch below. (Half-way through xfsqa with a debug >> kernel so far) > > xfsqa passed fine with this patch applied. > Great. All five patches look good to me. I'll get them into the tree tomorrow. From owner-xfs@oss.sgi.com Thu Jul 24 01:15:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:15:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_83, SUBJ_FRIEND autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O8FJEY031297 for ; Thu, 24 Jul 2008 01:15:20 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA10211; Thu, 24 Jul 2008 18:16:28 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 6EB3558C4C3F; Thu, 24 Jul 2008 18:16:28 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove INT_GET and friends Message-Id: <20080724081628.6EB3558C4C3F@chook.melbourne.sgi.com> Date: Thu, 24 Jul 2008 18:16:28 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17134 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs remove INT_GET and friends Thanks to hch's endian work, INT_GET etc are no longer used, and may as well be removed. INT_SET is still used in the acl code, though. Signed-off-by: Eric Sandeen Date: Thu Jul 24 18:15:32 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: esandeen,hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31756a fs/xfs/xfs_arch.h - 1.53 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_arch.h.diff?r1=text&tr1=1.53&r2=text&tr2=1.52&f=h From owner-xfs@oss.sgi.com Thu Jul 24 01:15:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:15:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,SUBJ_FRIEND autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O8FYOH031481 for ; Thu, 24 Jul 2008 01:15:35 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA10223; Thu, 24 Jul 2008 18:16:42 +1000 From: Niv Sardi To: Eric Sandeen Cc: xfs-oss Subject: Re: [PATCH] remove INT_GET and friends References: <47FF794C.4020801@sandeen.net> Date: Thu, 24 Jul 2008 18:16:35 +1000 In-Reply-To: <47FF794C.4020801@sandeen.net> (Eric Sandeen's message of "Fri, 11 Apr 2008 09:44:28 -0500") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17135 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs in -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 24 01:19:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:20:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O8JvQ7032417 for ; Thu, 24 Jul 2008 01:19:58 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA10570; Thu, 24 Jul 2008 18:21:06 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 10A7958C4C3F; Thu, 24 Jul 2008 18:21:05 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - convert xfs to use ERR_CAST Message-Id: <20080724082106.10A7958C4C3F@chook.melbourne.sgi.com> Date: Thu, 24 Jul 2008 18:21:05 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17136 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs convert xfs to use ERR_CAST Looks like somehow xfs got missed in the conversion that took place in e231c2ee64eb1c5cd3c63c31da9dac7d888dcf7f, "Convert ERR_PTR(PTR_ERR(p)) instances to ERR_CAST(p) " Signed-off-by: Eric Sandeen Acked-by: David Howells Date: Thu Jul 24 18:20:25 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: esandeen,dhowells@redhat.com,hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31757a fs/xfs/linux-2.6/xfs_export.c - 1.26 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_export.c.diff?r1=text&tr1=1.26&r2=text&tr2=1.25&f=h From owner-xfs@oss.sgi.com Thu Jul 24 01:20:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:20:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O8K9g9032504 for ; Thu, 24 Jul 2008 01:20:10 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA10573; Thu, 24 Jul 2008 18:21:16 +1000 From: Niv Sardi To: Eric Sandeen Cc: xfs mailing list , David Howells Subject: Re: [PATCH] convert xfs to use ERR_CAST References: <480FA737.5030001@sandeen.net> Date: Thu, 24 Jul 2008 18:21:09 +1000 In-Reply-To: <480FA737.5030001@sandeen.net> (Eric Sandeen's message of "Wed, 23 Apr 2008 16:16:39 -0500") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17137 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs in -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 24 01:23:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:23:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O8NpB6000824 for ; Thu, 24 Jul 2008 01:23:51 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA10728; Thu, 24 Jul 2008 18:25:00 +1000 From: Niv Sardi To: Eric Sandeen Cc: xfs-oss Subject: Re: [PATCH] remove shouting-indirection macros from xfs_trans.h References: <4872DEF8.6060704@sandeen.net> Date: Thu, 24 Jul 2008 18:24:54 +1000 In-Reply-To: <4872DEF8.6060704@sandeen.net> (Eric Sandeen's message of "Mon, 07 Jul 2008 22:28:56 -0500") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17138 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs looks good putting it in -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 24 01:24:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 01:24:32 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6O8OQXj001143 for ; Thu, 24 Jul 2008 01:24:27 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA10759; Thu, 24 Jul 2008 18:25:35 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 694A758C4C3F; Thu, 24 Jul 2008 18:25:35 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove shouting-indirection macros from xfs_trans.h Message-Id: <20080724082535.694A758C4C3F@chook.melbourne.sgi.com> Date: Thu, 24 Jul 2008 18:25:35 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17139 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs remove shouting-indirection macros from xfs_trans.h compile-tested, fairly easy to inspect with: quilt diff --diff="diff -iu" Signed-off-by: Eric Sandeen Date: Thu Jul 24 18:24:36 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: esandeen,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31758a fs/xfs/xfsidbg.c - 1.355 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.355&r2=text&tr2=1.354&f=h fs/xfs/xfs_trans_item.c - 1.48 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans_item.c.diff?r1=text&tr1=1.48&r2=text&tr2=1.47&f=h fs/xfs/xfs_trans.c - 1.187 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.c.diff?r1=text&tr1=1.187&r2=text&tr2=1.186&f=h fs/xfs/xfs_trans.h - 1.151 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans.h.diff?r1=text&tr1=1.151&r2=text&tr2=1.150&f=h fs/xfs/xfs_bmap.c - 1.397 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.397&r2=text&tr2=1.396&f=h fs/xfs/xfs_trans_buf.c - 1.131 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_trans_buf.c.diff?r1=text&tr1=1.131&r2=text&tr2=1.130&f=h From owner-xfs@oss.sgi.com Thu Jul 24 04:40:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 04:40:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6OBeh9k019301 for ; Thu, 24 Jul 2008 04:40:46 -0700 X-ASG-Debug-ID: 1216899712-0ae6010b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4C1CD327E49 for ; Thu, 24 Jul 2008 04:41:52 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id JHl8Us8swYqmDnvh for ; Thu, 24 Jul 2008 04:41:52 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAHcGiEh5LFxAiGdsb2JhbACSUwEBAQ8gnko X-IronPort-AV: E=Sophos;i="4.31,246,1215354600"; d="scan'208";a="156686320" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 21:11:50 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLzCP-0005da-8R; Thu, 24 Jul 2008 21:41:33 +1000 Date: Thu, 24 Jul 2008 21:41:28 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: xfs-dev , xfs-oss X-ASG-Orig-Subj: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks Subject: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks Message-ID: <20080724114128.GW6761@disturbed> Mail-Followup-To: Lachlan McIlroy , xfs-dev , xfs-oss References: <48857EFB.3030301@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48857EFB.3030301@sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216899714 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.718 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17140 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 22, 2008 at 04:32:27PM +1000, Lachlan McIlroy wrote: > This changes xfs_inode_item_push() to use XFS_IFLUSH_ASYNC_NOBLOCK when > flushing an inode so the flush wont block on inode cluster buffer lock. > Also change the prototype of the IOP_PUSH operation so that xfsaild_push() > can bump it's stuck count. > > This change was prompted by a deadlock that would only occur on a debug > XFS where a thread creating an inode had the buffer locked and was trying > to allocate space for the inode tracing facility. That recursed back into > the filesystem to flush data which created a transaction and needed log > space which wasn't available. A quick question - shouldn't the allocation use KM_NOFS if it being called in place that would cause recursion? Anywhere the inode tracing is called with a an inode lock held outside a transaction will also be suseptible to this deadlock. Also, there is the possibility that aborting writeback from the AIL in this manner could cause stalls or deadlocks if this item is at the of the log and it doesn't get written back straight away and the trigger thread then goes to sleep waiting for the tail to move. In that case, everything subsequent transaction will then go to sleep without trying to push the log and only the watchdog timeout on aild will get things moving again. So to fix a deadlock in debug code, I don't think we want to change the flush semantics of the AIL push on inodes for production code. Prevent the debug tracing code from recursing, instead.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 04:45:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 04:45:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6OBj7g4019883 for ; Thu, 24 Jul 2008 04:45:07 -0700 X-ASG-Debug-ID: 1216899977-798c023d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C7E48328358 for ; Thu, 24 Jul 2008 04:46:18 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id DP3lpiYVKE1FHibD for ; Thu, 24 Jul 2008 04:46:18 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhYCAHcGiEh5LFxAiGdsb2JhbACSUwEBAQ8gnko X-IronPort-AV: E=Sophos;i="4.31,246,1215354600"; d="scan'208";a="156688321" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 24 Jul 2008 21:16:17 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KLzGs-0005jx-Ss; Thu, 24 Jul 2008 21:46:10 +1000 Date: Thu, 24 Jul 2008 21:46:10 +1000 From: Dave Chinner To: Christoph Hellwig Cc: Mark Goodwin , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Message-ID: <20080724114610.GX6761@disturbed> Mail-Followup-To: Christoph Hellwig , Mark Goodwin , xfs@oss.sgi.com References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <20080723204927.GB8421@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723204927.GB8421@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216899978 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.718 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17141 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 04:49:27PM -0400, Christoph Hellwig wrote: > Btw, does anyone have recent gcov data for XFS? Last time I checked (not recent) xfsqa covered about 70% of XFS with default mkfs and mount options. The code has changed a lot since then and there's been quite a few additional tests added, so I've got no idea right now... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 10:58:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 10:58:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6OHwAJ2016825 for ; Thu, 24 Jul 2008 10:58:12 -0700 X-ASG-Debug-ID: 1216922360-041202800000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 14CE21922835 for ; Thu, 24 Jul 2008 10:59:20 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id CReOKg7sbFLQ6BW3 for ; Thu, 24 Jul 2008 10:59:20 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KM55t-0000Rc-7L; Thu, 24 Jul 2008 17:59:13 +0000 Date: Thu, 24 Jul 2008 13:59:13 -0400 From: Christoph Hellwig To: Nick Piggin Cc: hifumi.hisashi@oss.ntt.co.jp, jack@ucw.cz, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: partially uptodate page reads Subject: Re: partially uptodate page reads Message-ID: <20080724175913.GA32117@infradead.org> References: <200807250117.11331.nickpiggin@yahoo.com.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200807250117.11331.nickpiggin@yahoo.com.au> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216922361 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.745 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17142 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Fri, Jul 25, 2008 at 01:17:11AM +1000, Nick Piggin wrote: > Hi, I have some questions about your patch in -mm > > vfs-pagecache-usage-optimization-onpagesize=blocksize-environment.patch > > I have no particular problem with something like this, but leaving the > implementation details aside for the moment, can we discuss the > justification for this? > > Are there significant numbers of people using block size < page size in > situations where performance is important and significantly improved by > this patch? Can you give any performance numbers to illustrate perhaps? With XFS lots of people use 4k blocksize filesystems on ia64 systems with 16k pages, so an optimization like this would be useful. But as mentioned in one of your previous comments I'd rather prefer a readpage interface chaneg to deal with this. From owner-xfs@oss.sgi.com Thu Jul 24 12:08:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 12:08:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6OJ83sA021230 for ; Thu, 24 Jul 2008 12:08:04 -0700 X-ASG-Debug-ID: 1216926554-53da03510000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id F052919230C4 for ; Thu, 24 Jul 2008 12:09:14 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id B4Qs9GSJHzk8mncH for ; Thu, 24 Jul 2008 12:09:14 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m6OJ8g1I015032 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 24 Jul 2008 12:08:43 -0700 Received: from y.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m6OJ8fWY000381; Thu, 24 Jul 2008 12:08:41 -0700 Date: Thu, 24 Jul 2008 12:08:41 -0700 From: Andrew Morton To: Christoph Hellwig Cc: Nick Piggin , hifumi.hisashi@oss.ntt.co.jp, jack@ucw.cz, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: partially uptodate page reads Subject: Re: partially uptodate page reads Message-Id: <20080724120841.81c72be9.akpm@linux-foundation.org> In-Reply-To: <20080724175913.GA32117@infradead.org> References: <200807250117.11331.nickpiggin@yahoo.com.au> <20080724175913.GA32117@infradead.org> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1216926554 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.748 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17143 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Thu, 24 Jul 2008 13:59:13 -0400 Christoph Hellwig wrote: > On Fri, Jul 25, 2008 at 01:17:11AM +1000, Nick Piggin wrote: > > Hi, I have some questions about your patch in -mm > > > > vfs-pagecache-usage-optimization-onpagesize=blocksize-environment.patch > > > > I have no particular problem with something like this, but leaving the > > implementation details aside for the moment, can we discuss the > > justification for this? > > > > Are there significant numbers of people using block size < page size in > > situations where performance is important and significantly improved by > > this patch? Can you give any performance numbers to illustrate perhaps? > > With XFS lots of people use 4k blocksize filesystems on ia64 systems > with 16k pages, so an optimization like this would be useful. As Nick says, we really should have some measurement results which confirm this theory. Maybe we did do some but they didn't find theor way into the changelog. I've put the patch on hold until this confirmation data is available. > But as mentioned in one of your previous comments I'd rather prefer > a readpage interface chaneg to deal with this. From owner-xfs@oss.sgi.com Thu Jul 24 12:52:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 12:52:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_54, J_CHICKENPOX_75 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6OJqYA1028738 for ; Thu, 24 Jul 2008 12:52:34 -0700 X-ASG-Debug-ID: 1216929218-75d101410000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3FE1EE98146 for ; Thu, 24 Jul 2008 12:53:41 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id W3z9GADdGYRDjQqD for ; Thu, 24 Jul 2008 12:53:41 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6OJrRNg003101 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Jul 2008 21:53:27 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6OJrRVQ003099; Thu, 24 Jul 2008 21:53:27 +0200 Date: Thu, 24 Jul 2008 21:53:27 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] kill struct xfs_mount_args Subject: Re: [PATCH 2/4] kill struct xfs_mount_args Message-ID: <20080724195327.GA2962@lst.de> References: <20080525190741.GB13372@lst.de> <20080724070541.GT6761@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080724070541.GT6761@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216929224 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.751 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17144 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 05:05:42PM +1000, Dave Chinner wrote: > > @@ -228,7 +231,9 @@ xfs_parseargs( > > this_char); > > return EINVAL; > > } > > - strncpy(args->mtpt, value, MAXNAMELEN); > > + *mtpt = kstrndup(value, MAXNAMELEN, GFP_KERNEL); > > + if (!*mtpt) > > + return ENOMEM; > > It's a double ptr that dup'd the mtpt= value to successfully. > we check we have a string, but it still count be a null string. > > > - if ((args->flags & XFSMNT_DMAPI) && *args->mtpt == '\0') { > > + if ((mp->m_flags & XFS_MOUNT_DMAPI) && !mtpt) { > > Which means that check is not doing the same thing. Did you mean > to check it was not a null string like the original code > (i.e !**mtpt)? I've updated the patch to do the same check as the original code. > Also, a comment needs to be made in the function header that mtpt > needs to be freed by the caller. I think the deviced name allocatiosn comment covers it. And I don't want to comment this too broadly as it's stuff that shouldn't even exist in mainline strictly speaking.. > > + if (mp->m_qflags & (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | > > + XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | > > + XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE)) { > > struct xfs_qmops *ops; > > > > ops = symbol_get(xfs_qmcore_xfs); > > I think *QUOTA_ACTIVE implies *QUOTA_ACCT. i.e. the quota can't > be active if we are not accounting it. Hence I think this can > be simplified to : > > if (XFS_IS_QUOTA_RUNNING(mp)) { I just did a 1:1 conversion to check exactly what was there before. But XFS_IS_QUOTA_RUNNING is indeed much nicer and I've updated the patch to use it. Updated patch below: Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-24 08:30:24.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-24 10:14:28.000000000 +0200 @@ -18,7 +18,6 @@ #include "xfs.h" #include "xfs_bit.h" #include "xfs_log.h" -#include "xfs_clnt.h" #include "xfs_inum.h" #include "xfs_trans.h" #include "xfs_sb.h" @@ -74,32 +73,6 @@ static kmem_zone_t *xfs_vnode_zone; static kmem_zone_t *xfs_ioend_zone; mempool_t *xfs_ioend_pool; -STATIC struct xfs_mount_args * -xfs_args_allocate( - struct super_block *sb, - int silent) -{ - struct xfs_mount_args *args; - - args = kzalloc(sizeof(struct xfs_mount_args), GFP_KERNEL); - if (!args) - return NULL; - - args->logbufs = args->logbufsize = -1; - strncpy(args->fsname, sb->s_id, MAXNAMELEN); - - /* Copy the already-parsed mount(2) flags we're interested in */ - if (sb->s_flags & MS_DIRSYNC) - args->flags |= XFSMNT_DIRSYNC; - if (sb->s_flags & MS_SYNCHRONOUS) - args->flags |= XFSMNT_WSYNC; - if (silent) - args->flags |= XFSMNT_QUIET; - args->flags |= XFSMNT_32BITINODES; - - return args; -} - #define MNTOPT_LOGBUFS "logbufs" /* number of XFS log buffers */ #define MNTOPT_LOGBSIZE "logbsize" /* size of XFS log buffers */ #define MNTOPT_LOGDEV "logdev" /* log device */ @@ -188,26 +161,54 @@ suffix_strtoul(char *s, char **endp, uns return simple_strtoul((const char *)s, endp, base) << shift_left_factor; } +/* + * This function fills in xfs_mount_t fields based on mount args. + * Note: the superblock has _not_ yet been read in. + * + * Note that this function leaks the various device name allocations on + * failure. The caller takes care of them. + */ STATIC int xfs_parseargs( struct xfs_mount *mp, char *options, - struct xfs_mount_args *args, - int update) + char **mtpt) { + struct super_block *sb = mp->m_super; char *this_char, *value, *eov; - int dsunit, dswidth, vol_dsunit, vol_dswidth; - int iosize; + int dsunit = 0; + int dswidth = 0; + int iosize = 0; int dmapi_implies_ikeep = 1; + uchar_t iosizelog = 0; - args->flags |= XFSMNT_BARRIER; - args->flags2 |= XFSMNT2_COMPAT_IOSIZE; + /* + * Copy binary VFS mount flags we are interested in. + */ + if (sb->s_flags & MS_RDONLY) + mp->m_flags |= XFS_MOUNT_RDONLY; + if (sb->s_flags & MS_DIRSYNC) + mp->m_flags |= XFS_MOUNT_DIRSYNC; + if (sb->s_flags & MS_SYNCHRONOUS) + mp->m_flags |= XFS_MOUNT_WSYNC; + + /* + * Set some default flags that could be cleared by the mount option + * parsing. + */ + mp->m_flags |= XFS_MOUNT_BARRIER; + mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; + mp->m_flags |= XFS_MOUNT_SMALL_INUMS; + + /* + * These can be overridden by the mount option parsing. + */ + mp->m_logbufs = -1; + mp->m_logbsize = -1; if (!options) goto done; - iosize = dsunit = dswidth = vol_dsunit = vol_dswidth = 0; - while ((this_char = strsep(&options, ",")) != NULL) { if (!*this_char) continue; @@ -221,7 +222,7 @@ xfs_parseargs( this_char); return EINVAL; } - args->logbufs = simple_strtoul(value, &eov, 10); + mp->m_logbufs = simple_strtoul(value, &eov, 10); } else if (!strcmp(this_char, MNTOPT_LOGBSIZE)) { if (!value || !*value) { cmn_err(CE_WARN, @@ -229,7 +230,7 @@ xfs_parseargs( this_char); return EINVAL; } - args->logbufsize = suffix_strtoul(value, &eov, 10); + mp->m_logbsize = suffix_strtoul(value, &eov, 10); } else if (!strcmp(this_char, MNTOPT_LOGDEV)) { if (!value || !*value) { cmn_err(CE_WARN, @@ -237,7 +238,9 @@ xfs_parseargs( this_char); return EINVAL; } - strncpy(args->logname, value, MAXNAMELEN); + mp->m_logname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + if (!mp->m_logname) + return ENOMEM; } else if (!strcmp(this_char, MNTOPT_MTPT)) { if (!value || !*value) { cmn_err(CE_WARN, @@ -245,7 +248,9 @@ xfs_parseargs( this_char); return EINVAL; } - strncpy(args->mtpt, value, MAXNAMELEN); + *mtpt = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + if (!*mtpt) + return ENOMEM; } else if (!strcmp(this_char, MNTOPT_RTDEV)) { if (!value || !*value) { cmn_err(CE_WARN, @@ -253,7 +258,9 @@ xfs_parseargs( this_char); return EINVAL; } - strncpy(args->rtname, value, MAXNAMELEN); + mp->m_rtname = kstrndup(value, MAXNAMELEN, GFP_KERNEL); + if (!mp->m_rtname) + return ENOMEM; } else if (!strcmp(this_char, MNTOPT_BIOSIZE)) { if (!value || !*value) { cmn_err(CE_WARN, @@ -262,8 +269,7 @@ xfs_parseargs( return EINVAL; } iosize = simple_strtoul(value, &eov, 10); - args->flags |= XFSMNT_IOSIZE; - args->iosizelog = (uint8_t) iosize; + iosizelog = (uint8_t) iosize; } else if (!strcmp(this_char, MNTOPT_ALLOCSIZE)) { if (!value || !*value) { cmn_err(CE_WARN, @@ -272,8 +278,7 @@ xfs_parseargs( return EINVAL; } iosize = suffix_strtoul(value, &eov, 10); - args->flags |= XFSMNT_IOSIZE; - args->iosizelog = ffs(iosize) - 1; + iosizelog = ffs(iosize) - 1; } else if (!strcmp(this_char, MNTOPT_GRPID) || !strcmp(this_char, MNTOPT_BSDGROUPS)) { mp->m_flags |= XFS_MOUNT_GRPID; @@ -281,23 +286,25 @@ xfs_parseargs( !strcmp(this_char, MNTOPT_SYSVGROUPS)) { mp->m_flags &= ~XFS_MOUNT_GRPID; } else if (!strcmp(this_char, MNTOPT_WSYNC)) { - args->flags |= XFSMNT_WSYNC; + mp->m_flags |= XFS_MOUNT_WSYNC; } else if (!strcmp(this_char, MNTOPT_OSYNCISOSYNC)) { - args->flags |= XFSMNT_OSYNCISOSYNC; + mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; } else if (!strcmp(this_char, MNTOPT_NORECOVERY)) { - args->flags |= XFSMNT_NORECOVERY; + mp->m_flags |= XFS_MOUNT_NORECOVERY; } else if (!strcmp(this_char, MNTOPT_INO64)) { - args->flags |= XFSMNT_INO64; -#if !XFS_BIG_INUMS +#if XFS_BIG_INUMS + mp->m_flags |= XFS_MOUNT_INO64; + mp->m_inoadd = XFS_INO64_OFFSET; +#else cmn_err(CE_WARN, "XFS: %s option not allowed on this system", this_char); return EINVAL; #endif } else if (!strcmp(this_char, MNTOPT_NOALIGN)) { - args->flags |= XFSMNT_NOALIGN; + mp->m_flags |= XFS_MOUNT_NOALIGN; } else if (!strcmp(this_char, MNTOPT_SWALLOC)) { - args->flags |= XFSMNT_SWALLOC; + mp->m_flags |= XFS_MOUNT_SWALLOC; } else if (!strcmp(this_char, MNTOPT_SUNIT)) { if (!value || !*value) { cmn_err(CE_WARN, @@ -315,7 +322,7 @@ xfs_parseargs( } dswidth = simple_strtoul(value, &eov, 10); } else if (!strcmp(this_char, MNTOPT_64BITINODE)) { - args->flags &= ~XFSMNT_32BITINODES; + mp->m_flags &= ~XFS_MOUNT_SMALL_INUMS; #if !XFS_BIG_INUMS cmn_err(CE_WARN, "XFS: %s option not allowed on this system", @@ -323,56 +330,60 @@ xfs_parseargs( return EINVAL; #endif } else if (!strcmp(this_char, MNTOPT_NOUUID)) { - args->flags |= XFSMNT_NOUUID; + mp->m_flags |= XFS_MOUNT_NOUUID; } else if (!strcmp(this_char, MNTOPT_BARRIER)) { - args->flags |= XFSMNT_BARRIER; + mp->m_flags |= XFS_MOUNT_BARRIER; } else if (!strcmp(this_char, MNTOPT_NOBARRIER)) { - args->flags &= ~XFSMNT_BARRIER; + mp->m_flags &= ~XFS_MOUNT_BARRIER; } else if (!strcmp(this_char, MNTOPT_IKEEP)) { - args->flags |= XFSMNT_IKEEP; + mp->m_flags |= XFS_MOUNT_IKEEP; } else if (!strcmp(this_char, MNTOPT_NOIKEEP)) { dmapi_implies_ikeep = 0; - args->flags &= ~XFSMNT_IKEEP; + mp->m_flags &= ~XFS_MOUNT_IKEEP; } else if (!strcmp(this_char, MNTOPT_LARGEIO)) { - args->flags2 &= ~XFSMNT2_COMPAT_IOSIZE; + mp->m_flags &= ~XFS_MOUNT_COMPAT_IOSIZE; } else if (!strcmp(this_char, MNTOPT_NOLARGEIO)) { - args->flags2 |= XFSMNT2_COMPAT_IOSIZE; + mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; } else if (!strcmp(this_char, MNTOPT_ATTR2)) { - args->flags |= XFSMNT_ATTR2; + mp->m_flags |= XFS_MOUNT_ATTR2; } else if (!strcmp(this_char, MNTOPT_NOATTR2)) { - args->flags &= ~XFSMNT_ATTR2; - args->flags |= XFSMNT_NOATTR2; + mp->m_flags &= ~XFS_MOUNT_ATTR2; + mp->m_flags |= XFS_MOUNT_NOATTR2; } else if (!strcmp(this_char, MNTOPT_FILESTREAM)) { - args->flags2 |= XFSMNT2_FILESTREAMS; + mp->m_flags |= XFS_MOUNT_FILESTREAMS; } else if (!strcmp(this_char, MNTOPT_NOQUOTA)) { - args->flags &= ~(XFSMNT_UQUOTAENF|XFSMNT_UQUOTA); - args->flags &= ~(XFSMNT_GQUOTAENF|XFSMNT_GQUOTA); + mp->m_qflags &= ~(XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | + XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | + XFS_UQUOTA_ENFD | XFS_OQUOTA_ENFD); } else if (!strcmp(this_char, MNTOPT_QUOTA) || !strcmp(this_char, MNTOPT_UQUOTA) || !strcmp(this_char, MNTOPT_USRQUOTA)) { - args->flags |= XFSMNT_UQUOTA | XFSMNT_UQUOTAENF; + mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE | + XFS_UQUOTA_ENFD); } else if (!strcmp(this_char, MNTOPT_QUOTANOENF) || !strcmp(this_char, MNTOPT_UQUOTANOENF)) { - args->flags |= XFSMNT_UQUOTA; - args->flags &= ~XFSMNT_UQUOTAENF; + mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); + mp->m_qflags &= ~XFS_UQUOTA_ENFD; } else if (!strcmp(this_char, MNTOPT_PQUOTA) || !strcmp(this_char, MNTOPT_PRJQUOTA)) { - args->flags |= XFSMNT_PQUOTA | XFSMNT_PQUOTAENF; + mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE | + XFS_OQUOTA_ENFD); } else if (!strcmp(this_char, MNTOPT_PQUOTANOENF)) { - args->flags |= XFSMNT_PQUOTA; - args->flags &= ~XFSMNT_PQUOTAENF; + mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); + mp->m_qflags &= ~XFS_OQUOTA_ENFD; } else if (!strcmp(this_char, MNTOPT_GQUOTA) || !strcmp(this_char, MNTOPT_GRPQUOTA)) { - args->flags |= XFSMNT_GQUOTA | XFSMNT_GQUOTAENF; + mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE | + XFS_OQUOTA_ENFD); } else if (!strcmp(this_char, MNTOPT_GQUOTANOENF)) { - args->flags |= XFSMNT_GQUOTA; - args->flags &= ~XFSMNT_GQUOTAENF; + mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); + mp->m_qflags &= ~XFS_OQUOTA_ENFD; } else if (!strcmp(this_char, MNTOPT_DMAPI)) { - args->flags |= XFSMNT_DMAPI; + mp->m_flags |= XFS_MOUNT_DMAPI; } else if (!strcmp(this_char, MNTOPT_XDSM)) { - args->flags |= XFSMNT_DMAPI; + mp->m_flags |= XFS_MOUNT_DMAPI; } else if (!strcmp(this_char, MNTOPT_DMI)) { - args->flags |= XFSMNT_DMAPI; + mp->m_flags |= XFS_MOUNT_DMAPI; } else if (!strcmp(this_char, "ihashsize")) { cmn_err(CE_WARN, "XFS: ihashsize no longer used, option is deprecated."); @@ -390,27 +401,29 @@ xfs_parseargs( } } - if (args->flags & XFSMNT_NORECOVERY) { - if ((mp->m_flags & XFS_MOUNT_RDONLY) == 0) { - cmn_err(CE_WARN, - "XFS: no-recovery mounts must be read-only."); - return EINVAL; - } + /* + * no recovery flag requires a read-only mount + */ + if ((mp->m_flags & XFS_MOUNT_NORECOVERY) && + !(mp->m_flags & XFS_MOUNT_RDONLY)) { + cmn_err(CE_WARN, "XFS: no-recovery mounts must be read-only."); + return EINVAL; } - if ((args->flags & XFSMNT_NOALIGN) && (dsunit || dswidth)) { + if ((mp->m_flags & XFS_MOUNT_NOALIGN) && (dsunit || dswidth)) { cmn_err(CE_WARN, "XFS: sunit and swidth options incompatible with the noalign option"); return EINVAL; } - if ((args->flags & XFSMNT_GQUOTA) && (args->flags & XFSMNT_PQUOTA)) { + if ((mp->m_qflags & (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE)) && + (mp->m_qflags & (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE))) { cmn_err(CE_WARN, "XFS: cannot mount with both project and group quota"); return EINVAL; } - if ((args->flags & XFSMNT_DMAPI) && *args->mtpt == '\0') { + if ((mp->m_flags & XFS_MOUNT_DMAPI) && (!*mtpt || *mtpt[0] == '\0')) { printk("XFS: %s option needs the mount point option as well\n", MNTOPT_DMAPI); return EINVAL; @@ -438,27 +451,66 @@ xfs_parseargs( * Note that if "ikeep" or "noikeep" mount options are * supplied, then they are honored. */ - if ((args->flags & XFSMNT_DMAPI) && dmapi_implies_ikeep) - args->flags |= XFSMNT_IKEEP; + if ((mp->m_flags & XFS_MOUNT_DMAPI) && dmapi_implies_ikeep) + mp->m_flags |= XFS_MOUNT_IKEEP; - if ((args->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { +done: + if (!(mp->m_flags & XFS_MOUNT_NOALIGN)) { + /* + * At this point the superblock has not been read + * in, therefore we do not know the block size. + * Before the mount call ends we will convert + * these to FSBs. + */ if (dsunit) { - args->sunit = dsunit; - args->flags |= XFSMNT_RETERR; - } else { - args->sunit = vol_dsunit; + mp->m_dalign = dsunit; + mp->m_flags |= XFS_MOUNT_RETERR; } - dswidth ? (args->swidth = dswidth) : - (args->swidth = vol_dswidth); - } else { - args->sunit = args->swidth = 0; + + if (dswidth) + mp->m_swidth = dswidth; + } + + if (mp->m_logbufs != -1 && + mp->m_logbufs != 0 && + (mp->m_logbufs < XLOG_MIN_ICLOGS || + mp->m_logbufs > XLOG_MAX_ICLOGS)) { + cmn_err(CE_WARN, + "XFS: invalid logbufs value: %d [not %d-%d]", + mp->m_logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); + return XFS_ERROR(EINVAL); + } + if (mp->m_logbsize != -1 && + mp->m_logbsize != 0 && + (mp->m_logbsize < XLOG_MIN_RECORD_BSIZE || + mp->m_logbsize > XLOG_MAX_RECORD_BSIZE || + !is_power_of_2(mp->m_logbsize))) { + cmn_err(CE_WARN, + "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", + mp->m_logbsize); + return XFS_ERROR(EINVAL); + } + + mp->m_fsname = kstrndup(sb->s_id, MAXNAMELEN, GFP_KERNEL); + if (!mp->m_fsname) + return ENOMEM; + mp->m_fsname_len = strlen(mp->m_fsname) + 1; + + if (iosizelog) { + if (iosizelog > XFS_MAX_IO_LOG || + iosizelog < XFS_MIN_IO_LOG) { + cmn_err(CE_WARN, + "XFS: invalid log iosize: %d [not %d-%d]", + iosizelog, XFS_MIN_IO_LOG, + XFS_MAX_IO_LOG); + return XFS_ERROR(EINVAL); + } + + mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; + mp->m_readio_log = iosizelog; + mp->m_writeio_log = iosizelog; } -done: - if (args->flags & XFSMNT_32BITINODES) - mp->m_flags |= XFS_MOUNT_SMALL_INUMS; - if (args->flags2) - args->flags |= XFSMNT_FLAGS2; return 0; } @@ -704,8 +756,7 @@ xfs_close_devices( */ STATIC int xfs_open_devices( - struct xfs_mount *mp, - struct xfs_mount_args *args) + struct xfs_mount *mp) { struct block_device *ddev = mp->m_super->s_bdev; struct block_device *logdev = NULL, *rtdev = NULL; @@ -714,14 +765,14 @@ xfs_open_devices( /* * Open real time and log devices - order is important. */ - if (args->logname[0]) { - error = xfs_blkdev_get(mp, args->logname, &logdev); + if (mp->m_logname) { + error = xfs_blkdev_get(mp, mp->m_logname, &logdev); if (error) goto out; } - if (args->rtname[0]) { - error = xfs_blkdev_get(mp, args->rtname, &rtdev); + if (mp->m_rtname) { + error = xfs_blkdev_get(mp, mp->m_rtname, &rtdev); if (error) goto out_close_logdev; @@ -1404,175 +1455,28 @@ xfs_fs_setxquota( /* * This function fills in xfs_mount_t fields based on mount args. - * Note: the superblock has _not_ yet been read in. - */ -STATIC int -xfs_start_flags( - struct xfs_mount_args *ap, - struct xfs_mount *mp) -{ - int error; - - /* Values are in BBs */ - if ((ap->flags & XFSMNT_NOALIGN) != XFSMNT_NOALIGN) { - /* - * At this point the superblock has not been read - * in, therefore we do not know the block size. - * Before the mount call ends we will convert - * these to FSBs. - */ - mp->m_dalign = ap->sunit; - mp->m_swidth = ap->swidth; - } - - if (ap->logbufs != -1 && - ap->logbufs != 0 && - (ap->logbufs < XLOG_MIN_ICLOGS || - ap->logbufs > XLOG_MAX_ICLOGS)) { - cmn_err(CE_WARN, - "XFS: invalid logbufs value: %d [not %d-%d]", - ap->logbufs, XLOG_MIN_ICLOGS, XLOG_MAX_ICLOGS); - return XFS_ERROR(EINVAL); - } - mp->m_logbufs = ap->logbufs; - if (ap->logbufsize != -1 && - ap->logbufsize != 0 && - (ap->logbufsize < XLOG_MIN_RECORD_BSIZE || - ap->logbufsize > XLOG_MAX_RECORD_BSIZE || - !is_power_of_2(ap->logbufsize))) { - cmn_err(CE_WARN, - "XFS: invalid logbufsize: %d [not 16k,32k,64k,128k or 256k]", - ap->logbufsize); - return XFS_ERROR(EINVAL); - } - - error = ENOMEM; - - mp->m_logbsize = ap->logbufsize; - mp->m_fsname_len = strlen(ap->fsname) + 1; - - mp->m_fsname = kstrdup(ap->fsname, GFP_KERNEL); - if (!mp->m_fsname) - goto out; - - if (ap->rtname[0]) { - mp->m_rtname = kstrdup(ap->rtname, GFP_KERNEL); - if (!mp->m_rtname) - goto out_free_fsname; - - } - - if (ap->logname[0]) { - mp->m_logname = kstrdup(ap->logname, GFP_KERNEL); - if (!mp->m_logname) - goto out_free_rtname; - } - - if (ap->flags & XFSMNT_WSYNC) - mp->m_flags |= XFS_MOUNT_WSYNC; -#if XFS_BIG_INUMS - if (ap->flags & XFSMNT_INO64) { - mp->m_flags |= XFS_MOUNT_INO64; - mp->m_inoadd = XFS_INO64_OFFSET; - } -#endif - if (ap->flags & XFSMNT_RETERR) - mp->m_flags |= XFS_MOUNT_RETERR; - if (ap->flags & XFSMNT_NOALIGN) - mp->m_flags |= XFS_MOUNT_NOALIGN; - if (ap->flags & XFSMNT_SWALLOC) - mp->m_flags |= XFS_MOUNT_SWALLOC; - if (ap->flags & XFSMNT_OSYNCISOSYNC) - mp->m_flags |= XFS_MOUNT_OSYNCISOSYNC; - if (ap->flags & XFSMNT_32BITINODES) - mp->m_flags |= XFS_MOUNT_32BITINODES; - - if (ap->flags & XFSMNT_IOSIZE) { - if (ap->iosizelog > XFS_MAX_IO_LOG || - ap->iosizelog < XFS_MIN_IO_LOG) { - cmn_err(CE_WARN, - "XFS: invalid log iosize: %d [not %d-%d]", - ap->iosizelog, XFS_MIN_IO_LOG, - XFS_MAX_IO_LOG); - return XFS_ERROR(EINVAL); - } - - mp->m_flags |= XFS_MOUNT_DFLT_IOSIZE; - mp->m_readio_log = mp->m_writeio_log = ap->iosizelog; - } - - if (ap->flags & XFSMNT_IKEEP) - mp->m_flags |= XFS_MOUNT_IKEEP; - if (ap->flags & XFSMNT_DIRSYNC) - mp->m_flags |= XFS_MOUNT_DIRSYNC; - if (ap->flags & XFSMNT_ATTR2) - mp->m_flags |= XFS_MOUNT_ATTR2; - if (ap->flags & XFSMNT_NOATTR2) - mp->m_flags |= XFS_MOUNT_NOATTR2; - - if (ap->flags2 & XFSMNT2_COMPAT_IOSIZE) - mp->m_flags |= XFS_MOUNT_COMPAT_IOSIZE; - - /* - * no recovery flag requires a read-only mount - */ - if (ap->flags & XFSMNT_NORECOVERY) { - if (!(mp->m_flags & XFS_MOUNT_RDONLY)) { - cmn_err(CE_WARN, - "XFS: tried to mount a FS read-write without recovery!"); - return XFS_ERROR(EINVAL); - } - mp->m_flags |= XFS_MOUNT_NORECOVERY; - } - - if (ap->flags & XFSMNT_NOUUID) - mp->m_flags |= XFS_MOUNT_NOUUID; - if (ap->flags & XFSMNT_BARRIER) - mp->m_flags |= XFS_MOUNT_BARRIER; - else - mp->m_flags &= ~XFS_MOUNT_BARRIER; - - if (ap->flags2 & XFSMNT2_FILESTREAMS) - mp->m_flags |= XFS_MOUNT_FILESTREAMS; - - if (ap->flags & XFSMNT_DMAPI) - mp->m_flags |= XFS_MOUNT_DMAPI; - return 0; - - - out_free_rtname: - kfree(mp->m_rtname); - out_free_fsname: - kfree(mp->m_fsname); - out: - return error; -} - -/* - * This function fills in xfs_mount_t fields based on mount args. * Note: the superblock _has_ now been read in. */ STATIC int xfs_finish_flags( - struct xfs_mount_args *ap, struct xfs_mount *mp) { int ronly = (mp->m_flags & XFS_MOUNT_RDONLY); /* Fail a mount where the logbuf is smaller then the log stripe */ if (xfs_sb_version_haslogv2(&mp->m_sb)) { - if ((ap->logbufsize <= 0) && - (mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE)) { + if (mp->m_logbsize <= 0 && + mp->m_sb.sb_logsunit > XLOG_BIG_RECORD_BSIZE) { mp->m_logbsize = mp->m_sb.sb_logsunit; - } else if (ap->logbufsize > 0 && - ap->logbufsize < mp->m_sb.sb_logsunit) { + } else if (mp->m_logbsize > 0 && + mp->m_logbsize < mp->m_sb.sb_logsunit) { cmn_err(CE_WARN, "XFS: logbuf size must be greater than or equal to log stripe size"); return XFS_ERROR(EINVAL); } } else { /* Fail a mount if the logbuf is larger than 32K */ - if (ap->logbufsize > XLOG_BIG_RECORD_BSIZE) { + if (mp->m_logbsize > XLOG_BIG_RECORD_BSIZE) { cmn_err(CE_WARN, "XFS: logbuf size for version 1 logs must be 16K or 32K"); return XFS_ERROR(EINVAL); @@ -1584,7 +1488,7 @@ xfs_finish_flags( * told by noattr2 to turn it off */ if (xfs_sb_version_hasattr2(&mp->m_sb) && - !(ap->flags & XFSMNT_NOATTR2)) + !(mp->m_flags & XFS_MOUNT_NOATTR2)) mp->m_flags |= XFS_MOUNT_ATTR2; /* @@ -1596,6 +1500,7 @@ xfs_finish_flags( return XFS_ERROR(EROFS); } +#if 0 /* shared mounts were never supported on Linux */ /* * check for shared mount. */ @@ -1618,25 +1523,11 @@ xfs_finish_flags( /* * Shared XFS V0 can't deal with DMI. Return EINVAL. */ - if (mp->m_sb.sb_shared_vn == 0 && (ap->flags & XFSMNT_DMAPI)) + if (mp->m_sb.sb_shared_vn == 0 && + (mp->m_flags & XFS_MOUNT_DMAPI)) return XFS_ERROR(EINVAL); } - - if (ap->flags & XFSMNT_UQUOTA) { - mp->m_qflags |= (XFS_UQUOTA_ACCT | XFS_UQUOTA_ACTIVE); - if (ap->flags & XFSMNT_UQUOTAENF) - mp->m_qflags |= XFS_UQUOTA_ENFD; - } - - if (ap->flags & XFSMNT_GQUOTA) { - mp->m_qflags |= (XFS_GQUOTA_ACCT | XFS_GQUOTA_ACTIVE); - if (ap->flags & XFSMNT_GQUOTAENF) - mp->m_qflags |= XFS_OQUOTA_ENFD; - } else if (ap->flags & XFSMNT_PQUOTA) { - mp->m_qflags |= (XFS_PQUOTA_ACCT | XFS_PQUOTA_ACTIVE); - if (ap->flags & XFSMNT_PQUOTAENF) - mp->m_qflags |= XFS_OQUOTA_ENFD; - } +#endif return 0; } @@ -1649,16 +1540,12 @@ xfs_fs_fill_super( { struct inode *root; struct xfs_mount *mp = NULL; - struct xfs_mount_args *args; int flags = 0, error = ENOMEM; - - args = xfs_args_allocate(sb, silent); - if (!args) - return -ENOMEM; + char *mtpt = NULL; mp = kzalloc(sizeof(struct xfs_mount), GFP_KERNEL); if (!mp) - goto out_free_args; + goto out; spin_lock_init(&mp->m_sb_lock); mutex_init(&mp->m_ilock); @@ -1671,12 +1558,9 @@ xfs_fs_fill_super( mp->m_super = sb; sb->s_fs_info = mp; - if (sb->s_flags & MS_RDONLY) - mp->m_flags |= XFS_MOUNT_RDONLY; - - error = xfs_parseargs(mp, (char *)data, args, 0); + error = xfs_parseargs(mp, (char *)data, &mtpt); if (error) - goto out_free_mp; + goto out_free_fsname; sb_min_blocksize(sb, BBSIZE); sb->s_xattr = xfs_xattr_handlers; @@ -1684,33 +1568,28 @@ xfs_fs_fill_super( sb->s_qcop = &xfs_quotactl_operations; sb->s_op = &xfs_super_operations; - error = xfs_dmops_get(mp, args); + error = xfs_dmops_get(mp); if (error) - goto out_free_mp; - error = xfs_qmops_get(mp, args); + goto out_free_fsname; + error = xfs_qmops_get(mp); if (error) goto out_put_dmops; - if (args->flags & XFSMNT_QUIET) + if (silent) flags |= XFS_MFSI_QUIET; - error = xfs_open_devices(mp, args); + error = xfs_open_devices(mp); if (error) goto out_put_qmops; if (xfs_icsb_init_counters(mp)) mp->m_flags |= XFS_MOUNT_NO_PERCPU_SB; - /* - * Setup flags based on mount(2) options and then the superblock - */ - error = xfs_start_flags(args, mp); - if (error) - goto out_free_fsname; error = xfs_readsb(mp, flags); if (error) - goto out_free_fsname; - error = xfs_finish_flags(args, mp); + goto out_destroy_counters; + + error = xfs_finish_flags(mp); if (error) goto out_free_sb; @@ -1729,7 +1608,7 @@ xfs_fs_fill_super( if (error) goto out_filestream_unmount; - XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, args->mtpt, args->fsname); + XFS_SEND_MOUNT(mp, DM_RIGHT_NULL, mtpt, mp->m_fsname); sb->s_dirt = 1; sb->s_magic = XFS_SB_MAGIC; @@ -1762,27 +1641,27 @@ xfs_fs_fill_super( goto fail_vnrele; } - xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); + kfree(mtpt); - kfree(args); + xfs_itrace_exit(XFS_I(sb->s_root->d_inode)); return 0; out_filestream_unmount: xfs_filestream_unmount(mp); out_free_sb: xfs_freesb(mp); - out_free_fsname: - xfs_free_fsname(mp); + out_destroy_counters: xfs_icsb_destroy_counters(mp); xfs_close_devices(mp); out_put_qmops: xfs_qmops_put(mp); out_put_dmops: xfs_dmops_put(mp); - out_free_mp: + out_free_fsname: + xfs_free_fsname(mp); + kfree(mtpt); kfree(mp); - out_free_args: - kfree(args); + out: return -error; fail_vnrele: Index: linux-2.6-xfs/fs/xfs/xfs_clnt.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_clnt.h 2008-07-24 07:32:03.000000000 +0200 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,105 +0,0 @@ -/* - * Copyright (c) 2000-2005 Silicon Graphics, Inc. - * All Rights Reserved. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation. - * - * This program is distributed in the hope that it would be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write the Free Software Foundation, - * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ -#ifndef __XFS_CLNT_H__ -#define __XFS_CLNT_H__ - -/* - * XFS arguments structure, constructed from the arguments we - * are passed via the mount system call. - * - * NOTE: The mount system call is handled differently between - * Linux and IRIX. In IRIX we worked work with a binary data - * structure coming in across the syscall interface from user - * space (the mount userspace knows about each filesystem type - * and the set of valid options for it, and converts the users - * argument string into a binary structure _before_ making the - * system call), and the ABI issues that this implies. - * - * In Linux, we are passed a comma separated set of options; - * ie. a NULL terminated string of characters. Userspace mount - * code does not have any knowledge of mount options expected by - * each filesystem type and so each filesystem parses its mount - * options in kernel space. - * - * For the Linux port, we kept this structure pretty much intact - * and use it internally (because the existing code groks it). - */ -struct xfs_mount_args { - int flags; /* flags -> see XFSMNT_... macros below */ - int flags2; /* flags -> see XFSMNT2_... macros below */ - int logbufs; /* Number of log buffers, -1 to default */ - int logbufsize; /* Size of log buffers, -1 to default */ - char fsname[MAXNAMELEN+1]; /* data device name */ - char rtname[MAXNAMELEN+1]; /* realtime device filename */ - char logname[MAXNAMELEN+1]; /* journal device filename */ - char mtpt[MAXNAMELEN+1]; /* filesystem mount point */ - int sunit; /* stripe unit (BBs) */ - int swidth; /* stripe width (BBs), multiple of sunit */ - uchar_t iosizelog; /* log2 of the preferred I/O size */ - int ihashsize; /* inode hash table size (buckets) */ -}; - -/* - * XFS mount option flags -- args->flags1 - */ -#define XFSMNT_ATTR2 0x00000001 /* allow ATTR2 EA format */ -#define XFSMNT_WSYNC 0x00000002 /* safe mode nfs mount - * compatible */ -#define XFSMNT_INO64 0x00000004 /* move inode numbers up - * past 2^32 */ -#define XFSMNT_UQUOTA 0x00000008 /* user quota accounting */ -#define XFSMNT_PQUOTA 0x00000010 /* IRIX prj quota accounting */ -#define XFSMNT_UQUOTAENF 0x00000020 /* user quota limit - * enforcement */ -#define XFSMNT_PQUOTAENF 0x00000040 /* IRIX project quota limit - * enforcement */ -#define XFSMNT_QUIET 0x00000080 /* don't report mount errors */ -#define XFSMNT_NOALIGN 0x00000200 /* don't allocate at - * stripe boundaries*/ -#define XFSMNT_RETERR 0x00000400 /* return error to user */ -#define XFSMNT_NORECOVERY 0x00000800 /* no recovery, implies - * read-only mount */ -#define XFSMNT_SHARED 0x00001000 /* shared XFS mount */ -#define XFSMNT_IOSIZE 0x00002000 /* optimize for I/O size */ -#define XFSMNT_OSYNCISOSYNC 0x00004000 /* o_sync is REALLY o_sync */ - /* (osyncisdsync is default) */ -#define XFSMNT_NOATTR2 0x00008000 /* turn off ATTR2 EA format */ -#define XFSMNT_32BITINODES 0x00200000 /* restrict inodes to 32 - * bits of address space */ -#define XFSMNT_GQUOTA 0x00400000 /* group quota accounting */ -#define XFSMNT_GQUOTAENF 0x00800000 /* group quota limit - * enforcement */ -#define XFSMNT_NOUUID 0x01000000 /* Ignore fs uuid */ -#define XFSMNT_DMAPI 0x02000000 /* enable dmapi/xdsm */ -#define XFSMNT_BARRIER 0x04000000 /* use write barriers */ -#define XFSMNT_IKEEP 0x08000000 /* inode cluster delete */ -#define XFSMNT_SWALLOC 0x10000000 /* turn on stripe width - * allocation */ -#define XFSMNT_DIRSYNC 0x40000000 /* sync creat,link,unlink,rename - * symlink,mkdir,rmdir,mknod */ -#define XFSMNT_FLAGS2 0x80000000 /* more flags set in flags2 */ - -/* - * XFS mount option flags -- args->flags2 - */ -#define XFSMNT2_COMPAT_IOSIZE 0x00000001 /* don't report large preferred - * I/O size in stat(2) */ -#define XFSMNT2_FILESTREAMS 0x00000002 /* enable the filestreams - * allocator */ - -#endif /* __XFS_CLNT_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_dmops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_dmops.c 2008-07-24 07:32:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_dmops.c 2008-07-24 08:34:30.000000000 +0200 @@ -25,7 +25,6 @@ #include "xfs_inum.h" #include "xfs_ag.h" #include "xfs_mount.h" -#include "xfs_clnt.h" static struct xfs_dmops xfs_dmcore_stub = { @@ -38,9 +37,9 @@ static struct xfs_dmops xfs_dmcore_stub }; int -xfs_dmops_get(struct xfs_mount *mp, struct xfs_mount_args *args) +xfs_dmops_get(struct xfs_mount *mp) { - if (args->flags & XFSMNT_DMAPI) { + if (mp->m_flags & XFS_MOUNT_DMAPI) { struct xfs_dmops *ops; ops = symbol_get(xfs_dmcore_xfs); Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2008-07-24 07:32:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2008-07-24 10:09:21.000000000 +0200 @@ -540,9 +540,9 @@ extern void xfs_sb_from_disk(struct xfs_ extern void xfs_sb_to_disk(struct xfs_dsb *, struct xfs_sb *, __int64_t); extern int xfs_sb_validate_fsb_count(struct xfs_sb *, __uint64_t); -extern int xfs_dmops_get(struct xfs_mount *, struct xfs_mount_args *); +extern int xfs_dmops_get(struct xfs_mount *); extern void xfs_dmops_put(struct xfs_mount *); -extern int xfs_qmops_get(struct xfs_mount *, struct xfs_mount_args *); +extern int xfs_qmops_get(struct xfs_mount *); extern void xfs_qmops_put(struct xfs_mount *); extern struct xfs_dmops xfs_dmcore_xfs; Index: linux-2.6-xfs/fs/xfs/xfs_qmops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_qmops.c 2008-07-24 07:32:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_qmops.c 2008-07-24 10:12:11.000000000 +0200 @@ -28,7 +28,6 @@ #include "xfs_mount.h" #include "xfs_quota.h" #include "xfs_error.h" -#include "xfs_clnt.h" STATIC struct xfs_dquot * @@ -131,9 +130,9 @@ static struct xfs_qmops xfs_qmcore_stub }; int -xfs_qmops_get(struct xfs_mount *mp, struct xfs_mount_args *args) +xfs_qmops_get(struct xfs_mount *mp) { - if (args->flags & (XFSMNT_UQUOTA | XFSMNT_PQUOTA | XFSMNT_GQUOTA)) { + if (XFS_IS_QUOTA_RUNNING(mp)) { struct xfs_qmops *ops; ops = symbol_get(xfs_qmcore_xfs); Index: linux-2.6-xfs/fs/xfs/xfs_vfsops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vfsops.c 2008-07-24 08:30:24.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vfsops.c 2008-07-24 10:09:26.000000000 +0200 @@ -49,7 +49,6 @@ #include "xfs_extfree_item.h" #include "xfs_acl.h" #include "xfs_attr.h" -#include "xfs_clnt.h" #include "xfs_mru_cache.h" #include "xfs_filestream.h" #include "xfs_fsops.h" Index: linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/dmapi/xfs_dm.c 2008-07-24 08:34:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/dmapi/xfs_dm.c 2008-07-24 10:09:22.000000000 +0200 @@ -21,7 +21,6 @@ #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_clnt.h" #include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-24 08:34:30.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-24 10:09:17.000000000 +0200 @@ -22,7 +22,6 @@ #include "xfs_log.h" #include "xfs_imap.h" #include "xfs_inum.h" -#include "xfs_clnt.h" #include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.c 2008-07-24 07:32:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.c 2008-07-24 08:34:30.000000000 +0200 @@ -20,7 +20,6 @@ #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_clnt.h" #include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_bhv.c 2008-07-24 07:32:03.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c 2008-07-24 08:34:30.000000000 +0200 @@ -20,7 +20,6 @@ #include "xfs_bit.h" #include "xfs_log.h" #include "xfs_inum.h" -#include "xfs_clnt.h" #include "xfs_trans.h" #include "xfs_sb.h" #include "xfs_ag.h" From owner-xfs@oss.sgi.com Thu Jul 24 12:53:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 12:53:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6OJr4hK028884 for ; Thu, 24 Jul 2008 12:53:05 -0700 X-ASG-Debug-ID: 1216929253-72a900220000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9F2F132A7AD for ; Thu, 24 Jul 2008 12:54:14 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 2wxL0LrpQ9qg3eOy for ; Thu, 24 Jul 2008 12:54:14 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6OJs3Ng003135 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Thu, 24 Jul 2008 21:54:03 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6OJs3oL003133; Thu, 24 Jul 2008 21:54:03 +0200 Date: Thu, 24 Jul 2008 21:54:03 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/4] fix biosize option Subject: Re: [PATCH 4/4] fix biosize option Message-ID: <20080724195403.GB2962@lst.de> References: <20080525190754.GD13372@lst.de> <20080724071519.GV6761@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080724071519.GV6761@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216929255 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.752 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17145 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 05:15:19PM +1000, Dave Chinner wrote: > On Sun, May 25, 2008 at 09:07:54PM +0200, Christoph Hellwig wrote: > > iosizelog shouldn't be the same as iosize but the logarithm of it. Then > > again the current biosize option doesn't make much sense to me as it > > doesn't set the preferred I/O size as mentioned in the comment next to > > That's a hold-over from irix - biosize set the basic chunk size the > cache used for mapping writes, so was effectively the size of write > to use to avoid RMW cycles as well as the unit of delayed > allocation. > > > it but rather the allocation size and thus is identical to the allocsize > > option (except for the missing logarithm). It's also not documented in > > Documentation/filesystems/xfs.txt or the mount manpage. > > So when it was first added (probably for compatibility) the > allocation part was noticed and not the rest. Maybe we should > hook it up to xfs_preferred_iosize() rather than allocation now > that it exists... Or just stop making the option have any effect and just print a message that it's ignored.. From owner-xfs@oss.sgi.com Thu Jul 24 16:11:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:11:21 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONBHer009851 for ; Thu, 24 Jul 2008 16:11:18 -0700 X-ASG-Debug-ID: 1216941145-7b4e01850000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 86FBC32B5F5 for ; Thu, 24 Jul 2008 16:12:25 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id mkWYTxNsLLJrk6xi for ; Thu, 24 Jul 2008 16:12:25 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCAD2oiEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156949984" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 08:42:23 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KM9yw-000488-45; Fri, 25 Jul 2008 09:12:22 +1000 Date: Fri, 25 Jul 2008 09:12:21 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] kill struct xfs_mount_args Subject: Re: [PATCH 2/4] kill struct xfs_mount_args Message-ID: <20080724231220.GA15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080525190741.GB13372@lst.de> <20080724070541.GT6761@disturbed> <20080724195327.GA2962@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080724195327.GA2962@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216941148 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.764 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17146 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 09:53:27PM +0200, Christoph Hellwig wrote: > On Thu, Jul 24, 2008 at 05:05:42PM +1000, Dave Chinner wrote: > Updated patch below: Yeah, looks good now. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 16:15:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:15:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONFVpb010638 for ; Thu, 24 Jul 2008 16:15:31 -0700 X-ASG-Debug-ID: 1216941401-7bce01c60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B886A32B96C for ; Thu, 24 Jul 2008 16:16:42 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id NqncCT7Rq2smW8Ha for ; Thu, 24 Jul 2008 16:16:42 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCAD2oiEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156953187" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 08:46:41 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMA35-0004Dv-RG; Fri, 25 Jul 2008 09:16:39 +1000 Date: Fri, 25 Jul 2008 09:16:39 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 01/15] small cleanups in xfs_btree.c Subject: Re: [PATCH 01/15] small cleanups in xfs_btree.c Message-ID: <20080724231639.GB15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200820.GB7401@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723200820.GB7401@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216941402 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.764 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17147 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:08:20PM +0200, Christoph Hellwig wrote: > - remove unneeded xfs_btree_get_block forward declaration > - move xfs_btree_firstrec next to xfs_btree_lastrec looks good to me. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 16:24:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:24:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONOVq7016025 for ; Thu, 24 Jul 2008 16:24:33 -0700 X-ASG-Debug-ID: 1216941939-1b9900a20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6CB921924607 for ; Thu, 24 Jul 2008 16:25:40 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id XUHyUC5pZ1Ia0biX for ; Thu, 24 Jul 2008 16:25:40 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCALqriEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156958828" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 08:55:38 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMABm-0004Pk-4Z; Fri, 25 Jul 2008 09:25:38 +1000 Date: Fri, 25 Jul 2008 09:25:37 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 03/15] split up xfs_btree_init_cursor Subject: Re: [PATCH 03/15] split up xfs_btree_init_cursor Message-ID: <20080724232537.GD15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200835.GD7401@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723200835.GD7401@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216941942 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.765 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17148 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:08:35PM +0200, Christoph Hellwig wrote: > xfs_btree_init_cursor contains close to little shared code for the different > btrees and will get even more non-common code in the future. Split it up > into one routine per btree type. > > Because xfs_btree_dup_cursor needs to call the init routine for a generic > btree cursor add a new btree operation vector that contains a dup_cursor > method that initializes a new cursor based on an existing one. > > The btree operations vector is based on an idea and code from Dave Chinner > and will be used for more operations later on. Looks ok to me. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 16:25:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:26:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONPwqs016417 for ; Thu, 24 Jul 2008 16:25:59 -0700 X-ASG-Debug-ID: 1216942024-7b4e01f60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 71E7232BB31 for ; Thu, 24 Jul 2008 16:27:08 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id kM8CSadH6WW0HzWK for ; Thu, 24 Jul 2008 16:27:08 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCALqriEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156959563" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 08:57:01 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMAD6-0004RY-1W; Fri, 25 Jul 2008 09:27:00 +1000 Date: Fri, 25 Jul 2008 09:26:59 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 04/15] add generic btree types Subject: Re: [PATCH 04/15] add generic btree types Message-ID: <20080724232659.GE15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200842.GE7401@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723200842.GE7401@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216942029 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.765 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17149 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:08:42PM +0200, Christoph Hellwig wrote: > Add generic union types for btree pointers, keys and records. The generic > btree pointer contains a 32 and 64bit big endian type for short and long > form btrees, and the key and record contain the relevant type for each > possible btree. > > Split out from a bigger patch from Dave Chinner and simplified a little > further. Looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 16:27:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:27:22 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONRIAB016835 for ; Thu, 24 Jul 2008 16:27:18 -0700 X-ASG-Debug-ID: 1216942108-7f8402bf0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E3B1FE9D7C9 for ; Thu, 24 Jul 2008 16:28:29 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id BnGfIU7lERkQsGLU for ; Thu, 24 Jul 2008 16:28:29 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCALqriEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156960357" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 08:58:27 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMAEV-0004TS-EX; Fri, 25 Jul 2008 09:28:27 +1000 Date: Fri, 25 Jul 2008 09:28:27 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 05/15] make btree root in inode support generic Subject: Re: [PATCH 05/15] make btree root in inode support generic Message-ID: <20080724232827.GF15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200848.GF7401@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723200848.GF7401@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216942109 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.765 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17150 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:08:48PM +0200, Christoph Hellwig wrote: > The bmap btree is rooted in the inode and not in a single disk block. Make > the support for this feature more generic by: > > (a) adding a btree flag to check for instead of the XFS_BTNUM_BMAP type > (b) add a get_root_from_inode btree operation to get a btree block from > the inode, with the implementation details left to the individual btree. > > Also clean up xfs_btree_get_block, which is the place these two features > are used. > > The XFS_BTREE_ROOT_IN_INODE is based upon a patch from Dave Chinner. Looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 16:28:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:28:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONS6Mb017184 for ; Thu, 24 Jul 2008 16:28:06 -0700 X-ASG-Debug-ID: 1216942156-7233030c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 4D88932BB8F for ; Thu, 24 Jul 2008 16:29:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id O4zOJyOGN4uULBlE for ; Thu, 24 Jul 2008 16:29:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCALqriEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156960829" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 08:59:15 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMAFH-0004UZ-OW; Fri, 25 Jul 2008 09:29:15 +1000 Date: Fri, 25 Jul 2008 09:29:15 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 06/15] add a long pointers flag to xfs_btree_cur Subject: Re: [PATCH 06/15] add a long pointers flag to xfs_btree_cur Message-ID: <20080724232915.GG15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200853.GG7401@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723200853.GG7401@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216942158 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.765 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17151 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:08:53PM +0200, Christoph Hellwig wrote: > Add a flag to the xfs btree cursor when using long (64bit) block pointers > instead of checking btnum == XFS_BTNUM_BMAP. Very sane idea ;) Looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 16:35:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:36:00 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONZxtN018033 for ; Thu, 24 Jul 2008 16:35:59 -0700 X-ASG-Debug-ID: 1216942629-1b8d00f00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5DCBF1924BC7 for ; Thu, 24 Jul 2008 16:37:09 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id dr69GXBBnJZxJN3S for ; Thu, 24 Jul 2008 16:37:09 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCADiviEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156966323" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 09:07:07 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMAMi-0004go-7F; Fri, 25 Jul 2008 09:36:56 +1000 Date: Fri, 25 Jul 2008 09:36:55 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 07/15] refactor xfs_btree_readahead Subject: Re: [PATCH 07/15] refactor xfs_btree_readahead Message-ID: <20080724233655.GH15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200859.GH7401@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723200859.GH7401@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216942630 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.765 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17152 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:08:59PM +0200, Christoph Hellwig wrote: > From: Dave Chinner Can i review my own code? ;) > Refactor xfs_btree_readahead to make it more readable: > > (a) remove the inline xfs_btree_readahead wrapper and move all checks out > of line into the main routine. > (b) factor out helpers for short/long form btrees > (c) move check for root in inodes from the callers into xfs_btree_readahead > > > [hch: split out from a big patch and minor cleanups] > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-11 11:13:15.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-11 11:13:20.000000000 +0200 > @@ -709,66 +709,84 @@ xfs_btree_reada_bufs( > xfs_baread(mp->m_ddev_targp, d, mp->m_bsize * count); > } > > +STATIC int > +xfs_btree_reada_corel( I've been wondering if this is the best naming convention - appending a single s or l to indicate short or long btree ops. Perhaps this would be better as xfs_btree_readahead_short() and xfs_btree_readahead_long(), esp. as we dropped the 'core' from the caller to make it xfs_btree_readahead(). Otherwise it looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 16:39:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 16:39:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6ONdC64018601 for ; Thu, 24 Jul 2008 16:39:13 -0700 X-ASG-Debug-ID: 1216942822-7e4b036d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DBC8FE9D32D for ; Thu, 24 Jul 2008 16:40:23 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id I0PseUDKGRMWVKQC for ; Thu, 24 Jul 2008 16:40:23 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCADiviEh5LFxAiGdsb2JhbACSVQEBAQ8gn24 X-IronPort-AV: E=Sophos;i="4.31,248,1215354600"; d="scan'208";a="156969536" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 09:10:21 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMAQ0-0004lY-UW; Fri, 25 Jul 2008 09:40:20 +1000 Date: Fri, 25 Jul 2008 09:40:20 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 08/15] refactor btree validation helpers Subject: Re: [PATCH 08/15] refactor btree validation helpers Message-ID: <20080724234020.GI15438@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200904.GI7401@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723200904.GI7401@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216942823 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0001 1.0000 -2.0207 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.767 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17153 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 10:09:04PM +0200, Christoph Hellwig wrote: > Move the various btree validation helpers around in xfs_btree.c so that > they are close to each other and in common #ifdef DEBUG sections. > > Also add a new xfs_btree_check_ptr helper to check a btree ptr that > can be either long or short form. > > > Split out from a bigger patch from Dave Chinner with various small > changes applied by me. Looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 18:25:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 18:25:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P1Pevi024652 for ; Thu, 24 Jul 2008 18:25:41 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA03244; Fri, 25 Jul 2008 11:26:49 +1000 Message-ID: <48892D26.8060407@sgi.com> Date: Fri, 25 Jul 2008 11:32:22 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , xfs-dev , xfs-oss Subject: Re: [PATCH] Prevent log tail pushing from blocking on buffer locks References: <48857EFB.3030301@sgi.com> <20080724114128.GW6761@disturbed> In-Reply-To: <20080724114128.GW6761@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17154 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Tue, Jul 22, 2008 at 04:32:27PM +1000, Lachlan McIlroy wrote: >> This changes xfs_inode_item_push() to use XFS_IFLUSH_ASYNC_NOBLOCK when >> flushing an inode so the flush wont block on inode cluster buffer lock. >> Also change the prototype of the IOP_PUSH operation so that xfsaild_push() >> can bump it's stuck count. >> >> This change was prompted by a deadlock that would only occur on a debug >> XFS where a thread creating an inode had the buffer locked and was trying >> to allocate space for the inode tracing facility. That recursed back into >> the filesystem to flush data which created a transaction and needed log >> space which wasn't available. > > A quick question - shouldn't the allocation use KM_NOFS if it > being called in place that would cause recursion? Anywhere the > inode tracing is called with a an inode lock held outside a > transaction will also be suseptible to this deadlock. > > Also, there is the possibility that aborting writeback from > the AIL in this manner could cause stalls or deadlocks > if this item is at the of the log and it doesn't get written > back straight away and the trigger thread then goes to sleep > waiting for the tail to move. In that case, everything subsequent > transaction will then go to sleep without trying to push the > log and only the watchdog timeout on aild will get things > moving again. > > So to fix a deadlock in debug code, I don't think we want to > change the flush semantics of the AIL push on inodes for > production code. Prevent the debug tracing code from recursing, > instead.... I have a patch for using KM_NOFS in the debug code too and will post it soon. It just looked like the IOP_PUSH could be improved so that it didn't block on the buffer. Since we can already abort the push if IOP_TRYLOCK fails I didn't think I'd be introducing any new failure scenarios. From owner-xfs@oss.sgi.com Thu Jul 24 19:11:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 19:11:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P2BkFe027293 for ; Thu, 24 Jul 2008 19:11:47 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA04518; Fri, 25 Jul 2008 12:12:55 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 20EEE58C4C3F; Fri, 25 Jul 2008 12:12:55 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - Remove vn_from_inode() Message-Id: <20080725021255.20EEE58C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 12:12:55 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17155 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Remove vn_from_inode() bhv_vnode_t is just a typedef for struct inode, so there's no need for a helper to convert between the two. Signed-off-by: Christoph Hellwig Date: Fri Jul 25 12:11:50 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31760a fs/xfs/linux-2.6/xfs_vnode.h - 1.155 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.155&r2=text&tr2=1.154&f=h fs/xfs/linux-2.6/xfs_super.c - 1.439 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.439&r2=text&tr2=1.438&f=h - Remove vn_from_inode() From owner-xfs@oss.sgi.com Thu Jul 24 19:15:42 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 19:15:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P2FfYJ028039 for ; Thu, 24 Jul 2008 19:15:41 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA04708; Fri, 25 Jul 2008 12:16:50 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 73E2758C4C3F; Fri, 25 Jul 2008 12:16:50 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - kill vn_to_inode Message-Id: <20080725021650.73E2758C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 12:16:50 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17156 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs kill vn_to_inode bhv_vnode_t is just a typedef for struct inode, so there's no need for a helper to convert between the two. Signed-off-by: Christoph Hellwig Date: Fri Jul 25 12:16:06 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31761a fs/xfs/xfs_vnodeops.c - 1.768 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.768&r2=text&tr2=1.767&f=h fs/xfs/linux-2.6/xfs_linux.h - 1.169 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_linux.h.diff?r1=text&tr1=1.169&r2=text&tr2=1.168&f=h fs/xfs/linux-2.6/xfs_vnode.c - 1.159 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.159&r2=text&tr2=1.158&f=h fs/xfs/linux-2.6/xfs_vnode.h - 1.156 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.156&r2=text&tr2=1.155&f=h fs/xfs/linux-2.6/xfs_super.c - 1.440 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.440&r2=text&tr2=1.439&f=h - kill vn_to_inode From owner-xfs@oss.sgi.com Thu Jul 24 19:18:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 19:18:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P2IM2d028535 for ; Thu, 24 Jul 2008 19:18:24 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA04955; Fri, 25 Jul 2008 12:19:31 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 860D958C4C3F; Fri, 25 Jul 2008 12:19:31 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c Message-Id: <20080725021931.860D958C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 12:19:31 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17157 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c All the ACL routines are called from inode operations which are guaranteed to have a referenced inode by the VFS, so there's no need for the ACL code to grab another temporary one. Signed-off-by: Christoph Hellwig Date: Fri Jul 25 12:18:47 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31762a fs/xfs/xfs_acl.c - 1.77 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.c.diff?r1=text&tr1=1.77&r2=text&tr2=1.76&f=h - remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c From owner-xfs@oss.sgi.com Thu Jul 24 19:21:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 19:21:42 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P2Lc5U029014 for ; Thu, 24 Jul 2008 19:21:39 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA05031; Fri, 25 Jul 2008 12:22:48 +1000 From: Niv Sardi To: Eric Sandeen Cc: xfs-oss Subject: Re: [PATCH, RFC] - remove mounpoint UUID code References: <47D20F78.7000103@sandeen.net> Date: Fri, 25 Jul 2008 12:22:39 +1000 In-Reply-To: <47D20F78.7000103@sandeen.net> (Eric Sandeen's message of "Fri, 07 Mar 2008 22:00:56 -0600") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17158 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs ACK, removing it, it should be trivial to put back in if we ever need it. -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 24 19:23:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 19:23:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P2No3w029453 for ; Thu, 24 Jul 2008 19:23:51 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA05076; Fri, 25 Jul 2008 12:24:59 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id AF43D58C4C3F; Fri, 25 Jul 2008 12:24:59 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c Message-Id: <20080725022459.AF43D58C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 12:24:59 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17159 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c All the ACL routines are called from inode operations which are guaranteed to have a referenced inode by the VFS, so there's no need for the ACL code to grab another temporary one. Signed-off-by: Christoph Hellwig Date: Fri Jul 25 12:23:52 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31763a fs/xfs/xfs_acl.c - 1.78 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.c.diff?r1=text&tr1=1.78&r2=text&tr2=1.77&f=h - remove spurious VN_HOLD/VN_RELE calls from xfs_acl.c From owner-xfs@oss.sgi.com Thu Jul 24 19:39:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 19:39:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P2dfdw030553 for ; Thu, 24 Jul 2008 19:39:43 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA05489; Fri, 25 Jul 2008 12:40:51 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 1F8F058C4C3F; Fri, 25 Jul 2008 12:40:50 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove remaining VN_HOLD calls Message-Id: <20080725024051.1F8F058C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 12:40:50 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17160 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs remove remaining VN_HOLD calls Use IHOLD(ip) instead of VN_HOLD(VFS_I(ip)). Signed-off-by: Christoph Hellwig Date: Fri Jul 25 12:39:39 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31765a fs/xfs/xfs_dfrag.c - 1.69 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.69&r2=text&tr2=1.68&f=h fs/xfs/xfs_bmap.c - 1.398 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.398&r2=text&tr2=1.397&f=h fs/xfs/quota/xfs_dquot.c - 1.36 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_dquot.c.diff?r1=text&tr1=1.36&r2=text&tr2=1.35&f=h - remove remaining VN_HOLD calls From owner-xfs@oss.sgi.com Thu Jul 24 19:43:12 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 19:43:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P2hAf8031106 for ; Thu, 24 Jul 2008 19:43:11 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA05574; Fri, 25 Jul 2008 12:44:20 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 1B62A58C4C3F; Fri, 25 Jul 2008 12:44:19 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - implement IHOLD/IRELE directly Message-Id: <20080725024420.1B62A58C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 12:44:19 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17161 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs implement IHOLD/IRELE directly Now that all direct calls to VN_HOLD/VN_RELE are gone we can implement IHOLD/IRELE directly. For the IHOLD case also replace igrab with a direct increment of i_count because we are guaranteed to already have a live and referenced inode by the VFS. Also remove the vn_hold statistic because it's been rather meaningless for some time with most references done by other callers. Signed-off-by: Christoph Hellwig Date: Fri Jul 25 12:43:32 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31764a fs/xfs/xfs_utils.h - 1.44 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_utils.h.diff?r1=text&tr1=1.44&r2=text&tr2=1.43&f=h fs/xfs/linux-2.6/xfs_vnode.c - 1.160 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.160&r2=text&tr2=1.159&f=h fs/xfs/linux-2.6/xfs_vnode.h - 1.157 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.157&r2=text&tr2=1.156&f=h fs/xfs/linux-2.6/xfs_ksyms.c - 1.87 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.87&r2=text&tr2=1.86&f=h - implement IHOLD/IRELE directly From owner-xfs@oss.sgi.com Thu Jul 24 20:10:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 20:10:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P3AV9L032748 for ; Thu, 24 Jul 2008 20:10:31 -0700 X-ASG-Debug-ID: 1216955502-6480024a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 356A6E9DE2F for ; Thu, 24 Jul 2008 20:11:42 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id 5CMEIGDPCd4Wz7Oy for ; Thu, 24 Jul 2008 20:11:42 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 38977AC6272; Thu, 24 Jul 2008 22:11:41 -0500 (CDT) Message-ID: <48894466.4020507@sandeen.net> Date: Thu, 24 Jul 2008 22:11:34 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Niv Sardi CC: xfs-oss X-ASG-Orig-Subj: Re: [PATCH, RFC] - remove mounpoint UUID code Subject: Re: [PATCH, RFC] - remove mounpoint UUID code References: <47D20F78.7000103@sandeen.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216955503 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=COMMA_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.780 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 COMMA_SUBJECT Subject is like 'Re: FDSDS, this is a subject' X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17162 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Niv Sardi wrote: > ACK, removing it, it should be trivial to put back in if we ever need it. Ok, hch had some comments and this needs a careful eye towards any affected disk structures so probably should not go in immediately as-is. -Eric From owner-xfs@oss.sgi.com Thu Jul 24 20:37:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 20:37:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_83 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P3bY4p006610 for ; Thu, 24 Jul 2008 20:37:34 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA06750; Fri, 25 Jul 2008 13:38:42 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id D689558C4C3F; Fri, 25 Jul 2008 13:38:41 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove mounpoint UUID code Message-Id: <20080725033841.D689558C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 13:38:41 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17163 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs remove mounpoint UUID code It looks like all of the below is unused... and according to Nathan, "dont think it even got used/implemented anywhere, but i think it was meant to be an auto-mount kinda thing... such that when you look up at that point, it knows to mount the device with that uuid there, if its not already it was never really written anywhere ... just an idea in doug doucettes brain i think." Think it'll ever go anywhere, or should it get pruned? The below builds; not at all tested, until I get an idea if it's worth doing. Need to double check that some structures might not need padding out to keep things compatible/consistent... Date: Fri Jul 25 13:37:43 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: esandeen,hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31766a fs/xfs/xfsidbg.c - 1.356 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.356&r2=text&tr2=1.355&f=h fs/xfs/xfs_itable.c - 1.167 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_itable.c.diff?r1=text&tr1=1.167&r2=text&tr2=1.166&f=h fs/xfs/xfs_inode_item.c - 1.137 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode_item.c.diff?r1=text&tr1=1.137&r2=text&tr2=1.136&f=h fs/xfs/xfs_inode_item.h - 1.51 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode_item.h.diff?r1=text&tr1=1.51&r2=text&tr2=1.50&f=h fs/xfs/xfs_log_recover.c - 1.345 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.345&r2=text&tr2=1.344&f=h fs/xfs/xfs_inode.c - 1.510 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.510&r2=text&tr2=1.509&f=h fs/xfs/xfs_inode.h - 1.251 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.251&r2=text&tr2=1.250&f=h fs/xfs/xfs_attr_leaf.c - 1.115 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr_leaf.c.diff?r1=text&tr1=1.115&r2=text&tr2=1.114&f=h fs/xfs/xfs_bmap.c - 1.399 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.399&r2=text&tr2=1.398&f=h fs/xfs/xfs_dinode.h - 1.85 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dinode.h.diff?r1=text&tr1=1.85&r2=text&tr2=1.84&f=h fs/xfs/dmapi/xfs_dm.c - 1.77 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.77&r2=text&tr2=1.76&f=h From owner-xfs@oss.sgi.com Thu Jul 24 20:44:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 20:44:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_83, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P3iYHr007294 for ; Thu, 24 Jul 2008 20:44:34 -0700 X-ASG-Debug-ID: 1216957544-2f7c008f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 955B519255DD for ; Thu, 24 Jul 2008 20:45:44 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id pj6Vgm9BZWAqdZai for ; Thu, 24 Jul 2008 20:45:44 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id F1481AC6272; Thu, 24 Jul 2008 22:45:43 -0500 (CDT) Message-ID: <48894C66.5060204@sandeen.net> Date: Thu, 24 Jul 2008 22:45:42 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Niv Sardi-Altivanik CC: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - remove mounpoint UUID code Subject: Re: TAKE 981498 - remove mounpoint UUID code References: <20080725033841.D689558C4C3F@chook.melbourne.sgi.com> In-Reply-To: <20080725033841.D689558C4C3F@chook.melbourne.sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216957545 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.781 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17164 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Niv Sardi-Altivanik wrote: > remove mounpoint UUID code Are you sure this didn't change any disk structures? The patch I sent was RFC and completely untested... (and disclosed as such...) :) -Eric > It looks like all of the below is unused... and according > to Nathan, > > "dont think it even got used/implemented anywhere, but i think it > was meant to be an auto-mount kinda thing... such that when you look > up at that point, it knows to mount the device with that uuid there, > if its not already it was never really written anywhere ... just an > idea in doug doucettes brain i think." > > Think it'll ever go anywhere, or should it get pruned? > > The below builds; not at all tested, until I get an idea if it's worth > doing. Need to double check that some structures might not need padding > out to keep things compatible/consistent... > > > > Date: Fri Jul 25 13:37:43 AEST 2008 > Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 > Inspected by: esandeen,hch,xaiki > > The following file(s) were checked into: > longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb > > > Modid: xfs-linux-melb:xfs-kern:31766a > fs/xfs/xfsidbg.c - 1.356 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfsidbg.c.diff?r1=text&tr1=1.356&r2=text&tr2=1.355&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.356&r2=text&tr2=1.355&f=h > fs/xfs/xfs_itable.c - 1.167 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_itable.c.diff?r1=text&tr1=1.167&r2=text&tr2=1.166&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_itable.c.diff?r1=text&tr1=1.167&r2=text&tr2=1.166&f=h > fs/xfs/xfs_inode_item.c - 1.137 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_inode_item.c.diff?r1=text&tr1=1.137&r2=text&tr2=1.136&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode_item.c.diff?r1=text&tr1=1.137&r2=text&tr2=1.136&f=h > fs/xfs/xfs_inode_item.h - 1.51 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_inode_item.h.diff?r1=text&tr1=1.51&r2=text&tr2=1.50&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode_item.h.diff?r1=text&tr1=1.51&r2=text&tr2=1.50&f=h > fs/xfs/xfs_log_recover.c - 1.345 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_log_recover.c.diff?r1=text&tr1=1.345&r2=text&tr2=1.344&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_log_recover.c.diff?r1=text&tr1=1.345&r2=text&tr2=1.344&f=h > fs/xfs/xfs_inode.c - 1.510 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_inode.c.diff?r1=text&tr1=1.510&r2=text&tr2=1.509&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.510&r2=text&tr2=1.509&f=h > fs/xfs/xfs_inode.h - 1.251 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_inode.h.diff?r1=text&tr1=1.251&r2=text&tr2=1.250&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.251&r2=text&tr2=1.250&f=h > fs/xfs/xfs_attr_leaf.c - 1.115 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_attr_leaf.c.diff?r1=text&tr1=1.115&r2=text&tr2=1.114&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_attr_leaf.c.diff?r1=text&tr1=1.115&r2=text&tr2=1.114&f=h > fs/xfs/xfs_bmap.c - 1.399 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_bmap.c.diff?r1=text&tr1=1.399&r2=text&tr2=1.398&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_bmap.c.diff?r1=text&tr1=1.399&r2=text&tr2=1.398&f=h > fs/xfs/xfs_dinode.h - 1.85 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> xfs_dinode.h.diff?r1=text&tr1=1.85&r2=text&tr2=1.84&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dinode.h.diff?r1=text&tr1=1.85&r2=text&tr2=1.84&f=h > fs/xfs/dmapi/xfs_dm.c - 1.77 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/> dmapi/xfs_dm.c.diff?r1=text&tr1=1.77&r2=text&tr2=1.76&f=h > http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/dmapi/xfs_dm.c.diff?r1=text&tr1=1.77&r2=text&tr2=1.76&f=h > > From owner-xfs@oss.sgi.com Thu Jul 24 20:54:49 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 20:54:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P3smku008160 for ; Thu, 24 Jul 2008 20:54:49 -0700 X-ASG-Debug-ID: 1216958158-2f7f00e70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EE1AA1925530; Thu, 24 Jul 2008 20:55:58 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id DCYgKVex0RoxKoA8; Thu, 24 Jul 2008 20:55:58 -0700 (PDT) Received: from Russell-Cattelans-MacBook.local (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6P3tv96093362; Thu, 24 Jul 2008 22:55:58 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <48894ECC.1070609@thebarn.com> Date: Thu, 24 Jul 2008 22:55:56 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: markgw@sgi.com CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <48875040.9090400@thebarn.com> <48881B02.20900@sgi.com> In-Reply-To: <48881B02.20900@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7824/Thu Jul 24 20:48:33 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1216958159 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3979 1.0000 -0.0052 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.01 X-Barracuda-Spam-Status: No, SCORE=-0.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.782 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 17165 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > > > Russell Cattelan wrote: >>> Internally, we're attempting to refine our patch acceptance processes, >>> (e.g. gitify our internal dev tree and mirror it on oss so it's much >>> easier to push back out to oss). >> I'm sure you have seen this before: >> http://oss.sgi.com/cgi-bin/gitweb.cgi?p=cattelan/xfs-import/.git;a=summary' >> >> That is a running mirror of the ptools tree into git. (via the cvs tree) > > yes. But it's git -> ptools scripts that we need, preserving history, > etc. > Niv has some scripts for this - they're not production quality yet, but > we're getting there. Once this transitions, it'll be a *lot* easier for > us to pull in patches from external developer branches because we'll all > be using git for checkin. Personally I don't see a reason to keep a ptools tree in lock step with with a git tree. I all for not losing history (and I spent a bit of time when the tree was re-organized to keep the rcs history in tack). At this point the git tree has full xfs history and I would think this would be sufficient for what ever code archeology comes up. > >> It would be really nice to move all xfs development to git finally shut >> down >> the whole ptools -> cvs update process. > > once our internal dev tree is git based and internal git->ptools merging > is fully automatic, there is no actual need to shutdown the cvs crons. > It's worked for years and can stay running, no harm. Ya I'm still amazed those scripts are holding up given nobody is giving them any TLC. :-( > >> This would help facilitate creation of more "experimental" trees and/or >> branches >> so there would not be such a long delay of getting patches distributed. > > I think we'd just end up with a git dev branch on oss, maybe with a > daily pull from the internal dev tree (Russell, that would render > your cvs->git mirror obsolete I guess). In any case, patch flow and > turn-around should be greatly improved. The one thing about about SCM's that they are entirely a pain in the ass, but one of the most important tools in software engineering. So whatever happens it should be simple yet sufficient. > > Anyone have comments on any of the above? > > Cheers > -- Mark > From owner-xfs@oss.sgi.com Thu Jul 24 21:06:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 21:07:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P46reA009148 for ; Thu, 24 Jul 2008 21:06:54 -0700 Received: from [134.14.55.22] (dhcp22.melbourne.sgi.com [134.14.55.22]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA07611; Fri, 25 Jul 2008 14:08:01 +1000 Message-ID: <488951A1.9000408@sgi.com> Date: Fri, 25 Jul 2008 14:08:01 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Russell Cattelan CC: xfs@oss.sgi.com Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <48875040.9090400@thebarn.com> <48881B02.20900@sgi.com> <48894ECC.1070609@thebarn.com> In-Reply-To: <48894ECC.1070609@thebarn.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17166 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Russell Cattelan wrote: > Personally I don't see a reason to keep a ptools tree in lock step with > with a git tree. ... you might not, but you're not working for SGI anymore :) We have loads of other trees to merge stuff into other than those on oss. Many of the internal scripts for managing this are very intertwined with ptools. The one thing that will really help with handling externally contributed patches is for the primary internal SGI dev tree to become GIT based. But not having git->ptools auto merge is not an option. PCP is in the same boat, just ask Nathan :) Looking at this next week ... Cheers -- Mark From owner-xfs@oss.sgi.com Thu Jul 24 21:13:18 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 21:13:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P4DHom009802 for ; Thu, 24 Jul 2008 21:13:18 -0700 X-ASG-Debug-ID: 1216959267-77f001140000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3FDFF32C681 for ; Thu, 24 Jul 2008 21:14:28 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id hCeykChuwWXJ0VCy for ; Thu, 24 Jul 2008 21:14:28 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6P4EINg020796 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 25 Jul 2008 06:14:18 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6P4EIKq020794; Fri, 25 Jul 2008 06:14:18 +0200 Date: Fri, 25 Jul 2008 06:14:18 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 07/15] refactor xfs_btree_readahead Subject: Re: [PATCH 07/15] refactor xfs_btree_readahead Message-ID: <20080725041418.GB20636@lst.de> References: <20080723200859.GH7401@lst.de> <20080724233655.GH15438@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080724233655.GH15438@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216959269 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.782 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17167 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jul 25, 2008 at 09:36:55AM +1000, Dave Chinner wrote: > On Wed, Jul 23, 2008 at 10:08:59PM +0200, Christoph Hellwig wrote: > > From: Dave Chinner > > Can i review my own code? ;) Sure.. > > +STATIC int > > +xfs_btree_reada_corel( > > I've been wondering if this is the best naming convention - > appending a single s or l to indicate short or long btree ops. > Perhaps this would be better as xfs_btree_readahead_short() and > xfs_btree_readahead_long(), esp. as we dropped the 'core' from > the caller to make it xfs_btree_readahead(). > > Otherwise it looks good. I'll see if I can find a saner name. From owner-xfs@oss.sgi.com Thu Jul 24 21:27:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 21:27:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P4RTlC011047 for ; Thu, 24 Jul 2008 21:27:30 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08066; Fri, 25 Jul 2008 14:28:39 +1000 From: Niv Sardi To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH] use generic posix ACL code, enable ACL caching References: <20080614160127.GA15404@lst.de> <20080723201940.GA7908@lst.de> Date: Fri, 25 Jul 2008 14:28:30 +1000 In-Reply-To: <20080723201940.GA7908@lst.de> (Christoph Hellwig's message of "Wed, 23 Jul 2008 22:19:40 +0200") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17168 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig writes: > On Sat, Jun 14, 2008 at 06:01:27PM +0200, Christoph Hellwig wrote: >> Switch XFS to use the generic ACL code and enable caching the ACL values >> in the XFS inode. >> >> Compared to the last post various bugs have been fixed and a locking >> strategy has been designed and implemented. This now passes XFSQA. >> >> You'll need my various attr-related patches applies before this one. > > With various recent changes going in it needed another rediff. I also > moved the xfs_acl_chmod call into xfs_setattr from xfs_vn_setattr > because we would miss it for updates from dmapi. While doing this > I found out that xfs_acl_chmod is non-atomic vs the setattr which is > probably a bad thing, but also done that way in all other filesystems. > > Maybe we want to delay this patch until Niv's infrastructure to > piggy-back an attr_set ontop of an existing transaction is done so > that this issue could be solved. I like the patch, and don't think we need to wait for the trans aware attr code to get it in (it's not attomic now and nobody cares as you pointed out) that said, it's pretty big, and I'm did not review it carefully enough, and'd be *much* more comfortable if someone that knows the code more (like tes) could have a look at it before putting it in. Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 24 21:29:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 21:29:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P4Thu0011524 for ; Thu, 24 Jul 2008 21:29:44 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08329; Fri, 25 Jul 2008 14:30:52 +1000 From: Niv Sardi To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH] kill INDUCE_IO_ERROR References: <20080523062323.GA32637@lst.de> Date: Fri, 25 Jul 2008 14:30:43 +1000 In-Reply-To: <20080523062323.GA32637@lst.de> (Christoph Hellwig's message of "Fri, 23 May 2008 08:23:23 +0200") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17169 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs looks good, checking it in -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 24 21:30:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 21:30:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P4UQor011926 for ; Thu, 24 Jul 2008 21:30:26 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA08537; Fri, 25 Jul 2008 14:31:34 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 7BEFC58C4C3F; Fri, 25 Jul 2008 14:31:34 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - kill INDUCE_IO_ERROR Message-Id: <20080725043134.7BEFC58C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 14:31:34 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17170 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs kill INDUCE_IO_ERROR All the error injection is already enabled through ifdef DEBUG, so kill the never set second cpp symbol to activate it without the rest of the debugging infrastructure. Signed-off-by: Christoph Hellwig Date: Fri Jul 25 14:30:56 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31771a fs/xfs/xfs_mount.c - 1.439 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_mount.c.diff?r1=text&tr1=1.439&r2=text&tr2=1.438&f=h fs/xfs/xfs_error.c - 1.64 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_error.c.diff?r1=text&tr1=1.64&r2=text&tr2=1.63&f=h fs/xfs/xfs_error.h - 1.53 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_error.h.diff?r1=text&tr1=1.53&r2=text&tr2=1.52&f=h From owner-xfs@oss.sgi.com Thu Jul 24 21:31:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 21:31:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P4ViDk012338 for ; Thu, 24 Jul 2008 21:31:44 -0700 X-ASG-Debug-ID: 1216960373-7832014e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C4A6932C780; Thu, 24 Jul 2008 21:32:54 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Yl2smObkYdU79OCL; Thu, 24 Jul 2008 21:32:54 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6P4WaNg021692 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 25 Jul 2008 06:32:37 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6P4WUgp021679; Fri, 25 Jul 2008 06:32:30 +0200 Date: Fri, 25 Jul 2008 06:32:30 +0200 From: Christoph Hellwig To: Niv Sardi Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] use generic posix ACL code, enable ACL caching Subject: Re: [PATCH] use generic posix ACL code, enable ACL caching Message-ID: <20080725043230.GA21392@lst.de> References: <20080614160127.GA15404@lst.de> <20080723201940.GA7908@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216960375 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0115 1.0000 -1.9458 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.35 X-Barracuda-Spam-Status: No, SCORE=-1.35 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.783 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17171 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jul 25, 2008 at 02:28:30PM +1000, Niv Sardi wrote: > I like the patch, and don't think we need to wait for the trans aware > attr code to get it in (it's not attomic now and nobody cares as you > pointed out) that said, it's pretty big, and I'm did not review it > carefully enough, and'd be *much* more comfortable if someone that knows > the code more (like tes) could have a look at it before putting it in. Tim had started looking at it a while ago, and for a patch of this complexity I'm more than happy to wait a long time for a throughout review. This particular non-atomicy doesn't exist with the current code, btw because we don't do any adjustments of the ACL entries on chmod time. In fact we might just drop this call because XFS doesn't require the ACL to be minimal and the other filesystems only do it for compatiblity with future ACE entry types that will most likely never exist. That's why I'd like to wait for some comments from Tim - I just make sure the latest version of the patch always stays posted for anyone to look at it. From owner-xfs@oss.sgi.com Thu Jul 24 21:32:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 21:32:03 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P4W0jd012484 for ; Thu, 24 Jul 2008 21:32:00 -0700 X-ASG-Debug-ID: 1216960390-284102c60000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CBF3DE9E59D; Thu, 24 Jul 2008 21:33:10 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id G6mwegat1qIASjbE; Thu, 24 Jul 2008 21:33:10 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6P4X0Ng021728 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Fri, 25 Jul 2008 06:33:00 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6P4Wx58021724; Fri, 25 Jul 2008 06:32:59 +0200 Date: Fri, 25 Jul 2008 06:32:59 +0200 From: Christoph Hellwig To: Niv Sardi Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] kill INDUCE_IO_ERROR Subject: Re: [PATCH] kill INDUCE_IO_ERROR Message-ID: <20080725043259.GB21392@lst.de> References: <20080523062323.GA32637@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1216960391 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.783 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17172 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jul 25, 2008 at 02:30:43PM +1000, Niv Sardi wrote: > looks good, checking it in Donald NACKed this one.. From owner-xfs@oss.sgi.com Thu Jul 24 22:01:04 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 22:01:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P510Bl014440 for ; Thu, 24 Jul 2008 22:01:04 -0700 X-ASG-Debug-ID: 1216962130-2f72033c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D2F09192578E for ; Thu, 24 Jul 2008 22:02:10 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id m0tAXQTZBxSuDLTT for ; Thu, 24 Jul 2008 22:02:10 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCABD5iEh5LFxAiGdsb2JhbACSVAEBAQ8gnhU X-IronPort-AV: E=Sophos;i="4.31,251,1215354600"; d="scan'208";a="157192995" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 14:32:05 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMFR7-0005GY-HH; Fri, 25 Jul 2008 15:01:49 +1000 Date: Fri, 25 Jul 2008 15:01:49 +1000 From: Dave Chinner To: Eric Sandeen Cc: Niv Sardi-Altivanik , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - remove mounpoint UUID code Subject: Re: TAKE 981498 - remove mounpoint UUID code Message-ID: <20080725050149.GL5947@disturbed> Mail-Followup-To: Eric Sandeen , Niv Sardi-Altivanik , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com References: <20080725033841.D689558C4C3F@chook.melbourne.sgi.com> <48894C66.5060204@sandeen.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48894C66.5060204@sandeen.net> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216962131 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.786 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17173 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Jul 24, 2008 at 10:45:42PM -0500, Eric Sandeen wrote: > Niv Sardi-Altivanik wrote: > > remove mounpoint UUID code > > Are you sure this didn't change any disk structures? The patch I sent > was RFC and completely untested... (and disclosed as such...) :) Looking at the original patch, it definitely does change the format of log structures on disk. it removes the union of the uuid and rdev in the xfs_inode_log_format[32|64] which takes that entry from 16 bytes down to 4 bytes. So I'd suggest that thisss should be removed immediately before it hits public and people start corrupting their filesystems.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 22:08:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 22:08:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P58qc6015123 for ; Thu, 24 Jul 2008 22:08:53 -0700 Received: from cxfsmac10.melbourne.sgi.com (cxfsmac10.melbourne.sgi.com [134.14.55.100]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA09232; Fri, 25 Jul 2008 15:09:59 +1000 Message-ID: <48896038.4060207@sgi.com> Date: Fri, 25 Jul 2008 15:10:16 +1000 From: Donald Douwsma User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: Niv Sardi , xfs@oss.sgi.com Subject: Re: [PATCH] kill INDUCE_IO_ERROR References: <20080523062323.GA32637@lst.de> <20080725043259.GB21392@lst.de> In-Reply-To: <20080725043259.GB21392@lst.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17174 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Fri, Jul 25, 2008 at 02:30:43PM +1000, Niv Sardi wrote: >> looks good, checking it in > > Donald NACKed this one.. > Yep, but I changed my mind on it a while ago, the blocklayer error injection looks like a more useful framework for testing with release builds. Niv and I chatted about it and its fine by me. Don From owner-xfs@oss.sgi.com Thu Jul 24 22:11:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 22:11:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P5BjRo015568 for ; Thu, 24 Jul 2008 22:11:46 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA09280; Fri, 25 Jul 2008 15:12:55 +1000 From: Niv Sardi To: Eric Sandeen Cc: xfs-oss Subject: Re: [PATCH, RFC] - remove mounpoint UUID code References: <47D20F78.7000103@sandeen.net> <48894466.4020507@sandeen.net> Date: Fri, 25 Jul 2008 15:12:46 +1000 In-Reply-To: <48894466.4020507@sandeen.net> (Eric Sandeen's message of "Thu, 24 Jul 2008 22:11:34 -0500") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17175 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Eric Sandeen writes: > Niv Sardi wrote: >> ACK, removing it, it should be trivial to put back in if we ever need it. > > Ok, hch had some comments and this needs a careful eye towards any > affected disk structures so probably should not go in immediately as-is. Yeah, just saw that, well it's only in -dev now, so we'll audit it carefully, and see where it goes. I only read hch's last comment which ended in «This is really just dead junk that should go away.». Anyway, we now can use the awesome xfsqa infrastructure to have this tested =) Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Thu Jul 24 22:17:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 22:17:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P5HrmS016394 for ; Thu, 24 Jul 2008 22:17:54 -0700 Received: from linuxbuild.melbourne.sgi.com (linuxbuild.melbourne.sgi.com [134.14.54.115]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA09490; Fri, 25 Jul 2008 15:19:00 +1000 Received: by linuxbuild.melbourne.sgi.com (Postfix, from userid 16365) id C7093359F6F9; Fri, 25 Jul 2008 15:18:59 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: TAKE 981498 - kill xfs_lock_dir_and_entry Message-Id: <20080725051859.C7093359F6F9@linuxbuild.melbourne.sgi.com> Date: Fri, 25 Jul 2008 15:18:59 +1000 (EST) From: donaldd@sgi.com (Donald Douwsma) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17176 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: donaldd@sgi.com Precedence: bulk X-list: xfs kill xfs_lock_dir_and_entry When multiple inodes are locked in XFS it happens in order of the inode number, with the everything but the first inode trylocked if any of the previous inodes is in the AIL. Except for the sorting of the inodes this logic is implemented in xfs_lock_inodes, but also partially duplicated in xfs_lock_dir_and_entry in a particularly stupid way adds a lock roundtrip if the inode ordering is not optimal. This patch adds a new helper xfs_lock_two_inodes that takes two inodes and locks them in the most optimal way according to the above locking protocol and uses it for all places that want to lock two inodes. The only caller of xfs_lock_inodes is xfs_rename which might lock up to four inodes. Signed-off-by: Christoph Hellwig Date: Fri Jul 25 15:14:03 AEST 2008 Workarea: linuxbuild.melbourne.sgi.com:/home/donaldd/isms/2.6.x-xfs Inspected by: hch The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31772a fs/xfs/xfs_vnodeops.c - 1.769 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.769&r2=text&tr2=1.768&f=h - kill xfs_lock_dir_and_entry fs/xfs/xfs_dfrag.c - 1.70 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.70&r2=text&tr2=1.69&f=h - kill xfs_lock_dir_and_entry fs/xfs/xfs_inode.h - 1.252 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.252&r2=text&tr2=1.251&f=h - kill xfs_lock_dir_and_entry From owner-xfs@oss.sgi.com Thu Jul 24 22:19:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 22:19:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P5JeVw016801 for ; Thu, 24 Jul 2008 22:19:41 -0700 X-ASG-Debug-ID: 1216963251-12ae00710000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0882B19257EB for ; Thu, 24 Jul 2008 22:20:51 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id s3WK1NOScCHeSHGC for ; Thu, 24 Jul 2008 22:20:51 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KMFjX-0001NH-9Z; Fri, 25 Jul 2008 05:20:51 +0000 Date: Fri, 25 Jul 2008 01:20:51 -0400 From: Christoph Hellwig To: Christian Affolter Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: Corruption of in-memory data detected - on heavy hard linking Subject: Re: Corruption of in-memory data detected - on heavy hard linking Message-ID: <20080725052051.GA26367@infradead.org> References: <48876D03.8010804@stepping-stone.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <48876D03.8010804@stepping-stone.ch> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1216963252 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.788 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17177 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 07:40:19PM +0200, Christian Affolter wrote: > Kernel-Error: > Filesystem "sdc1": XFS internal error xfs_trans_cancel at line 1163 of > file fs/xfs/xfs_trans.c. Caller 0xffffffff803a4fcf > Pid: 22816, comm: cp Not tainted 2.6.24-gentoo-r8 #1 2.6.24 is pretty old. Did you try with a recent kernel? We had some fixes for in-core memory corruption although I don't remember one in this area. From owner-xfs@oss.sgi.com Thu Jul 24 22:25:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 22:25:11 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P5P5mb017439 for ; Thu, 24 Jul 2008 22:25:06 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA09614; Fri, 25 Jul 2008 15:26:14 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id B173B58C4C3F; Fri, 25 Jul 2008 15:26:14 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: REOPEN 981498 - Revert remove mounpoint UUID code Message-Id: <20080725052614.B173B58C4C3F@chook.melbourne.sgi.com> Date: Fri, 25 Jul 2008 15:26:14 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17178 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Revert remove mounpoint UUID code As spotted by dchinner and hch, this touches on-disk format and log format, should be more carefully reviewed. Date: Fri Jul 25 15:25:25 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: hch,xaiki Undoes mod: xfs-linux-melb:xfs-kern:31766a The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31773a fs/xfs/xfsidbg.c - 1.357 - changed fs/xfs/xfs_itable.c - 1.168 - changed fs/xfs/xfs_inode_item.c - 1.138 - changed fs/xfs/xfs_inode_item.h - 1.52 - changed fs/xfs/xfs_log_recover.c - 1.346 - changed fs/xfs/xfs_inode.c - 1.511 - changed fs/xfs/xfs_inode.h - 1.253 - changed fs/xfs/xfs_attr_leaf.c - 1.116 - changed fs/xfs/xfs_bmap.c - 1.400 - changed fs/xfs/xfs_dinode.h - 1.86 - changed fs/xfs/dmapi/xfs_dm.c - 1.78 - changed From owner-xfs@oss.sgi.com Thu Jul 24 22:39:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 22:39:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P5dTG7018464 for ; Thu, 24 Jul 2008 22:39:29 -0700 X-ASG-Debug-ID: 1216964439-71f303370000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D048C32C96D; Thu, 24 Jul 2008 22:40:39 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id jgUPRcD0RbYtU7ZS; Thu, 24 Jul 2008 22:40:39 -0700 (PDT) Received: from Russell-Cattelans-MacBook.local (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6P5eccK095036; Fri, 25 Jul 2008 00:40:38 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <48896756.6040101@thebarn.com> Date: Fri, 25 Jul 2008 00:40:38 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: markgw@sgi.com CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <48875040.9090400@thebarn.com> <48881B02.20900@sgi.com> <48894ECC.1070609@thebarn.com> <488951A1.9000408@sgi.com> In-Reply-To: <488951A1.9000408@sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7824/Thu Jul 24 20:48:33 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1216964440 X-Barracuda-Bayes: INNOCENT GLOBAL 0.3431 1.0000 -0.1776 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.18 X-Barracuda-Spam-Status: No, SCORE=-0.18 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.787 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 17179 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Mark Goodwin wrote: > > > Russell Cattelan wrote: >> Personally I don't see a reason to keep a ptools tree in lock step with >> with a git tree. ... > > you might not, but you're not working for SGI anymore :) > We have loads of other trees to merge stuff into other than > those on oss. Ya I'm familiar with the complexity disguising itself as productivity. (But I will say I experienced a much worse complexity for the sake of complexity situation) > Many of the internal scripts for managing this > are very intertwined with ptools. The one thing that will > really help with handling externally contributed patches is > for the primary internal SGI dev tree to become GIT based. > But not having git->ptools auto merge is not an option. Actually if auto merge is a requirement I don't really see a shift in policy. I don't see much difference in a ptool->git vs a git->ptools process. Just because git is the birthing repo for changes, it seems like that is just drawing more process into things and making change adoption just as slow if not slower. It seems like decoupling the process, not just switching SCM's and allowing experimental changes to come to light sooner is what people are looking for. > > PCP is in the same boat, just ask Nathan :) > > Looking at this next week ... > > Cheers > -- Mark > From owner-xfs@oss.sgi.com Thu Jul 24 23:11:45 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 23:11:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6P6BioQ020582 for ; Thu, 24 Jul 2008 23:11:45 -0700 X-ASG-Debug-ID: 1216966374-783003580000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7873732CA78 for ; Thu, 24 Jul 2008 23:12:54 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Szk4z7Woyxzv1QE9 for ; Thu, 24 Jul 2008 23:12:54 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AncCAKUKiUh5LFxAiGdsb2JhbACSVAEBAQ8gnlc X-IronPort-AV: E=Sophos;i="4.31,251,1215354600"; d="scan'208";a="157234948" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 25 Jul 2008 15:42:53 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMGXr-0008Gi-AU; Fri, 25 Jul 2008 16:12:51 +1000 Date: Fri, 25 Jul 2008 16:12:50 +1000 From: Dave Chinner To: Donald Douwsma Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - kill xfs_lock_dir_and_entry Subject: Re: TAKE 981498 - kill xfs_lock_dir_and_entry Message-ID: <20080725061250.GM5947@disturbed> Mail-Followup-To: Donald Douwsma , xfs@oss.sgi.com References: <20080725051859.C7093359F6F9@linuxbuild.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080725051859.C7093359F6F9@linuxbuild.melbourne.sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1216966375 X-Barracuda-Bayes: INNOCENT GLOBAL 0.1674 1.0000 -1.0041 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.00 X-Barracuda-Spam-Status: No, SCORE=-1.00 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.790 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17180 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Fri, Jul 25, 2008 at 03:18:59PM +1000, Donald Douwsma wrote: > kill xfs_lock_dir_and_entry .... > Date: Fri Jul 25 15:14:03 AEST 2008 > Workarea: linuxbuild.melbourne.sgi.com:/home/donaldd/isms/2.6.x-xfs > Inspected by: hch Ah - I think you are dropping the review on all these checkins, Donald. My name should be against that as having reviewed it.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Thu Jul 24 23:54:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 24 Jul 2008 23:54:25 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6P6sLel023071 for ; Thu, 24 Jul 2008 23:54:22 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA11555; Fri, 25 Jul 2008 16:55:31 +1000 From: Niv Sardi To: Russell Cattelan Cc: markgw@sgi.com, xfs@oss.sgi.com Subject: Re: [PATCH 2/4] XFS: Use the inode tree for finding dirty inodes References: <1216556394-17529-1-git-send-email-david@fromorbit.com> <1216556394-17529-3-git-send-email-david@fromorbit.com> <20080722042829.GB27123@infradead.org> <20080722053019.GI6761@disturbed> <20080722072733.GA15376@infradead.org> <20080723000548.GG5947@disturbed> <488692FB.1010101@sgi.com> <48875040.9090400@thebarn.com> <48881B02.20900@sgi.com> <48894ECC.1070609@thebarn.com> Date: Fri, 25 Jul 2008 16:55:22 +1000 In-Reply-To: <48894ECC.1070609@thebarn.com> (Russell Cattelan's message of "Thu, 24 Jul 2008 22:55:56 -0500") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17181 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Russell Cattelan writes: > Mark Goodwin wrote: >> Russell Cattelan wrote: >>>> Internally, we're attempting to refine our patch acceptance processes, >>>> (e.g. gitify our internal dev tree and mirror it on oss so it's much >>>> easier to push back out to oss). >>> I'm sure you have seen this before: >>> http://oss.sgi.com/cgi-bin/gitweb.cgi?p=cattelan/xfs-import/.git;a=summary' moving from one SCM that is not syncable with the community to another is not helping at all. While that clone is great to work *with* git, the commit ids have nothing to do with the community's one, and we stil have to convert all the work (to fixup commiter names and so forth too) to be able to be integrated in the community. >>> That is a running mirror of the ptools tree into git. (via the cvs tree) >> yes. But it's git -> ptools scripts that we need, preserving >> history, etc. >> Niv has some scripts for this - they're not production quality yet, but >> we're getting there. Once this transitions, it'll be a *lot* easier for >> us to pull in patches from external developer branches because we'll all >> be using git for checkin. > Personally I don't see a reason to keep a ptools tree in lock step with > with a git tree. I all for not losing history (and I spent a bit of > time when > the tree was re-organized to keep the rcs history in tack). > At this point the git tree has full xfs history and I would think this would > be sufficient for what ever code archeology comes up. for code archeology, we have many other trees. I'm more interested to be able to answer things like: 'what commits have never made it to linus ?' (dmapi, patches that had to be slightly changed) and be able to sort all our mods in 3 categories: merged-upstream (git-patch-id equality), partly-merged-upstream (commit title equality), unkonwn-upstream. I have a tree here, ready to be used to replace the internal ptools tree, it needs some more work to detect the non-merged part of the partly-merged-upstream, but well, the diff is mostly whitespaces, and I guess we can discard them. Hopefully, this can be widely used RSN. Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Fri Jul 25 08:00:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 25 Jul 2008 08:00:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6PF0KM6000496 for ; Fri, 25 Jul 2008 08:00:21 -0700 X-ASG-Debug-ID: 1216998091-45ae035e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1E7D91BBBE1C for ; Fri, 25 Jul 2008 08:01:31 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id iDqWBxCQpvYyQdpJ for ; Fri, 25 Jul 2008 08:01:31 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 86253AC6272; Fri, 25 Jul 2008 10:01:30 -0500 (CDT) Message-ID: <4889EAC9.5070304@sandeen.net> Date: Fri, 25 Jul 2008 10:01:29 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Eric Sandeen , Niv Sardi-Altivanik , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - remove mounpoint UUID code Subject: Re: TAKE 981498 - remove mounpoint UUID code References: <20080725033841.D689558C4C3F@chook.melbourne.sgi.com> <48894C66.5060204@sandeen.net> <20080725050149.GL5947@disturbed> In-Reply-To: <20080725050149.GL5947@disturbed> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1216998092 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.826 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17182 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Dave Chinner wrote: > On Thu, Jul 24, 2008 at 10:45:42PM -0500, Eric Sandeen wrote: >> Niv Sardi-Altivanik wrote: >>> remove mounpoint UUID code >> Are you sure this didn't change any disk structures? The patch I sent >> was RFC and completely untested... (and disclosed as such...) :) > > Looking at the original patch, it definitely does change the format > of log structures on disk. it removes the union of the uuid and rdev > in the xfs_inode_log_format[32|64] which takes that entry from 16 > bytes down to 4 bytes. So I'd suggest that thisss should be removed > immediately before it hits public and people start corrupting their > filesystems.... Yep. Well crud, I even knew that when I sent it, hence the RFC/untested/blah/blah but I suppose I shouldn't send a patch that I know to be busted even if it's just as a whaddya-think. I'll pad out the union, check all the log structs, run qa & resend. And despite all the talk about community & contributors running qa and helping with test coverage - as a general rule do sgi devels run qa too before committing? -Eric > Cheers, > > Dave. From owner-xfs@oss.sgi.com Fri Jul 25 12:28:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 25 Jul 2008 12:28:49 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6PJSkpc017441 for ; Fri, 25 Jul 2008 12:28:46 -0700 X-ASG-Debug-ID: 1217014196-6ecf03c70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D115432FC05 for ; Fri, 25 Jul 2008 12:29:56 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id QUwhRtre2XXzrU4S for ; Fri, 25 Jul 2008 12:29:56 -0700 (PDT) Received: from Liberator.local (24-181-159-178.dhcp.dlth.mn.charter.com [24.181.159.178]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 3F46BAC6272; Fri, 25 Jul 2008 14:29:55 -0500 (CDT) Message-ID: <488A29B0.9090804@sandeen.net> Date: Fri, 25 Jul 2008 14:29:52 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Bernard Li , xfs-oss X-ASG-Orig-Subj: Re: Help with XFS... Subject: Re: Help with XFS... References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1217014197 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.843 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17183 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Bernard Li wrote: > Hi Eric: You should just send this to the list (cc'd), many more eyes will see it and might have better suggestions. In general though if the log won't replay on mount, xfs_repair -L is the thing. since you're on devicemapper, you probably got burned by the lack of barriers / ordered write support in dm, and that led to your unreplayable log corruption when you lost power. Going forward, I'd suggest that a UPS would be a good investment. -Eric > Sorry for writing you directly, but I figure you're probably the best > person I could ask, regarding this issue. So if you have some time, I > would appreciate some feedback from you, thanks! > > So we had a power outage and upon bringing up a file server, we can no > longer mount a XFS partition: > > mount: Structure needs cleaning > > and we got the following in /var/log/messages: > > Jul 25 11:48:52 vus-sxmail-v032 kernel: XFS mounting filesystem dm-7 > Jul 25 11:48:52 vus-sxmail-v032 kernel: Starting XFS recovery on > filesystem: dm-7 (logdev: internal) > Jul 25 11:48:52 vus-sxmail-v032 kernel: Filesystem "dm-7": XFS > internal error xlog_valid_rec_header(1) at line 3449 of file > fs/xfs/xfs_log_recover.c. Caller 0xf8e833bb > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xlog_valid_rec_header+0xcd/0xd9 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xlog_do_recovery_pass+0x21f/0x79d [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xlog_do_recovery_pass+0x21f/0x79d [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > autoremove_wake_function+0xd/0x2d > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] schedule+0x4c2/0x538 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xlog_do_log_recovery+0x34/0x94 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xlog_do_recover+0x12/0xf3 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xlog_recover+0x75/0x84 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_log_mount+0x96/0xce [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_mountfs+0x87f/0xaf9 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_setsize_buftarg_flags+0x2a/0x89 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_buf_rele+0x21/0x5f [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_readsb+0x17c/0x198 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_mount+0x2e1/0x357 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] xfs_mount+0x0/0x357 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] vfs_mount+0x17/0x1a [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_fs_fill_super+0x68/0x175 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] snprintf+0x1c/0x1f > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] disk_name+0x1f/0x60 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] get_sb_bdev+0xc6/0x10e > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] __alloc_pages+0x57/0x297 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_fs_get_sb+0xe/0x11 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > xfs_fs_fill_super+0x0/0x175 [xfs] > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] do_kern_mount+0x8f/0x13d > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] do_mount+0x5fa/0x648 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] mntput_no_expire+0x11/0x62 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] link_path_walk+0xaf/0xb9 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] dput+0x22/0x113 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] mntput_no_expire+0x11/0x62 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > __handle_mm_fault+0x7dd/0x7f3 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > get_page_from_freelist+0x6f/0x29d > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] do_page_fault+0x16c/0x51e > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > copy_mount_options+0x26/0x109 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] sys_mount+0x64/0x97 > Jul 25 11:48:52 vus-sxmail-v032 kernel: [] > sysenter_past_esp+0x54/0x79 > Jul 25 11:48:52 vus-sxmail-v032 kernel: XFS: log mount/recovery > failed: error 117 > Jul 25 11:48:52 vus-sxmail-v032 kernel: XFS: log mount failed > > I think we have two options with xfs_repair: > > 1) Run it with -L and zero the log > 2) Run it without -L and try to replay the log > > Any insight? We are running 2.6.16.54-0.2.5-default kernel. > > I guess it might be a good idea to run xfs_dump on the filesystem to > try to salvage whatever we have before we try xfs_repair... > > Thanks a lot in advance, > > Bernard > From owner-xfs@oss.sgi.com Fri Jul 25 23:32:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 25 Jul 2008 23:33:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q6Wbs9002440 for ; Fri, 25 Jul 2008 23:32:38 -0700 X-ASG-Debug-ID: 1217054028-31a000db0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 557DC192E570 for ; Fri, 25 Jul 2008 23:33:48 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id Qa2gNNVjMyhb388M for ; Fri, 25 Jul 2008 23:33:48 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q6XdNg022939 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 08:33:39 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q6XdeU022937 for xfs@oss.sgi.com; Sat, 26 Jul 2008 08:33:39 +0200 Date: Sat, 26 Jul 2008 08:33:39 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 3/3] stop using file_update_time Subject: [PATCH 3/3] stop using file_update_time Message-ID: <20080726063339.GC22603@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217054029 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.887 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17186 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs xfs_ichtime updates the xfs_inode and Linux inode timestamps just fine, no need to call file_update_time and then copy the values over to the XFS inode. The only additional thing in file_update_time are checks not applicable to the write path. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-24 08:37:09.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-24 08:37:18.000000000 +0200 @@ -134,52 +134,6 @@ xfs_ichgtime( } /* - * Variant on the above which avoids querying the system clock - * in situations where we know the Linux inode timestamps have - * just been updated (and so we can update our inode cheaply). - */ -void -xfs_ichgtime_fast( - xfs_inode_t *ip, - struct inode *inode, - int flags) -{ - timespec_t *tvp; - - /* - * We're not supposed to change timestamps in readonly-mounted - * filesystems. Throw it away if anyone asks us. - */ - if (unlikely(IS_RDONLY(inode))) - return; - - if (flags & XFS_ICHGTIME_MOD) { - tvp = &inode->i_mtime; - ip->i_d.di_mtime.t_sec = (__int32_t)tvp->tv_sec; - ip->i_d.di_mtime.t_nsec = (__int32_t)tvp->tv_nsec; - } - if (flags & XFS_ICHGTIME_CHG) { - tvp = &inode->i_ctime; - ip->i_d.di_ctime.t_sec = (__int32_t)tvp->tv_sec; - ip->i_d.di_ctime.t_nsec = (__int32_t)tvp->tv_nsec; - } - - /* - * We update the i_update_core field _after_ changing - * the timestamps in order to coordinate properly with - * xfs_iflush() so that we don't lose timestamp updates. - * This keeps us from having to hold the inode lock - * while doing this. We use the SYNCHRONIZE macro to - * ensure that the compiler does not reorder the update - * of i_update_core above the timestamp updates above. - */ - SYNCHRONIZE(); - ip->i_update_core = 1; - if (!(inode->i_state & I_NEW)) - mark_inode_dirty_sync(inode); -} - -/* * Hook in SELinux. This is not quite correct yet, what we really need * here (as we do for default ACLs) is a mechanism by which creation of * these attrs can be journalled at inode creation time (along with the Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h 2008-07-24 08:37:09.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h 2008-07-24 08:37:40.000000000 +0200 @@ -26,9 +26,6 @@ extern const struct file_operations xfs_ extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size); -extern void xfs_ichgtime(struct xfs_inode *, int); -extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); - extern void xfs_setup_inode(struct xfs_inode *); #endif /* __XFS_IOPS_H__ */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c 2008-07-24 08:37:09.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c 2008-07-24 08:37:18.000000000 +0200 @@ -667,11 +667,8 @@ start: if (new_size > xip->i_size) xip->i_new_size = new_size; - if (likely(!(ioflags & IO_INVIS))) { - file_update_time(file); - xfs_ichgtime_fast(xip, inode, - XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); - } + if (likely(!(ioflags & IO_INVIS))) + xfs_ichgtime(xip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG); /* * If the offset is beyond the size of the file, we have a couple Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-24 08:37:09.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-24 08:37:18.000000000 +0200 @@ -294,7 +294,6 @@ EXPORT_SYMBOL(xfs_dinode_from_disk); EXPORT_SYMBOL(xfs_sb_from_disk); EXPORT_SYMBOL(xfs_zero_eof); EXPORT_SYMBOL(xlog_recover_process_iunlinks); -EXPORT_SYMBOL(xfs_ichgtime_fast); EXPORT_SYMBOL(xfs_free_eofblocks); EXPORT_SYMBOL(xfs_do_force_shutdown); From owner-xfs@oss.sgi.com Fri Jul 25 23:32:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 25 Jul 2008 23:33:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q6WU2A002419 for ; Fri, 25 Jul 2008 23:32:31 -0700 X-ASG-Debug-ID: 1217054021-318400ef0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 10EFC192E56D for ; Fri, 25 Jul 2008 23:33:41 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id cCDnfVGN3RgH2RAe for ; Fri, 25 Jul 2008 23:33:41 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q6XVNg022911 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 08:33:31 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q6XVgj022909 for xfs@oss.sgi.com; Sat, 26 Jul 2008 08:33:31 +0200 Date: Sat, 26 Jul 2008 08:33:31 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/3] update timestamp in xfs_ialloc manually Subject: [PATCH 1/3] update timestamp in xfs_ialloc manually Message-ID: <20080726063331.GA22603@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217054022 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.887 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17184 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs In xfs_ialloc we just want to set all timestamps to the current time. We don't need to mark the inode dirty like xfs_ichgtime does, and we don't need nor want the opimizations in xfs_ichgtime that I will introduce in the next patch. So just opencode the timestamp update in xfs_ialloc, and remove the new unused XFS_ICHGTIME_ACC case in xfs_ichgtime. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 23:29:42.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 23:29:59.000000000 +0200 @@ -89,12 +89,6 @@ xfs_mark_inode_dirty_sync( * Change the requested timestamp in the given inode. * We don't lock across timestamp updates, and we don't log them but * we do record the fact that there is dirty information in core. - * - * NOTE -- callers MUST combine XFS_ICHGTIME_MOD or XFS_ICHGTIME_CHG - * with XFS_ICHGTIME_ACC to be sure that access time - * update will take. Calling first with XFS_ICHGTIME_ACC - * and then XFS_ICHGTIME_MOD may fail to modify the access - * timestamp if the filesystem is mounted noacctm. */ void xfs_ichgtime( @@ -110,11 +104,6 @@ xfs_ichgtime( ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; } - if (flags & XFS_ICHGTIME_ACC) { - inode->i_atime = tv; - ip->i_d.di_atime.t_sec = (__int32_t)tv.tv_sec; - ip->i_d.di_atime.t_nsec = (__int32_t)tv.tv_nsec; - } if (flags & XFS_ICHGTIME_CHG) { inode->i_ctime = tv; ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; @@ -150,12 +139,6 @@ xfs_ichgtime_fast( timespec_t *tvp; /* - * Atime updates for read() & friends are handled lazily now, and - * explicit updates must go through xfs_ichgtime() - */ - ASSERT((flags & XFS_ICHGTIME_ACC) == 0); - - /* * We're not supposed to change timestamps in readonly-mounted * filesystems. Throw it away if anyone asks us. */ Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-23 23:27:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-23 23:29:07.000000000 +0200 @@ -1049,6 +1049,7 @@ xfs_ialloc( xfs_inode_t *ip; uint flags; int error; + timespec_t tv; /* * Call the space management code to pick @@ -1129,7 +1130,13 @@ xfs_ialloc( ip->i_size = 0; ip->i_d.di_nextents = 0; ASSERT(ip->i_d.di_nblocks == 0); - xfs_ichgtime(ip, XFS_ICHGTIME_CHG|XFS_ICHGTIME_ACC|XFS_ICHGTIME_MOD); + + nanotime(&tv); + ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; + ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; + ip->i_d.di_atime = ip->i_d.di_mtime; + ip->i_d.di_ctime = ip->i_d.di_mtime; + /* * di_gen will have been taken care of in xfs_iread. */ Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-23 23:30:06.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-23 23:30:16.000000000 +0200 @@ -87,8 +87,7 @@ typedef struct xfs_ifork { * Flags for xfs_ichgtime(). */ #define XFS_ICHGTIME_MOD 0x1 /* data fork modification timestamp */ -#define XFS_ICHGTIME_ACC 0x2 /* data fork access timestamp */ -#define XFS_ICHGTIME_CHG 0x4 /* inode field change timestamp */ +#define XFS_ICHGTIME_CHG 0x2 /* inode field change timestamp */ /* * Per-fork incore inode flags. Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c 2008-07-23 23:29:21.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c 2008-07-23 23:29:37.000000000 +0200 @@ -513,7 +513,6 @@ xfs_setattr( ip->i_d.di_atime.t_sec = iattr->ia_atime.tv_sec; ip->i_d.di_atime.t_nsec = iattr->ia_atime.tv_nsec; ip->i_update_core = 1; - timeflags &= ~XFS_ICHGTIME_ACC; } if (mask & ATTR_MTIME) { inode->i_mtime = iattr->ia_mtime; From owner-xfs@oss.sgi.com Fri Jul 25 23:32:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Fri, 25 Jul 2008 23:33:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q6WYUU002428 for ; Fri, 25 Jul 2008 23:32:34 -0700 X-ASG-Debug-ID: 1217054024-0bb2039c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AF7C6331892 for ; Fri, 25 Jul 2008 23:33:45 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id pVNCyVxFA1eFhxuT for ; Fri, 25 Jul 2008 23:33:45 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q6XZNg022925 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 08:33:35 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q6XZG9022923 for xfs@oss.sgi.com; Sat, 26 Jul 2008 08:33:35 +0200 Date: Sat, 26 Jul 2008 08:33:35 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 2/3] optimize xfs_ichgtime Subject: [PATCH 2/3] optimize xfs_ichgtime Message-ID: <20080726063335.GB22603@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217054026 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.886 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17185 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Port a little optmization from file_update_time to xfs_ichgtime, and only update the timestamp and mark the inode dirty if the timestamp actually changes in the timer tick resultion supported by the running kernel. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 23:31:32.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-23 23:34:20.000000000 +0200 @@ -97,17 +97,23 @@ xfs_ichgtime( { struct inode *inode = VFS_I(ip); timespec_t tv; + int sync_it = 0; - nanotime(&tv); - if (flags & XFS_ICHGTIME_MOD) { + tv = current_fs_time(inode->i_sb); + + if ((flags & XFS_ICHGTIME_MOD) && + !timespec_equal(&inode->i_mtime, &tv)) { inode->i_mtime = tv; ip->i_d.di_mtime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_mtime.t_nsec = (__int32_t)tv.tv_nsec; + sync_it = 1; } - if (flags & XFS_ICHGTIME_CHG) { + if ((flags & XFS_ICHGTIME_CHG) && + !timespec_equal(&inode->i_ctime, &tv)) { inode->i_ctime = tv; ip->i_d.di_ctime.t_sec = (__int32_t)tv.tv_sec; ip->i_d.di_ctime.t_nsec = (__int32_t)tv.tv_nsec; + sync_it = 1; } /* @@ -119,10 +125,12 @@ xfs_ichgtime( * ensure that the compiler does not reorder the update * of i_update_core above the timestamp updates above. */ - SYNCHRONIZE(); - ip->i_update_core = 1; - if (!(inode->i_state & I_NEW)) - mark_inode_dirty_sync(inode); + if (sync_it) { + SYNCHRONIZE(); + ip->i_update_core = 1; + if (!(inode->i_state & I_NEW)) + mark_inode_dirty_sync(inode); + } } /* From owner-xfs@oss.sgi.com Sat Jul 26 02:06:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:06:27 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q96Ibw019389 for ; Sat, 26 Jul 2008 02:06:19 -0700 X-ASG-Debug-ID: 1217063248-0a2202720000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DFAAC331B65 for ; Sat, 26 Jul 2008 02:07:28 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id FXk1XyS0A9wuZe5F for ; Sat, 26 Jul 2008 02:07:28 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoCAE+Gikh5LFxAiGdsb2JhbACSTgEBAQ8gmxU X-IronPort-AV: E=Sophos;i="4.31,255,1215354600"; d="scan'208";a="157840078" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Jul 2008 18:37:27 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMfkL-0002MW-Sk; Sat, 26 Jul 2008 19:07:25 +1000 Date: Sat, 26 Jul 2008 19:07:25 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/3] update timestamp in xfs_ialloc manually Subject: Re: [PATCH 1/3] update timestamp in xfs_ialloc manually Message-ID: <20080726090725.GR5947@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080726063331.GA22603@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726063331.GA22603@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217063249 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0207 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17187 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sat, Jul 26, 2008 at 08:33:31AM +0200, Christoph Hellwig wrote: > In xfs_ialloc we just want to set all timestamps to the current time. > We don't need to mark the inode dirty like xfs_ichgtime does, and we > don't need nor want the opimizations in xfs_ichgtime that I will > introduce in the next patch. Looks sane, and solves an issue with code I'm working on, too. FWIW, the conditional check against I_NEW before marking the indo dirty can be removed as well, as this was call that required avoiding avoiding it. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sat Jul 26 02:11:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:11:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9BLif019995 for ; Sat, 26 Jul 2008 02:11:21 -0700 X-ASG-Debug-ID: 1217063552-6c32018c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3F4AAEA58FE for ; Sat, 26 Jul 2008 02:12:32 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id J1y9H0ggDGvpOWa8 for ; Sat, 26 Jul 2008 02:12:32 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoCAE+Gikh5LFxAiGdsb2JhbACSTgEBAQ8gmxU X-IronPort-AV: E=Sophos;i="4.31,255,1215354600"; d="scan'208";a="157841768" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Jul 2008 18:42:30 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMfpG-0002UN-3X; Sat, 26 Jul 2008 19:12:30 +1000 Date: Sat, 26 Jul 2008 19:12:30 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 2/3] optimize xfs_ichgtime Subject: Re: [PATCH 2/3] optimize xfs_ichgtime Message-ID: <20080726091230.GS5947@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080726063335.GB22603@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726063335.GB22603@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217063553 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0015 1.0000 -2.0111 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.898 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17188 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sat, Jul 26, 2008 at 08:33:35AM +0200, Christoph Hellwig wrote: > Port a little optmization from file_update_time to xfs_ichgtime, and > only update the timestamp and mark the inode dirty if the timestamp > actually changes in the timer tick resultion supported by the running > kernel. Looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sat Jul 26 02:12:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:12:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9CcSq020143 for ; Sat, 26 Jul 2008 02:12:39 -0700 X-ASG-Debug-ID: 1217063629-0a2202af0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 952BB331B7C for ; Sat, 26 Jul 2008 02:13:49 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id f1qaQztyxCskeYT2 for ; Sat, 26 Jul 2008 02:13:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoCAE+Gikh5LFxAiGdsb2JhbACSTgEBAQ8gmxU X-IronPort-AV: E=Sophos;i="4.31,255,1215354600"; d="scan'208";a="157842304" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Jul 2008 18:43:48 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMfqW-0002W5-F7; Sat, 26 Jul 2008 19:13:48 +1000 Date: Sat, 26 Jul 2008 19:13:48 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] stop using file_update_time Subject: Re: [PATCH 3/3] stop using file_update_time Message-ID: <20080726091348.GT5947@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080726063339.GC22603@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726063339.GC22603@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217063630 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17189 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sat, Jul 26, 2008 at 08:33:39AM +0200, Christoph Hellwig wrote: > xfs_ichtime updates the xfs_inode and Linux inode timestamps just fine, > no need to call file_update_time and then copy the values over to the > XFS inode. The only additional thing in file_update_time are checks > not applicable to the write path. ..... > Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h 2008-07-24 08:37:09.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h 2008-07-24 08:37:40.000000000 +0200 > @@ -26,9 +26,6 @@ extern const struct file_operations xfs_ > > extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size); > > -extern void xfs_ichgtime(struct xfs_inode *, int); > -extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); > - I don't think you meant to remove the xfs_ichgtime() prototype as well... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sat Jul 26 02:13:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:13:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9DSVb020498 for ; Sat, 26 Jul 2008 02:13:28 -0700 X-ASG-Debug-ID: 1217063678-0a1f02e40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 164FF331B84 for ; Sat, 26 Jul 2008 02:14:38 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id kKgXCOSCjGXgd7qf for ; Sat, 26 Jul 2008 02:14:38 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9ESNg029744 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 26 Jul 2008 11:14:28 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9ESTd029742; Sat, 26 Jul 2008 11:14:28 +0200 Date: Sat, 26 Jul 2008 11:14:28 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] stop using file_update_time Subject: Re: [PATCH 3/3] stop using file_update_time Message-ID: <20080726091428.GA29710@lst.de> References: <20080726063339.GC22603@lst.de> <20080726091348.GT5947@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726091348.GT5947@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217063680 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17190 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Sat, Jul 26, 2008 at 07:13:48PM +1000, Dave Chinner wrote: > I don't think you meant to remove the xfs_ichgtime() prototype > as well... Actually I did, but I forgot to mention why. There's a second prototype in xfs_inode.h which is enough. From owner-xfs@oss.sgi.com Sat Jul 26 02:13:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:14:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9DwkL020775 for ; Sat, 26 Jul 2008 02:13:59 -0700 X-ASG-Debug-ID: 1217063708-2c1900ae0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 817BC331B8D for ; Sat, 26 Jul 2008 02:15:09 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 1NXUtEttb4OleBBz for ; Sat, 26 Jul 2008 02:15:09 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9ExNg029790 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Sat, 26 Jul 2008 11:14:59 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9ExuF029788; Sat, 26 Jul 2008 11:14:59 +0200 Date: Sat, 26 Jul 2008 11:14:59 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 1/3] update timestamp in xfs_ialloc manually Subject: Re: [PATCH 1/3] update timestamp in xfs_ialloc manually Message-ID: <20080726091459.GB29710@lst.de> References: <20080726063331.GA22603@lst.de> <20080726090725.GR5947@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726090725.GR5947@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217063710 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17191 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Sat, Jul 26, 2008 at 07:07:25PM +1000, Dave Chinner wrote: > On Sat, Jul 26, 2008 at 08:33:31AM +0200, Christoph Hellwig wrote: > > In xfs_ialloc we just want to set all timestamps to the current time. > > We don't need to mark the inode dirty like xfs_ichgtime does, and we > > don't need nor want the opimizations in xfs_ichgtime that I will > > introduce in the next patch. > > Looks sane, and solves an issue with code I'm working on, too. > > FWIW, the conditional check against I_NEW before marking the > indo dirty can be removed as well, as this was call that required > avoiding avoiding it. Yeah. Will update and retest the patch. From owner-xfs@oss.sgi.com Sat Jul 26 02:21:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:21:33 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9LVGQ022054 for ; Sat, 26 Jul 2008 02:21:31 -0700 X-ASG-Debug-ID: 1217064160-337501340000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BCF00192E6E7 for ; Sat, 26 Jul 2008 02:22:41 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 3JCKth2njDOLV3FG for ; Sat, 26 Jul 2008 02:22:41 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApoCANiJikh5LFxAiGdsb2JhbACSTgEBAQ8gmws X-IronPort-AV: E=Sophos;i="4.31,255,1215354600"; d="scan'208";a="157845077" Received: from ppp121-44-92-64.lns10.syd6.internode.on.net (HELO disturbed) ([121.44.92.64]) by ipmail01.adl6.internode.on.net with ESMTP; 26 Jul 2008 18:52:38 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KMfz4-0002i2-5C; Sat, 26 Jul 2008 19:22:38 +1000 Date: Sat, 26 Jul 2008 19:22:38 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 3/3] stop using file_update_time Subject: Re: [PATCH 3/3] stop using file_update_time Message-ID: <20080726092238.GU5947@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080726063339.GC22603@lst.de> <20080726091348.GT5947@disturbed> <20080726091428.GA29710@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726091428.GA29710@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217064162 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0018 1.0000 -2.0095 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.01 X-Barracuda-Spam-Status: No, SCORE=-2.01 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.897 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17192 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Sat, Jul 26, 2008 at 11:14:28AM +0200, Christoph Hellwig wrote: > On Sat, Jul 26, 2008 at 07:13:48PM +1000, Dave Chinner wrote: > > I don't think you meant to remove the xfs_ichgtime() prototype > > as well... > > Actually I did, but I forgot to mention why. There's a second prototype > in xfs_inode.h which is enough. Ah, ok, so there is. Looks good, then ;) Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Sat Jul 26 02:44:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:44:35 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9iXGR023331 for ; Sat, 26 Jul 2008 02:44:33 -0700 X-ASG-Debug-ID: 1217065542-7a0d019e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B5D74EA54F7 for ; Sat, 26 Jul 2008 02:45:43 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id CAOVdvo1I8uOKN2X for ; Sat, 26 Jul 2008 02:45:43 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9jXNg031326 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:45:33 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9jXUd031324 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:45:33 +0200 Date: Sat, 26 Jul 2008 11:45:33 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH] stop using igrab in xfs_vn_link Subject: [PATCH] stop using igrab in xfs_vn_link Message-ID: <20080726094533.GA31253@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217065544 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17193 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs ->link is guranteed to get an already reference inode passed so we can do a simple increment of i_count instead of using igrab and thus avoid banging on the global inode_lock. This is what most filesystems already do. Also move the increment after the call to xfs_link to simplify error handling. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-25 06:48:34.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-25 06:49:30.000000000 +0200 @@ -359,20 +359,17 @@ xfs_vn_link( struct inode *dir, struct dentry *dentry) { - struct inode *inode; /* inode of guy being linked to */ + struct inode *inode = old_dentry->d_inode; struct xfs_name name; int error; - inode = old_dentry->d_inode; xfs_dentry_to_name(&name, dentry); - igrab(inode); error = xfs_link(XFS_I(dir), XFS_I(inode), &name); - if (unlikely(error)) { - iput(inode); + if (unlikely(error)) return -error; - } + atomic_inc(&inode->i_count); d_instantiate(dentry, inode); return 0; } From owner-xfs@oss.sgi.com Sat Jul 26 02:52:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:52:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9qrO2023994 for ; Sat, 26 Jul 2008 02:52:53 -0700 X-ASG-Debug-ID: 1217066043-768802070000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6A30BEA58E0 for ; Sat, 26 Jul 2008 02:54:04 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ChgxlqBE1K30KsGm for ; Sat, 26 Jul 2008 02:54:04 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9rsNg031684 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:53:54 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9rsSH031682 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:53:54 +0200 Date: Sat, 26 Jul 2008 11:53:54 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 4/6] refactor xfs_mount_free Subject: [PATCH 4/6] refactor xfs_mount_free Message-ID: <20080726095354.GB31253@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217066045 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17194 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs xfs_mount_free mostly frees the perag data, which is something that is duplicated in the mount error path. Move the XFS_QM_DONE call to the caller and remove the useless mutex_destroy/spinlock_destroy calls so that we can re-use it for the mount error path. Also rename it to xfs_free_perag to reflect what it does. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-26 09:27:46.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-26 09:27:47.000000000 +0200 @@ -128,7 +128,7 @@ static const struct { * initialized. */ STATIC void -xfs_mount_free( +xfs_free_perag( xfs_mount_t *mp) { if (mp->m_perag) { @@ -139,13 +139,6 @@ xfs_mount_free( kmem_free(mp->m_perag[agno].pagb_list); kmem_free(mp->m_perag); } - - spinlock_destroy(&mp->m_ail_lock); - spinlock_destroy(&mp->m_sb_lock); - mutex_destroy(&mp->m_ilock); - mutex_destroy(&mp->m_growlock); - if (mp->m_quotainfo) - XFS_QM_DONE(mp); } /* @@ -922,7 +915,6 @@ xfs_mountfs( __uint64_t resblks; __int64_t update_flags = 0LL; uint quotamount, quotaflags; - int agno; int uuid_mounted = 0; int error = 0; @@ -1216,12 +1208,7 @@ xfs_mountfs( error3: xfs_log_unmount_dealloc(mp); error2: - for (agno = 0; agno < sbp->sb_agcount; agno++) - if (mp->m_perag[agno].pagb_list) - kmem_free(mp->m_perag[agno].pagb_list); - kmem_free(mp->m_perag); - mp->m_perag = NULL; - /* FALLTHROUGH */ + xfs_free_perag(mp); error1: if (uuid_mounted) uuid_table_remove(&mp->m_sb.sb_uuid); @@ -1307,7 +1294,9 @@ xfs_unmountfs( #if defined(DEBUG) xfs_errortag_clearall(mp, 0); #endif - xfs_mount_free(mp); + xfs_free_perag(mp); + if (mp->m_quotainfo) + XFS_QM_DONE(mp); } STATIC void From owner-xfs@oss.sgi.com Sat Jul 26 02:56:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:56:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9u0M2024513 for ; Sat, 26 Jul 2008 02:56:02 -0700 X-ASG-Debug-ID: 1217066230-2ba902f40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8BB13331A2B for ; Sat, 26 Jul 2008 02:57:11 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id mOzsppPBDNBWN4kJ for ; Sat, 26 Jul 2008 02:57:11 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9v1Ng031877 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:57:01 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9v1D4031875 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:57:01 +0200 Date: Sat, 26 Jul 2008 11:57:01 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 1/6] move root inode IRELE into xfs_unmountfs Subject: [PATCH 1/6] move root inode IRELE into xfs_unmountfs Message-ID: <20080726095701.GA31858@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217066232 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.901 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17195 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs The root inode is allocated in xfs_mountfs so it should be release in xfs_unmountfs. For the unmount case that means we do it after the the xfs_sync(mp, SYNC_WAIT | SYNC_CLOSE) in the forced shutdown case and the dmapi unmount event. Note that both reference the rip variable which might be freed by that time in case inode flushing has kicked in, so strictly speaking this might count as a bug fix Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-26 09:08:06.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-26 09:21:25.000000000 +0200 @@ -1182,8 +1182,6 @@ xfs_fs_put_super( error = xfs_unmount_flush(mp, 0); WARN_ON(error); - IRELE(rip); - /* * If we're forcing a shutdown, typically because of a media error, * we want to make sure we invalidate dirty pages that belong to @@ -1683,8 +1681,6 @@ xfs_fs_fill_super( error = xfs_unmount_flush(mp, 0); WARN_ON(error); - IRELE(mp->m_rootip); - xfs_unmountfs(mp); goto out_free_fsname; } Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-26 09:02:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-26 09:27:36.000000000 +0200 @@ -1250,6 +1250,8 @@ xfs_unmountfs(xfs_mount_t *mp) __uint64_t resblks; int error = 0; + IRELE(mp->m_rootip); + /* * We can potentially deadlock here if we have an inode cluster * that has been freed has it's buffer still pinned in memory because From owner-xfs@oss.sgi.com Sat Jul 26 02:56:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:56:09 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9u6va024537 for ; Sat, 26 Jul 2008 02:56:06 -0700 X-ASG-Debug-ID: 1217066235-6c3203050000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7C0B7EA5AB8 for ; Sat, 26 Jul 2008 02:57:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id haXbBFZRW4g0Gl5y for ; Sat, 26 Jul 2008 02:57:16 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9v5Ng031896 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:57:06 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9v58O031894 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:57:05 +0200 Date: Sat, 26 Jul 2008 11:57:05 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 2/6] cleanup xfs_mountfs Subject: [PATCH 2/6] cleanup xfs_mountfs Message-ID: <20080726095705.GB31858@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217066237 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17196 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Remove all the useless flags and code keyed off it in xfs_mountfs. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.c 2008-07-24 19:37:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.c 2008-07-24 22:57:15.000000000 +0200 @@ -308,8 +308,7 @@ xfs_qm_unmount_quotadestroy( */ void xfs_qm_mount_quotas( - xfs_mount_t *mp, - int mfsi_flags) + xfs_mount_t *mp) { int error = 0; uint sbf; @@ -344,8 +343,7 @@ xfs_qm_mount_quotas( /* * If any of the quotas are not consistent, do a quotacheck. */ - if (XFS_QM_NEED_QUOTACHECK(mp) && - !(mfsi_flags & XFS_MFSI_NO_QUOTACHECK)) { + if (XFS_QM_NEED_QUOTACHECK(mp)) { error = xfs_qm_quotacheck(mp); if (error) { /* Quotacheck failed and disabled quotas. */ Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm.h 2008-05-24 20:05:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm.h 2008-07-24 22:57:15.000000000 +0200 @@ -165,7 +165,7 @@ typedef struct xfs_dquot_acct { #define XFS_QM_RELE(xqm) ((xqm)->qm_nrefs--) extern void xfs_qm_destroy_quotainfo(xfs_mount_t *); -extern void xfs_qm_mount_quotas(xfs_mount_t *, int); +extern void xfs_qm_mount_quotas(xfs_mount_t *); extern int xfs_qm_quotacheck(xfs_mount_t *); extern void xfs_qm_unmount_quotadestroy(xfs_mount_t *); extern int xfs_qm_unmount_quotas(xfs_mount_t *); Index: linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_qm_bhv.c 2008-07-24 19:37:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/quota/xfs_qm_bhv.c 2008-07-24 22:57:15.000000000 +0200 @@ -160,7 +160,7 @@ xfs_qm_newmount( * mounting, and get on with the boring life * without disk quotas. */ - xfs_qm_mount_quotas(mp, 0); + xfs_qm_mount_quotas(mp); } else { /* * Clear the quota flags, but remember them. This @@ -182,13 +182,12 @@ STATIC int xfs_qm_endmount( xfs_mount_t *mp, uint needquotamount, - uint quotaflags, - int mfsi_flags) + uint quotaflags) { if (needquotamount) { ASSERT(mp->m_qflags == 0); mp->m_qflags = quotaflags; - xfs_qm_mount_quotas(mp, mfsi_flags); + xfs_qm_mount_quotas(mp); } #if defined(DEBUG) && defined(XFS_LOUD_RECOVERY) Index: linux-2.6-xfs/fs/xfs/xfs_log_recover.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log_recover.c 2008-07-24 19:37:16.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log_recover.c 2008-07-24 22:57:15.000000000 +0200 @@ -3938,8 +3938,7 @@ xlog_recover( */ int xlog_recover_finish( - xlog_t *log, - int mfsi_flags) + xlog_t *log) { /* * Now we're ready to do the transactions needed for the @@ -3967,9 +3966,7 @@ xlog_recover_finish( xfs_log_force(log->l_mp, (xfs_lsn_t)0, (XFS_LOG_FORCE | XFS_LOG_SYNC)); - if ( (mfsi_flags & XFS_MFSI_NOUNLINK) == 0 ) { - xlog_recover_process_iunlinks(log); - } + xlog_recover_process_iunlinks(log); xlog_recover_check_summary(log); Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-24 22:54:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-24 22:57:15.000000000 +0200 @@ -697,11 +697,11 @@ xfs_initialize_perag_data(xfs_mount_t *m * Update alignment values based on mount options and sb values */ STATIC int -xfs_update_alignment(xfs_mount_t *mp, int mfsi_flags, __uint64_t *update_flags) +xfs_update_alignment(xfs_mount_t *mp, __uint64_t *update_flags) { xfs_sb_t *sbp = &(mp->m_sb); - if (mp->m_dalign && !(mfsi_flags & XFS_MFSI_SECOND)) { + if (mp->m_dalign) { /* * If stripe unit and stripe width are not multiples * of the fs blocksize turn off alignment. @@ -857,7 +857,7 @@ xfs_set_inoalignment(xfs_mount_t *mp) * Check that the data (and log if separate) are an ok size. */ STATIC int -xfs_check_sizes(xfs_mount_t *mp, int mfsi_flags) +xfs_check_sizes(xfs_mount_t *mp) { xfs_buf_t *bp; xfs_daddr_t d; @@ -880,8 +880,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfs return error; } - if (((mfsi_flags & XFS_MFSI_CLIENT) == 0) && - mp->m_logdev_targp != mp->m_ddev_targp) { + if (mp->m_logdev_targp != mp->m_ddev_targp) { d = (xfs_daddr_t)XFS_FSB_TO_BB(mp, mp->m_sb.sb_logblocks); if (XFS_BB_TO_FSB(mp, d) != mp->m_sb.sb_logblocks) { cmn_err(CE_WARN, "XFS: size check 3 failed"); @@ -916,8 +915,7 @@ xfs_check_sizes(xfs_mount_t *mp, int mfs */ int xfs_mountfs( - xfs_mount_t *mp, - int mfsi_flags) + xfs_mount_t *mp) { xfs_sb_t *sbp = &(mp->m_sb); xfs_inode_t *rip; @@ -978,7 +976,7 @@ xfs_mountfs( * allocator alignment is within an ag, therefore ag has * to be aligned at stripe boundary. */ - error = xfs_update_alignment(mp, mfsi_flags, &update_flags); + error = xfs_update_alignment(mp, &update_flags); if (error) goto error1; @@ -997,8 +995,7 @@ xfs_mountfs( * since a single partition filesystem is identical to a single * partition volume/filesystem. */ - if ((mfsi_flags & XFS_MFSI_SECOND) == 0 && - (mp->m_flags & XFS_MOUNT_NOUUID) == 0) { + if ((mp->m_flags & XFS_MOUNT_NOUUID) == 0) { if (xfs_uuid_mount(mp)) { error = XFS_ERROR(EINVAL); goto error1; @@ -1026,7 +1023,7 @@ xfs_mountfs( /* * Check that the data (and log if separate) are an ok size. */ - error = xfs_check_sizes(mp, mfsi_flags); + error = xfs_check_sizes(mp); if (error) goto error1; @@ -1040,13 +1037,6 @@ xfs_mountfs( } /* - * For client case we are done now - */ - if (mfsi_flags & XFS_MFSI_CLIENT) { - return 0; - } - - /* * Copies the low order bits of the timestamp and the randomly * set "sequence" number out of a UUID. */ @@ -1183,7 +1173,7 @@ xfs_mountfs( * delayed until after the root and real-time bitmap inodes * were consistently read in. */ - error = xfs_log_mount_finish(mp, mfsi_flags); + error = xfs_log_mount_finish(mp); if (error) { cmn_err(CE_WARN, "XFS: log mount finish failed"); goto error4; @@ -1192,7 +1182,7 @@ xfs_mountfs( /* * Complete the quota initialisation, post-log-replay component. */ - error = XFS_QM_MOUNT(mp, quotamount, quotaflags, mfsi_flags); + error = XFS_QM_MOUNT(mp, quotamount, quotaflags); if (error) goto error4; Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2008-07-24 19:37:16.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2008-07-24 22:57:15.000000000 +0200 @@ -114,7 +114,7 @@ struct xfs_dqtrxops; struct xfs_quotainfo; typedef int (*xfs_qminit_t)(struct xfs_mount *, uint *, uint *); -typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint, int); +typedef int (*xfs_qmmount_t)(struct xfs_mount *, uint, uint); typedef int (*xfs_qmunmount_t)(struct xfs_mount *); typedef void (*xfs_qmdone_t)(struct xfs_mount *); typedef void (*xfs_dqrele_t)(struct xfs_dquot *); @@ -158,8 +158,8 @@ typedef struct xfs_qmops { #define XFS_QM_INIT(mp, mnt, fl) \ (*(mp)->m_qm_ops->xfs_qminit)(mp, mnt, fl) -#define XFS_QM_MOUNT(mp, mnt, fl, mfsi_flags) \ - (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl, mfsi_flags) +#define XFS_QM_MOUNT(mp, mnt, fl) \ + (*(mp)->m_qm_ops->xfs_qmmount)(mp, mnt, fl) #define XFS_QM_UNMOUNT(mp) \ (*(mp)->m_qm_ops->xfs_qmunmount)(mp) #define XFS_QM_DONE(mp) \ @@ -440,13 +440,6 @@ void xfs_do_force_shutdown(struct xfs_mo /* * Flags for xfs_mountfs */ -#define XFS_MFSI_SECOND 0x01 /* Secondary mount -- skip stuff */ -#define XFS_MFSI_CLIENT 0x02 /* Is a client -- skip lots of stuff */ -/* XFS_MFSI_RRINODES */ -#define XFS_MFSI_NOUNLINK 0x08 /* Skip unlinked inode processing in */ - /* log recovery */ -#define XFS_MFSI_NO_QUOTACHECK 0x10 /* Skip quotacheck processing */ -/* XFS_MFSI_CONVERT_SUNIT */ #define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */ #define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) @@ -515,7 +508,7 @@ typedef struct xfs_mod_sb { extern void xfs_mod_sb(xfs_trans_t *, __int64_t); extern int xfs_log_sbcount(xfs_mount_t *, uint); -extern int xfs_mountfs(xfs_mount_t *mp, int); +extern int xfs_mountfs(xfs_mount_t *mp); extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); extern int xfs_unmountfs(xfs_mount_t *); Index: linux-2.6-xfs/fs/xfs/xfs_log.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log.c 2008-05-28 15:35:25.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log.c 2008-07-24 22:57:15.000000000 +0200 @@ -588,12 +588,12 @@ error: * mp - ubiquitous xfs mount point structure */ int -xfs_log_mount_finish(xfs_mount_t *mp, int mfsi_flags) +xfs_log_mount_finish(xfs_mount_t *mp) { int error; if (!(mp->m_flags & XFS_MOUNT_NORECOVERY)) - error = xlog_recover_finish(mp->m_log, mfsi_flags); + error = xlog_recover_finish(mp->m_log); else { error = 0; ASSERT(mp->m_flags & XFS_MOUNT_RDONLY); Index: linux-2.6-xfs/fs/xfs/xfs_log.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log.h 2008-05-28 15:35:25.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log.h 2008-07-24 22:57:15.000000000 +0200 @@ -149,7 +149,7 @@ int xfs_log_mount(struct xfs_mount *mp struct xfs_buftarg *log_target, xfs_daddr_t start_block, int num_bblocks); -int xfs_log_mount_finish(struct xfs_mount *mp, int); +int xfs_log_mount_finish(struct xfs_mount *mp); void xfs_log_move_tail(struct xfs_mount *mp, xfs_lsn_t tail_lsn); int xfs_log_notify(struct xfs_mount *mp, Index: linux-2.6-xfs/fs/xfs/xfs_log_priv.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_log_priv.h 2008-07-23 09:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_log_priv.h 2008-07-24 22:57:15.000000000 +0200 @@ -468,7 +468,7 @@ extern int xlog_find_tail(xlog_t *log, xfs_daddr_t *head_blk, xfs_daddr_t *tail_blk); extern int xlog_recover(xlog_t *log); -extern int xlog_recover_finish(xlog_t *log, int mfsi_flags); +extern int xlog_recover_finish(xlog_t *log); extern void xlog_pack_data(xlog_t *log, xlog_in_core_t *iclog, int); extern void xlog_recover_process_iunlinks(xlog_t *log); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-24 22:54:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-24 22:57:15.000000000 +0200 @@ -1601,7 +1601,7 @@ xfs_fs_fill_super( if (error) goto out_free_sb; - error = xfs_mountfs(mp, flags); + error = xfs_mountfs(mp); if (error) goto out_filestream_unmount; From owner-xfs@oss.sgi.com Sat Jul 26 02:56:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:56:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_66 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9uAGs024581 for ; Sat, 26 Jul 2008 02:56:10 -0700 X-ASG-Debug-ID: 1217066239-45ae01300000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DC307331A2F for ; Sat, 26 Jul 2008 02:57:19 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 07Bz7LYhSca5bB7y for ; Sat, 26 Jul 2008 02:57:19 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9vANg031910 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:57:10 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9vAMw031908 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:57:10 +0200 Date: Sat, 26 Jul 2008 11:57:10 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 3/6] xfs_unmountfs should return void Subject: [PATCH 3/6] xfs_unmountfs should return void Message-ID: <20080726095710.GC31858@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217066241 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.901 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17197 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs xfs_unmounts can't and shouldn't return errors so declare it as returning void. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-26 09:27:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-26 09:27:43.000000000 +0200 @@ -1229,16 +1229,15 @@ xfs_mountfs( } /* - * xfs_unmountfs - * * This flushes out the inodes,dquots and the superblock, unmounts the * log and makes sure that incore structures are freed. */ -int -xfs_unmountfs(xfs_mount_t *mp) +void +xfs_unmountfs( + struct xfs_mount *mp) { - __uint64_t resblks; - int error = 0; + __uint64_t resblks; + int error; IRELE(mp->m_rootip); @@ -1311,7 +1310,6 @@ xfs_unmountfs(xfs_mount_t *mp) xfs_errortag_clearall(mp, 0); #endif xfs_mount_free(mp); - return 0; } STATIC void Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h 2008-07-26 09:27:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.h 2008-07-26 09:27:43.000000000 +0200 @@ -511,7 +511,7 @@ extern int xfs_log_sbcount(xfs_mount_t * extern int xfs_mountfs(xfs_mount_t *mp); extern void xfs_mountfs_check_barriers(xfs_mount_t *mp); -extern int xfs_unmountfs(xfs_mount_t *); +extern void xfs_unmountfs(xfs_mount_t *); extern int xfs_unmountfs_writesb(xfs_mount_t *); extern int xfs_unmount_flush(xfs_mount_t *, int); extern int xfs_mod_incore_sb(xfs_mount_t *, xfs_sb_field_t, int64_t, int); From owner-xfs@oss.sgi.com Sat Jul 26 02:56:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:56:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9uD20024639 for ; Sat, 26 Jul 2008 02:56:13 -0700 X-ASG-Debug-ID: 1217066243-768702200000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1A308EA5AD1 for ; Sat, 26 Jul 2008 02:57:23 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id hc2F91NIEC44TcgN for ; Sat, 26 Jul 2008 02:57:23 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9vENg031925 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:57:14 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9vE23031923 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:57:14 +0200 Date: Sat, 26 Jul 2008 11:57:14 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 4/6] don't call xfs_freesb from xfs_unmountfs Subject: [PATCH 4/6] don't call xfs_freesb from xfs_unmountfs Message-ID: <20080726095714.GD31858@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217066245 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17198 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs xfs_readsb is called before xfs_mount so xfs_freesb should be called after xfs_unmountfs, too. This means it now happens after a few things during the of xfs_unmount which all have nothing to do with the superblock. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-24 22:57:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-24 23:00:27.000000000 +0200 @@ -1198,6 +1198,7 @@ xfs_fs_put_super( } xfs_unmountfs(mp); + xfs_freesb(mp); xfs_icsb_destroy_counters(mp); xfs_close_devices(mp); xfs_qmops_put(mp); @@ -1682,7 +1683,7 @@ xfs_fs_fill_super( WARN_ON(error); xfs_unmountfs(mp); - goto out_free_fsname; + goto out_free_sb; } STATIC int Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-24 22:58:14.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-24 23:00:27.000000000 +0200 @@ -1296,8 +1296,6 @@ xfs_unmountfs( xfs_unmountfs_wait(mp); /* wait for async bufs */ xfs_log_unmount(mp); /* Done! No more fs ops. */ - xfs_freesb(mp); - /* * All inodes from this mount point should be freed. */ From owner-xfs@oss.sgi.com Sat Jul 26 02:57:24 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:57:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9vOpH025021 for ; Sat, 26 Jul 2008 02:57:24 -0700 X-ASG-Debug-ID: 1217066314-6cb403120000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D1DD9E9D818 for ; Sat, 26 Jul 2008 02:58:34 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id uYTWc4FiiXtsP2MV for ; Sat, 26 Jul 2008 02:58:34 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9wONg031975 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:58:24 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9wOrb031973 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:58:24 +0200 Date: Sat, 26 Jul 2008 11:58:24 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 6/6] use KM_MAYFAIL in xfs_mountfs Subject: [PATCH 6/6] use KM_MAYFAIL in xfs_mountfs Message-ID: <20080726095824.GE31858@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217066315 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.900 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17199 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Use KM_MAYFAIL for the m_perag allocation, we can deal with the error easily and blocking forever during mount is not a good idea either. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_mount.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-24 23:02:26.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-24 23:04:15.000000000 +0200 @@ -1052,8 +1052,10 @@ xfs_mountfs( * Allocate and initialize the per-ag data. */ init_rwsem(&mp->m_peraglock); - mp->m_perag = - kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), KM_SLEEP); + mp->m_perag = kmem_zalloc(sbp->sb_agcount * sizeof(xfs_perag_t), + KM_MAYFAIL); + if (!mp->m_perag) + goto error1; mp->m_maxagi = xfs_initialize_perag(mp, sbp->sb_agcount); From owner-xfs@oss.sgi.com Sat Jul 26 02:57:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 02:57:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6Q9vrdi025540 for ; Sat, 26 Jul 2008 02:57:53 -0700 X-ASG-Debug-ID: 1217066343-4275019a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B1629331A44 for ; Sat, 26 Jul 2008 02:59:03 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id zl8zMm5YfuarXsPe for ; Sat, 26 Jul 2008 02:59:03 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6Q9wrNg031996 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Sat, 26 Jul 2008 11:58:53 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6Q9wr53031993 for xfs@oss.sgi.com; Sat, 26 Jul 2008 11:58:53 +0200 Date: Sat, 26 Jul 2008 11:58:53 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 4/6] refactor xfs_mount_free Subject: Re: [PATCH 4/6] refactor xfs_mount_free Message-ID: <20080726095853.GF31858@lst.de> References: <20080726095354.GB31253@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080726095354.GB31253@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217066344 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.901 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17200 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Sorry, this should have been 5/6 On Sat, Jul 26, 2008 at 11:53:54AM +0200, Christoph Hellwig wrote: > xfs_mount_free mostly frees the perag data, which is something that > is duplicated in the mount error path. > > Move the XFS_QM_DONE call to the caller and remove the useless > mutex_destroy/spinlock_destroy calls so that we can re-use it for > the mount error path. Also rename it to xfs_free_perag to reflect what > it does. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfs_mount.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.c 2008-07-26 09:27:46.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_mount.c 2008-07-26 09:27:47.000000000 +0200 > @@ -128,7 +128,7 @@ static const struct { > * initialized. > */ > STATIC void > -xfs_mount_free( > +xfs_free_perag( > xfs_mount_t *mp) > { > if (mp->m_perag) { > @@ -139,13 +139,6 @@ xfs_mount_free( > kmem_free(mp->m_perag[agno].pagb_list); > kmem_free(mp->m_perag); > } > - > - spinlock_destroy(&mp->m_ail_lock); > - spinlock_destroy(&mp->m_sb_lock); > - mutex_destroy(&mp->m_ilock); > - mutex_destroy(&mp->m_growlock); > - if (mp->m_quotainfo) > - XFS_QM_DONE(mp); > } > > /* > @@ -922,7 +915,6 @@ xfs_mountfs( > __uint64_t resblks; > __int64_t update_flags = 0LL; > uint quotamount, quotaflags; > - int agno; > int uuid_mounted = 0; > int error = 0; > > @@ -1216,12 +1208,7 @@ xfs_mountfs( > error3: > xfs_log_unmount_dealloc(mp); > error2: > - for (agno = 0; agno < sbp->sb_agcount; agno++) > - if (mp->m_perag[agno].pagb_list) > - kmem_free(mp->m_perag[agno].pagb_list); > - kmem_free(mp->m_perag); > - mp->m_perag = NULL; > - /* FALLTHROUGH */ > + xfs_free_perag(mp); > error1: > if (uuid_mounted) > uuid_table_remove(&mp->m_sb.sb_uuid); > @@ -1307,7 +1294,9 @@ xfs_unmountfs( > #if defined(DEBUG) > xfs_errortag_clearall(mp, 0); > #endif > - xfs_mount_free(mp); > + xfs_free_perag(mp); > + if (mp->m_quotainfo) > + XFS_QM_DONE(mp); > } > > STATIC void ---end quoted text--- From owner-xfs@oss.sgi.com Sat Jul 26 09:29:38 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 09:29:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6QGTbXf026283 for ; Sat, 26 Jul 2008 09:29:37 -0700 X-ASG-Debug-ID: 1217089845-407d00b50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 06FD8192FD17; Sat, 26 Jul 2008 09:30:45 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id DccXZDJwUzO2Exic; Sat, 26 Jul 2008 09:30:45 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KMmfM-0004uk-TB; Sat, 26 Jul 2008 16:30:44 +0000 Date: Sat, 26 Jul 2008 12:30:44 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981875 - xfs_dm_rdwr() needs to pass a vfsmount to dentry_open() Subject: Re: TAKE 981875 - xfs_dm_rdwr() needs to pass a vfsmount to dentry_open() Message-ID: <20080726163044.GA11528@infradead.org> References: <20080516045732.F12DC58C4C29@chook.melbourne.sgi.com> <20080516051048.GB5035@infradead.org> <20080520064356.GA8711@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080520064356.GA8711@infradead.org> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1217089849 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.925 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17201 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs Not only is this buggy stuff still there, but it also sneaked into linux-next were it shold be reverted ASAP. From owner-xfs@oss.sgi.com Sat Jul 26 10:04:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 10:04:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.1 required=5.0 tests=BAYES_50,HTML_MESSAGE, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6QH4PxV028932 for ; Sat, 26 Jul 2008 10:04:25 -0700 X-ASG-Debug-ID: 1217091936-4067017f0000-w1Z2WR X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from wa-smtp-01.yousendit.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A89E91930609 for ; Sat, 26 Jul 2008 10:05:36 -0700 (PDT) Received: from wa-smtp-01.yousendit.com (wa-smtp-01.yousendit.com [209.8.50.210]) by cuda.sgi.com with ESMTP id uM11EPGk7HACTp6o for ; Sat, 26 Jul 2008 10:05:36 -0700 (PDT) Received: from wa-smtp-01.yousendit.com (wa-smtp-01.yousendit.com [127.0.0.1]) by wa-smtp-01.yousendit.com (Postfix) with ESMTP id 6C188185D6A6 for ; Sat, 26 Jul 2008 10:05:35 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; h=Received:From:To:Reply-To:Subject:MIME-Version:Content-Type:Message-Id:Date; b=TctdXl4x3NYMkq17cpjc8Wtprtb1gxN6oXpUAu48ETHHqeknFobqqL+O2mWd3+B9XkpcSiyjtmBdDRzNM0F49MBUY2ze/d5NeClWxY8yQSXHudyo9g9jDlmL3ew/FaCHga6YsKFVfEE/S54n0szF9fj4tBuNvZqkOjKN3Vl4wj4=; c=nofws; d=yousendit.com; q=dns; s=postfix Received: from localhost (unknown [209.8.50.53]) by wa-smtp-01.yousendit.com (Postfix) with ESMTP id 68D0F185D5C1 for ; Sat, 26 Jul 2008 10:05:35 -0700 (PDT) From: aisha al obeid via YouSendIt To: linux-xfs@oss.sgi.com Reply-To: aisha al obeid via YouSendIt X-ASG-Orig-Subj: Emergency From Mrs. Aisha Al-obeid ( Iraq Woman Read It Well) Subject: Emergency From Mrs. Aisha Al-obeid ( Iraq Woman Read It Well) MIME-Version: 1.0 Message-Id: <20080726170535.68D0F185D5C1@wa-smtp-01.yousendit.com> Date: Sat, 26 Jul 2008 10:05:35 -0700 (PDT) X-Barracuda-Connect: wa-smtp-01.yousendit.com[209.8.50.210] X-Barracuda-Start-Time: 1217091936 X-Barracuda-Bayes: INNOCENT GLOBAL 0.5030 1.0000 0.7500 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: 0.75 X-Barracuda-Spam-Status: No, SCORE=0.75 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=HTML_MESSAGE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.928 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.00 HTML_MESSAGE BODY: HTML included in message X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 7bit Content-length: 746 X-archive-position: 17202 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: delivery@yousendit.com Precedence: bulk X-list: xfs You have a priority delivery from YouSendIt Dear please download the file and read my mail, I want to invest in your country from Iraq woman Click here to download file: https://rcpt.yousendit.com/592627451/5d46fa1474c5202170b8b02ed2179a2a Sent by: aishamrs@gmail.com File to pick up: Attn from iraq woman.doc File will remain active for: 14 Days YouSendIt Inc. : http://www.yousendit.com Terms of Service: http://www.yousendit.com/cms/termsofservice Privacy Policy : http://www.yousendit.com/cms/privacypolicy DMCA Policy: http://www.yousendit.com/cms/dmca Opt Out: http://www.yousendit.com/blocking.php?action=optout&email=linux-xfs@oss.sgi.com&key=71fcaa48c18053bda8ce37eb29088defd3d15cd5 [[HTML alternate version deleted]] From owner-xfs@oss.sgi.com Sat Jul 26 15:02:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Sat, 26 Jul 2008 15:02:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,J_CHICKENPOX_23, J_CHICKENPOX_24,J_CHICKENPOX_45 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6QM2UZV021225 for ; Sat, 26 Jul 2008 15:02:30 -0700 X-ASG-Debug-ID: 1217109821-447e01930000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from rv-out-0708.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 67562EA7684 for ; Sat, 26 Jul 2008 15:03:41 -0700 (PDT) Received: from rv-out-0708.google.com (rv-out-0708.google.com [209.85.198.240]) by cuda.sgi.com with ESMTP id T99qSYt1d7way7KH for ; Sat, 26 Jul 2008 15:03:41 -0700 (PDT) Received: by rv-out-0708.google.com with SMTP id f25so2846001rvb.32 for ; Sat, 26 Jul 2008 15:03:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type:content-transfer-encoding :content-disposition; bh=NzGsqUpxSfCbLqk8jVnXnnv5tb/EluVy/3Ikzm/SJzM=; b=riRKv2fNY4m5KrDVkndZ5i14Xg+kjd+9BxgHinG+/6q5Nc/vOtZmPNnxcaiD0rtK/m h5NmeCbh0MRXyZlYWZwROaofyJfy+x0Q7djtJ0EQEqq+K19Pde3lQvyS/rrdjOLJ6x3V YsKa+K2iPH342biCpq5fUYa9xytRpjm51tT10= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type :content-transfer-encoding:content-disposition; b=hfa2JpAXBsJmcGZur4oH3AP4uJ5w3CSvPOg+tRpMCPHrgiuzo3DdCuC4px8byUY7VB P5efIt2cxXXSM1Ey9eHg2n/s5OXHX0ETpsK0bc9c87sdbATj/4ru5GjIB9eYDBzGAK6z LJO1pSbngIHBDLnZod0bybT8K30AiApqVZqpc= Received: by 10.141.179.5 with SMTP id g5mr1599988rvp.30.1217109821025; Sat, 26 Jul 2008 15:03:41 -0700 (PDT) Received: by 10.141.177.16 with HTTP; Sat, 26 Jul 2008 15:03:40 -0700 (PDT) Message-ID: <8ece0edb0807261503w2998464asfeb403cce270d9ae@mail.gmail.com> Date: Sat, 26 Jul 2008 22:03:40 +0000 From: entereczek To: xfs@oss.sgi.com X-ASG-Orig-Subj: HDD and xfs problem Subject: HDD and xfs problem MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Barracuda-Connect: rv-out-0708.google.com[209.85.198.240] X-Barracuda-Start-Time: 1217109822 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0003 1.0000 -2.0192 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.947 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17203 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: entereczek@gmail.com Precedence: bulk X-list: xfs Hi, I've got a problem with my harddisk. After last reboot my system hangs with kernel panic about xfs problems. I tried accessing my xfs partitions using live cd but I get: [ 2567.872000] hda: drive not ready for command [ 2567.888000] hda: status error: status=0x59 { DriveReady SeekComplete DataRequest Error } [ 2567.888000] hda: status error: error=0x40 { UncorrectableError }, LBAsect=23695938, high=1, low=6918722, sector=23695938 [ 2567.888000] ide: failed opcode was: unknown [ 2567.888000] end_request: I/O error, dev hda, sector 23695938 [ 2567.888000] hda: drive not ready for command [ 2567.892000] hda: status error: status=0x59 { DriveReady SeekComplete DataRequest Error } [ 2567.892000] hda: status error: error=0x40 { UncorrectableError }, LBAsect=23695938, high=1, low=6918722, sector=23695942 [ 2567.892000] ide: failed opcode was: unknown [ 2567.892000] end_request: I/O error, dev hda, sector 23695942 [ 2567.892000] hda: drive not ready for command [ 2567.928000] hda: status error: status=0x59 { DriveReady SeekComplete DataRequest Error } [ 2567.928000] hda: status error: error=0x40 { UncorrectableError }, LBAsect=23695938, high=1, low=6918722, sector=0 [ 2567.928000] ide: failed opcode was: 0xea [ 2567.928000] hda: drive not ready for command [ 2567.928000] hda: wcache flush failed! The weirdest thing is that I can boot that disk and in command line grub after trying: >root (hd0,[press TAB] I get list of 3 first partitions and instead of last 3 I get: Error 18: Selected cylinder exceeds maximum supported by BIOS I tried >root (hd0,5) which was my home directory and I didn't get any errors. So i tried: >kernel /myusername/[TAB] and I got list of my dirs&files. I can list files and show it's content by grub's cat from that partition using grub, but I can't do mount it using live cd. So I deeply investigated it using livecd: >fdisk -l /dev/hda >ls /dev/hda* /dev/hda /dev/hda1 /dev/hda2 /dev/hda3 /dev/hda4 /dev/hda5 /dev/hda6 >xfs_admin -l /dev/hda5 xfs_admin: /dev/hda1 is invalid (cannot read first 512 bytes) >dd if=/dev/hda of=temp dd: reading `/dev/hda': Input/output error 0+0 records in 0+0 records out 0 bytes (0 B) copied, 0.0301734 seconds, 0.0 kB/s >dd if=/dev/hda5 of=temp dd: reading `/dev/hda5': Input/output error 0+0 records in 0+0 records out 0 bytes (0 B) copied, 0.0619014 seconds, 0.0 kB/s and in dmesg I get lots of errors as above. So, fdisk doesn't see any partitions but block devices are good. I get in&out error in linux, but grub can access that xfs partition. So here is the deal: 1. Is there any chance of forcing linux to get access to this drive? 2. Is there any way of getting a mirror clone of this drive so I can try for example replacing first 512 bytes from another xfs partition or any other way without disturbing the orginal one? 3. Is there any way of cloning content of this xfs in grub-level or use grub-implementation of xfs client to get access to this data? 4. Is there any other working way of getting access to my data? PS: I almost forgot, I tried connecting this HDD to PC running M$ Win and when I accessed partition manager in computer management it hang :P Regards, Entereczek From owner-xfs@oss.sgi.com Sun Jul 27 17:59:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 17:59:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6S0xWC8007332 for ; Sun, 27 Jul 2008 17:59:33 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA10037; Mon, 28 Jul 2008 11:00:38 +1000 Message-ID: <488D1B8D.4020802@sgi.com> Date: Mon, 28 Jul 2008 11:06:21 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Eric Sandeen CC: Niv Sardi-Altivanik , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: Re: TAKE 981498 - remove mounpoint UUID code References: <20080725033841.D689558C4C3F@chook.melbourne.sgi.com> <48894C66.5060204@sandeen.net> <20080725050149.GL5947@disturbed> <4889EAC9.5070304@sandeen.net> In-Reply-To: <4889EAC9.5070304@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17204 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Dave Chinner wrote: >> On Thu, Jul 24, 2008 at 10:45:42PM -0500, Eric Sandeen wrote: >>> Niv Sardi-Altivanik wrote: >>>> remove mounpoint UUID code >>> Are you sure this didn't change any disk structures? The patch I sent >>> was RFC and completely untested... (and disclosed as such...) :) >> Looking at the original patch, it definitely does change the format >> of log structures on disk. it removes the union of the uuid and rdev >> in the xfs_inode_log_format[32|64] which takes that entry from 16 >> bytes down to 4 bytes. So I'd suggest that thisss should be removed >> immediately before it hits public and people start corrupting their >> filesystems.... > > Yep. Well crud, I even knew that when I sent it, hence the > RFC/untested/blah/blah but I suppose I shouldn't send a patch that I > know to be busted even if it's just as a whaddya-think. I'll pad out > the union, check all the log structs, run qa & resend. > > And despite all the talk about community & contributors running qa and > helping with test coverage - as a general rule do sgi devels run qa too > before committing? Yes. Well we are supposed to anyway. From owner-xfs@oss.sgi.com Sun Jul 27 18:55:51 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 18:55:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6S1tlvS010823 for ; Sun, 27 Jul 2008 18:55:50 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA11009; Mon, 28 Jul 2008 11:56:52 +1000 Message-ID: <488D2763.1020607@sgi.com> Date: Mon, 28 Jul 2008 11:56:51 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Eric Sandeen CC: Niv Sardi-Altivanik , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: Re: TAKE 981498 - remove mounpoint UUID code References: <20080725033841.D689558C4C3F@chook.melbourne.sgi.com> <48894C66.5060204@sandeen.net> <20080725050149.GL5947@disturbed> <4889EAC9.5070304@sandeen.net> In-Reply-To: <4889EAC9.5070304@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17205 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Dave Chinner wrote: >> On Thu, Jul 24, 2008 at 10:45:42PM -0500, Eric Sandeen wrote: >>> Niv Sardi-Altivanik wrote: >>>> remove mounpoint UUID code >>> Are you sure this didn't change any disk structures? The patch I sent >>> was RFC and completely untested... (and disclosed as such...) :) >> Looking at the original patch, it definitely does change the format >> of log structures on disk. it removes the union of the uuid and rdev >> in the xfs_inode_log_format[32|64] which takes that entry from 16 >> bytes down to 4 bytes. So I'd suggest that thisss should be removed >> immediately before it hits public and people start corrupting their >> filesystems.... > > Yep. Well crud, I even knew that when I sent it, hence the > RFC/untested/blah/blah but I suppose I shouldn't send a patch that I > know to be busted even if it's just as a whaddya-think. I'll pad out > the union, check all the log structs, run qa & resend. > Well, I wouldn't think it is a problem for xfs_dinode_t, after di_next_unlinked the data structure is basically documentation and certainly di_a really starts at the attribute fork offset :) As Dave said, it is a problem for xfs_inode_log_format and friends, (ones which were changed for 32/64 bit variants). This is not good but it is only a problem if you need to do log replay with a new kernel on a dirty log created on the old kernel (or vice-versa). I don't think I want to change log replay to handle yet another variant of inode item :) But it aint as bad as before as there is a cutoff point and it only becomes a problem on unclean mount at that cutoff point. Then again, if rc-1 is unstable and we crash out with a dirty log and then try to replay using a more stable old kernel, it would have trouble in log replay. (Just thinking aloud of possiblities :-) > And despite all the talk about community & contributors running qa and > helping with test coverage - as a general rule do sgi devels run qa too > before committing? > Yes. --Tim From owner-xfs@oss.sgi.com Sun Jul 27 19:36:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 19:36:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6S2aX8m014349 for ; Sun, 27 Jul 2008 19:36:34 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA11663; Mon, 28 Jul 2008 12:37:43 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 4016258C4C3F; Mon, 28 Jul 2008 12:37:43 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - remove some easy bhv_vnode_t instances Message-Id: <20080728023743.4016258C4C3F@chook.melbourne.sgi.com> Date: Mon, 28 Jul 2008 12:37:43 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17206 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs remove some easy bhv_vnode_t instances In various places we can just move a VFS_I call into the argument list of called functions/macros instead of having a local bhv_vnode_t. Signed-off-by: Christoph Hellwig Date: Mon Jul 28 12:36:08 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31776a fs/xfs/xfs_vnodeops.c - 1.770 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.770&r2=text&tr2=1.769&f=h fs/xfs/xfs_itable.c - 1.169 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_itable.c.diff?r1=text&tr1=1.169&r2=text&tr2=1.168&f=h fs/xfs/xfs_vfsops.c - 1.573 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.573&r2=text&tr2=1.572&f=h fs/xfs/xfs_dfrag.c - 1.71 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dfrag.c.diff?r1=text&tr1=1.71&r2=text&tr2=1.70&f=h fs/xfs/xfs_inode.c - 1.512 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.512&r2=text&tr2=1.511&f=h fs/xfs/linux-2.6/xfs_super.c - 1.441 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.441&r2=text&tr2=1.440&f=h - remove some easy bhv_vnode_t instances From owner-xfs@oss.sgi.com Sun Jul 27 21:35:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 21:35:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,J_CHICKENPOX_52, J_CHICKENPOX_62,J_CHICKENPOX_63 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6S4Z2r0026062 for ; Sun, 27 Jul 2008 21:35:03 -0700 X-ASG-Debug-ID: 1217219773-360100b40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 444FDEB30A8 for ; Sun, 27 Jul 2008 21:36:13 -0700 (PDT) Received: from serv2.oss.ntt.co.jp (serv2.oss.ntt.co.jp [222.151.198.100]) by cuda.sgi.com with ESMTP id yuOJiO2zsG1DcrgV for ; Sun, 27 Jul 2008 21:36:13 -0700 (PDT) Received: from serv2.oss.ntt.co.jp (localhost [127.0.0.1]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 62CC72480BE; Mon, 28 Jul 2008 13:36:11 +0900 (JST) Received: from serv1.oss.ntt.co.jp (serv1.localdomain [172.19.0.2]) by serv2.oss.ntt.co.jp (Postfix) with ESMTP id 510F5248084; Mon, 28 Jul 2008 13:36:11 +0900 (JST) Received: from hifumi-PC.oss.ntt.co.jp (unknown [172.17.1.7]) by serv1.oss.ntt.co.jp (Postfix) with ESMTP id 0B6FA104001; Mon, 28 Jul 2008 13:36:11 +0900 (JST) Message-Id: <6.0.0.20.2.20080728115511.045088a8@172.19.0.2> X-Sender: hhifumi@172.19.0.2 X-Mailer: QUALCOMM Windows Eudora Version 6J-Jr3 Date: Mon, 28 Jul 2008 13:34:12 +0900 To: Andrew Morton , Christoph Hellwig From: Hisashi Hifumi X-ASG-Orig-Subj: Re: partially uptodate page reads Subject: Re: partially uptodate page reads Cc: Nick Piggin , jack@ucw.cz, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com In-Reply-To: <20080724120841.81c72be9.akpm@linux-foundation.org> References: <200807250117.11331.nickpiggin@yahoo.com.au> <20080724175913.GA32117@infradead.org> <20080724120841.81c72be9.akpm@linux-foundation.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Barracuda-Connect: serv2.oss.ntt.co.jp[222.151.198.100] X-Barracuda-Start-Time: 1217219774 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1068 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17207 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hifumi.hisashi@oss.ntt.co.jp Precedence: bulk X-list: xfs Hi >> > >> > Are there significant numbers of people using block size < page size in >> > situations where performance is important and significantly improved by >> > this patch? Can you give any performance numbers to illustrate perhaps? >> >> With XFS lots of people use 4k blocksize filesystems on ia64 systems >> with 16k pages, so an optimization like this would be useful. > >As Nick says, we really should have some measurement results which >confirm this theory. Maybe we did do some but they didn't find theor >way into the changelog. > >I've put the patch on hold until this confirmation data is available. > I've got some performance number. I wrote a benchmark program and got result number with this program. This benchmark do: 1, mount and open a test file. 2, create a 512MB file. 3, close a file and umount. 4, mount and again open a test file. 5, pwrite randomly 300000 times on a test file. offset is aligned by IO size(1024bytes). 6, measure time of preading randomly 100000 times on a test file. The result was: 2.6.26 330 sec 2.6.26-patched 226 sec Arch:i386 Filesystem:ext3 Blocksize:1024 bytes Memory: 1GB On ext3/4, a file is written through buffer/block. So random read/write mixed workloads or random read after random write workloads are optimized with this patch under pagesize != blocksize environment. This test result showed this. The benchmark program is as follows: #include #include #include #include #include #include #include #include #include #define LEN 1024 #define LOOP 1024*512 /* 512MB */ main(void) { unsigned long i, offset, filesize; int fd; char buf[LEN]; time_t t1, t2; if (mount("/dev/sda1", "/root/test1/", "ext3", 0, 0) < 0) { perror("cannot mount\n"); exit(1); } memset(buf, 0, LEN); fd = open("/root/test1/testfile", O_CREAT|O_RDWR|O_TRUNC); if (fd < 0) { perror("cannot open file\n"); exit(1); } for (i = 0; i < LOOP; i++) write(fd, buf, LEN); close(fd); if (umount("/root/test1/") < 0) { perror("cannot umount\n"); exit(1); } if (mount("/dev/sda1", "/root/test1/", "ext3", 0, 0) < 0) { perror("cannot mount\n"); exit(1); } fd = open("/root/test1/testfile", O_RDWR); if (fd < 0) { perror("cannot open file\n"); exit(1); } filesize = LEN * LOOP; for (i = 0; i < 300000; i++){ offset = (random() % filesize) & (~(LEN - 1)); pwrite(fd, buf, LEN, offset); } printf("start test\n"); time(&t1); for (i = 0; i < 100000; i++){ offset = (random() % filesize) & (~(LEN - 1)); pread(fd, buf, LEN, offset); } time(&t2); printf("%ld sec\n", t2-t1); close(fd); if (umount("/root/test1/") < 0) { perror("cannot umount\n"); exit(1); } } From owner-xfs@oss.sgi.com Sun Jul 27 23:10:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 23:10:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6S6AnEa031927 for ; Sun, 27 Jul 2008 23:10:51 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA15244; Mon, 28 Jul 2008 16:11:59 +1000 From: Niv Sardi To: Christoph Hellwig Cc: Lachlan McIlroy , sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: Re: TAKE 981875 - xfs_dm_rdwr() needs to pass a vfsmount to dentry_open() References: <20080516045732.F12DC58C4C29@chook.melbourne.sgi.com> <20080516051048.GB5035@infradead.org> <20080520064356.GA8711@infradead.org> <20080726163044.GA11528@infradead.org> Date: Mon, 28 Jul 2008 16:11:58 +1000 In-Reply-To: <20080726163044.GA11528@infradead.org> (Christoph Hellwig's message of "Sat, 26 Jul 2008 12:30:44 -0400") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17208 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig writes: > Not only is this buggy stuff still there, but it also sneaked into > linux-next were it shold be reverted ASAP. Yep, shouldn't have gotten there, Lachlan and I are working on cleaning the mess in the oss git tree, the pull should be made out of this one: Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Sun Jul 27 23:13:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 23:13:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6S6DCoJ032270 for ; Sun, 27 Jul 2008 23:13:13 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA15285 for ; Mon, 28 Jul 2008 16:14:24 +1000 From: Niv Sardi To: xfs@oss.sgi.com Subject: Dropped Patches. Date: Mon, 28 Jul 2008 16:14:23 +1000 Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17209 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs As you may have noticed, we're trying to kill the patches acceptance backlog. I've been through my 'tagged as pending' patches, but I might have forgotten some, if you have patches that you want in that haven't been given attention that are older than a week, can you please reply to them with a ping so that they re-appear on our radar ? Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Sun Jul 27 23:25:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 23:25:19 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6S6PFpR000997 for ; Sun, 27 Jul 2008 23:25:16 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA15542; Mon, 28 Jul 2008 16:26:26 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id BB57158C4C3F; Mon, 28 Jul 2008 16:26:25 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - kill bhv_vnode_t Message-Id: <20080728062625.BB57158C4C3F@chook.melbourne.sgi.com> Date: Mon, 28 Jul 2008 16:26:25 +1000 (EST) From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17210 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs kill bhv_vnode_t All remaining bhv_vnode_t instance are in code that's more or less Linux specific. (Well, for xfs_acl.c that could be argued, but that code is on the removal list, too). So just do an s/bhv_vnode_t/struct inode/ over the whole tree. We can clean up variable naming and some useless helpers later. Signed-off-by: Christoph Hellwig Date: Mon Jul 28 16:25:27 AEST 2008 Workarea: redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-hch Inspected by: hch lachlan Author: lachlan The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31781a fs/xfs/xfs_vnodeops.c - 1.771 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vnodeops.c.diff?r1=text&tr1=1.771&r2=text&tr2=1.770&f=h fs/xfs/xfs_vfsops.c - 1.574 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_vfsops.c.diff?r1=text&tr1=1.574&r2=text&tr2=1.573&f=h fs/xfs/xfs_acl.h - 1.39 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.h.diff?r1=text&tr1=1.39&r2=text&tr2=1.38&f=h fs/xfs/xfs_acl.c - 1.79 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_acl.c.diff?r1=text&tr1=1.79&r2=text&tr2=1.78&f=h fs/xfs/xfs_inode.c - 1.513 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.513&r2=text&tr2=1.512&f=h fs/xfs/xfs_inode.h - 1.254 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.h.diff?r1=text&tr1=1.254&r2=text&tr2=1.253&f=h fs/xfs/quota/xfs_qm_syscalls.c - 1.46 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/quota/xfs_qm_syscalls.c.diff?r1=text&tr1=1.46&r2=text&tr2=1.45&f=h fs/xfs/linux-2.6/xfs_vnode.c - 1.161 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.c.diff?r1=text&tr1=1.161&r2=text&tr2=1.160&f=h fs/xfs/linux-2.6/xfs_vnode.h - 1.158 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_vnode.h.diff?r1=text&tr1=1.158&r2=text&tr2=1.157&f=h fs/xfs/linux-2.6/xfs_super.h - 1.80 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.h.diff?r1=text&tr1=1.80&r2=text&tr2=1.79&f=h fs/xfs/linux-2.6/xfs_super.c - 1.442 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.442&r2=text&tr2=1.441&f=h - kill bhv_vnode_t From owner-xfs@oss.sgi.com Sun Jul 27 23:50:26 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 23:50:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6S6oPlI002554 for ; Sun, 27 Jul 2008 23:50:25 -0700 X-ASG-Debug-ID: 1217227896-69b103700000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 14FAEEB93A4 for ; Sun, 27 Jul 2008 23:51:36 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id nWQDdV6eKl5YI93I for ; Sun, 27 Jul 2008 23:51:36 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m6S6pQMn009875 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 27 Jul 2008 23:51:27 -0700 Received: from y.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m6S6pOKV024827; Sun, 27 Jul 2008 23:51:25 -0700 Date: Sun, 27 Jul 2008 23:51:24 -0700 From: Andrew Morton To: Hisashi Hifumi Cc: Christoph Hellwig , Nick Piggin , jack@ucw.cz, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: partially uptodate page reads Subject: Re: partially uptodate page reads Message-Id: <20080727235124.5b04fd8b.akpm@linux-foundation.org> In-Reply-To: <6.0.0.20.2.20080728115511.045088a8@172.19.0.2> References: <200807250117.11331.nickpiggin@yahoo.com.au> <20080724175913.GA32117@infradead.org> <20080724120841.81c72be9.akpm@linux-foundation.org> <6.0.0.20.2.20080728115511.045088a8@172.19.0.2> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1217227898 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1076 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17211 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Mon, 28 Jul 2008 13:34:12 +0900 Hisashi Hifumi wrote: > Hi > > >> > > >> > Are there significant numbers of people using block size < page size in > >> > situations where performance is important and significantly improved by > >> > this patch? Can you give any performance numbers to illustrate perhaps? > >> > >> With XFS lots of people use 4k blocksize filesystems on ia64 systems > >> with 16k pages, so an optimization like this would be useful. > > > >As Nick says, we really should have some measurement results which > >confirm this theory. Maybe we did do some but they didn't find theor > >way into the changelog. > > > >I've put the patch on hold until this confirmation data is available. > > > > I've got some performance number. > I wrote a benchmark program and got result number with this program. > This benchmark do: > 1, mount and open a test file. > 2, create a 512MB file. > 3, close a file and umount. > 4, mount and again open a test file. > 5, pwrite randomly 300000 times on a test file. offset is aligned by IO size(1024bytes). > 6, measure time of preading randomly 100000 times on a test file. > > The result was: > 2.6.26 > 330 sec > > 2.6.26-patched > 226 sec > > Arch:i386 > Filesystem:ext3 > Blocksize:1024 bytes > Memory: 1GB > > On ext3/4, a file is written through buffer/block. So random read/write mixed workloads > or random read after random write workloads are optimized with this patch under > pagesize != blocksize environment. This test result showed this. OK, thanks. Those are pretty nice numbers for what is probably a fairly common workload. From owner-xfs@oss.sgi.com Sun Jul 27 23:57:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Sun, 27 Jul 2008 23:57:57 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6S6vrHJ003300 for ; Sun, 27 Jul 2008 23:57:54 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA16194 for ; Mon, 28 Jul 2008 16:59:05 +1000 Date: Mon, 28 Jul 2008 17:00:48 +1000 To: "xfs@oss.sgi.com" Subject: xfs_lowbit32 implementation From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.50 (Win32) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17212 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs More of this libxfs port of the kernel (who cleaned up xfs_bit.*!)... Anyway... /* Get low bit set out of 32-bit argument, -1 if none set */ static inline int xfs_lowbit32(__uint32_t v) { unsigned long t = v; return (v) ? find_first_bit(&t, 32) : -1; } Couldn't that be: /* Get low bit set out of 32-bit argument, -1 if none set */ static inline int xfs_lowbit32(__uint32_t v) { return ffs(v) - 1; } From owner-xfs@oss.sgi.com Mon Jul 28 00:08:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 00:08:23 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6S78CfX006565 for ; Mon, 28 Jul 2008 00:08:13 -0700 X-ASG-Debug-ID: 1217228964-07e502cd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp1.linux-foundation.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CBC91EB966E for ; Mon, 28 Jul 2008 00:09:24 -0700 (PDT) Received: from smtp1.linux-foundation.org (smtp1.linux-foundation.org [140.211.169.13]) by cuda.sgi.com with ESMTP id mIotzW5GCbf6eP2v for ; Mon, 28 Jul 2008 00:09:24 -0700 (PDT) Received: from imap1.linux-foundation.org (imap1.linux-foundation.org [140.211.169.55]) by smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with ESMTP id m6S79KZP010867 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 28 Jul 2008 00:09:21 -0700 Received: from y.localdomain (localhost [127.0.0.1]) by imap1.linux-foundation.org (8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with SMTP id m6S798iI025415; Mon, 28 Jul 2008 00:09:10 -0700 Date: Mon, 28 Jul 2008 00:09:08 -0700 From: Andrew Morton To: Nick Piggin Cc: Hisashi Hifumi , Christoph Hellwig , jack@ucw.cz, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: partially uptodate page reads Subject: Re: partially uptodate page reads Message-Id: <20080728000908.869c3e85.akpm@linux-foundation.org> In-Reply-To: <200807281656.37908.nickpiggin@yahoo.com.au> References: <200807250117.11331.nickpiggin@yahoo.com.au> <6.0.0.20.2.20080728115511.045088a8@172.19.0.2> <20080727235124.5b04fd8b.akpm@linux-foundation.org> <200807281656.37908.nickpiggin@yahoo.com.au> X-Mailer: Sylpheed 2.4.8 (GTK+ 2.12.5; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-MIMEDefang-Filter: lf$Revision: 1.188 $ X-Scanned-By: MIMEDefang 2.63 on 140.211.169.13 X-Barracuda-Connect: smtp1.linux-foundation.org[140.211.169.13] X-Barracuda-Start-Time: 1217228964 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1078 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17213 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: akpm@linux-foundation.org Precedence: bulk X-list: xfs On Mon, 28 Jul 2008 16:56:37 +1000 Nick Piggin wrote: > On Monday 28 July 2008 16:51, Andrew Morton wrote: > > On Mon, 28 Jul 2008 13:34:12 +0900 Hisashi Hifumi > wrote: > > > Hi > > > > > > >> > Are there significant numbers of people using block size < page size > > > >> > in situations where performance is important and significantly > > > >> > improved by this patch? Can you give any performance numbers to > > > >> > illustrate perhaps? > > > >> > > > >> With XFS lots of people use 4k blocksize filesystems on ia64 systems > > > >> with 16k pages, so an optimization like this would be useful. > > > > > > > >As Nick says, we really should have some measurement results which > > > >confirm this theory. Maybe we did do some but they didn't find theor > > > >way into the changelog. > > > > > > > >I've put the patch on hold until this confirmation data is available. > > > > > > I've got some performance number. > > > I wrote a benchmark program and got result number with this program. > > > This benchmark do: > > > 1, mount and open a test file. > > > 2, create a 512MB file. > > > 3, close a file and umount. > > > 4, mount and again open a test file. > > > 5, pwrite randomly 300000 times on a test file. offset is aligned by IO > > > size(1024bytes). 6, measure time of preading randomly 100000 times on a > > > test file. > > > > > > The result was: > > > 2.6.26 > > > 330 sec > > > > > > 2.6.26-patched > > > 226 sec > > > > > > Arch:i386 > > > Filesystem:ext3 > > > Blocksize:1024 bytes > > > Memory: 1GB > > > > > > On ext3/4, a file is written through buffer/block. So random read/write > > > mixed workloads or random read after random write workloads are optimized > > > with this patch under pagesize != blocksize environment. This test result > > > showed this. > > Yeah, thanks for the numbers. > > > > OK, thanks. Those are pretty nice numbers for what is probably a > > fairly common workload. > > What kind of workloads does this kind of thing? Various databases? (confused). More likely pattern is 8k IOs with 16k pagesize or thereabouts. From owner-xfs@oss.sgi.com Mon Jul 28 04:03:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 04:03:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SB3W47030256 for ; Mon, 28 Jul 2008 04:03:33 -0700 X-ASG-Debug-ID: 1217243078-11c100670000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtprelay08.ispgateway.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id EDCBC336AF9; Mon, 28 Jul 2008 04:04:39 -0700 (PDT) Received: from smtprelay08.ispgateway.de (smtprelay08.ispgateway.de [80.67.29.8]) by cuda.sgi.com with ESMTP id S7XvSwJgIzL0Pb5v; Mon, 28 Jul 2008 04:04:39 -0700 (PDT) Received: from [62.43.225.238] (helo=[192.168.30.191]) by smtprelay08.ispgateway.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.68) (envelope-from ) id 1KNQWr-0002gc-Is; Mon, 28 Jul 2008 13:04:38 +0200 Message-ID: <488DA7C5.4090001@cape-horn-eng.com> Date: Mon, 28 Jul 2008 13:04:37 +0200 From: Richard Ems User-Agent: Thunderbird 2.0.0.16 (X11/20080720) MIME-Version: 1.0 To: xaiki@sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Dropped Patches PING [ XFS internal error xfs_btree_check_lblock] Subject: Dropped Patches PING [ XFS internal error xfs_btree_check_lblock] X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Df-Sender: 337294 X-Barracuda-Connect: smtprelay08.ispgateway.de[80.67.29.8] X-Barracuda-Start-Time: 1217243082 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1092 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17214 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: Richard.Ems@cape-horn-eng.com Precedence: bulk X-list: xfs PING ! (Re: Dropped Patches) Cheers, Richard -------- Original Message -------- Subject: Re: XFS internal error xfs_btree_check_lblock Date: Tue, 22 Jul 2008 13:24:28 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering To: Russell Cattelan CC: Richard Ems , xfs@oss.sgi.com, "Bill O'Donnell" References: <4880AEF8.2080906@cape-horn-eng.com> <48815AA6.3080102@sgi.com> <4884B419.6080603@thebarn.com> Russell Cattelan wrote: > If the patches are for current XFS can we post them here? / reviewed? > Not sure why the backport to sles10 should hold them up if they are ready? For the record, the patches I'm referring to are: # Prevent extent btree block allocation failures http://oss.sgi.com/archives/xfs/2008-06/msg00122.html # fix extent corruption in xfs_iext_irec_compact_full() http://oss.sgi.com/archives/xfs/2008-06/msg00209.html # Convert ASSERTs to XFS_WANT_CORRUPTED_GOTOs http://oss.sgi.com/archives/xfs/2008-06/msg00231.html # Always reset btree cursor after an insert http://oss.sgi.com/archives/xfs/2008-06/msg00243.html # set minleft in xfs_bmbt_split() http://oss.sgi.com/archives/xfs/2008-06/msg00280.html # Restore the lowspace extent allocator algorithm http://oss.sgi.com/archives/xfs/2008-06/msg00281.html Some of the above might not refer directly to the final committed patches but the thread URLs should be accurate. These are bug fixes that go a long way back and really do need to be back-ported and pushed out for the mentioned distros. There are probably other patches not listed above that should be considered too. Cheers >> Richard Ems wrote: >>> Hi, >>> >>> this FS error occurred on an openSUSE 10.3 64 bit, with all openSUSE >>> updates. xfsprogs is xfsprogs-2.9.4-17.1 . >>> >>> The filesystem with the error is our /home, on an Areca ARC-1220 RAID >>> Controller, 6 Hitachi 1TB disks on RAID 5. >>> >>> The controller reports all disks are fine, no errors. >>> >>> The system had an uptime of 74 days, and had no problems with any FS >>> before. >>> >>> >>> First errors logged on /var/log/messages start at today 11:16 : >>> >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: f >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 2 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 10 >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 11 >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 20 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 12 >>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 13 >>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: 0 >>> lastx: 13 >>> >>> >>> and this continues up to 11:58 where we got >>> >>> >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff88306053 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: Call Trace: >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_btree_check_lblock+0xf4/0xfe >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmbt_lookup+0x16e/0x44b >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmap_add_extent_delay_real+0x3f7/0xf16 >>> Jul 18 11:58:37 c3m kernel: [] __up_read+0x13/0x8a >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmap_btalloc+0x5d7/0x693 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmap_add_extent+0x21c/0x3ad >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_btree_init_cursor+0x37/0x168 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_bmapi+0xa98/0x108f >>> Jul 18 11:58:37 c3m kernel: [] >>> cfq_set_request+0x2e7/0x345 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_trans_reserve+0xdd/0x1b0 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap_write_allocate+0x255/0x3ce >>> Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap+0x2a3/0x33b >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_map_blocks+0x35/0x66 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_submit_ioend+0xb2/0xc4 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_page_state_convert+0x2b3/0x556 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_vm_writepage+0xa7/0xe0 >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> write_cache_pages+0x184/0x2cd >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_acceptable+0x0/0xca >>> Jul 18 11:58:37 c3m kernel: [] >>> do_writepages+0x20/0x2d >>> Jul 18 11:58:37 c3m kernel: [] >>> __filemap_fdatawrite_range+0x5b/0x6e >>> Jul 18 11:58:37 c3m kernel: [] >>> __dentry_open+0x101/0x1aa >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_sync+0x5b/0xa5 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_commit+0x57/0x7a >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_dispatch+0xdd/0x19e >>> Jul 18 11:58:37 c3m kernel: [] >>> :sunrpc:svc_process+0x3e1/0x726 >>> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>> 0xffffffff88321fd2 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: Call Trace: >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_trans_cancel+0x5c/0xf2 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap_write_allocate+0x3a8/0x3ce >>> Jul 18 11:58:37 c3m kernel: [] elv_insert+0x153/0x221 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_iomap+0x2a3/0x33b >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_map_blocks+0x35/0x66 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_submit_ioend+0xb2/0xc4 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_page_state_convert+0x2b3/0x556 >>> Jul 18 11:58:37 c3m kernel: [] >>> :xfs:xfs_vm_writepage+0xa7/0xe0 >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> write_cache_pages+0x184/0x2cd >>> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_acceptable+0x0/0xca >>> Jul 18 11:58:37 c3m kernel: [] >>> do_writepages+0x20/0x2d >>> Jul 18 11:58:37 c3m kernel: [] >>> __filemap_fdatawrite_range+0x5b/0x6e >>> Jul 18 11:58:37 c3m kernel: [] >>> __dentry_open+0x101/0x1aa >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_sync+0x5b/0xa5 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_commit+0x57/0x7a >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >>> Jul 18 11:58:37 c3m kernel: [] >>> :nfsd:nfsd_dispatch+0xdd/0x19e >>> Jul 18 11:58:37 c3m kernel: [] >>> :sunrpc:svc_process+0x3e1/0x726 >>> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x197/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >>> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >>> Jul 18 11:58:37 c3m kernel: >>> Jul 18 11:58:37 c3m kernel: xfs_force_shutdown(sdc1,0x8) called from >>> line 1133 of file fs/xfs/xfs_trans.c. Return address = >>> 0xffffffff8832ea7c >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": Corruption of >>> in-memory data detected. Shutting down filesystem: sdc1 >>> Jul 18 11:58:37 c3m kernel: Please umount the filesystem, and rectify >>> the problem(s) >>> Jul 18 11:58:37 c3m kernel: nfsd: non-standard errno: -117 >>> >>> >>> >>> It was impossible for me to xfs_check (out of memory) or repair >>> without rebooting. >>> After rebooting only "xfs_repair -L" worked and repaired the FS, but >>> short time >>> later it failed again and it continues failing after each repair. >>> >>> What's happening here? >>> >>> Any help would be very appreciated! >>> >>> Many thanks, Richard >>> >>> >>> >>> # grep -i "xfs internal error" /var/log/messages | wc -l >>> 182 >>> >>> # grep -i "xfs internal error" /var/log/messages >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff88306053 >>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>> 0xffffffff88321fd2 >>> Jul 18 12:39:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xlog_recover_do_inode_trans(1) at line 2310 of file >>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>> Jul 18 12:41:32 c3m kernel: Filesystem "sdc1": XFS internal error >>> xlog_recover_do_inode_trans(1) at line 2310 of file >>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>> Jul 18 12:44:15 c3m kernel: Filesystem "sdc1": XFS internal error >>> xlog_recover_do_inode_trans(1) at line 2310 of file >>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>> Jul 18 12:57:35 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:35 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:36 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:37 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:38 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:39 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:39 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:39 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:39 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:40 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:42 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:45 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:46 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:47 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:47 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:48 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:49 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:53 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:57:54 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:15 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d7451 >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 12:58:16 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:43 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:44 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:45 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:02:46 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882ff9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:31 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:32 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:09:32 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:18:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 13:18:06 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff882fc9bc >>> Jul 18 16:21:48 c3m kernel: XFS internal error > >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:48 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:49 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:50 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:51 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:52 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: XFS internal error >>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>> Caller 0xffffffff883009bc >>> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>> Caller 0xffffffff882d8451 >>> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>> 0xffffffff88304f9e >>> >>> >>> >> > > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- -- Richard Ems mail: Richard.Ems@Cape-Horn-Eng.com Cape Horn Engineering S.L. C/ Dr. J.J. Dómine 1, 5º piso 46011 Valencia Tel : +34 96 3242923 / Fax 924 From owner-xfs@oss.sgi.com Mon Jul 28 04:24:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 04:24:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6SBNwa4004651 for ; Mon, 28 Jul 2008 04:23:58 -0700 Received: from [134.15.251.6] (melb-sw-corp-251-6.corp.sgi.com [134.15.251.6]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA21001; Mon, 28 Jul 2008 21:25:02 +1000 Message-ID: <488DAC8C.7000409@sgi.com> Date: Mon, 28 Jul 2008 21:25:00 +1000 From: Mark Goodwin Reply-To: markgw@sgi.com Organization: SGI Engineering User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Richard Ems CC: xaiki@sgi.com, xfs@oss.sgi.com Subject: Re: Dropped Patches PING [ XFS internal error xfs_btree_check_lblock] References: <488DA7C5.4090001@cape-horn-eng.com> In-Reply-To: <488DA7C5.4090001@cape-horn-eng.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17215 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: markgw@sgi.com Precedence: bulk X-list: xfs Richard Ems wrote: > PING ! (Re: Dropped Patches) These are not "dropped" patches - if you need the fixes for OpenSuSE then please get in touch with the OpenSuSE folks and refer them to the details below. We do expect to have SLES patches ready within a few days (and presumably Novell will follow-up with OpenSUSE). Otherwise you could always build your own kernel from mainline :) Thanks > > Cheers, Richard > > -------- Original Message -------- > Subject: Re: XFS internal error xfs_btree_check_lblock > Date: Tue, 22 Jul 2008 13:24:28 +1000 > From: Mark Goodwin > Reply-To: markgw@sgi.com > Organization: SGI Engineering > To: Russell Cattelan > CC: Richard Ems , xfs@oss.sgi.com, "Bill > O'Donnell" > References: <4880AEF8.2080906@cape-horn-eng.com> > <48815AA6.3080102@sgi.com> <4884B419.6080603@thebarn.com> > > > > Russell Cattelan wrote: >> If the patches are for current XFS can we post them here? / reviewed? >> Not sure why the backport to sles10 should hold them up if they are >> ready? > > For the record, the patches I'm referring to are: > > # Prevent extent btree block allocation failures > http://oss.sgi.com/archives/xfs/2008-06/msg00122.html > > # fix extent corruption in xfs_iext_irec_compact_full() > http://oss.sgi.com/archives/xfs/2008-06/msg00209.html > > # Convert ASSERTs to XFS_WANT_CORRUPTED_GOTOs > http://oss.sgi.com/archives/xfs/2008-06/msg00231.html > > # Always reset btree cursor after an insert > http://oss.sgi.com/archives/xfs/2008-06/msg00243.html > > # set minleft in xfs_bmbt_split() > http://oss.sgi.com/archives/xfs/2008-06/msg00280.html > > # Restore the lowspace extent allocator algorithm > http://oss.sgi.com/archives/xfs/2008-06/msg00281.html > > Some of the above might not refer directly to the final committed > patches but the thread URLs should be accurate. These are bug fixes > that go a long way back and really do need to be back-ported and > pushed out for the mentioned distros. There are probably other patches > not listed above that should be considered too. > > Cheers > > >>> Richard Ems wrote: >>>> Hi, >>>> >>>> this FS error occurred on an openSUSE 10.3 64 bit, with all openSUSE >>>> updates. xfsprogs is xfsprogs-2.9.4-17.1 . >>>> >>>> The filesystem with the error is our /home, on an Areca ARC-1220 >>>> RAID Controller, 6 Hitachi 1TB disks on RAID 5. >>>> >>>> The controller reports all disks are fine, no errors. >>>> >>>> The system had an uptime of 74 days, and had no problems with any FS >>>> before. >>>> >>>> >>>> First errors logged on /var/log/messages start at today 11:16 : >>>> >>>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: >>>> 0 lastx: f >>>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 2 times >>>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: >>>> 0 lastx: 10 >>>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >>>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: >>>> 0 lastx: 11 >>>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 20 times >>>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: >>>> 0 lastx: 12 >>>> Jul 18 11:16:08 c3m syslog-ng[15627]: last message repeated 3 times >>>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: >>>> 0 lastx: 13 >>>> Jul 18 11:16:08 c3m kernel: Filesystem "sdc1": Access to block zero >>>> in inode 381260 start_block: 0 start_off: 0 blkcnt: 0 extent-state: >>>> 0 lastx: 13 >>>> >>>> >>>> and this continues up to 11:58 where we got >>>> >>>> >>>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff88306053 >>>> Jul 18 11:58:37 c3m kernel: >>>> Jul 18 11:58:37 c3m kernel: Call Trace: >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_btree_check_lblock+0xf4/0xfe >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_bmbt_lookup+0x16e/0x44b >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_bmap_add_extent_delay_real+0x3f7/0xf16 >>>> Jul 18 11:58:37 c3m kernel: [] __up_read+0x13/0x8a >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_bmap_btalloc+0x5d7/0x693 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_bmap_add_extent+0x21c/0x3ad >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_btree_init_cursor+0x37/0x168 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_bmapi+0xa98/0x108f >>>> Jul 18 11:58:37 c3m kernel: [] >>>> cfq_set_request+0x2e7/0x345 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_trans_reserve+0xdd/0x1b0 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_iomap_write_allocate+0x255/0x3ce >>>> Jul 18 11:58:37 c3m kernel: [] >>>> elv_insert+0x153/0x221 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_iomap+0x2a3/0x33b >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_map_blocks+0x35/0x66 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_submit_ioend+0xb2/0xc4 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_page_state_convert+0x2b3/0x556 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_vm_writepage+0xa7/0xe0 >>>> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> write_cache_pages+0x184/0x2cd >>>> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_acceptable+0x0/0xca >>>> Jul 18 11:58:37 c3m kernel: [] >>>> do_writepages+0x20/0x2d >>>> Jul 18 11:58:37 c3m kernel: [] >>>> __filemap_fdatawrite_range+0x5b/0x6e >>>> Jul 18 11:58:37 c3m kernel: [] >>>> __dentry_open+0x101/0x1aa >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_sync+0x5b/0xa5 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_commit+0x57/0x7a >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_dispatch+0xdd/0x19e >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :sunrpc:svc_process+0x3e1/0x726 >>>> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd+0x197/0x2b2 >>>> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >>>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >>>> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >>>> Jul 18 11:58:37 c3m kernel: >>>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>>> 0xffffffff88321fd2 >>>> Jul 18 11:58:37 c3m kernel: >>>> Jul 18 11:58:37 c3m kernel: Call Trace: >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_trans_cancel+0x5c/0xf2 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_iomap_write_allocate+0x3a8/0x3ce >>>> Jul 18 11:58:37 c3m kernel: [] >>>> elv_insert+0x153/0x221 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_iomap+0x2a3/0x33b >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_map_blocks+0x35/0x66 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_submit_ioend+0xb2/0xc4 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_page_state_convert+0x2b3/0x556 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :xfs:xfs_vm_writepage+0xa7/0xe0 >>>> Jul 18 11:58:37 c3m kernel: [] __writepage+0xa/0x23 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> write_cache_pages+0x184/0x2cd >>>> Jul 18 11:58:37 c3m kernel: [] __writepage+0x0/0x23 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_acceptable+0x0/0xca >>>> Jul 18 11:58:37 c3m kernel: [] >>>> do_writepages+0x20/0x2d >>>> Jul 18 11:58:37 c3m kernel: [] >>>> __filemap_fdatawrite_range+0x5b/0x6e >>>> Jul 18 11:58:37 c3m kernel: [] >>>> __dentry_open+0x101/0x1aa >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_sync+0x5b/0xa5 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_commit+0x57/0x7a >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd3_proc_commit+0xc5/0xd2 >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd_dispatch+0xdd/0x19e >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :sunrpc:svc_process+0x3e1/0x726 >>>> Jul 18 11:58:37 c3m kernel: [] __down_read+0x12/0x9a >>>> Jul 18 11:58:37 c3m kernel: [] >>>> :nfsd:nfsd+0x197/0x2b2 >>>> Jul 18 11:58:37 c3m kernel: [] child_rip+0xa/0x12 >>>> Jul 18 11:58:37 c3m kernel: [] :nfsd:nfsd+0x0/0x2b2 >>>> Jul 18 11:58:37 c3m kernel: [] child_rip+0x0/0x12 >>>> Jul 18 11:58:37 c3m kernel: >>>> Jul 18 11:58:37 c3m kernel: xfs_force_shutdown(sdc1,0x8) called from >>>> line 1133 of file fs/xfs/xfs_trans.c. Return address = >>>> 0xffffffff8832ea7c >>>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": Corruption of >>>> in-memory data detected. Shutting down filesystem: sdc1 >>>> Jul 18 11:58:37 c3m kernel: Please umount the filesystem, and >>>> rectify the problem(s) >>>> Jul 18 11:58:37 c3m kernel: nfsd: non-standard errno: -117 >>>> >>>> >>>> >>>> It was impossible for me to xfs_check (out of memory) or repair >>>> without rebooting. >>>> After rebooting only "xfs_repair -L" worked and repaired the FS, but >>>> short time >>>> later it failed again and it continues failing after each repair. >>>> >>>> What's happening here? >>>> >>>> Any help would be very appreciated! >>>> >>>> Many thanks, Richard >>>> >>>> >>>> >>>> # grep -i "xfs internal error" /var/log/messages | wc -l >>>> 182 >>>> >>>> # grep -i "xfs internal error" /var/log/messages >>>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_lblock at line 213 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff88306053 >>>> Jul 18 11:58:37 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>>> 0xffffffff88321fd2 >>>> Jul 18 12:39:51 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xlog_recover_do_inode_trans(1) at line 2310 of file >>>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>>> Jul 18 12:41:32 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xlog_recover_do_inode_trans(1) at line 2310 of file >>>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>>> Jul 18 12:44:15 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xlog_recover_do_inode_trans(1) at line 2310 of file >>>> fs/xfs/xfs_log_recover.c. Caller 0xffffffff8830be0e >>>> Jul 18 12:57:35 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:35 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:36 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:36 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:36 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:36 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:37 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:37 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:37 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:37 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:37 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:37 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:38 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:38 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:38 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:38 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:39 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:39 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:39 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:39 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:40 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:40 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:40 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:40 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:40 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:40 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:42 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:42 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:43 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:45 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:46 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:47 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:47 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:48 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:49 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:50 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:51 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:51 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:51 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:52 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:53 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:53 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:53 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:54 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:54 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:54 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:54 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:57:54 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:57:54 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:15 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d7451 >>>> Jul 18 12:58:16 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:16 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:16 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 12:58:16 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:43 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:44 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:45 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:02:46 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882ff9bc >>>> Jul 18 13:09:31 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:09:31 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:09:31 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:09:31 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:09:31 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:09:31 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:09:32 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:09:32 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:18:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 13:18:06 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff882fc9bc >>>> Jul 18 16:21:48 c3m kernel: XFS internal error >> >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:48 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:49 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:50 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:51 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:51 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:51 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:52 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:53 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:53 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:53 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:53 c3m kernel: XFS internal error >>>> XFS_WANT_CORRUPTED_GOTO at line 4522 of file fs/xfs/xfs_bmap.c. >>>> Caller 0xffffffff883009bc >>>> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_btree_check_sblock at line 334 of file fs/xfs/xfs_btree.c. >>>> Caller 0xffffffff882d8451 >>>> Jul 18 16:21:53 c3m kernel: Filesystem "sdc1": XFS internal error >>>> xfs_trans_cancel at line 1132 of file fs/xfs/xfs_trans.c. Caller >>>> 0xffffffff88304f9e >>>> >>>> >>>> >>> >> >> > -- Mark Goodwin markgw@sgi.com Engineering Manager for XFS and PCP Phone: +61-3-99631937 SGI Australian Software Group Cell: +61-4-18969583 ------------------------------------------------------------- From owner-xfs@oss.sgi.com Mon Jul 28 05:14:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 05:14:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SCENll008015 for ; Mon, 28 Jul 2008 05:14:25 -0700 X-ASG-Debug-ID: 1217247335-590900ac0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 36344337042; Mon, 28 Jul 2008 05:15:35 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id gXAqN2Z3O7JFUbrS; Mon, 28 Jul 2008 05:15:35 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KNRdW-00010w-LU; Mon, 28 Jul 2008 12:15:34 +0000 Date: Mon, 28 Jul 2008 08:15:34 -0400 From: Christoph Hellwig To: Lachlan McIlroy Cc: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: TAKE 981498 - kill bhv_vnode_t Subject: Re: TAKE 981498 - kill bhv_vnode_t Message-ID: <20080728121534.GA12715@infradead.org> References: <20080728062625.BB57158C4C3F@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080728062625.BB57158C4C3F@chook.melbourne.sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1217247336 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1096 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17216 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Mon, Jul 28, 2008 at 04:26:25PM +1000, Lachlan McIlroy wrote: > kill bhv_vnode_t > > All remaining bhv_vnode_t instance are in code that's more or less Linux > specific. (Well, for xfs_acl.c that could be argued, but that code is > on the removal list, too). So just do an s/bhv_vnode_t/struct inode/ > over the whole tree. We can clean up variable naming and some useless > helpers later. Thanks, but I wonder how this could even apply without the intialize_vnode cleanup.. From owner-xfs@oss.sgi.com Mon Jul 28 05:33:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 05:33:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35, J_CHICKENPOX_38,J_CHICKENPOX_44,J_CHICKENPOX_55,J_CHICKENPOX_56,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SCXTIQ010107 for ; Mon, 28 Jul 2008 05:33:29 -0700 X-ASG-Debug-ID: 1217248480-242500d30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx2.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 74646193EDEB for ; Mon, 28 Jul 2008 05:34:40 -0700 (PDT) Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by cuda.sgi.com with ESMTP id l8Ta0mjpeEdJySIl for ; Mon, 28 Jul 2008 05:34:40 -0700 (PDT) X-ASG-Whitelist: Client Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 2315345C83; Mon, 28 Jul 2008 14:34:39 +0200 (CEST) Date: Mon, 28 Jul 2008 14:34:38 +0200 From: Nick Piggin To: Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List Cc: Andrew Morton , dri-devel@lists.sourceforge.net X-ASG-Orig-Subj: [rfc][patch 1/3] mm: vmap rewrite Subject: [rfc][patch 1/3] mm: vmap rewrite Message-ID: <20080728123438.GA13926@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.9i X-Barracuda-Connect: cantor2.suse.de[195.135.220.15] X-Barracuda-Start-Time: 1217248481 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17217 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: npiggin@suse.de Precedence: bulk X-list: xfs Hi all, I plan to submit my vmap rewrite to -mm. Although I am not planning to submit fsblock to be merged, I figure that at least XFS wants a fast, scalable vmap in some configurations. Others may want as well (didn't look too hard, but the DRM subsystem needs or will need much better performance so I have heard). And yet others might discover interesting new ways to use a sanely performing vmap. The code is in reasonable shape (aside from checkpatch 80 column vomit), so I figure it is better to submit this rather than let it rot. Comments? -- Rewrite the vmap allocator to use rbtrees and lazy tlb flushing, and provide a fast, scalable percpu frontend for small vmaps (requires a slightly different API, though). The biggest problem with vmap is actually vunmap. Presently this requires a global kernel TLB flush, which on most architectures is a broadcast IPI to all CPUs to flush the cache. This is all done under a global lock. As the number of CPUs increases, so will the number of vunmaps a scaled workload will want to perform, and so will the cost of a global TLB flush. This gives terrible quadratic scalability characteristics. Another problem is that the entire vmap subsystem works under a single lock. It is a rwlock, but it is actually taken for write in all the fast paths, and the read locking would likely never be run concurrently anyway, so it's just pointless. This is a rewrite of vmap subsystem to solve those problems. The existing vmalloc API is implemented on top of the rewritten subsystem. The TLB flushing problem is solved by using lazy TLB unmapping. vmap addresses do not have to be flushed immediately when they are vunmapped, because the kernel will not reuse them again (would be a use-after-free) until they are reallocated. So the addresses aren't allocated again until a subsequent TLB flush. A single TLB flush then can flush multiple vunmaps from each CPU. XEN and PAT and such do not like deferred TLB flushing because they can't always handle multiple aliasing virtual addresses to a physical address. They now call vm_unmap_aliases() in order to flush any deferred mappings. That call is very expensive (well, actually not a lot more expensive than a single vunmap under the old scheme), however it should be OK if not called too often. The virtual memory extent information is stored in an rbtree rather than a linked list to improve the algorithmic scalability. There is a per-CPU allocator for small vmaps, which amortizes or avoids global locking. To use the per-CPU interface, the vm_map_ram / vm_unmap_ram interfaces must be used in place of vmap and vunmap. Vmalloc does not use these interfaces at the moment, so it will not be quite so scalable (although it will use lazy TLB flushing). As a quick test of performance, I ran a test that loops in the kernel, linearly mapping then touching then unmapping 4 pages. Different numbers of tests were run in parallel on an 4 core, 2 socket opteron. Results are in nanoseconds per map+touch+unmap. threads vanilla vmap rewrite 1 14700 2900 2 33600 3000 4 49500 2800 8 70631 2900 So with a 8 cores, the rewritten version is already 25x faster. In a slightly more realistic test (although with an older and less scalable version of the patch), I ripped the not-very-good vunmap batching code out of XFS, and implemented the large buffer mapping with vm_map_ram and vm_unmap_ram... along with a couple of other tricks, I was able to speed up a large directory workload by 20x on a 64 CPU system. I believe vmap/vunmap is actually sped up a lot more than 20x on such a system, but I'm running into other locks now. vmap is pretty well blown off the profiles. Before: 1352059 total 0.1401 798784 _write_lock 8320.6667 <- vmlist_lock 529313 default_idle 1181.5022 15242 smp_call_function 15.8771 <- vmap tlb flushing 2472 __get_vm_area_node 1.9312 <- vmap 1762 remove_vm_area 4.5885 <- vunmap 316 map_vm_area 0.2297 <- vmap 312 kfree 0.1950 300 _spin_lock 3.1250 252 sn_send_IPI_phys 0.4375 <- tlb flushing 238 vmap 0.8264 <- vmap 216 find_lock_page 0.5192 196 find_next_bit 0.3603 136 sn2_send_IPI 0.2024 130 pio_phys_write_mmr 2.0312 118 unmap_kernel_range 0.1229 After: 78406 total 0.0081 40053 default_idle 89.4040 33576 ia64_spinlock_contention 349.7500 1650 _spin_lock 17.1875 319 __reg_op 0.5538 281 _atomic_dec_and_lock 1.0977 153 mutex_unlock 1.5938 123 iget_locked 0.1671 117 xfs_dir_lookup 0.1662 117 dput 0.1406 114 xfs_iget_core 0.0268 92 xfs_da_hashname 0.1917 75 d_alloc 0.0670 68 vmap_page_range 0.0462 <- vmap 58 kmem_cache_alloc 0.0604 57 memset 0.0540 52 rb_next 0.1625 50 __copy_user 0.0208 49 bitmap_find_free_region 0.2188 <- vmap 46 ia64_sn_udelay 0.1106 45 find_inode_fast 0.1406 42 memcmp 0.2188 42 finish_task_switch 0.1094 42 __d_lookup 0.0410 40 radix_tree_lookup_slot 0.1250 37 _spin_unlock_irqrestore 0.3854 36 xfs_bmapi 0.0050 36 kmem_cache_free 0.0256 35 xfs_vn_getattr 0.0322 34 radix_tree_lookup 0.1062 33 __link_path_walk 0.0035 31 xfs_da_do_buf 0.0091 30 _xfs_buf_find 0.0204 28 find_get_page 0.0875 27 xfs_iread 0.0241 27 __strncpy_from_user 0.2812 26 _xfs_buf_initialize 0.0406 24 _xfs_buf_lookup_pages 0.0179 24 vunmap_page_range 0.0250 <- vunmap 23 find_lock_page 0.0799 22 vm_map_ram 0.0087 <- vmap 20 kfree 0.0125 19 put_page 0.0330 18 __kmalloc 0.0176 17 xfs_da_node_lookup_int 0.0086 17 _read_lock 0.0885 17 page_waitqueue 0.0664 vmap has gone from being the top 5 on the profiles and flushing the crap out of all TLBs, to using less than 1% of kernel time. Who ever said vmap is unsuitable to implement large block support? :) --- This work is a basic requirement for my large block support in fsblock, although I will also be using other techniques such as page-at-a-time algorithms and atomic mappings to further reduce the reliance on vmap. Basically, when those techniques are used, I anticipate vmap to basically be almost unused anyway, however this is going to help transition... Index: linux-2.6/mm/vmalloc.c =================================================================== --- linux-2.6.orig/mm/vmalloc.c +++ linux-2.6/mm/vmalloc.c @@ -8,6 +8,7 @@ * Numa awareness, Christoph Lameter, SGI, June 2005 */ +#include #include #include #include @@ -18,16 +19,17 @@ #include #include #include +#include +#include +#include +#include +#include #include #include -DEFINE_RWLOCK(vmlist_lock); -struct vm_struct *vmlist; - -static void *__vmalloc_node(unsigned long size, gfp_t gfp_mask, pgprot_t prot, - int node, void *caller); +/*** Page table manipulation functions ***/ static void vunmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end) { @@ -40,8 +42,7 @@ static void vunmap_pte_range(pmd_t *pmd, } while (pte++, addr += PAGE_SIZE, addr != end); } -static inline void vunmap_pmd_range(pud_t *pud, unsigned long addr, - unsigned long end) +static void vunmap_pmd_range(pud_t *pud, unsigned long addr, unsigned long end) { pmd_t *pmd; unsigned long next; @@ -55,8 +56,7 @@ static inline void vunmap_pmd_range(pud_ } while (pmd++, addr = next, addr != end); } -static inline void vunmap_pud_range(pgd_t *pgd, unsigned long addr, - unsigned long end) +static void vunmap_pud_range(pgd_t *pgd, unsigned long addr, unsigned long end) { pud_t *pud; unsigned long next; @@ -70,12 +70,10 @@ static inline void vunmap_pud_range(pgd_ } while (pud++, addr = next, addr != end); } -void unmap_kernel_range(unsigned long addr, unsigned long size) +static void vunmap_page_range(unsigned long addr, unsigned long end) { pgd_t *pgd; unsigned long next; - unsigned long start = addr; - unsigned long end = addr + size; BUG_ON(addr >= end); pgd = pgd_offset_k(addr); @@ -86,16 +84,10 @@ void unmap_kernel_range(unsigned long ad continue; vunmap_pud_range(pgd, addr, next); } while (pgd++, addr = next, addr != end); - flush_tlb_kernel_range(start, end); -} - -static void unmap_vm_area(struct vm_struct *area) -{ - unmap_kernel_range((unsigned long)area->addr, area->size); } static int vmap_pte_range(pmd_t *pmd, unsigned long addr, - unsigned long end, pgprot_t prot, struct page ***pages) + unsigned long end, pgprot_t prot, struct page **pages, int *nr) { pte_t *pte; @@ -103,18 +95,24 @@ static int vmap_pte_range(pmd_t *pmd, un if (!pte) return -ENOMEM; do { - struct page *page = **pages; - WARN_ON(!pte_none(*pte)); - if (!page) + struct page *page = pages[*nr]; + + if (unlikely(!pte_none(*pte))) { + WARN_ON(1); + return -EBUSY; + } + if (unlikely(!page)) { + WARN_ON(1); return -ENOMEM; + } set_pte_at(&init_mm, addr, pte, mk_pte(page, prot)); - (*pages)++; + (*nr)++; } while (pte++, addr += PAGE_SIZE, addr != end); return 0; } -static inline int vmap_pmd_range(pud_t *pud, unsigned long addr, - unsigned long end, pgprot_t prot, struct page ***pages) +static int vmap_pmd_range(pud_t *pud, unsigned long addr, + unsigned long end, pgprot_t prot, struct page **pages, int *nr) { pmd_t *pmd; unsigned long next; @@ -124,14 +122,14 @@ static inline int vmap_pmd_range(pud_t * return -ENOMEM; do { next = pmd_addr_end(addr, end); - if (vmap_pte_range(pmd, addr, next, prot, pages)) + if (vmap_pte_range(pmd, addr, next, prot, pages, nr)) return -ENOMEM; } while (pmd++, addr = next, addr != end); return 0; } -static inline int vmap_pud_range(pgd_t *pgd, unsigned long addr, - unsigned long end, pgprot_t prot, struct page ***pages) +static int vmap_pud_range(pgd_t *pgd, unsigned long addr, + unsigned long end, pgprot_t prot, struct page **pages, int *nr) { pud_t *pud; unsigned long next; @@ -141,50 +139,48 @@ static inline int vmap_pud_range(pgd_t * return -ENOMEM; do { next = pud_addr_end(addr, end); - if (vmap_pmd_range(pud, addr, next, prot, pages)) + if (vmap_pmd_range(pud, addr, next, prot, pages, nr)) return -ENOMEM; } while (pud++, addr = next, addr != end); return 0; } -int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages) +static int vmap_page_range(unsigned long addr, unsigned long end, + pgprot_t prot, struct page **pages) { pgd_t *pgd; unsigned long next; - unsigned long addr = (unsigned long) area->addr; - unsigned long end = addr + area->size - PAGE_SIZE; - int err; + int err = 0; + int nr = 0; BUG_ON(addr >= end); pgd = pgd_offset_k(addr); do { next = pgd_addr_end(addr, end); - err = vmap_pud_range(pgd, addr, next, prot, pages); + err = vmap_pud_range(pgd, addr, next, prot, pages, &nr); if (err) break; } while (pgd++, addr = next, addr != end); - flush_cache_vmap((unsigned long) area->addr, end); - return err; + flush_cache_vmap(addr, end); + return err ? : nr; } -EXPORT_SYMBOL_GPL(map_vm_area); /* - * Map a vmalloc()-space virtual address to the physical page. + * Walk a vmap address to the struct page it maps. */ struct page *vmalloc_to_page(const void *vmalloc_addr) { unsigned long addr = (unsigned long) vmalloc_addr; struct page *page = NULL; pgd_t *pgd = pgd_offset_k(addr); - pud_t *pud; - pmd_t *pmd; - pte_t *ptep, pte; if (!pgd_none(*pgd)) { - pud = pud_offset(pgd, addr); + pud_t *pud = pud_offset(pgd, addr); if (!pud_none(*pud)) { - pmd = pmd_offset(pud, addr); + pmd_t *pmd = pmd_offset(pud, addr); if (!pmd_none(*pmd)) { + pte_t *ptep, pte; + ptep = pte_offset_map(pmd, addr); pte = *ptep; if (pte_present(pte)) @@ -206,13 +202,637 @@ unsigned long vmalloc_to_pfn(const void } EXPORT_SYMBOL(vmalloc_to_pfn); -static struct vm_struct * -__get_vm_area_node(unsigned long size, unsigned long flags, unsigned long start, - unsigned long end, int node, gfp_t gfp_mask, void *caller) + +/*** Global kva allocator ***/ + +#define VM_LAZY_FREE 0x01 +#define VM_LAZY_FREEING 0x02 +#define VM_VM_AREA 0x04 + +struct vmap_area { + unsigned long va_start; + unsigned long va_end; + unsigned long flags; + struct rb_node rb_node; + struct list_head list; + struct list_head purge_list; + void *private; + struct rcu_head rcu_head; +}; + +static DEFINE_SPINLOCK(vmap_area_lock); +static struct rb_root vmap_area_root = RB_ROOT; +static LIST_HEAD(vmap_area_list); + +static struct vmap_area *__find_vmap_area(unsigned long addr) +{ + struct rb_node *n = vmap_area_root.rb_node; + + while (n) { + struct vmap_area *va; + + va = rb_entry(n, struct vmap_area, rb_node); + if (addr < va->va_start) + n = n->rb_left; + else if (addr > va->va_start) + n = n->rb_right; + else + return va; + } + + return NULL; +} + +static void __insert_vmap_area(struct vmap_area *va) { - struct vm_struct **p, *tmp, *area; - unsigned long align = 1; + struct rb_node **p = &vmap_area_root.rb_node; + struct rb_node *parent = NULL; + struct rb_node *tmp; + + while (*p) { + struct vmap_area *tmp; + + parent = *p; + tmp = rb_entry(parent, struct vmap_area, rb_node); + if (va->va_start < tmp->va_end) + p = &(*p)->rb_left; + else if (va->va_end > tmp->va_start) + p = &(*p)->rb_right; + else + BUG(); + } + + rb_link_node(&va->rb_node, parent, p); + rb_insert_color(&va->rb_node, &vmap_area_root); + + /* address-sort this list so it is usable like the vmlist */ + tmp = rb_prev(&va->rb_node); + if (tmp) { + struct vmap_area *prev; + prev = rb_entry(tmp, struct vmap_area, rb_node); + list_add_rcu(&va->list, &prev->list); + } else + list_add_rcu(&va->list, &vmap_area_list); +} + +static void purge_vmap_area_lazy(void); + +static struct vmap_area *alloc_vmap_area(unsigned long size, unsigned long align, + unsigned long vstart, unsigned long vend, + int node, gfp_t gfp_mask) +{ + struct vmap_area *va; + struct rb_node *n; unsigned long addr; + int purged = 0; + + BUG_ON(size & ~PAGE_MASK); + + addr = ALIGN(vstart, align); + + va = kmalloc_node(sizeof(struct vmap_area), + gfp_mask & GFP_RECLAIM_MASK, node); + if (unlikely(!va)) + return ERR_PTR(-ENOMEM); + +retry: + spin_lock(&vmap_area_lock); + /* XXX: could have a last_hole cache */ + n = vmap_area_root.rb_node; + if (n) { + struct vmap_area *first = NULL; + + do { + struct vmap_area *tmp; + tmp = rb_entry(n, struct vmap_area, rb_node); + if (tmp->va_end >= addr) { + if (!first && tmp->va_start <= addr) + first = tmp; + n = n->rb_left; + } else { + first = tmp; + n = n->rb_right; + } + } while (n); + + if (!first) + goto found; + + if (first->va_end < addr) { + n = rb_next(&first->rb_node); + if (n) + first = rb_entry(n, struct vmap_area, rb_node); + else + goto found; + } + + while (addr + size >= first->va_start && addr + size <= vend) { + addr = ALIGN(first->va_end + PAGE_SIZE, align); + + n = rb_next(&first->rb_node); + if (n) + first = rb_entry(n, struct vmap_area, rb_node); + else + goto found; + } + } +found: + if (addr + size > vend) { + spin_unlock(&vmap_area_lock); + if (!purged) { + purge_vmap_area_lazy(); + purged = 1; + goto retry; + } + if (printk_ratelimit()) + printk(KERN_WARNING "vmap allocation failed: " + "use vmalloc= to increase size.\n"); + return ERR_PTR(-EBUSY); + } + + BUG_ON(addr & (align-1)); + + va->va_start = addr; + va->va_end = addr + size; + va->flags = 0; + __insert_vmap_area(va); + spin_unlock(&vmap_area_lock); + + return va; +} + +static void rcu_free_va(struct rcu_head *head) +{ + struct vmap_area *va = container_of(head, struct vmap_area, rcu_head); + + kfree(va); +} + +static void __free_vmap_area(struct vmap_area *va) +{ + BUG_ON(RB_EMPTY_NODE(&va->rb_node)); + rb_erase(&va->rb_node, &vmap_area_root); + RB_CLEAR_NODE(&va->rb_node); + list_del_rcu(&va->list); + + call_rcu(&va->rcu_head, rcu_free_va); +} + +static void free_vmap_area(struct vmap_area *va) +{ + spin_lock(&vmap_area_lock); + __free_vmap_area(va); + spin_unlock(&vmap_area_lock); +} + +static void unmap_vmap_area(struct vmap_area *va) +{ + vunmap_page_range(va->va_start, va->va_end); +} + +#define LAZY_MAX (64*1024*1024 / PAGE_SIZE) +static atomic_t vmap_lazy_nr = ATOMIC_INIT(0); + +static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, + int sync, int force_flush) +{ + static DEFINE_SPINLOCK(purge_lock); + LIST_HEAD(valist); + struct vmap_area *va; + int nr = 0; + + if (!sync && !force_flush) { + if (!spin_trylock(&purge_lock)) + return; + } else + spin_lock(&purge_lock); + + rcu_read_lock(); + list_for_each_entry_rcu(va, &vmap_area_list, list) { + if (va->flags & VM_LAZY_FREE) { + if (va->va_start < *start) + *start = va->va_start; + if (va->va_end > *end) + *end = va->va_end; + nr += (va->va_end - va->va_start) >> PAGE_SHIFT; + unmap_vmap_area(va); + list_add_tail(&va->purge_list, &valist); + va->flags |= VM_LAZY_FREEING; + va->flags &= ~VM_LAZY_FREE; + } + } + rcu_read_unlock(); + + if (nr) { + BUG_ON(nr > atomic_read(&vmap_lazy_nr)); + atomic_sub(nr, &vmap_lazy_nr); + } + + if (nr || force_flush) + flush_tlb_kernel_range(*start, *end); + + if (nr) { + spin_lock(&vmap_area_lock); + list_for_each_entry(va, &valist, purge_list) + __free_vmap_area(va); + spin_unlock(&vmap_area_lock); + } + spin_unlock(&purge_lock); +} + +static void purge_vmap_area_lazy(void) +{ + unsigned long start = ULONG_MAX, end = 0; + + __purge_vmap_area_lazy(&start, &end, 0, 0); +} + +static void free_unmap_vmap_area(struct vmap_area *va) +{ + va->flags |= VM_LAZY_FREE; + atomic_add((va->va_end - va->va_start) >> PAGE_SHIFT, &vmap_lazy_nr); + if (unlikely(atomic_read(&vmap_lazy_nr) > LAZY_MAX)) + purge_vmap_area_lazy(); +} + +static struct vmap_area *find_vmap_area(unsigned long addr) +{ + struct vmap_area *va; + + spin_lock(&vmap_area_lock); + va = __find_vmap_area(addr); + spin_unlock(&vmap_area_lock); + + return va; +} + +static void free_unmap_vmap_area_addr(unsigned long addr) +{ + struct vmap_area *va; + + va = find_vmap_area(addr); + BUG_ON(!va); + free_unmap_vmap_area(va); +} + + +/*** Per cpu kva allocator ***/ + +/* + * vmap space is limited especially on 32 bit architectures. Ensure there is + * room for at least 16 percpu vmap blocks per CPU. + */ +#if 0 /* constant vmalloc space size */ +#define VMALLOC_SPACE (VMALLOC_END-VMALLOC_START) +#else +#if BITS_PER_LONG == 32 +#define VMALLOC_SPACE (128*1024*1024) +#else +#define VMALLOC_SPACE (128*1024*1024*1024) +#endif +#endif + +#define VMALLOC_PAGES (VMALLOC_SPACE / PAGE_SIZE) +#define VMAP_MAX_ALLOC BITS_PER_LONG /* 256K with 4K pages */ +#define VMAP_BBMAP_BITS_MAX 1024 /* 4MB with 4K pages */ +#define VMAP_BBMAP_BITS_MIN (VMAP_MAX_ALLOC*2) +#define VMAP_MIN(x, y) ((x) < (y) ? (x) : (y)) /* can't use min() */ +#define VMAP_MAX(x, y) ((x) > (y) ? (x) : (y)) /* can't use max() */ +#define VMAP_BBMAP_BITS VMAP_MIN(VMAP_BBMAP_BITS_MAX, VMAP_MAX(VMAP_BBMAP_BITS_MIN, VMALLOC_PAGES / NR_CPUS / 16)) + +#define VMAP_BLOCK_SIZE (VMAP_BBMAP_BITS * PAGE_SIZE) + +struct vmap_block_queue { + spinlock_t lock; + struct list_head free; + struct list_head dirty; + unsigned int nr_dirty; +}; + +struct vmap_block { + spinlock_t lock; + struct vmap_area *va; + struct vmap_block_queue *vbq; + unsigned long free, dirty; + DECLARE_BITMAP(alloc_map, VMAP_BBMAP_BITS); + DECLARE_BITMAP(dirty_map, VMAP_BBMAP_BITS); + union { + struct { + struct list_head free_list; + struct list_head dirty_list; + }; + struct rcu_head rcu_head; + }; +}; + +static DEFINE_PER_CPU(struct vmap_block_queue, vmap_block_queue); + +static DEFINE_SPINLOCK(vmap_block_tree_lock); +static RADIX_TREE(vmap_block_tree, GFP_ATOMIC); +/* XXX: have global list of vmap blocks to fall back on? */ + +static unsigned long addr_to_vb_idx(unsigned long addr) +{ + addr -= VMALLOC_START & ~(VMAP_BLOCK_SIZE-1); + addr /= VMAP_BLOCK_SIZE; + return addr; +} + +static struct vmap_block *new_vmap_block(gfp_t gfp_mask) +{ + struct vmap_block_queue *vbq; + struct vmap_block *vb; + struct vmap_area *va; + int node, err; + + node = numa_node_id(); + + vb = kmalloc_node(sizeof(struct vmap_block), + gfp_mask & GFP_RECLAIM_MASK, node); + if (unlikely(!vb)) + return ERR_PTR(-ENOMEM); + + va = alloc_vmap_area(VMAP_BLOCK_SIZE, VMAP_BLOCK_SIZE, + VMALLOC_START, VMALLOC_END, + node, gfp_mask); + if (unlikely(IS_ERR(va))) { + kfree(vb); + return ERR_PTR(PTR_ERR(va)); + } + + err = radix_tree_preload(gfp_mask); + if (unlikely(err)) { + kfree(vb); + free_vmap_area(va); + return ERR_PTR(err); + } + + spin_lock_init(&vb->lock); + vb->va = va; + vb->free = VMAP_BBMAP_BITS; + vb->dirty = 0; + bitmap_zero(vb->alloc_map, VMAP_BBMAP_BITS); + bitmap_zero(vb->dirty_map, VMAP_BBMAP_BITS); + INIT_LIST_HEAD(&vb->free_list); + INIT_LIST_HEAD(&vb->dirty_list); + + spin_lock(&vmap_block_tree_lock); + err = radix_tree_insert(&vmap_block_tree, addr_to_vb_idx(va->va_start), vb); + spin_unlock(&vmap_block_tree_lock); + BUG_ON(err); + radix_tree_preload_end(); + + vbq = &get_cpu_var(vmap_block_queue); + vb->vbq = vbq; + spin_lock(&vbq->lock); + list_add(&vb->free_list, &vbq->free); + spin_unlock(&vbq->lock); + put_cpu_var(vmap_cpu_blocks); + + return vb; +} + +static void rcu_free_vb(struct rcu_head *head) +{ + struct vmap_block *vb = container_of(head, struct vmap_block, rcu_head); + + kfree(vb); +} + +static void free_vmap_block(struct vmap_block *vb) +{ + struct vmap_block *tmp; + + spin_lock(&vb->vbq->lock); + if (!list_empty(&vb->free_list)) + list_del(&vb->free_list); + if (!list_empty(&vb->dirty_list)) + list_del(&vb->dirty_list); + spin_unlock(&vb->vbq->lock); + + spin_lock(&vmap_block_tree_lock); + tmp = radix_tree_delete(&vmap_block_tree, addr_to_vb_idx(vb->va->va_start)); + spin_unlock(&vmap_block_tree_lock); + BUG_ON(tmp != vb); + + free_unmap_vmap_area(vb->va); + call_rcu(&vb->rcu_head, rcu_free_vb); +} + +static void *vb_alloc(unsigned long size, + gfp_t gfp_mask) +{ + struct vmap_block_queue *vbq; + struct vmap_block *vb; + unsigned long addr = 0; + unsigned int order; + + BUG_ON(size & ~PAGE_MASK); + BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); + order = get_order(size); + +again: + rcu_read_lock(); + vbq = &get_cpu_var(vmap_block_queue); + list_for_each_entry_rcu(vb, &vbq->free, free_list) { + int i; + + spin_lock(&vb->lock); + i = bitmap_find_free_region(vb->alloc_map, VMAP_BBMAP_BITS, order); + + if (i >= 0) { + addr = vb->va->va_start + (i << PAGE_SHIFT); + BUG_ON(addr_to_vb_idx(addr) != addr_to_vb_idx(vb->va->va_start)); + vb->free -= 1UL << order; + if (vb->free == 0) { + spin_lock(&vbq->lock); + list_del_init(&vb->free_list); + spin_unlock(&vbq->lock); + } + spin_unlock(&vb->lock); + break; + } + spin_unlock(&vb->lock); + } + put_cpu_var(vmap_cpu_blocks); + rcu_read_unlock(); + + if (!addr) { + vb = new_vmap_block(gfp_mask); + if (IS_ERR(vb)) + return vb; + goto again; + } + + return (void *)addr; +} + +static void vb_free(const void *addr, unsigned long size) +{ + unsigned long offset; + unsigned int order; + struct vmap_block *vb; + + BUG_ON(size & ~PAGE_MASK); + BUG_ON(size > PAGE_SIZE*VMAP_MAX_ALLOC); + order = get_order(size); + + offset = (unsigned long)addr & (VMAP_BLOCK_SIZE - 1); + + rcu_read_lock(); + vb = radix_tree_lookup(&vmap_block_tree, addr_to_vb_idx((unsigned long)addr)); + rcu_read_unlock(); + BUG_ON(!vb); + + spin_lock(&vb->lock); + bitmap_allocate_region(vb->dirty_map, offset >> PAGE_SHIFT, order); + if (!vb->dirty) { + spin_lock(&vb->vbq->lock); + list_add(&vb->dirty_list, &vb->vbq->dirty); + spin_unlock(&vb->vbq->lock); + } + vb->dirty += 1UL << order; + if (vb->dirty == VMAP_BBMAP_BITS) { + BUG_ON(vb->free || !list_empty(&vb->free_list)); + spin_unlock(&vb->lock); + free_vmap_block(vb); + } else + spin_unlock(&vb->lock); +} + +void vm_unmap_aliases(void) +{ + unsigned long start = ULONG_MAX, end = 0; + int cpu; + int flush = 0; + + for_each_possible_cpu(cpu) { + struct vmap_block_queue *vbq = &per_cpu(vmap_block_queue, cpu); + struct vmap_block *vb; + + rcu_read_lock(); + list_for_each_entry_rcu(vb, &vbq->free, free_list) { + int i; + + spin_lock(&vb->lock); + for (i = find_first_bit(vb->dirty_map, VMAP_BBMAP_BITS); + i < VMAP_BBMAP_BITS; + i = find_next_bit(vb->dirty_map, VMAP_BBMAP_BITS, i)){ + unsigned long s, e; + int j; + j = find_next_zero_bit(vb->dirty_map, + VMAP_BBMAP_BITS, i); + + s = vb->va->va_start + (i << PAGE_SHIFT); + e = vb->va->va_start + (j << PAGE_SHIFT); + vunmap_page_range(s, e); + flush = 1; + + if (s < start) + start = s; + if (e > end) + end = e; + + i = j; + } + spin_unlock(&vb->lock); + } + rcu_read_unlock(); + } + + __purge_vmap_area_lazy(&start, &end, 1, flush); +} + +void vm_unmap_ram(const void *mem, unsigned int count) +{ + unsigned long size = count << PAGE_SHIFT; + unsigned long addr = (unsigned long)mem; + + BUG_ON(!addr || addr < VMALLOC_START || addr > VMALLOC_END || (addr & (PAGE_SIZE-1))); + + debug_check_no_locks_freed(mem, size); + + if (likely(count <= VMAP_MAX_ALLOC)) + vb_free(mem, size); + else + free_unmap_vmap_area_addr(addr); +} + +void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot) +{ + unsigned long size = count << PAGE_SHIFT; + unsigned long addr; + void *mem; + + if (likely(count <= VMAP_MAX_ALLOC)) { + mem = vb_alloc(size, GFP_KERNEL); + if (IS_ERR(mem)) + return NULL; + addr = (unsigned long)mem; + } else { + struct vmap_area *va; + va = alloc_vmap_area(size, PAGE_SIZE, VMALLOC_START, VMALLOC_END, node, GFP_KERNEL); + if (IS_ERR(va)) + return NULL; + + addr = va->va_start; + mem = (void *)addr; + } + if (vmap_page_range(addr, addr + size, prot, pages) < 0) { + vm_unmap_ram(mem, count); + return NULL; + } + return mem; +} + +void __init vmalloc_init(void) +{ + int i; + + for_each_possible_cpu(i) { + struct vmap_block_queue *vbq; + + vbq = &per_cpu(vmap_block_queue, i); + spin_lock_init(&vbq->lock); + INIT_LIST_HEAD(&vbq->free); + INIT_LIST_HEAD(&vbq->dirty); + vbq->nr_dirty = 0; + } +} + +void unmap_kernel_range(unsigned long addr, unsigned long size) +{ + unsigned long end = addr + size; + vunmap_page_range(addr, end); + flush_tlb_kernel_range(addr, end); +} + +int map_vm_area(struct vm_struct *area, pgprot_t prot, struct page ***pages) +{ + unsigned long addr = (unsigned long)area->addr; + int err; + err = vmap_page_range(addr, addr + area->size- PAGE_SIZE, prot, *pages); + if (err > 0) { + *pages += err; + err = 0; + } + + return err; +} +EXPORT_SYMBOL_GPL(map_vm_area); + +/*** Old vmalloc interfaces ***/ +DEFINE_RWLOCK(vmlist_lock); +struct vm_struct *vmlist; + +static struct vm_struct *__get_vm_area_node(unsigned long size, + unsigned long flags, unsigned long start, unsigned long end, + int node, gfp_t gfp_mask, void *caller) +{ + static struct vmap_area *va; + struct vm_struct *area; + struct vm_struct *tmp, **p; + unsigned long align = 1; BUG_ON(in_interrupt()); if (flags & VM_IOREMAP) { @@ -225,13 +845,12 @@ __get_vm_area_node(unsigned long size, u align = 1ul << bit; } - addr = ALIGN(start, align); + size = PAGE_ALIGN(size); if (unlikely(!size)) return NULL; area = kmalloc_node(sizeof(*area), gfp_mask & GFP_RECLAIM_MASK, node); - if (unlikely(!area)) return NULL; @@ -240,48 +859,32 @@ __get_vm_area_node(unsigned long size, u */ size += PAGE_SIZE; - write_lock(&vmlist_lock); - for (p = &vmlist; (tmp = *p) != NULL ;p = &tmp->next) { - if ((unsigned long)tmp->addr < addr) { - if((unsigned long)tmp->addr + tmp->size >= addr) - addr = ALIGN(tmp->size + - (unsigned long)tmp->addr, align); - continue; - } - if ((size + addr) < addr) - goto out; - if (size + addr <= (unsigned long)tmp->addr) - goto found; - addr = ALIGN(tmp->size + (unsigned long)tmp->addr, align); - if (addr > end - size) - goto out; - } - if ((size + addr) < addr) - goto out; - if (addr > end - size) - goto out; - -found: - area->next = *p; - *p = area; + va = alloc_vmap_area(size, align, start, end, node, gfp_mask); + if (IS_ERR(va)) { + kfree(area); + return NULL; + } area->flags = flags; - area->addr = (void *)addr; + area->addr = (void *)va->va_start; area->size = size; area->pages = NULL; area->nr_pages = 0; area->phys_addr = 0; area->caller = caller; + va->private = area; + va->flags |= VM_VM_AREA; + + write_lock(&vmlist_lock); + for (p = &vmlist; (tmp = *p) != NULL; p = &tmp->next) { + if (tmp->addr >= area->addr) + break; + } + area->next = *p; + *p = area; write_unlock(&vmlist_lock); return area; - -out: - write_unlock(&vmlist_lock); - kfree(area); - if (printk_ratelimit()) - printk(KERN_WARNING "allocation failed: out of vmalloc space - use vmalloc= to increase size.\n"); - return NULL; } struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, @@ -321,39 +924,15 @@ struct vm_struct *get_vm_area_node(unsig gfp_mask, __builtin_return_address(0)); } -/* Caller must hold vmlist_lock */ -static struct vm_struct *__find_vm_area(const void *addr) +static struct vm_struct *find_vm_area(const void *addr) { - struct vm_struct *tmp; + struct vmap_area *va; - for (tmp = vmlist; tmp != NULL; tmp = tmp->next) { - if (tmp->addr == addr) - break; - } - - return tmp; -} + va = find_vmap_area((unsigned long)addr); + if (va && va->flags & VM_VM_AREA) + return va->private; -/* Caller must hold vmlist_lock */ -static struct vm_struct *__remove_vm_area(const void *addr) -{ - struct vm_struct **p, *tmp; - - for (p = &vmlist ; (tmp = *p) != NULL ;p = &tmp->next) { - if (tmp->addr == addr) - goto found; - } return NULL; - -found: - unmap_vm_area(tmp); - *p = tmp->next; - - /* - * Remove the guard page. - */ - tmp->size -= PAGE_SIZE; - return tmp; } /** @@ -366,11 +945,24 @@ found: */ struct vm_struct *remove_vm_area(const void *addr) { - struct vm_struct *v; - write_lock(&vmlist_lock); - v = __remove_vm_area(addr); - write_unlock(&vmlist_lock); - return v; + struct vmap_area *va; + + va = find_vmap_area((unsigned long)addr); + if (va && va->flags & VM_VM_AREA) { + struct vm_struct *vm = va->private; + struct vm_struct *tmp, **p; + free_unmap_vmap_area(va); + vm->size -= PAGE_SIZE; + + write_lock(&vmlist_lock); + for (p = &vmlist; (tmp = *p) != vm; p = &tmp->next) + ; + *p = tmp->next; + write_unlock(&vmlist_lock); + + return vm; + } + return NULL; } static void __vunmap(const void *addr, int deallocate_pages) @@ -480,6 +1072,8 @@ void *vmap(struct page **pages, unsigned } EXPORT_SYMBOL(vmap); +static void *__vmalloc_node(unsigned long size, gfp_t gfp_mask, pgprot_t prot, + int node, void *caller); static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask, pgprot_t prot, int node, void *caller) { @@ -606,10 +1200,8 @@ void *vmalloc_user(unsigned long size) ret = __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); if (ret) { - write_lock(&vmlist_lock); - area = __find_vm_area(ret); + area = find_vm_area(ret); area->flags |= VM_USERMAP; - write_unlock(&vmlist_lock); } return ret; } @@ -689,10 +1281,8 @@ void *vmalloc_32_user(unsigned long size ret = __vmalloc(size, GFP_VMALLOC32 | __GFP_ZERO, PAGE_KERNEL); if (ret) { - write_lock(&vmlist_lock); - area = __find_vm_area(ret); + area = find_vm_area(ret); area->flags |= VM_USERMAP; - write_unlock(&vmlist_lock); } return ret; } @@ -793,26 +1383,25 @@ int remap_vmalloc_range(struct vm_area_s struct vm_struct *area; unsigned long uaddr = vma->vm_start; unsigned long usize = vma->vm_end - vma->vm_start; - int ret; if ((PAGE_SIZE-1) & (unsigned long)addr) return -EINVAL; - read_lock(&vmlist_lock); - area = __find_vm_area(addr); + area = find_vm_area(addr); if (!area) - goto out_einval_locked; + return -EINVAL; if (!(area->flags & VM_USERMAP)) - goto out_einval_locked; + return -EINVAL; if (usize + (pgoff << PAGE_SHIFT) > area->size - PAGE_SIZE) - goto out_einval_locked; - read_unlock(&vmlist_lock); + return -EINVAL; addr += pgoff << PAGE_SHIFT; do { struct page *page = vmalloc_to_page(addr); + int ret; + ret = vm_insert_page(vma, uaddr, page); if (ret) return ret; @@ -825,11 +1414,7 @@ int remap_vmalloc_range(struct vm_area_s /* Prevent "things" like memory migration? VM_flags need a cleanup... */ vma->vm_flags |= VM_RESERVED; - return ret; - -out_einval_locked: - read_unlock(&vmlist_lock); - return -EINVAL; + return 0; } EXPORT_SYMBOL(remap_vmalloc_range); Index: linux-2.6/include/linux/vmalloc.h =================================================================== --- linux-2.6.orig/include/linux/vmalloc.h +++ linux-2.6/include/linux/vmalloc.h @@ -23,7 +23,6 @@ struct vm_area_struct; #endif struct vm_struct { - /* keep next,addr,size together to speedup lookups */ struct vm_struct *next; void *addr; unsigned long size; @@ -37,6 +36,11 @@ struct vm_struct { /* * Highlevel APIs for driver use */ +extern void vm_unmap_ram(const void *mem, unsigned int count); +extern void *vm_map_ram(struct page **pages, unsigned int count, + int node, pgprot_t prot); +extern void vm_unmap_aliases(void); + extern void *vmalloc(unsigned long size); extern void *vmalloc_user(unsigned long size); extern void *vmalloc_node(unsigned long size, int node); Index: linux-2.6/init/main.c =================================================================== --- linux-2.6.orig/init/main.c +++ linux-2.6/init/main.c @@ -89,6 +89,7 @@ extern void mca_init(void); extern void sbus_init(void); extern void prio_tree_init(void); extern void radix_tree_init(void); +extern void vmalloc_init(void); extern void free_initmem(void); #ifdef CONFIG_ACPI extern void acpi_early_init(void); @@ -642,6 +643,7 @@ asmlinkage void __init start_kernel(void initrd_start = 0; } #endif + vmalloc_init(); vfs_caches_init_early(); cpuset_init_early(); mem_init(); Index: linux-2.6/arch/x86/xen/enlighten.c =================================================================== --- linux-2.6.orig/arch/x86/xen/enlighten.c +++ linux-2.6/arch/x86/xen/enlighten.c @@ -853,6 +853,7 @@ static void xen_alloc_ptpage(struct mm_s /* make sure there are no stray mappings of this page */ kmap_flush_unused(); + vm_unmap_aliases(); } } Index: linux-2.6/arch/x86/xen/mmu.c =================================================================== --- linux-2.6.orig/arch/x86/xen/mmu.c +++ linux-2.6/arch/x86/xen/mmu.c @@ -723,6 +723,7 @@ void xen_pgd_pin(pgd_t *pgd) /* re-enable interrupts for kmap_flush_unused */ xen_mc_issue(0); kmap_flush_unused(); + vm_unmap_aliases(); xen_mc_batch(); } Index: linux-2.6/arch/x86/mm/pageattr.c =================================================================== --- linux-2.6.orig/arch/x86/mm/pageattr.c +++ linux-2.6/arch/x86/mm/pageattr.c @@ -777,6 +777,8 @@ static int change_page_attr_set_clr(unsi WARN_ON_ONCE(1); } + vm_unmap_aliases(); + cpa.vaddr = addr; cpa.numpages = numpages; cpa.mask_set = mask_set; From owner-xfs@oss.sgi.com Mon Jul 28 05:35:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 05:35:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SCZAwQ010611 for ; Mon, 28 Jul 2008 05:35:10 -0700 X-ASG-Debug-ID: 1217248582-124f01d70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id BC23B193F16D for ; Mon, 28 Jul 2008 05:36:22 -0700 (PDT) Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id A9nRuyMrIrCMnlup for ; Mon, 28 Jul 2008 05:36:22 -0700 (PDT) X-ASG-Whitelist: Client X-ASG-Whitelist: Barracuda Reputation Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 5D46D419D6; Mon, 28 Jul 2008 14:36:21 +0200 (CEST) Date: Mon, 28 Jul 2008 14:36:21 +0200 From: Nick Piggin To: Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List Cc: Andrew Morton , dri-devel@lists.sourceforge.net X-ASG-Orig-Subj: [rfc][patch 2/3] xfs: remove vmap cache Subject: [rfc][patch 2/3] xfs: remove vmap cache Message-ID: <20080728123621.GB13926@wotan.suse.de> References: <20080728123438.GA13926@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080728123438.GA13926@wotan.suse.de> User-Agent: Mutt/1.5.9i X-Barracuda-Connect: cantor.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1217248582 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17218 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: npiggin@suse.de Precedence: bulk X-list: xfs XFS's vmap batching simply defers a number (up to 64) of vunmaps, and keeps track of them in a list. To purge the batch, it just goes through the list and calls vunamp on each one. This is pretty poor: a global TLB flush is still performed on each vunmap, with the most expensive parts of the operation being the broadcast IPIs and locking involved in the SMP callouts, and the locking involved in the vmap management -- none of these are avoided by just batching up the calls. I'm actually surprised it ever made much difference at all. Rip all this logic out of XFS completely. I improve vmap performance and scalability directly in the previous and subsequent patch. Signed-off-by: Nick Piggin --- Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.c +++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.c @@ -166,75 +166,6 @@ test_page_region( } /* - * Mapping of multi-page buffers into contiguous virtual space - */ - -typedef struct a_list { - void *vm_addr; - struct a_list *next; -} a_list_t; - -static a_list_t *as_free_head; -static int as_list_len; -static DEFINE_SPINLOCK(as_lock); - -/* - * Try to batch vunmaps because they are costly. - */ -STATIC void -free_address( - void *addr) -{ - a_list_t *aentry; - -#ifdef CONFIG_XEN - /* - * Xen needs to be able to make sure it can get an exclusive - * RO mapping of pages it wants to turn into a pagetable. If - * a newly allocated page is also still being vmap()ed by xfs, - * it will cause pagetable construction to fail. This is a - * quick workaround to always eagerly unmap pages so that Xen - * is happy. - */ - vunmap(addr); - return; -#endif - - aentry = kmalloc(sizeof(a_list_t), GFP_NOWAIT); - if (likely(aentry)) { - spin_lock(&as_lock); - aentry->next = as_free_head; - aentry->vm_addr = addr; - as_free_head = aentry; - as_list_len++; - spin_unlock(&as_lock); - } else { - vunmap(addr); - } -} - -STATIC void -purge_addresses(void) -{ - a_list_t *aentry, *old; - - if (as_free_head == NULL) - return; - - spin_lock(&as_lock); - aentry = as_free_head; - as_free_head = NULL; - as_list_len = 0; - spin_unlock(&as_lock); - - while ((old = aentry) != NULL) { - vunmap(aentry->vm_addr); - aentry = aentry->next; - kfree(old); - } -} - -/* * Internal xfs_buf_t object manipulation */ @@ -334,7 +265,7 @@ xfs_buf_free( uint i; if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) - free_address(bp->b_addr - bp->b_offset); + vunmap(bp->b_addr - bp->b_offset); for (i = 0; i < bp->b_page_count; i++) { struct page *page = bp->b_pages[i]; @@ -456,8 +387,6 @@ _xfs_buf_map_pages( bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; bp->b_flags |= XBF_MAPPED; } else if (flags & XBF_MAPPED) { - if (as_list_len > 64) - purge_addresses(); bp->b_addr = vmap(bp->b_pages, bp->b_page_count, VM_MAP, PAGE_KERNEL); if (unlikely(bp->b_addr == NULL)) @@ -1739,8 +1668,6 @@ xfsbufd( count++; } - if (as_list_len > 0) - purge_addresses(); if (count) blk_run_address_space(target->bt_mapping); From owner-xfs@oss.sgi.com Mon Jul 28 05:35:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 05:35:56 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SCZqRN010814 for ; Mon, 28 Jul 2008 05:35:52 -0700 X-ASG-Debug-ID: 1217248624-5a0601d30000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from mx1.suse.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 710F2337319 for ; Mon, 28 Jul 2008 05:37:04 -0700 (PDT) Received: from mx1.suse.de (ns1.suse.de [195.135.220.2]) by cuda.sgi.com with ESMTP id DJfCjWkueOk409tm for ; Mon, 28 Jul 2008 05:37:04 -0700 (PDT) X-ASG-Whitelist: Client X-ASG-Whitelist: Barracuda Reputation Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.suse.de (Postfix) with ESMTP id 9AB29418E2; Mon, 28 Jul 2008 14:37:03 +0200 (CEST) Date: Mon, 28 Jul 2008 14:37:03 +0200 From: Nick Piggin To: Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List Cc: Andrew Morton , dri-devel@lists.sourceforge.net X-ASG-Orig-Subj: [rfc][patch 3/3] xfs: use new vmap API Subject: [rfc][patch 3/3] xfs: use new vmap API Message-ID: <20080728123703.GC13926@wotan.suse.de> References: <20080728123438.GA13926@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080728123438.GA13926@wotan.suse.de> User-Agent: Mutt/1.5.9i X-Barracuda-Connect: ns1.suse.de[195.135.220.2] X-Barracuda-Start-Time: 1217248625 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17219 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: npiggin@suse.de Precedence: bulk X-list: xfs Implement XFS's large buffer support with the new vmap APIs. See the vmap rewrite patch for some numbers. Signed-off-by: Nick Piggin --- Index: linux-2.6/fs/xfs/linux-2.6/xfs_buf.c =================================================================== --- linux-2.6.orig/fs/xfs/linux-2.6/xfs_buf.c +++ linux-2.6/fs/xfs/linux-2.6/xfs_buf.c @@ -265,7 +265,7 @@ xfs_buf_free( uint i; if ((bp->b_flags & XBF_MAPPED) && (bp->b_page_count > 1)) - vunmap(bp->b_addr - bp->b_offset); + vm_unmap_ram(bp->b_addr - bp->b_offset, bp->b_page_count); for (i = 0; i < bp->b_page_count; i++) { struct page *page = bp->b_pages[i]; @@ -387,8 +387,8 @@ _xfs_buf_map_pages( bp->b_addr = page_address(bp->b_pages[0]) + bp->b_offset; bp->b_flags |= XBF_MAPPED; } else if (flags & XBF_MAPPED) { - bp->b_addr = vmap(bp->b_pages, bp->b_page_count, - VM_MAP, PAGE_KERNEL); + bp->b_addr = vm_map_ram(bp->b_pages, bp->b_page_count, + -1, PAGE_KERNEL); if (unlikely(bp->b_addr == NULL)) return -ENOMEM; bp->b_addr += bp->b_offset; From owner-xfs@oss.sgi.com Mon Jul 28 08:38:48 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 08:39:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SFckQr025989 for ; Mon, 28 Jul 2008 08:38:48 -0700 X-ASG-Debug-ID: 1217259597-465703c40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 205BA1940123 for ; Mon, 28 Jul 2008 08:39:58 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id bLkBFEZR80cmra3v for ; Mon, 28 Jul 2008 08:39:58 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6SFdxIF029271 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Mon, 28 Jul 2008 17:39:59 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6SFdxSj029269; Mon, 28 Jul 2008 17:39:59 +0200 Date: Mon, 28 Jul 2008 17:39:59 +0200 From: Christoph Hellwig To: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 07/15] refactor xfs_btree_readahead Subject: Re: [PATCH 07/15] refactor xfs_btree_readahead Message-ID: <20080728153959.GA29132@lst.de> References: <20080723200859.GH7401@lst.de> <20080724233655.GH15438@disturbed> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080724233655.GH15438@disturbed> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217259599 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1108 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17220 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Fri, Jul 25, 2008 at 09:36:55AM +1000, Dave Chinner wrote: > I've been wondering if this is the best naming convention - > appending a single s or l to indicate short or long btree ops. > Perhaps this would be better as xfs_btree_readahead_short() and > xfs_btree_readahead_long(), esp. as we dropped the 'core' from > the caller to make it xfs_btree_readahead(). I've renamedthe helpers to xfs_btree_readahead_lblock / xfs_btree_readahead_slblock to match the naming for the other short / long block helpers. From owner-xfs@oss.sgi.com Mon Jul 28 14:38:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 14:38:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SLc2Bb018926 for ; Mon, 28 Jul 2008 14:38:03 -0700 X-ASG-Debug-ID: 1217281152-455301f70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fg-out-1718.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 13E6D1906D2D for ; Mon, 28 Jul 2008 14:39:13 -0700 (PDT) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by cuda.sgi.com with ESMTP id L9eKxr5kg40DuTd5 for ; Mon, 28 Jul 2008 14:39:13 -0700 (PDT) Received: by fg-out-1718.google.com with SMTP id l26so2316726fgb.8 for ; Mon, 28 Jul 2008 14:39:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=YX3rgNhI604uajYHmSb1832wm0qRyAYUVyJdHF7AFUw=; b=tF4CMjmbrIOu/iqmjS6KH3iK+811Ux6W5xr6FRxw/xKJUzW5HcyxM5KwJbcQLXXsM0 blIWTz7I8oeLLYFQlZGHFZ9xKJ3Smctr/HiN+mnthXPjs7/7Y9WU6adKgb3Cvn/QrPjB HLkyh4tLJ28Qso9Gd2dsXfEpUia2J9vq5/em8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=futAOJ18Lt9P2XzQIOXuSrM5RaoAuE00Dg4vgbfDBnOJV14OZtPAYJA4eFrwoQM0DA qV6dQRtAeprkRavA73GEwH3YwWnpz4rDqV3FN0IPBOFemC+55adu4Ut88guR0UfDC7u2 TIXsemCrKSKgeIXXrk4BNnyBwcZNXsLtPVuU0= Received: by 10.86.71.1 with SMTP id t1mr3001267fga.36.1217281152413; Mon, 28 Jul 2008 14:39:12 -0700 (PDT) Received: from ?192.168.1.9? ( [217.162.230.206]) by mx.google.com with ESMTPS id e11sm14279000fga.4.2008.07.28.14.39.10 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Jul 2008 14:39:11 -0700 (PDT) X-ASG-Orig-Subj: [PING] do not test return value of xfs_bmap_*_count_leaves Subject: [PING] do not test return value of xfs_bmap_*_count_leaves From: Ruben Porras To: xfs@oss.sgi.com Content-Type: text/plain Date: Mon, 28 Jul 2008 23:39:09 +0200 Message-Id: <1217281149.5345.39.camel@marzo> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: fg-out-1718.google.com[72.14.220.156] X-Barracuda-Start-Time: 1217281155 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0459 1.0000 -1.7257 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.73 X-Barracuda-Spam-Status: No, SCORE=-1.73 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1134 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17221 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nahoo82@gmail.com Precedence: bulk X-list: xfs http://oss.sgi.com/archives/xfs/2008-04/msg00087.html From owner-xfs@oss.sgi.com Mon Jul 28 14:39:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 14:39:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SLdixH019178 for ; Mon, 28 Jul 2008 14:39:44 -0700 X-ASG-Debug-ID: 1217281256-31e6012d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from fg-out-1718.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5A3E5EC246B for ; Mon, 28 Jul 2008 14:40:56 -0700 (PDT) Received: from fg-out-1718.google.com (fg-out-1718.google.com [72.14.220.156]) by cuda.sgi.com with ESMTP id dFIfZTgNCXRou5V2 for ; Mon, 28 Jul 2008 14:40:56 -0700 (PDT) Received: by fg-out-1718.google.com with SMTP id l26so2317136fgb.8 for ; Mon, 28 Jul 2008 14:40:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:subject:from:to:content-type :date:message-id:mime-version:x-mailer:content-transfer-encoding; bh=z2XPoGMYVN5aEltgLoJA4p83MixXb3Ep5YmCb8FomoY=; b=t6WF3xKbIieFPUofwLXaxgRasGQwtTzLcVfDrKwp+bxPjVdVSiVV4U03y7kZniGNgp fADHtmsXQgkmIQs4BBLOMckvd14BaXWyz9/UNLm88MXegF7yWlU7hlhLn145If1/G13A CXETIFACmkz0MZNlu9Ahz9f9ku6rPVqvYSFvM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:from:to:content-type:date:message-id:mime-version:x-mailer :content-transfer-encoding; b=YtE9cxJxB29+6LyV332/XMHEMvHMzUp7NqrOnFxQoqjxs13v44LYIK81oZkIcfoiFy dbIwL6Nqbjt+Y+zG4Kx9pv7BJ3cgHVu7d219ukji/1ZcuafvQgllut998xNOFUK2pZBV +ztbVrr9EpYQHq+8x9tTY4vVQ8LXCLD0A41LQ= Received: by 10.86.52.6 with SMTP id z6mr3010352fgz.18.1217281255478; Mon, 28 Jul 2008 14:40:55 -0700 (PDT) Received: from ?192.168.1.9? ( [217.162.230.206]) by mx.google.com with ESMTPS id 12sm11736335fgg.0.2008.07.28.14.40.53 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 28 Jul 2008 14:40:54 -0700 (PDT) X-ASG-Orig-Subj: [PING] fix comments related to xfs_write_file Subject: [PING] fix comments related to xfs_write_file From: Ruben Porras To: xfs@oss.sgi.com Content-Type: text/plain Date: Mon, 28 Jul 2008 23:40:52 +0200 Message-Id: <1217281252.5345.41.camel@marzo> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: fg-out-1718.google.com[72.14.220.156] X-Barracuda-Start-Time: 1217281257 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0341 1.0000 -1.8006 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.80 X-Barracuda-Spam-Status: No, SCORE=-1.80 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1134 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17222 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: nahoo82@gmail.com Precedence: bulk X-list: xfs http://oss.sgi.com/archives/xfs/2008-04/msg00088.html sorry, I do not have the original mails on my MUA. cu. From owner-xfs@oss.sgi.com Mon Jul 28 15:56:02 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 15:56:04 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SMu0Kf023485 for ; Mon, 28 Jul 2008 15:56:02 -0700 X-ASG-Debug-ID: 1217285826-4b2c01f50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id E6DB233A246 for ; Mon, 28 Jul 2008 15:57:10 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id JDwzLHBYDGnzPJEw for ; Mon, 28 Jul 2008 15:57:10 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6SMv8IF019195 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 00:57:08 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6SMv810019192 for xfs@oss.sgi.com; Tue, 29 Jul 2008 00:57:08 +0200 Date: Tue, 29 Jul 2008 00:57:08 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH] sanitize xfs_initialize_vnode Subject: Re: [PATCH] sanitize xfs_initialize_vnode Message-ID: <20080728225708.GA19096@lst.de> References: <20080502105215.GA17870@lst.de> <20080723195110.GA6645@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080723195110.GA6645@lst.de> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217285832 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1140 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17223 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Wed, Jul 23, 2008 at 09:51:10PM +0200, Christoph Hellwig wrote: > On Fri, May 02, 2008 at 12:52:15PM +0200, Christoph Hellwig wrote: > > Sanitize setting up the Linux indode. > > > > Setting up the xfs_inode <-> inode link is opencoded in xfs_iget_core > > now because that's the only place it needs to be done, > > xfs_initialize_vnode is renamed to xfs_setup_inode and loses all > > superflous paramaters. The check for I_NEW is removed because it always > > is true and the di_mode check moves into xfs_iget_core because it's only > > needed there. > > > > xfs_set_inodeops and xfs_revalidate_inode are merged into > > xfs_setup_inode and the whole things is moved into xfs_iops.c where it > > belongs. > > Rediffed to apply ontop of Dave's and my vnode helper cleanups: And another rediff after the vnode removal which was supposed to apply after this patch. Any chance to get in before it gets three month old? Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c 2008-07-29 00:48:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c 2008-07-29 00:51:19.000000000 +0200 @@ -718,7 +718,7 @@ out_error: return error; } -const struct inode_operations xfs_inode_operations = { +static const struct inode_operations xfs_inode_operations = { .permission = xfs_vn_permission, .truncate = xfs_vn_truncate, .getattr = xfs_vn_getattr, @@ -730,7 +730,7 @@ const struct inode_operations xfs_inode_ .fallocate = xfs_vn_fallocate, }; -const struct inode_operations xfs_dir_inode_operations = { +static const struct inode_operations xfs_dir_inode_operations = { .create = xfs_vn_create, .lookup = xfs_vn_lookup, .link = xfs_vn_link, @@ -755,7 +755,7 @@ const struct inode_operations xfs_dir_in .listxattr = xfs_vn_listxattr, }; -const struct inode_operations xfs_dir_ci_inode_operations = { +static const struct inode_operations xfs_dir_ci_inode_operations = { .create = xfs_vn_create, .lookup = xfs_vn_ci_lookup, .link = xfs_vn_link, @@ -780,7 +780,7 @@ const struct inode_operations xfs_dir_ci .listxattr = xfs_vn_listxattr, }; -const struct inode_operations xfs_symlink_inode_operations = { +static const struct inode_operations xfs_symlink_inode_operations = { .readlink = generic_readlink, .follow_link = xfs_vn_follow_link, .put_link = xfs_vn_put_link, @@ -792,3 +792,98 @@ const struct inode_operations xfs_symlin .removexattr = generic_removexattr, .listxattr = xfs_vn_listxattr, }; + +STATIC void +xfs_diflags_to_iflags( + struct inode *inode, + struct xfs_inode *ip) +{ + if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) + inode->i_flags |= S_IMMUTABLE; + else + inode->i_flags &= ~S_IMMUTABLE; + if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) + inode->i_flags |= S_APPEND; + else + inode->i_flags &= ~S_APPEND; + if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) + inode->i_flags |= S_SYNC; + else + inode->i_flags &= ~S_SYNC; + if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) + inode->i_flags |= S_NOATIME; + else + inode->i_flags &= ~S_NOATIME; +} + +/* + * Initialize the Linux inode, set up the operation vectors and + * unlock the inode. + * + * When reading existing inodes from disk this is called directly + * from xfs_iget, when creating a new inode it is called from + * xfs_ialloc after setting up the inode. + */ +void +xfs_setup_inode( + struct xfs_inode *ip) +{ + struct inode *inode = ip->i_vnode; + + inode->i_mode = ip->i_d.di_mode; + inode->i_nlink = ip->i_d.di_nlink; + inode->i_uid = ip->i_d.di_uid; + inode->i_gid = ip->i_d.di_gid; + + switch (inode->i_mode & S_IFMT) { + case S_IFBLK: + case S_IFCHR: + inode->i_rdev = + MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, + sysv_minor(ip->i_df.if_u2.if_rdev)); + break; + default: + inode->i_rdev = 0; + break; + } + + inode->i_generation = ip->i_d.di_gen; + i_size_write(inode, ip->i_d.di_size); + inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; + inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; + inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; + inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; + inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; + inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; + xfs_diflags_to_iflags(inode, ip); + xfs_iflags_clear(ip, XFS_IMODIFIED); + + switch (inode->i_mode & S_IFMT) { + case S_IFREG: + inode->i_op = &xfs_inode_operations; + inode->i_fop = &xfs_file_operations; + inode->i_mapping->a_ops = &xfs_address_space_operations; + break; + case S_IFDIR: + if (xfs_sb_version_hasasciici(&XFS_M(inode->i_sb)->m_sb)) + inode->i_op = &xfs_dir_ci_inode_operations; + else + inode->i_op = &xfs_dir_inode_operations; + inode->i_fop = &xfs_dir_file_operations; + break; + case S_IFLNK: + inode->i_op = &xfs_symlink_inode_operations; + if (!(ip->i_df.if_flags & XFS_IFINLINE)) + inode->i_mapping->a_ops = &xfs_address_space_operations; + break; + default: + inode->i_op = &xfs_inode_operations; + init_special_inode(inode, inode->i_mode, inode->i_rdev); + break; + } + + xfs_iflags_clear(ip, XFS_INEW); + barrier(); + + unlock_new_inode(inode); +} Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h 2008-07-29 00:48:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h 2008-07-29 00:51:19.000000000 +0200 @@ -18,10 +18,7 @@ #ifndef __XFS_IOPS_H__ #define __XFS_IOPS_H__ -extern const struct inode_operations xfs_inode_operations; -extern const struct inode_operations xfs_dir_inode_operations; -extern const struct inode_operations xfs_dir_ci_inode_operations; -extern const struct inode_operations xfs_symlink_inode_operations; +struct xfs_inode; extern const struct file_operations xfs_file_operations; extern const struct file_operations xfs_dir_file_operations; @@ -29,8 +26,9 @@ extern const struct file_operations xfs_ extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size); -struct xfs_inode; extern void xfs_ichgtime(struct xfs_inode *, int); extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int); +extern void xfs_setup_inode(struct xfs_inode *); + #endif /* __XFS_IOPS_H__ */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-29 00:48:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-29 00:51:19.000000000 +0200 @@ -155,12 +155,9 @@ EXPORT_SYMBOL(kmem_zone_free); EXPORT_SYMBOL(kmem_zone_init); EXPORT_SYMBOL(kmem_zone_zalloc); EXPORT_SYMBOL(xfs_address_space_operations); -EXPORT_SYMBOL(xfs_dir_inode_operations); EXPORT_SYMBOL(xfs_dir_file_operations); -EXPORT_SYMBOL(xfs_inode_operations); EXPORT_SYMBOL(xfs_file_operations); EXPORT_SYMBOL(xfs_invis_file_operations); -EXPORT_SYMBOL(xfs_symlink_inode_operations); EXPORT_SYMBOL(xfs_buf_delwri_dequeue); EXPORT_SYMBOL(_xfs_buf_find); EXPORT_SYMBOL(xfs_buf_iostart); Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.h 2008-07-29 00:50:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.h 2008-07-29 00:51:35.000000000 +0200 @@ -72,9 +72,6 @@ struct block_device; extern __uint64_t xfs_max_file_offset(unsigned int); -extern void xfs_initialize_vnode(struct xfs_mount *mp, struct inode *vp, - struct xfs_inode *ip); - extern void xfs_flush_inode(struct xfs_inode *); extern void xfs_flush_device(struct xfs_inode *); Index: linux-2.6-xfs/fs/xfs/xfs_iget.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iget.c 2008-07-29 00:48:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_iget.c 2008-07-29 00:51:19.000000000 +0200 @@ -288,10 +288,17 @@ finish_inode: *ipp = ip; /* + * Set up the Linux with the Linux inode. + */ + ip->i_vnode = inode; + inode->i_private = ip; + + /* * If we have a real type for an on-disk inode, we can set ops(&unlock) * now. If it's a new inode being created, xfs_ialloc will handle it. */ - xfs_initialize_vnode(mp, inode, ip); + if (ip->i_d.di_mode != 0) + xfs_setup_inode(ip); return 0; } Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-29 00:50:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-29 00:54:42.000000000 +0200 @@ -1046,7 +1046,6 @@ xfs_ialloc( { xfs_ino_t ino; xfs_inode_t *ip; - struct inode *vp; uint flags; int error; @@ -1077,7 +1076,6 @@ xfs_ialloc( } ASSERT(ip != NULL); - vp = VFS_I(ip); ip->i_d.di_mode = (__uint16_t)mode; ip->i_d.di_onlink = 0; ip->i_d.di_nlink = nlink; @@ -1220,7 +1218,7 @@ xfs_ialloc( xfs_trans_log_inode(tp, ip, flags); /* now that we have an i_mode we can setup inode ops and unlock */ - xfs_initialize_vnode(tp->t_mountp, vp, ip); + xfs_setup_inode(ip); *ipp = ip; return 0; Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-29 00:50:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-29 00:51:19.000000000 +0200 @@ -581,116 +581,6 @@ xfs_max_file_offset( return (((__uint64_t)pagefactor) << bitshift) - 1; } -STATIC_INLINE void -xfs_set_inodeops( - struct inode *inode) -{ - switch (inode->i_mode & S_IFMT) { - case S_IFREG: - inode->i_op = &xfs_inode_operations; - inode->i_fop = &xfs_file_operations; - inode->i_mapping->a_ops = &xfs_address_space_operations; - break; - case S_IFDIR: - if (xfs_sb_version_hasasciici(&XFS_M(inode->i_sb)->m_sb)) - inode->i_op = &xfs_dir_ci_inode_operations; - else - inode->i_op = &xfs_dir_inode_operations; - inode->i_fop = &xfs_dir_file_operations; - break; - case S_IFLNK: - inode->i_op = &xfs_symlink_inode_operations; - if (!(XFS_I(inode)->i_df.if_flags & XFS_IFINLINE)) - inode->i_mapping->a_ops = &xfs_address_space_operations; - break; - default: - inode->i_op = &xfs_inode_operations; - init_special_inode(inode, inode->i_mode, inode->i_rdev); - break; - } -} - -STATIC_INLINE void -xfs_revalidate_inode( - xfs_mount_t *mp, - struct inode *inode, - xfs_inode_t *ip) -{ - - inode->i_mode = ip->i_d.di_mode; - inode->i_nlink = ip->i_d.di_nlink; - inode->i_uid = ip->i_d.di_uid; - inode->i_gid = ip->i_d.di_gid; - - switch (inode->i_mode & S_IFMT) { - case S_IFBLK: - case S_IFCHR: - inode->i_rdev = - MKDEV(sysv_major(ip->i_df.if_u2.if_rdev) & 0x1ff, - sysv_minor(ip->i_df.if_u2.if_rdev)); - break; - default: - inode->i_rdev = 0; - break; - } - - inode->i_generation = ip->i_d.di_gen; - i_size_write(inode, ip->i_d.di_size); - inode->i_atime.tv_sec = ip->i_d.di_atime.t_sec; - inode->i_atime.tv_nsec = ip->i_d.di_atime.t_nsec; - inode->i_mtime.tv_sec = ip->i_d.di_mtime.t_sec; - inode->i_mtime.tv_nsec = ip->i_d.di_mtime.t_nsec; - inode->i_ctime.tv_sec = ip->i_d.di_ctime.t_sec; - inode->i_ctime.tv_nsec = ip->i_d.di_ctime.t_nsec; - if (ip->i_d.di_flags & XFS_DIFLAG_IMMUTABLE) - inode->i_flags |= S_IMMUTABLE; - else - inode->i_flags &= ~S_IMMUTABLE; - if (ip->i_d.di_flags & XFS_DIFLAG_APPEND) - inode->i_flags |= S_APPEND; - else - inode->i_flags &= ~S_APPEND; - if (ip->i_d.di_flags & XFS_DIFLAG_SYNC) - inode->i_flags |= S_SYNC; - else - inode->i_flags &= ~S_SYNC; - if (ip->i_d.di_flags & XFS_DIFLAG_NOATIME) - inode->i_flags |= S_NOATIME; - else - inode->i_flags &= ~S_NOATIME; - xfs_iflags_clear(ip, XFS_IMODIFIED); -} - -void -xfs_initialize_vnode( - struct xfs_mount *mp, - struct inode *inode, - struct xfs_inode *ip) -{ - - if (!ip->i_vnode) { - ip->i_vnode = inode; - inode->i_private = ip; - } - - /* - * We need to set the ops vectors, and unlock the inode, but if - * we have been called during the new inode create process, it is - * too early to fill in the Linux inode. We will get called a - * second time once the inode is properly set up, and then we can - * finish our work. - */ - if (ip->i_d.di_mode != 0 && (inode->i_state & I_NEW)) { - xfs_revalidate_inode(mp, inode, ip); - xfs_set_inodeops(inode); - - xfs_iflags_clear(ip, XFS_INEW); - barrier(); - - unlock_new_inode(inode); - } -} - int xfs_blkdev_get( xfs_mount_t *mp, From owner-xfs@oss.sgi.com Mon Jul 28 16:32:57 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 16:33:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,J_CHICKENPOX_23 autolearn=no version=3.3.0-r574664 Received: from relay.sgi.com (relay1.corp.sgi.com [192.26.58.214]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6SNWvdu030670 for ; Mon, 28 Jul 2008 16:32:57 -0700 Received: from estes.americas.sgi.com (estes.americas.sgi.com [128.162.236.10]) by relay1.corp.sgi.com (Postfix) with ESMTP id 8FA268F8094 for ; Mon, 28 Jul 2008 16:34:07 -0700 (PDT) Received: from lnx-holt.americas.sgi.com (lnx-holt.americas.sgi.com [128.162.233.109]) by estes.americas.sgi.com (Postfix) with ESMTP id 4026570001C8; Mon, 28 Jul 2008 18:34:07 -0500 (CDT) Received: from holt by lnx-holt.americas.sgi.com with local (Exim 4.69) (envelope-from ) id 1KNcEB-0006IV-5n; Mon, 28 Jul 2008 18:34:07 -0500 Date: Mon, 28 Jul 2008 18:34:07 -0500 From: Robin Holt To: Nick Piggin Cc: Linux Memory Management List , xfs@oss.sgi.com, xen-devel@lists.xensource.com, Linux Kernel Mailing List , Andrew Morton , dri-devel@lists.sourceforge.net Subject: Re: [rfc][patch 1/3] mm: vmap rewrite Message-ID: <20080728233407.GB10501@sgi.com> References: <20080728123438.GA13926@wotan.suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080728123438.GA13926@wotan.suse.de> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17224 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: holt@sgi.com Precedence: bulk X-list: xfs > After: > 78406 total 0.0081 > 40053 default_idle 89.4040 > 33576 ia64_spinlock_contention 349.7500 > 1650 _spin_lock 17.1875 Here is a patch that will unroll those two sample and let you see which function is hitting the contention. This has been submitted and rejected at least once a few years ago. I keep and old copy around because it is often very handy. I have not tested it in a couple years (usually working on performance with a SLES kernel). It applied with a couple minor fixups so I assume it works. If not, please let me know. Index: ia64_spinlock_contention/arch/ia64/kernel/head.S =================================================================== --- ia64_spinlock_contention.orig/arch/ia64/kernel/head.S 2008-07-28 17:35:21.000000000 -0500 +++ ia64_spinlock_contention/arch/ia64/kernel/head.S 2008-07-28 17:35:51.000000000 -0500 @@ -1137,6 +1137,8 @@ GLOBAL_ENTRY(ia64_spinlock_contention_pr tbit.nz p15,p0=r27,IA64_PSR_I_BIT .restore sp // pop existing prologue after next insn mov b6 = r28 + .global ia64_spinlock_contention_pre3_4_beg // for kernprof +ia64_spinlock_contention_pre3_4_beg: .prologue .save ar.pfs, r0 .altrp b6 @@ -1185,6 +1187,8 @@ GLOBAL_ENTRY(ia64_spinlock_contention) (p14) br.cond.sptk.few .wait br.ret.sptk.many b6 // lock is now taken + .global ia64_spinlock_contention_end // for determining if we are in ia64_spinlock_contention code. +ia64_spinlock_contention_end: END(ia64_spinlock_contention) #endif Index: ia64_spinlock_contention/arch/ia64/kernel/ia64_ksyms.c =================================================================== --- ia64_spinlock_contention.orig/arch/ia64/kernel/ia64_ksyms.c 2008-07-28 17:35:21.000000000 -0500 +++ ia64_spinlock_contention/arch/ia64/kernel/ia64_ksyms.c 2008-07-28 17:35:51.000000000 -0500 @@ -95,6 +95,10 @@ EXPORT_SYMBOL(unw_init_running); */ extern char ia64_spinlock_contention_pre3_4; EXPORT_SYMBOL(ia64_spinlock_contention_pre3_4); +extern char ia64_spinlock_contention_pre3_4_beg; +EXPORT_SYMBOL(ia64_spinlock_contention_pre3_4_beg); +extern char ia64_spinlock_contention_pre3_4_end; +EXPORT_SYMBOL(ia64_spinlock_contention_pre3_4_end); # else /* * This is not a normal routine and we don't want a function descriptor for it, so we use @@ -102,6 +106,8 @@ EXPORT_SYMBOL(ia64_spinlock_contention_p */ extern char ia64_spinlock_contention; EXPORT_SYMBOL(ia64_spinlock_contention); +extern char ia64_spinlock_contention_end; +EXPORT_SYMBOL(ia64_spinlock_contention_end); # endif # endif #endif Index: ia64_spinlock_contention/arch/ia64/kernel/perfmon_default_smpl.c =================================================================== --- ia64_spinlock_contention.orig/arch/ia64/kernel/perfmon_default_smpl.c 2008-07-28 17:35:21.000000000 -0500 +++ ia64_spinlock_contention/arch/ia64/kernel/perfmon_default_smpl.c 2008-07-28 18:18:56.000000000 -0500 @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -98,6 +99,16 @@ default_init(struct task_struct *task, v return 0; } +#ifdef CONFIG_SMP +#if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3) +extern char ia64_spinlock_contention_pre3_4_beg[], ia64_spinlock_contention_pre3_4_end[]; +#define ia64_spinlock_contention ia64_spinlock_contention_pre3_4_beg +#define ia64_spinlock_contention_end ia64_spinlock_contention_pre3_4_end +#else +extern char ia64_spinlock_contention[], ia64_spinlock_contention_end[]; +#endif +#endif + static int default_handler(struct task_struct *task, void *buf, pfm_ovfl_arg_t *arg, struct pt_regs *regs, unsigned long stamp) { @@ -164,6 +175,14 @@ default_handler(struct task_struct *task * where did the fault happen (includes slot number) */ ent->ip = regs->cr_iip | ((regs->cr_ipsr >> 41) & 0x3); +#ifdef CONFIG_SMP + /* Fix up the ip for code in the spinlock contention path. */ + if ((ent->ip >= (unsigned long)ia64_spinlock_contention) && + (ent->ip < (unsigned long)ia64_spinlock_contention_end)) + ent->ip = regs->b6; +#endif + if (in_lock_functions(ent->ip)) + ent->ip = regs->r28; ent->tstamp = stamp; ent->cpu = smp_processor_id(); From owner-xfs@oss.sgi.com Mon Jul 28 18:01:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 18:01:44 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T11aqW003376 for ; Mon, 28 Jul 2008 18:01:39 -0700 Received: from itchy.melbourne.sgi.com (itchy.melbourne.sgi.com [134.14.55.96]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA10214; Tue, 29 Jul 2008 11:02:45 +1000 From: Niv Sardi To: Christoph Hellwig Cc: xfs@oss.sgi.com Subject: Re: [PATCH] sanitize xfs_initialize_vnode References: <20080502105215.GA17870@lst.de> <20080723195110.GA6645@lst.de> <20080728225708.GA19096@lst.de> Date: Tue, 29 Jul 2008 11:02:42 +1000 In-Reply-To: <20080728225708.GA19096@lst.de> (Christoph Hellwig's message of "Tue, 29 Jul 2008 00:57:08 +0200") Message-ID: User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17225 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs I thought I got this one in already, apparently not, going in now. Cheers, -- Niv Sardi From owner-xfs@oss.sgi.com Mon Jul 28 18:04:28 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 18:04:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_35 autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T14RqT003702 for ; Mon, 28 Jul 2008 18:04:27 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA10274; Tue, 29 Jul 2008 11:05:37 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 16403) id 6142C58C4C3F; Tue, 29 Jul 2008 11:05:37 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: TAKE 981498 - sanitize xfs_initialize_vnode Message-Id: <20080729010537.6142C58C4C3F@chook.melbourne.sgi.com> Date: Tue, 29 Jul 2008 11:05:37 +1000 (EST) From: xaiki@sgi.com (Niv Sardi-Altivanik) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17226 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xaiki@sgi.com Precedence: bulk X-list: xfs sanitize xfs_initialize_vnode Sanitize setting up the Linux indode. Setting up the xfs_inode <-> inode link is opencoded in xfs_iget_core now because that's the only place it needs to be done, xfs_initialize_vnode is renamed to xfs_setup_inode and loses all superflous paramaters. The check for I_NEW is removed because it always is true and the di_mode check moves into xfs_iget_core because it's only needed there. xfs_set_inodeops and xfs_revalidate_inode are merged into xfs_setup_inode and the whole things is moved into xfs_iops.c where it belongs. Signed-off-by: Christoph Hellwig Date: Tue Jul 29 11:03:57 AEST 2008 Workarea: itchy.melbourne.sgi.com:/i386/home/xaiki/Wrk/ptools/xfs-2.6 Inspected by: hch,xaiki The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31782a fs/xfs/xfs_iget.c - 1.243 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_iget.c.diff?r1=text&tr1=1.243&r2=text&tr2=1.242&f=h fs/xfs/xfs_inode.c - 1.514 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_inode.c.diff?r1=text&tr1=1.514&r2=text&tr2=1.513&f=h fs/xfs/linux-2.6/xfs_super.h - 1.81 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.h.diff?r1=text&tr1=1.81&r2=text&tr2=1.80&f=h fs/xfs/linux-2.6/xfs_super.c - 1.443 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_super.c.diff?r1=text&tr1=1.443&r2=text&tr2=1.442&f=h fs/xfs/linux-2.6/xfs_iops.c - 1.296 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.c.diff?r1=text&tr1=1.296&r2=text&tr2=1.295&f=h fs/xfs/linux-2.6/xfs_iops.h - 1.36 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_iops.h.diff?r1=text&tr1=1.36&r2=text&tr2=1.35&f=h fs/xfs/linux-2.6/xfs_ksyms.c - 1.88 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/linux-2.6/xfs_ksyms.c.diff?r1=text&tr1=1.88&r2=text&tr2=1.87&f=h From owner-xfs@oss.sgi.com Mon Jul 28 18:25:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 18:25:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T1Pg9X005327 for ; Mon, 28 Jul 2008 18:25:42 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA10699; Tue, 29 Jul 2008 11:26:50 +1000 Message-ID: <488E7334.90205@sgi.com> Date: Tue, 29 Jul 2008 11:32:36 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Christoph Hellwig CC: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: Re: TAKE 981498 - kill bhv_vnode_t References: <20080728062625.BB57158C4C3F@chook.melbourne.sgi.com> <20080728121534.GA12715@infradead.org> In-Reply-To: <20080728121534.GA12715@infradead.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17227 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Mon, Jul 28, 2008 at 04:26:25PM +1000, Lachlan McIlroy wrote: >> kill bhv_vnode_t >> >> All remaining bhv_vnode_t instance are in code that's more or less Linux >> specific. (Well, for xfs_acl.c that could be argued, but that code is >> on the removal list, too). So just do an s/bhv_vnode_t/struct inode/ >> over the whole tree. We can clean up variable naming and some useless >> helpers later. > > Thanks, but I wonder how this could even apply without the > intialize_vnode cleanup.. It applied fine. Didn't build though - I had to change a couple more bhv_vnode_t's. From owner-xfs@oss.sgi.com Mon Jul 28 18:28:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 18:28:12 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T1S22x005745 for ; Mon, 28 Jul 2008 18:28:04 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id LAA10766 for ; Tue, 29 Jul 2008 11:29:14 +1000 Date: Tue, 29 Jul 2008 11:29:36 +1000 To: "xfs@oss.sgi.com" Subject: [REVIEW] Cleanup more dir v1 macros and stuff From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.50 (Win32) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17228 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs Well, it seems I found a few remnants (cookie crumbs) of dirv1 stuff in the kernel! This patch removes those remnants! --- fs/xfs/xfs_da_btree.h | 20 -------------------- fs/xfs/xfs_mount.h | 1 - fs/xfs/xfsidbg.c | 5 ++--- 3 files changed, 2 insertions(+), 24 deletions(-) Index: 2.6.x-xfs/fs/xfs/xfs_da_btree.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_da_btree.h +++ 2.6.x-xfs/fs/xfs/xfs_da_btree.h @@ -72,27 +72,7 @@ typedef struct xfs_da_intnode { typedef struct xfs_da_node_hdr xfs_da_node_hdr_t; typedef struct xfs_da_node_entry xfs_da_node_entry_t; -#define XFS_DA_MAXHASH ((xfs_dahash_t)-1) /* largest valid hash value */ - #define XFS_LBSIZE(mp) (mp)->m_sb.sb_blocksize -#define XFS_LBLOG(mp) (mp)->m_sb.sb_blocklog - -#define XFS_DA_MAKE_BNOENTRY(mp,bno,entry) \ - (((bno) << (mp)->m_dircook_elog) | (entry)) -#define XFS_DA_MAKE_COOKIE(mp,bno,entry,hash) \ - (((xfs_off_t)XFS_DA_MAKE_BNOENTRY(mp, bno, entry) << 32) | (hash)) -#define XFS_DA_COOKIE_HASH(mp,cookie) ((xfs_dahash_t)cookie) -#define XFS_DA_COOKIE_BNO(mp,cookie) \ - ((((xfs_off_t)(cookie) >> 31) == -1LL ? \ - (xfs_dablk_t)0 : \ - (xfs_dablk_t)((xfs_off_t)(cookie) >> \ - ((mp)->m_dircook_elog + 32)))) -#define XFS_DA_COOKIE_ENTRY(mp,cookie) \ - ((((xfs_off_t)(cookie) >> 31) == -1LL ? \ - (xfs_dablk_t)0 : \ - (xfs_dablk_t)(((xfs_off_t)(cookie) >> 32) & \ - ((1 << (mp)->m_dircook_elog) - 1)))) - /*======================================================================== * Btree searching and modification structure definitions. Index: 2.6.x-xfs/fs/xfs/xfs_mount.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_mount.h +++ 2.6.x-xfs/fs/xfs/xfs_mount.h @@ -267,7 +267,6 @@ typedef struct xfs_mount { xfs_buftarg_t *m_ddev_targp; /* saves taking the address */ xfs_buftarg_t *m_logdev_targp;/* ptr to log device */ xfs_buftarg_t *m_rtdev_targp; /* ptr to rt device */ - __uint8_t m_dircook_elog; /* log d-cookie entry bits */ __uint8_t m_blkbit_log; /* blocklog + NBBY */ __uint8_t m_blkbb_log; /* blocklog - BBSHIFT */ __uint8_t m_agno_log; /* log #ag's */ Index: 2.6.x-xfs/fs/xfs/xfsidbg.c =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfsidbg.c +++ 2.6.x-xfs/fs/xfs/xfsidbg.c @@ -6330,9 +6330,8 @@ xfsidbg_xmount(xfs_mount_t *mp) kdb_printf("rsumlevels 0x%x rsumsize 0x%x rbmip 0x%p rsumip 0x%p\n", mp->m_rsumlevels, mp->m_rsumsize, mp->m_rbmip, mp->m_rsumip); kdb_printf("rootip 0x%p\n", mp->m_rootip); - kdb_printf("dircook_elog %d blkbit_log %d blkbb_log %d agno_log %d\n", - mp->m_dircook_elog, mp->m_blkbit_log, mp->m_blkbb_log, - mp->m_agno_log); + kdb_printf("blkbit_log %d blkbb_log %d agno_log %d\n", + mp->m_blkbit_log, mp->m_blkbb_log, mp->m_agno_log); kdb_printf("agino_log %d inode cluster size %d\n", mp->m_agino_log, mp->m_inode_cluster_size); kdb_printf("blockmask 0x%x blockwsize 0x%x blockwmask 0x%x\n", From owner-xfs@oss.sgi.com Mon Jul 28 19:04:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 19:04:05 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: *** X-Spam-Status: No, score=3.2 required=5.0 tests=AWL,BAYES_50,RCVD_IN_PSBL autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6T242UD007249 for ; Mon, 28 Jul 2008 19:04:03 -0700 X-ASG-Debug-ID: 1217297113-180d00a70000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp.sina.com.cn (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CC35D33AF84 for ; Mon, 28 Jul 2008 19:05:14 -0700 (PDT) Received: from smtp.sina.com.cn (smtp.sina.com.cn [202.108.3.233]) by cuda.sgi.com with ESMTP id j0MiatNL55nY8ea2 for ; Mon, 28 Jul 2008 19:05:14 -0700 (PDT) Received: from xgw (unknown [211.162.201.124]) by smtp.sina.com.cn (SINAMAIL) with ESMTP id 0BECB5F9914 for ; Tue, 29 Jul 2008 10:05:11 +0800 (CST) Message-ID: <010901c8f11f$9a9a68f0$3400a8c0@xgw> From: "Robert" To: X-ASG-Orig-Subj: linux xfs filesystem corruption Subject: linux xfs filesystem corruption Date: Tue, 29 Jul 2008 10:05:30 +0800 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-Barracuda-Connect: smtp.sina.com.cn[202.108.3.233] X-Barracuda-Start-Time: 1217297114 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1152 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17229 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xiaguowu2004@sina.com Precedence: bulk X-list: xfs Dear all, I have encoutered linux xfs filesystem corruption, I search this topic on the web, but I can't find any useful information to fix my problem. I build a raid5 with 'mdadm' on my own embeded system which is based on arm, and format it with 'mkfs.xfs', mount it to a directory to be set for nfs share. On the host side, I mount the raid, and start writing data to this raid, for about 20hours later, I start to delete the data , but the following message shows: XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1610 of file fs/xfs/xfs_alloc.c, xfs_force_shutdown(md0,0x8) called from line 4073 of file fs/xfs/xfs_bmap.c Filesystem "md0" corruption of in-memory data detected. Shutting down filesystem.Please umount the filesystem and rectify the problem. Although the filesystem crashed, the system did not hang. So I cd to this directory, and ls, and find that all the data seems to be lost, but 'df' reports that the most of raid has been used, I try to repair it with xfs_repair, and everything is OK. But now I don't want to fix this problem by xfs_repair, if the problem happens again, I have to reparit it again, it's too trouble, so if there is any way to solve this prolbem? I want to find out what causes this error happend, Anybody has experience in this problem? The following is my system parameter: linux version: 2.6.12.6 CPU: arm926ej memory: 128M If you answer this question ,Could you please cc to me? I didn't subscribe this mailing list. Thanks in advance! Robert From owner-xfs@oss.sgi.com Mon Jul 28 19:23:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 19:24:01 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T2Nvgv008221 for ; Mon, 28 Jul 2008 19:23:58 -0700 Received: from pc-bnaujok.melbourne.sgi.com (pc-bnaujok.melbourne.sgi.com [134.14.55.58]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA12656 for ; Tue, 29 Jul 2008 12:25:09 +1000 Date: Tue, 29 Jul 2008 12:25:45 +1000 To: "xfs@oss.sgi.com" Subject: [REVIEW] Update kernel headers to compile in userspace (libxfs) From: "Barry Naujok" Organization: SGI Content-Type: text/plain; format=flowed; delsp=yes; charset=utf-8 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Message-ID: User-Agent: Opera Mail/9.50 (Win32) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17230 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: bnaujok@sgi.com Precedence: bulk X-list: xfs There's been some changes in the headers that fail to compile in user-land. This patch #ifdef __KERNEL__ these things as none of them are actually used/required in user-space. --- fs/xfs/xfs_ag.h | 2 ++ fs/xfs/xfs_dir2_block.h | 2 ++ fs/xfs/xfs_dir2_leaf.h | 2 ++ fs/xfs/xfs_dir2_sf.h | 2 ++ fs/xfs/xfs_inode_item.h | 5 ++--- 5 files changed, 10 insertions(+), 3 deletions(-) Index: 2.6.x-xfs/fs/xfs/xfs_ag.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_ag.h +++ 2.6.x-xfs/fs/xfs/xfs_ag.h @@ -196,11 +196,13 @@ typedef struct xfs_perag spinlock_t pagb_lock; /* lock for pagb_list */ #endif xfs_perag_busy_t *pagb_list; /* unstable blocks */ +#ifdef __KERNEL__ atomic_t pagf_fstrms; /* # of filestreams active in this AG */ int pag_ici_init; /* incore inode cache initialised */ rwlock_t pag_ici_lock; /* incore inode lock */ struct radix_tree_root pag_ici_root; /* incore inode cache root */ +#endif } xfs_perag_t; #define XFS_AG_MAXLEVELS(mp) ((mp)->m_ag_maxlevels) Index: 2.6.x-xfs/fs/xfs/xfs_dir2_block.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_dir2_block.h +++ 2.6.x-xfs/fs/xfs/xfs_dir2_block.h @@ -80,8 +80,10 @@ xfs_dir2_block_leaf_p(xfs_dir2_block_tai * Function declarations. */ extern int xfs_dir2_block_addname(struct xfs_da_args *args); +#ifdef __KERNEL__ extern int xfs_dir2_block_getdents(struct xfs_inode *dp, void *dirent, xfs_off_t *offset, filldir_t filldir); +#endif extern int xfs_dir2_block_lookup(struct xfs_da_args *args); extern int xfs_dir2_block_removename(struct xfs_da_args *args); extern int xfs_dir2_block_replace(struct xfs_da_args *args); Index: 2.6.x-xfs/fs/xfs/xfs_dir2_leaf.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_dir2_leaf.h +++ 2.6.x-xfs/fs/xfs/xfs_dir2_leaf.h @@ -232,9 +232,11 @@ extern void xfs_dir2_leaf_compact(struct extern void xfs_dir2_leaf_compact_x1(struct xfs_dabuf *bp, int *indexp, int *lowstalep, int *highstalep, int *lowlogp, int *highlogp); +#ifdef __KERNEL__ extern int xfs_dir2_leaf_getdents(struct xfs_inode *dp, void *dirent, size_t bufsize, xfs_off_t *offset, filldir_t filldir); +#endif extern int xfs_dir2_leaf_init(struct xfs_da_args *args, xfs_dir2_db_t bno, struct xfs_dabuf **bpp, int magic); extern void xfs_dir2_leaf_log_ents(struct xfs_trans *tp, struct xfs_dabuf *bp, Index: 2.6.x-xfs/fs/xfs/xfs_dir2_sf.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_dir2_sf.h +++ 2.6.x-xfs/fs/xfs/xfs_dir2_sf.h @@ -169,8 +169,10 @@ extern int xfs_dir2_block_to_sf(struct x int size, xfs_dir2_sf_hdr_t *sfhp); extern int xfs_dir2_sf_addname(struct xfs_da_args *args); extern int xfs_dir2_sf_create(struct xfs_da_args *args, xfs_ino_t pino); +#ifdef __KERNEL__ extern int xfs_dir2_sf_getdents(struct xfs_inode *dp, void *dirent, xfs_off_t *offset, filldir_t filldir); +#endif extern int xfs_dir2_sf_lookup(struct xfs_da_args *args); extern int xfs_dir2_sf_removename(struct xfs_da_args *args); extern int xfs_dir2_sf_replace(struct xfs_da_args *args); Index: 2.6.x-xfs/fs/xfs/xfs_inode_item.h =================================================================== --- 2.6.x-xfs.orig/fs/xfs/xfs_inode_item.h +++ 2.6.x-xfs/fs/xfs/xfs_inode_item.h @@ -168,6 +168,8 @@ static inline int xfs_ilog_fext(int w) return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT); } +#ifdef __KERNEL__ + static inline int xfs_inode_clean(xfs_inode_t *ip) { return (!ip->i_itemp || @@ -175,9 +177,6 @@ static inline int xfs_inode_clean(xfs_in !ip->i_update_core; } - -#ifdef __KERNEL__ - extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); extern void xfs_inode_item_destroy(struct xfs_inode *); extern void xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *); From owner-xfs@oss.sgi.com Mon Jul 28 19:45:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 19:45:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6T2jqGj008954 for ; Mon, 28 Jul 2008 19:45:52 -0700 X-ASG-Debug-ID: 1217299622-129d035f0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5D72933ADC0 for ; Mon, 28 Jul 2008 19:47:02 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id xHPOt3YZ6CFsRedq for ; Mon, 28 Jul 2008 19:47:02 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 2F57CAC6275; Mon, 28 Jul 2008 21:47:02 -0500 (CDT) Message-ID: <488E84A5.6040409@sandeen.net> Date: Mon, 28 Jul 2008 21:47:01 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Robert CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: linux xfs filesystem corruption Subject: Re: linux xfs filesystem corruption References: <010901c8f11f$9a9a68f0$3400a8c0@xgw> In-Reply-To: <010901c8f11f$9a9a68f0$3400a8c0@xgw> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1217299624 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1156 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17231 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Robert wrote: > Dear all, > I have encoutered linux xfs filesystem corruption, I search this topic > on the > web, but I can't find any useful information to fix my problem. > I build a raid5 with 'mdadm' on my own embeded system which is based > on > arm, and format it with 'mkfs.xfs', mount it to a directory to be set for > nfs > share. On the host side, I mount the raid, and start writing data to this > raid, for > about 20hours later, I start to delete the data , but the following message > shows: > > XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1610 of file > fs/xfs/xfs_alloc.c, xfs_force_shutdown(md0,0x8) called from line 4073 of > file fs/xfs/xfs_bmap.c > Filesystem "md0" corruption of in-memory data detected. Shutting down > filesystem.Please umount the filesystem and rectify the problem. arm has been problematic on several fronts. The first was with the v2 directory code... http://oss.sgi.com/archives/xfs/2008-06/msg00064.html but that doesn't appear to be what you are hitting. There have been other problems with cache flushing that I don't remember all the details of now ... > Although the filesystem crashed, the system did not hang. So I cd to > this directory, > and ls, and find that all the data seems to be lost, but 'df' reports that > the most of > raid has been used, I try to repair it with xfs_repair, and everything is > OK. > But now I don't want to fix this problem by xfs_repair, if the problem > happens again, and what did xfs_repair find? Do you have a record of it? > I have to reparit it again, it's too trouble, so if there is any way to > solve this prolbem? > I want to find out what causes this error happend, > Anybody has experience in this problem? > The following is my system parameter: > linux version: 2.6.12.6 any other patches applied? Can you try again with a more recent kernel? -Eric > CPU: arm926ej > memory: 128M > If you answer this question ,Could you please cc to me? I didn't subscribe > this mailing list. > Thanks in advance! > > Robert > > > From owner-xfs@oss.sgi.com Mon Jul 28 20:53:56 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 20:54:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T3rsqp014979 for ; Mon, 28 Jul 2008 20:53:55 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA14538; Tue, 29 Jul 2008 13:55:03 +1000 Message-ID: <488E9497.2090900@sgi.com> Date: Tue, 29 Jul 2008 13:55:03 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 02/15] use the same btree_cur union member for alloc and inobt trees References: <20080723200826.GC7401@lst.de> In-Reply-To: <20080723200826.GC7401@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17232 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Hi there, This was fine but just one thing which looked odd: Christoph Hellwig wrote: > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-16 03:24:18.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-16 03:24:19.000000000 +0200 > @@ -570,6 +570,13 @@ xfs_btree_init_cursor( > cur->bc_private.a.agbp = agbp; > cur->bc_private.a.agno = agno; > break; > + case XFS_BTNUM_INO: > + /* > + * Inode allocation btree fields. > + */ > + cur->bc_private.a.agbp = agbp; > + cur->bc_private.a.agno = agno; > + break; > case XFS_BTNUM_BMAP: > /* > * Bmap btree fields. > @@ -582,13 +589,6 @@ xfs_btree_init_cursor( > cur->bc_private.b.flags = 0; > cur->bc_private.b.whichfork = whichfork; > break; > - case XFS_BTNUM_INO: > - /* > - * Inode allocation btree fields. > - */ > - cur->bc_private.i.agbp = agbp; > - cur->bc_private.i.agno = agno; > - break; > default: Could probably just add XFS_BNUM_INO to the case below (and modify the comment): > case XFS_BTNUM_BNO: > case XFS_BTNUM_CNT: > /* > * Allocation btree fields. > */ > cur->bc_private.a.agbp = agbp; > cur->bc_private.a.agno = agno; > break; --Tim From owner-xfs@oss.sgi.com Mon Jul 28 20:57:09 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 20:57:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T3v7Df015287 for ; Mon, 28 Jul 2008 20:57:08 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id NAA14602; Tue, 29 Jul 2008 13:58:17 +1000 Message-ID: <488E9559.409@sgi.com> Date: Tue, 29 Jul 2008 13:58:17 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 01/15] small cleanups in xfs_btree.c References: <20080723200820.GB7401@lst.de> In-Reply-To: <20080723200820.GB7401@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17233 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Fine (not much going on there:). I'll check it in. --Tim Christoph Hellwig wrote: > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-06 16:08:37.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-06 16:12:13.000000000 +0200 > @@ -46,38 +46,11 @@ kmem_zone_t *xfs_btree_cur_zone; > /* > * Btree magic numbers. > */ > -const __uint32_t xfs_magics[XFS_BTNUM_MAX] = > -{ > +const __uint32_t xfs_magics[XFS_BTNUM_MAX] = { > XFS_ABTB_MAGIC, XFS_ABTC_MAGIC, XFS_BMAP_MAGIC, XFS_IBT_MAGIC > }; > > /* > - * Prototypes for internal routines. > - */ > - > -/* > - * Checking routine: return maxrecs for the block. > - */ > -STATIC int /* number of records fitting in block */ > -xfs_btree_maxrecs( > - xfs_btree_cur_t *cur, /* btree cursor */ > - xfs_btree_block_t *block);/* generic btree block pointer */ > - > -/* > - * Internal routines. > - */ > - > -/* > - * Retrieve the block pointer from the cursor at the given level. > - * This may be a bmap btree root or from a buffer. > - */ > -STATIC xfs_btree_block_t * /* generic btree block pointer */ > -xfs_btree_get_block( > - xfs_btree_cur_t *cur, /* btree cursor */ > - int level, /* level in btree */ > - struct xfs_buf **bpp); /* buffer containing the block */ > - > -/* > * Checking routine: return maxrecs for the block. > */ > STATIC int /* number of records fitting in block */ > @@ -457,35 +430,6 @@ xfs_btree_dup_cursor( > } > > /* > - * Change the cursor to point to the first record at the given level. > - * Other levels are unaffected. > - */ > -int /* success=1, failure=0 */ > -xfs_btree_firstrec( > - xfs_btree_cur_t *cur, /* btree cursor */ > - int level) /* level to change */ > -{ > - xfs_btree_block_t *block; /* generic btree block pointer */ > - xfs_buf_t *bp; /* buffer containing block */ > - > - /* > - * Get the block pointer for this level. > - */ > - block = xfs_btree_get_block(cur, level, &bp); > - xfs_btree_check_block(cur, block, level, bp); > - /* > - * It's empty, there is no such record. > - */ > - if (!block->bb_h.bb_numrecs) > - return 0; > - /* > - * Set the ptr value to 1, that's the first record/key. > - */ > - cur->bc_ptrs[level] = 1; > - return 1; > -} > - > -/* > * Retrieve the block pointer from the cursor at the given level. > * This may be a bmap btree root or from a buffer. > */ > @@ -671,6 +615,35 @@ xfs_btree_islastblock( > } > > /* > + * Change the cursor to point to the first record at the given level. > + * Other levels are unaffected. > + */ > +int /* success=1, failure=0 */ > +xfs_btree_firstrec( > + xfs_btree_cur_t *cur, /* btree cursor */ > + int level) /* level to change */ > +{ > + xfs_btree_block_t *block; /* generic btree block pointer */ > + xfs_buf_t *bp; /* buffer containing block */ > + > + /* > + * Get the block pointer for this level. > + */ > + block = xfs_btree_get_block(cur, level, &bp); > + xfs_btree_check_block(cur, block, level, bp); > + /* > + * It's empty, there is no such record. > + */ > + if (!block->bb_h.bb_numrecs) > + return 0; > + /* > + * Set the ptr value to 1, that's the first record/key. > + */ > + cur->bc_ptrs[level] = 1; > + return 1; > +} > + > +/* > * Change the cursor to point to the last record in the current block > * at the given level. Other levels are unaffected. > */ > > -- From owner-xfs@oss.sgi.com Mon Jul 28 21:06:05 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 21:06:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6T465Aw015786 for ; Mon, 28 Jul 2008 21:06:05 -0700 X-ASG-Debug-ID: 1217304435-0ff7016d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A5D4E1941B82; Mon, 28 Jul 2008 21:07:16 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id bjWEeRB15QXrNLW5; Mon, 28 Jul 2008 21:07:16 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6T47IIF030606 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 29 Jul 2008 06:07:18 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6T47Idx030604; Tue, 29 Jul 2008 06:07:18 +0200 Date: Tue, 29 Jul 2008 06:07:18 +0200 From: Christoph Hellwig To: Timothy Shimmin Cc: Christoph Hellwig , xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 02/15] use the same btree_cur union member for alloc and inobt trees Subject: Re: [PATCH 02/15] use the same btree_cur union member for alloc and inobt trees Message-ID: <20080729040718.GA30548@lst.de> References: <20080723200826.GC7401@lst.de> <488E9497.2090900@sgi.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <488E9497.2090900@sgi.com> User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217304437 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1160 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17234 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 01:55:03PM +1000, Timothy Shimmin wrote: > Hi there, > > This was fine but just one thing which looked odd: > > Christoph Hellwig wrote: > > > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > > =================================================================== > > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-16 03:24:18.000000000 +0200 > > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-16 03:24:19.000000000 +0200 > > @@ -570,6 +570,13 @@ xfs_btree_init_cursor( > > cur->bc_private.a.agbp = agbp; > > cur->bc_private.a.agno = agno; > > break; > > + case XFS_BTNUM_INO: > > + /* > > + * Inode allocation btree fields. > > + */ > > + cur->bc_private.a.agbp = agbp; > > + cur->bc_private.a.agno = agno; > > + break; > > case XFS_BTNUM_BMAP: > > /* > > * Bmap btree fields. > > @@ -582,13 +589,6 @@ xfs_btree_init_cursor( > > cur->bc_private.b.flags = 0; > > cur->bc_private.b.whichfork = whichfork; > > break; > > - case XFS_BTNUM_INO: > > - /* > > - * Inode allocation btree fields. > > - */ > > - cur->bc_private.i.agbp = agbp; > > - cur->bc_private.i.agno = agno; > > - break; > > default: > > Could probably just add XFS_BNUM_INO to the case below > (and modify the comment): We could, and in fact that was my plan initially but I gave it up because later we'd add the method table initialization which would be different for the alloc vs inobt trees. I then later factored these out into separate functions, so this whole switch goes away a few patches later in the series. Given that it would only cause churn in the series I'd prefer to leave the patch as-is. From owner-xfs@oss.sgi.com Mon Jul 28 21:11:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 21:11:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T4Ax8w016144 for ; Mon, 28 Jul 2008 21:11:00 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA14903; Tue, 29 Jul 2008 14:12:09 +1000 Message-ID: <488E9899.2000106@sgi.com> Date: Tue, 29 Jul 2008 14:12:09 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: Christoph Hellwig CC: xfs@oss.sgi.com Subject: Re: [PATCH 02/15] use the same btree_cur union member for alloc and inobt trees References: <20080723200826.GC7401@lst.de> <488E9497.2090900@sgi.com> <20080729040718.GA30548@lst.de> In-Reply-To: <20080729040718.GA30548@lst.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17235 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Christoph Hellwig wrote: > On Tue, Jul 29, 2008 at 01:55:03PM +1000, Timothy Shimmin wrote: >> Hi there, >> >> This was fine but just one thing which looked odd: >> >> Christoph Hellwig wrote: >>> >>> Index: linux-2.6-xfs/fs/xfs/xfs_btree.c >>> =================================================================== >>> --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-16 03:24:18.000000000 +0200 >>> +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-16 03:24:19.000000000 +0200 >>> @@ -570,6 +570,13 @@ xfs_btree_init_cursor( >>> cur->bc_private.a.agbp = agbp; >>> cur->bc_private.a.agno = agno; >>> break; >>> + case XFS_BTNUM_INO: >>> + /* >>> + * Inode allocation btree fields. >>> + */ >>> + cur->bc_private.a.agbp = agbp; >>> + cur->bc_private.a.agno = agno; >>> + break; >>> case XFS_BTNUM_BMAP: >>> /* >>> * Bmap btree fields. >>> @@ -582,13 +589,6 @@ xfs_btree_init_cursor( >>> cur->bc_private.b.flags = 0; >>> cur->bc_private.b.whichfork = whichfork; >>> break; >>> - case XFS_BTNUM_INO: >>> - /* >>> - * Inode allocation btree fields. >>> - */ >>> - cur->bc_private.i.agbp = agbp; >>> - cur->bc_private.i.agno = agno; >>> - break; >>> default: >> Could probably just add XFS_BNUM_INO to the case below >> (and modify the comment): > > We could, and in fact that was my plan initially I'm not surprised :-) > but I gave it up > because later we'd add the method table initialization which > would be different for the alloc vs inobt trees. I then later factored > these out into separate functions, so this whole switch goes away > a few patches later in the series. > Oh okay, method in the madness ;-) > Given that it would only cause churn in the series I'd prefer to > leave the patch as-is. Yep, fine. --Tim From owner-xfs@oss.sgi.com Mon Jul 28 21:18:29 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 21:18:31 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6T4ISu3016741 for ; Mon, 28 Jul 2008 21:18:29 -0700 X-ASG-Debug-ID: 1217305180-53b803570000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from bombadil.infradead.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id A99BB11EE1D9; Mon, 28 Jul 2008 21:19:40 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org [18.85.46.34]) by cuda.sgi.com with ESMTP id eAeqPdRrzvcqxWNC; Mon, 28 Jul 2008 21:19:40 -0700 (PDT) Received: from hch by bombadil.infradead.org with local (Exim 4.68 #1 (Red Hat Linux)) id 1KNggV-000257-QH; Tue, 29 Jul 2008 04:19:39 +0000 Date: Tue, 29 Jul 2008 00:19:39 -0400 From: Christoph Hellwig To: Barry Naujok Cc: "xfs@oss.sgi.com" X-ASG-Orig-Subj: Re: [REVIEW] Update kernel headers to compile in userspace (libxfs) Subject: Re: [REVIEW] Update kernel headers to compile in userspace (libxfs) Message-ID: <20080729041939.GA7232@infradead.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org See http://www.infradead.org/rpr.html X-Barracuda-Connect: bombadil.infradead.org[18.85.46.34] X-Barracuda-Start-Time: 1217305180 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1161 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17236 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@infradead.org Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 12:25:45PM +1000, Barry Naujok wrote: > +#ifdef __KERNEL__ > atomic_t pagf_fstrms; /* # of filestreams active in this AG */ > > int pag_ici_init; /* incore inode cache initialised */ > rwlock_t pag_ici_lock; /* incore inode lock */ > struct radix_tree_root pag_ici_root; /* incore inode cache root */ > +#endif I gues this does indeed not make much sense in userspace. > +#ifdef __KERNEL__ > extern int xfs_dir2_block_getdents(struct xfs_inode *dp, void *dirent, > xfs_off_t *offset, filldir_t filldir); > +#endif Instead of all these ifdefs in the dir code wouldn't it be better to just provide a filldir_t in userspace? getdents into a user formatted buffers sounds at least like a theoretically useful functionality for libxfs. > Index: 2.6.x-xfs/fs/xfs/xfs_inode_item.h > =================================================================== > --- 2.6.x-xfs.orig/fs/xfs/xfs_inode_item.h > +++ 2.6.x-xfs/fs/xfs/xfs_inode_item.h > @@ -168,6 +168,8 @@ static inline int xfs_ilog_fext(int w) > return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT); > } > > +#ifdef __KERNEL__ > + > static inline int xfs_inode_clean(xfs_inode_t *ip) > { > return (!ip->i_itemp || > @@ -175,9 +177,6 @@ static inline int xfs_inode_clean(xfs_in > !ip->i_update_core; > } > > - > -#ifdef __KERNEL__ > - > extern void xfs_inode_item_init(struct xfs_inode *, struct xfs_mount *); > extern void xfs_inode_item_destroy(struct xfs_inode *); > extern void xfs_iflush_done(struct xfs_buf *, xfs_inode_log_item_t *); Makes sense, too. From owner-xfs@oss.sgi.com Mon Jul 28 22:56:03 2008 Received: with ECARTIS (v1.0.0; list xfs); Mon, 28 Jul 2008 22:56:06 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: ** X-Spam-Status: No, score=2.0 required=5.0 tests=AWL,BAYES_05,RCVD_IN_PSBL autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6T5u3lm018303 for ; Mon, 28 Jul 2008 22:56:03 -0700 X-ASG-Debug-ID: 1217311034-360101c90000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from smtp.sina.com.cn (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 388CFEC5266 for ; Mon, 28 Jul 2008 22:57:14 -0700 (PDT) Received: from smtp.sina.com.cn (smtp.sina.com.cn [202.108.3.233]) by cuda.sgi.com with ESMTP id 5HEGmBewv9uG2NKr for ; Mon, 28 Jul 2008 22:57:14 -0700 (PDT) Received: from xgw (unknown [211.162.201.124]) by smtp.sina.com.cn (SINAMAIL) with ESMTP id 5863C1088E9; Tue, 29 Jul 2008 13:57:11 +0800 (CST) Message-ID: <013c01c8f140$033e61c0$3400a8c0@xgw> From: "Robert" To: "Eric Sandeen" Cc: References: <010901c8f11f$9a9a68f0$3400a8c0@xgw> <488E84A5.6040409@sandeen.net> X-ASG-Orig-Subj: Re: linux xfs filesystem corruption Subject: Re: linux xfs filesystem corruption Date: Tue, 29 Jul 2008 13:57:24 +0800 X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3138 X-RFC2646: Format=Flowed; Original X-Barracuda-Connect: smtp.sina.com.cn[202.108.3.233] X-Barracuda-Start-Time: 1217311035 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1167 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17237 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xiaguowu2004@sina.com Precedence: bulk X-list: xfs Hi, Eric, Thanks for your reply! >> XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1610 of file >> fs/xfs/xfs_alloc.c, xfs_force_shutdown(md0,0x8) called from line 4073 of >> file fs/xfs/xfs_bmap.c >> Filesystem "md0" corruption of in-memory data detected. Shutting down >> filesystem.Please umount the filesystem and rectify the problem. > > arm has been problematic on several fronts. The first was with the v2 > directory code... > > http://oss.sgi.com/archives/xfs/2008-06/msg00064.html > > but that doesn't appear to be what you are hitting. There have been > other problems with cache flushing that I don't remember all the details > of now ... > I will try this method to see if there will be effective. >> Although the filesystem crashed, the system did not hang. So I cd to >> this directory, >> and ls, and find that all the data seems to be lost, but 'df' reports >> that >> the most of >> raid has been used, I try to repair it with xfs_repair, and everything is >> OK. >> But now I don't want to fix this problem by xfs_repair, if the >> problem >> happens again, > > and what did xfs_repair find? Do you have a record of it? I'm sorry that I didn't capture the outputs, today I try to replay the issue again, and use "xfs_repair" to repair filesytem, but this time it seems that the filesystem is not repaired successfully, but it still can be used for a while. Here is the output of xfs_repair : ~ # /mnt/xfs_repair -n /dev/md0 - creating 2 worker thread(s) Phase 1 - find and verify superblock... - reporting progress in intervals of 15 minutes Killed >> I have to reparit it again, it's too trouble, so if there is any way to >> solve this prolbem? >> I want to find out what causes this error happend, >> Anybody has experience in this problem? >> The following is my system parameter: >> linux version: 2.6.12.6 > > any other patches applied? Can you try again with a more recent kernel? > I haven't found any patch of this issue. Athough I find some patches related to this problem from the web, it has already been applied in my linux kernel. I have no way to try the recent kernel, because our embeded system is based on Marvell development board, and if I use the recent kernel, the Marvell's patch of this kernel is required. Robert From owner-xfs@oss.sgi.com Tue Jul 29 00:02:19 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 00:02:30 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T72IGF023500 for ; Tue, 29 Jul 2008 00:02:19 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA18678; Tue, 29 Jul 2008 17:03:27 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id 729BD58C4C3F; Tue, 29 Jul 2008 17:03:27 +1000 (EST) To: sgi.bugs.xfs@engr.sgi.com, xfs@oss.sgi.com Subject: PARTIAL TAKE 981498 - small cleanups in xfs_btree.c Message-Id: <20080729070327.729BD58C4C3F@chook.melbourne.sgi.com> Date: Tue, 29 Jul 2008 17:03:27 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17238 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs small cleanups in xfs_btree.c Remove unneeded xfs_btree_get_block forward declaration. Move xfs_btree_firstrec next to xfs_btree_lastrec. Signed-off-by: Christoph Hellwig Date: Tue Jul 29 17:02:19 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: tes@sgi.com,david@fromorbit.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31787a fs/xfs/xfs_btree.c - 1.117 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_btree.c.diff?r1=text&tr1=1.117&r2=text&tr2=1.116&f=h - - remove unneeded xfs_btree_get_block forward declaration - move xfs_btree_firstrec next to xfs_btree_lastrec From owner-xfs@oss.sgi.com Tue Jul 29 00:08:33 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 00:08:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6T78V0m024262 for ; Tue, 29 Jul 2008 00:08:32 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id RAA18741; Tue, 29 Jul 2008 17:09:42 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 1116) id CE3C558C4C3F; Tue, 29 Jul 2008 17:09:41 +1000 (EST) To: xfs@oss.sgi.com, sgi.bugs.xfs@engr.sgi.com Subject: PARTIAL TAKE 981498 - Use the same btree_cur union member for alloc and inobt trees. Message-Id: <20080729070941.CE3C558C4C3F@chook.melbourne.sgi.com> Date: Tue, 29 Jul 2008 17:09:41 +1000 (EST) From: tes@sgi.com (Tim Shimmin) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17239 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Use the same btree_cur union member for alloc and inobt trees. The alloc and inobt btree use the same agbp/agno pair in the btree_cur union. Make them use the same bc_private.a union member so that code for these two short form btree implementations can be shared. Signed-off-by: Christoph Hellwig Date: Tue Jul 29 17:07:56 AEST 2008 Workarea: chook.melbourne.sgi.com:/build/tes/2.6.x-xfs-quilt Inspected by: tes@sgi.com,david@fromorbit.com The following file(s) were checked into: longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb Modid: xfs-linux-melb:xfs-kern:31788a fs/xfs/xfsidbg.c - 1.358 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfsidbg.c.diff?r1=text&tr1=1.358&r2=text&tr2=1.357&f=h - use the same btree_cur union member for alloc and inobt trees fs/xfs/xfs_ialloc_btree.c - 1.87 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_ialloc_btree.c.diff?r1=text&tr1=1.87&r2=text&tr2=1.86&f=h - use the same btree_cur union member for alloc and inobt trees fs/xfs/xfs_btree.c - 1.118 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_btree.c.diff?r1=text&tr1=1.118&r2=text&tr2=1.117&f=h - use the same btree_cur union member for alloc and inobt trees fs/xfs/xfs_btree.h - 1.68 - changed http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_btree.h.diff?r1=text&tr1=1.68&r2=text&tr2=1.67&f=h - use the same btree_cur union member for alloc and inobt trees From owner-xfs@oss.sgi.com Tue Jul 29 11:51:20 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 11:51:46 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TIpJID023797 for ; Tue, 29 Jul 2008 11:51:20 -0700 X-ASG-Debug-ID: 1217357550-516d01d50000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from slurp.thebarn.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9C0AEECD9FC for ; Tue, 29 Jul 2008 11:52:30 -0700 (PDT) Received: from slurp.thebarn.com (cattelan-host202.dsl.visi.com [208.42.117.202]) by cuda.sgi.com with ESMTP id sXOTH4v0yekNEYbW for ; Tue, 29 Jul 2008 11:52:30 -0700 (PDT) Received: from funky.thebarn.com (slurp.thebarn.com [208.42.117.201]) (authenticated bits=0) by slurp.thebarn.com (8.14.0/8.13.8) with ESMTP id m6TIqSiX032819; Tue, 29 Jul 2008 13:52:29 -0500 (CDT) (envelope-from cattelan@thebarn.com) Message-ID: <488F66EC.80106@thebarn.com> Date: Tue, 29 Jul 2008 13:52:28 -0500 From: Russell Cattelan User-Agent: Thunderbird 2.0.0.6 (Macintosh/20070728) MIME-Version: 1.0 To: Robert CC: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: linux xfs filesystem corruption Subject: Re: linux xfs filesystem corruption References: <010901c8f11f$9a9a68f0$3400a8c0@xgw> In-Reply-To: <010901c8f11f$9a9a68f0$3400a8c0@xgw> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Scanned: ClamAV 0.91.2/7880/Tue Jul 29 12:49:36 2008 on slurp.thebarn.com X-Virus-Status: Clean X-Barracuda-Connect: cattelan-host202.dsl.visi.com[208.42.117.202] X-Barracuda-Start-Time: 1217357551 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0208 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1219 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-archive-position: 17240 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: cattelan@thebarn.com Precedence: bulk X-list: xfs Robert wrote: > Dear all, > I have encoutered linux xfs filesystem corruption, I search this topic > on the > web, but I can't find any useful information to fix my problem. > I build a raid5 with 'mdadm' on my own embeded system which is based > on > arm, and format it with 'mkfs.xfs', mount it to a directory to be set for > nfs > share. On the host side, I mount the raid, and start writing data to this > raid, for > about 20hours later, I start to delete the data , but the following message > shows: > > Would it be possible to get a xfs meta dump of the corrupted image? There have been other reports of corrupted fs when running on non x86 architectures. It might be helpful to examine the file system to see what has gone wrong. > XFS internal error XFS_WANT_CORRUPTED_GOTO at line 1610 of file > fs/xfs/xfs_alloc.c, xfs_force_shutdown(md0,0x8) called from line 4073 of > file fs/xfs/xfs_bmap.c > Filesystem "md0" corruption of in-memory data detected. Shutting down > filesystem.Please umount the filesystem and rectify the problem. > > Although the filesystem crashed, the system did not hang. So I cd to > this directory, > and ls, and find that all the data seems to be lost, but 'df' reports that > the most of > raid has been used, I try to repair it with xfs_repair, and everything is > OK. > But now I don't want to fix this problem by xfs_repair, if the problem > happens again, > I have to reparit it again, it's too trouble, so if there is any way to > solve this prolbem? > I want to find out what causes this error happend, > Anybody has experience in this problem? > The following is my system parameter: > linux version: 2.6.12.6 > CPU: arm926ej > memory: 128M > If you answer this question ,Could you please cc to me? I didn't subscribe > this mailing list. > Thanks in advance! > > Robert > > > From owner-xfs@oss.sgi.com Tue Jul 29 12:28:59 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:02 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJSxhu031191 for ; Tue, 29 Jul 2008 12:28:59 -0700 X-ASG-Debug-ID: 1217359810-0cdc00910000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 36E48ECE214 for ; Tue, 29 Jul 2008 12:30:10 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id BC6eN14C856bunCq for ; Tue, 29 Jul 2008 12:30:10 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUCIF019165 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:12 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUCen019163 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:12 +0200 Date: Tue, 29 Jul 2008 21:30:12 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 02/21] add generic btree types Subject: [PATCH 02/21] add generic btree types Message-ID: <20080729193012.GC19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-add-generic-types User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359812 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17243 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Add generic union types for btree pointers, keys and records. The generic btree pointer contains a 32 and 64bit big endian type for short and long form btrees, and the key and record contain the relevant type for each possible btree. Split out from a bigger patch from Dave Chinner and simplified a little further. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 17:26:11.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 17:27:59.000000000 +0200 @@ -70,6 +70,12 @@ typedef struct xfs_btree_hdr __be16 bb_numrecs; /* current # of data records */ } xfs_btree_hdr_t; +/* + * Generic block, key, ptr and record wrapper structures + * These are disk format structures, and are converted where + * necessary be the btree specific code that needs to interpret + * them. + */ typedef struct xfs_btree_block { xfs_btree_hdr_t bb_h; /* header */ union { @@ -84,6 +90,25 @@ typedef struct xfs_btree_block { } bb_u; /* rest */ } xfs_btree_block_t; +union xfs_btree_ptr { + __be32 s; /* short form ptr */ + __be64 l; /* long form ptr */ +}; + +union xfs_btree_key { + xfs_bmbt_key_t bmbt; + xfs_bmdr_key_t bmbr; /* bmbt root block */ + xfs_alloc_key_t alloc; + xfs_inobt_key_t inobt; +}; + +union xfs_btree_rec { + xfs_bmbt_rec_t bmbt; + xfs_bmdr_rec_t bmbr; /* bmbt root block */ + xfs_alloc_rec_t alloc; + xfs_inobt_rec_t inobt; +}; + /* * For logging record fields. */ -- From owner-xfs@oss.sgi.com Tue Jul 29 12:28:55 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:28:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJSsVc031158 for ; Tue, 29 Jul 2008 12:28:54 -0700 X-ASG-Debug-ID: 1217359803-0c3703170000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 461151947CAD for ; Tue, 29 Jul 2008 12:30:04 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ZryDhgEdnRjoO6oR for ; Tue, 29 Jul 2008 12:30:04 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJU5IF019145 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:05 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJU5XG019143 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:05 +0200 Date: Tue, 29 Jul 2008 21:30:05 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 01/21] split up xfs_btree_init_cursor Subject: [PATCH 01/21] split up xfs_btree_init_cursor Message-ID: <20080729193005.GB19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-split-init-cursor User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359806 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17242 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs xfs_btree_init_cursor contains close to little shared code for the different btrees and will get even more non-common code in the future. Split it up into one routine per btree type. Because xfs_btree_dup_cursor needs to call the init routine for a generic btree cursor add a new btree operation vector that contains a dup_cursor method that initializes a new cursor based on an existing one. The btree operations vector is based on an idea and code from Dave Chinner and will be used for more operations later on. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -136,6 +136,11 @@ extern const __uint32_t xfs_magics[]; #define XFS_BTREE_MAXLEVELS 8 /* max of all btrees */ +struct xfs_btree_ops { + /* cursor operations */ + struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); +}; + /* * Btree cursor structure. * This collects all information needed by the btree code in one place. @@ -144,6 +149,7 @@ typedef struct xfs_btree_cur { struct xfs_trans *bc_tp; /* transaction we're in, if any */ struct xfs_mount *bc_mp; /* file system mount struct */ + const struct xfs_btree_ops *bc_ops; union { xfs_alloc_rec_incore_t a; xfs_bmbt_irec_t b; @@ -313,20 +319,6 @@ xfs_btree_get_bufs( uint lock); /* lock flags for get_buf */ /* - * Allocate a new btree cursor. - * The cursor is either for allocation (A) or bmap (B). - */ -xfs_btree_cur_t * /* new btree cursor */ -xfs_btree_init_cursor( - struct xfs_mount *mp, /* file system mount point */ - struct xfs_trans *tp, /* transaction pointer */ - struct xfs_buf *agbp, /* (A only) buffer for agf structure */ - xfs_agnumber_t agno, /* (A only) allocation group number */ - xfs_btnum_t btnum, /* btree identifier */ - struct xfs_inode *ip, /* (B only) inode owning the btree */ - int whichfork); /* (B only) data/attr fork */ - -/* * Check for the cursor referring to the last block at the given level. */ int /* 1=is last block, 0=not last block */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -387,16 +387,17 @@ xfs_btree_dup_cursor( tp = cur->bc_tp; mp = cur->bc_mp; + /* * Allocate a new cursor like the old one. */ - new = xfs_btree_init_cursor(mp, tp, cur->bc_private.a.agbp, - cur->bc_private.a.agno, cur->bc_btnum, cur->bc_private.b.ip, - cur->bc_private.b.whichfork); + new = cur->bc_ops->dup_cursor(cur); + /* * Copy the record currently in the cursor. */ new->bc_rec = cur->bc_rec; + /* * For each level current, re-get the buffer and copy the ptr value. */ @@ -416,15 +417,6 @@ xfs_btree_dup_cursor( } else new->bc_bufs[i] = NULL; } - /* - * For bmap btrees, copy the firstblock, flist, and flags values, - * since init cursor doesn't get them. - */ - if (new->bc_btnum == XFS_BTNUM_BMAP) { - new->bc_private.b.firstblock = cur->bc_private.b.firstblock; - new->bc_private.b.flist = cur->bc_private.b.flist; - new->bc_private.b.flags = cur->bc_private.b.flags; - } *ncur = new; return 0; } @@ -505,97 +497,6 @@ xfs_btree_get_bufs( } /* - * Allocate a new btree cursor. - * The cursor is either for allocation (A) or bmap (B) or inodes (I). - */ -xfs_btree_cur_t * /* new btree cursor */ -xfs_btree_init_cursor( - xfs_mount_t *mp, /* file system mount point */ - xfs_trans_t *tp, /* transaction pointer */ - xfs_buf_t *agbp, /* (A only) buffer for agf structure */ - /* (I only) buffer for agi structure */ - xfs_agnumber_t agno, /* (AI only) allocation group number */ - xfs_btnum_t btnum, /* btree identifier */ - xfs_inode_t *ip, /* (B only) inode owning the btree */ - int whichfork) /* (B only) data or attr fork */ -{ - xfs_agf_t *agf; /* (A) allocation group freespace */ - xfs_agi_t *agi; /* (I) allocation group inodespace */ - xfs_btree_cur_t *cur; /* return value */ - xfs_ifork_t *ifp; /* (I) inode fork pointer */ - int nlevels=0; /* number of levels in the btree */ - - ASSERT(xfs_btree_cur_zone != NULL); - /* - * Allocate a new cursor. - */ - cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); - /* - * Deduce the number of btree levels from the arguments. - */ - switch (btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - agf = XFS_BUF_TO_AGF(agbp); - nlevels = be32_to_cpu(agf->agf_levels[btnum]); - break; - case XFS_BTNUM_BMAP: - ifp = XFS_IFORK_PTR(ip, whichfork); - nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; - break; - case XFS_BTNUM_INO: - agi = XFS_BUF_TO_AGI(agbp); - nlevels = be32_to_cpu(agi->agi_level); - break; - default: - ASSERT(0); - } - /* - * Fill in the common fields. - */ - cur->bc_tp = tp; - cur->bc_mp = mp; - cur->bc_nlevels = nlevels; - cur->bc_btnum = btnum; - cur->bc_blocklog = mp->m_sb.sb_blocklog; - /* - * Fill in private fields. - */ - switch (btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - /* - * Allocation btree fields. - */ - cur->bc_private.a.agbp = agbp; - cur->bc_private.a.agno = agno; - break; - case XFS_BTNUM_INO: - /* - * Inode allocation btree fields. - */ - cur->bc_private.a.agbp = agbp; - cur->bc_private.a.agno = agno; - break; - case XFS_BTNUM_BMAP: - /* - * Bmap btree fields. - */ - cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); - cur->bc_private.b.ip = ip; - cur->bc_private.b.firstblock = NULLFSBLOCK; - cur->bc_private.b.flist = NULL; - cur->bc_private.b.allocated = 0; - cur->bc_private.b.flags = 0; - cur->bc_private.b.whichfork = whichfork; - break; - default: - ASSERT(0); - } - return cur; -} - -/* * Check for the cursor referring to the last block at the given level. */ int /* 1=is last block, 0=not last block */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -2608,3 +2608,62 @@ xfs_check_nostate_extents( } return 0; } + + +STATIC struct xfs_btree_cur * +xfs_bmbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + struct xfs_btree_cur *new; + + new = xfs_bmbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.b.ip, cur->bc_private.b.whichfork); + + /* + * Copy the firstblock, flist, and flags values, + * since init cursor doesn't get them. + */ + new->bc_private.b.firstblock = cur->bc_private.b.firstblock; + new->bc_private.b.flist = cur->bc_private.b.flist; + new->bc_private.b.flags = cur->bc_private.b.flags; + + return new; +} + +static const struct xfs_btree_ops xfs_bmbt_ops = { + .dup_cursor = xfs_bmbt_dup_cursor, +}; + +/* + * Allocate a new bmap btree cursor. + */ +struct xfs_btree_cur * /* new bmap btree cursor */ +xfs_bmbt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_inode *ip, /* inode owning the btree */ + int whichfork) /* data or attr fork */ +{ + struct xfs_ifork *ifp = XFS_IFORK_PTR(ip, whichfork); + struct xfs_btree_cur *cur; + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be16_to_cpu(ifp->if_broot->bb_level) + 1; + cur->bc_btnum = XFS_BTNUM_BMAP; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_bmbt_ops; + + cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); + cur->bc_private.b.ip = ip; + cur->bc_private.b.firstblock = NULLFSBLOCK; + cur->bc_private.b.flist = NULL; + cur->bc_private.b.allocated = 0; + cur->bc_private.b.flags = 0; + cur->bc_private.b.whichfork = whichfork; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -2076,3 +2076,44 @@ xfs_inobt_update( } return 0; } + +STATIC struct xfs_btree_cur * +xfs_inobt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_inobt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno); +} + +static const struct xfs_btree_ops xfs_inobt_ops = { + .dup_cursor = xfs_inobt_dup_cursor, +}; + +/* + * Allocate a new inode btree cursor. + */ +struct xfs_btree_cur * /* new inode btree cursor */ +xfs_inobt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_buf *agbp, /* buffer for agi structure */ + xfs_agnumber_t agno) /* allocation group number */ +{ + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); + struct xfs_btree_cur *cur; + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be32_to_cpu(agi->agi_level); + cur->bc_btnum = XFS_BTNUM_INO; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_inobt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-14 17:26:11.000000000 +0200 @@ -640,8 +640,8 @@ xfs_alloc_ag_vextent_exact( /* * Allocate/initialize a cursor for the by-number freespace btree. */ - bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); /* * Lookup bno and minlen in the btree (minlen is irrelevant, really). * Look for the closest free block <= bno, it must contain bno @@ -696,8 +696,8 @@ xfs_alloc_ag_vextent_exact( * We are allocating agbno for rlen [agbno .. end] * Allocate/initialize a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); ASSERT(args->agbno + args->len <= be32_to_cpu(XFS_BUF_TO_AGF(args->agbp)->agf_length)); if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, @@ -759,8 +759,8 @@ xfs_alloc_ag_vextent_near( /* * Get a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); ltlen = 0; bno_cur_lt = bno_cur_gt = NULL; /* @@ -886,8 +886,8 @@ xfs_alloc_ag_vextent_near( /* * Set up a cursor for the by-bno tree. */ - bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, - args->agbp, args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur_lt = xfs_allocbt_init_cursor(args->mp, args->tp, + args->agbp, args->agno, XFS_BTNUM_BNO); /* * Fix up the btree entries. */ @@ -914,8 +914,8 @@ xfs_alloc_ag_vextent_near( /* * Allocate and initialize the cursor for the leftward search. */ - bno_cur_lt = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur_lt = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); /* * Lookup <= bno to find the leftward search's starting point. */ @@ -1267,8 +1267,8 @@ xfs_alloc_ag_vextent_size( /* * Allocate and initialize a cursor for the by-size btree. */ - cnt_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_CNT, NULL, 0); + cnt_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_CNT); bno_cur = NULL; /* * Look for an entry >= maxlen+alignment-1 blocks. @@ -1372,8 +1372,8 @@ xfs_alloc_ag_vextent_size( /* * Allocate and initialize a cursor for the by-block tree. */ - bno_cur = xfs_btree_init_cursor(args->mp, args->tp, args->agbp, - args->agno, XFS_BTNUM_BNO, NULL, 0); + bno_cur = xfs_allocbt_init_cursor(args->mp, args->tp, args->agbp, + args->agno, XFS_BTNUM_BNO); if ((error = xfs_alloc_fixup_trees(cnt_cur, bno_cur, fbno, flen, rbno, rlen, XFSA_FIXUP_CNT_OK))) goto error0; @@ -1515,8 +1515,7 @@ xfs_free_ag_extent( /* * Allocate and initialize a cursor for the by-block btree. */ - bno_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO, NULL, - 0); + bno_cur = xfs_allocbt_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_BNO); cnt_cur = NULL; /* * Look for a neighboring block on the left (lower block numbers) @@ -1575,8 +1574,7 @@ xfs_free_ag_extent( /* * Now allocate and initialize a cursor for the by-size tree. */ - cnt_cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT, NULL, - 0); + cnt_cur = xfs_allocbt_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_CNT); /* * Have both left and right contiguous neighbors. * Merge all three into a single free block. Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-14 17:26:11.000000000 +0200 @@ -2209,3 +2209,48 @@ xfs_alloc_update( } return 0; } + +STATIC struct xfs_btree_cur * +xfs_allocbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno, + cur->bc_btnum); +} + +static const struct xfs_btree_ops xfs_allocbt_ops = { + .dup_cursor = xfs_allocbt_dup_cursor, +}; + +/* + * Allocate a new allocation btree cursor. + */ +struct xfs_btree_cur * /* new alloc btree cursor */ +xfs_allocbt_init_cursor( + struct xfs_mount *mp, /* file system mount point */ + struct xfs_trans *tp, /* transaction pointer */ + struct xfs_buf *agbp, /* buffer for agf structure */ + xfs_agnumber_t agno, /* allocation group number */ + xfs_btnum_t btnum) /* btree identifier */ +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + struct xfs_btree_cur *cur; + + ASSERT(btnum == XFS_BTNUM_BNO || btnum == XFS_BTNUM_CNT); + + cur = kmem_zone_zalloc(xfs_btree_cur_zone, KM_SLEEP); + + cur->bc_tp = tp; + cur->bc_mp = mp; + cur->bc_nlevels = be32_to_cpu(agf->agf_levels[btnum]); + cur->bc_btnum = btnum; + cur->bc_blocklog = mp->m_sb.sb_blocklog; + + cur->bc_ops = &xfs_allocbt_ops; + + cur->bc_private.a.agbp = agbp; + cur->bc_private.a.agno = agno; + + return cur; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -152,4 +152,9 @@ extern int xfs_alloc_lookup_le(struct xf extern int xfs_alloc_update(struct xfs_btree_cur *cur, xfs_agblock_t bno, xfs_extlen_t len); + +extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_buf *, + xfs_agnumber_t, xfs_btnum_t); + #endif /* __XFS_ALLOC_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-14 17:26:11.000000000 +0200 @@ -422,8 +422,7 @@ xfs_bmap_add_attrfork_btree( if (ip->i_df.if_broot_bytes <= XFS_IFORK_DSIZE(ip)) *flags |= XFS_ILOG_DBROOT; else { - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - XFS_DATA_FORK); + cur = xfs_bmbt_init_cursor(mp, tp, ip, XFS_DATA_FORK); cur->bc_private.b.flist = flist; cur->bc_private.b.firstblock = *firstblock; if ((error = xfs_bmbt_lookup_ge(cur, 0, 0, 0, &stat))) @@ -3441,8 +3440,7 @@ xfs_bmap_extents_to_btree( * Need a cursor. Can't allocate until bb_level is filled in. */ mp = ip->i_mount; - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - whichfork); + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; cur->bc_private.b.flags = wasdel ? XFS_BTCUR_BPRV_WASDEL : 0; @@ -5029,8 +5027,7 @@ xfs_bmapi( if (abno == NULLFSBLOCK) break; if ((ifp->if_flags & XFS_IFBROOT) && !cur) { - cur = xfs_btree_init_cursor(mp, - tp, NULL, 0, XFS_BTNUM_BMAP, + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; @@ -5147,9 +5144,8 @@ xfs_bmapi( */ ASSERT(mval->br_blockcount <= len); if ((ifp->if_flags & XFS_IFBROOT) && !cur) { - cur = xfs_btree_init_cursor(mp, - tp, NULL, 0, XFS_BTNUM_BMAP, - ip, whichfork); + cur = xfs_bmbt_init_cursor(mp, + tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; @@ -5440,8 +5436,7 @@ xfs_bunmapi( logflags = 0; if (ifp->if_flags & XFS_IFBROOT) { ASSERT(XFS_IFORK_FORMAT(ip, whichfork) == XFS_DINODE_FMT_BTREE); - cur = xfs_btree_init_cursor(mp, tp, NULL, 0, XFS_BTNUM_BMAP, ip, - whichfork); + cur = xfs_bmbt_init_cursor(mp, tp, ip, whichfork); cur->bc_private.b.firstblock = *firstblock; cur->bc_private.b.flist = flist; cur->bc_private.b.flags = 0; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -24,6 +24,7 @@ struct xfs_btree_cur; struct xfs_btree_lblock; struct xfs_mount; struct xfs_inode; +struct xfs_trans; /* * Bmap root header, on-disk form only. @@ -300,6 +301,9 @@ extern void xfs_bmbt_to_bmdr(xfs_bmbt_bl extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); +extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_inode *, int); + #endif /* __KERNEL__ */ #endif /* __XFS_BMAP_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-14 17:26:11.000000000 +0200 @@ -335,8 +335,7 @@ xfs_ialloc_ag_alloc( /* * Insert records describing the new inode chunk into the btree. */ - cur = xfs_btree_init_cursor(args.mp, tp, agbp, agno, - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(args.mp, tp, agbp, agno); for (thisino = newino; thisino < newino + newlen; thisino += XFS_INODES_PER_CHUNK) { @@ -676,8 +675,7 @@ nextag: */ agno = tagno; *IO_agbp = NULL; - cur = xfs_btree_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno), - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, be32_to_cpu(agi->agi_seqno)); /* * If pagino is 0 (this is the root inode allocation) use newino. * This must work because we've just allocated some. @@ -1022,8 +1020,7 @@ xfs_difree( /* * Initialize the cursor. */ - cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, agno); #ifdef DEBUG if (cur->bc_nlevels == 1) { int freecount = 0; @@ -1259,8 +1256,7 @@ xfs_dilocate( #endif /* DEBUG */ return error; } - cur = xfs_btree_init_cursor(mp, tp, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, tp, agbp, agno); if ((error = xfs_inobt_lookup_le(cur, agino, 0, 0, &i))) { #ifdef DEBUG xfs_fs_cmn_err(CE_ALERT, mp, "xfs_dilocate: " Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-14 17:26:11.000000000 +0200 @@ -175,4 +175,8 @@ extern int xfs_inobt_lookup_le(struct xf extern int xfs_inobt_update(struct xfs_btree_cur *cur, xfs_agino_t ino, __int32_t fcnt, xfs_inofree_t free); + +extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, + struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); + #endif /* __XFS_IALLOC_BTREE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-14 17:24:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-14 17:26:11.000000000 +0200 @@ -418,8 +418,7 @@ xfs_bulkstat( /* * Allocate and initialize a btree cursor for ialloc btree. */ - cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, XFS_BTNUM_INO, - (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); irbp = irbuf; irbufend = irbuf + nirbuf; end_of_ag = 0; @@ -844,8 +843,7 @@ xfs_inumbers( agino = 0; continue; } - cur = xfs_btree_init_cursor(mp, NULL, agbp, agno, - XFS_BTNUM_INO, (xfs_inode_t *)0, 0); + cur = xfs_inobt_init_cursor(mp, NULL, agbp, agno); error = xfs_inobt_lookup_ge(cur, agino, 0, 0, &tmp); if (error) { xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); -- From owner-xfs@oss.sgi.com Tue Jul 29 12:28:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:28:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJSlFC031138 for ; Tue, 29 Jul 2008 12:28:52 -0700 X-ASG-Debug-ID: 1217359798-556303bd0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6C6F6ECE20B for ; Tue, 29 Jul 2008 12:29:59 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 5imATotgBnZq9DtT for ; Tue, 29 Jul 2008 12:29:59 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJU0IF019123 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:00 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJU0YG019121 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:00 +0200 Date: Tue, 29 Jul 2008 21:30:00 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 00/21] btree cleanups and unification Subject: [PATCH 00/21] btree cleanups and unification Message-ID: <20080729193000.GA19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359800 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17241 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs This is the full btree unficiation based on Dave's initial patches plus various cleanups. This second versions post now contains the complete btree refactoring, and passes XFSQA. The two first patches from the first round have been merged, so they are not included anymore. In the reposted patches not much has changed, only the readahead helpers have been renamed and the tracing infrastructure has been improved a little. The real news is the missing btree operations, including all the hairy ones. These have been reimplemented looking at the three original btrees and Daves code, in doubt going with the former. That means the small helpers to insert/remove/move records are gone now in favour of following the original code more closely. This fixed the one off error showing up in the intial refactoring. There's a lot of new comments and empty lines, so by diffstat the new code isn't all that much smaller: 36 files changed, 6041 insertions(+), 7128 deletions(-) but the (debug) binary modules is almost 15kb smaller: text data bss dec hex filename 631577 4227 3092 638896 9bfb0 fs/xfs/xfs.ko.old 616929 4435 3124 624488 98768 fs/xfs/xfs.ko.btree I have not run any benchmarks yet to see what the performance impact is, and I still have some ideas to optimize the code. -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJT7UH031298 for ; Tue, 29 Jul 2008 12:29:07 -0700 X-ASG-Debug-ID: 1217359814-5a66003b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 5C0F333F1E1 for ; Tue, 29 Jul 2008 12:30:17 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id vepgEF1feBeJJ0PC for ; Tue, 29 Jul 2008 12:30:17 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUGIF019179 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:17 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUGXu019177 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:16 +0200 Date: Tue, 29 Jul 2008 21:30:16 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 03/21] make btree root in inode support generic Subject: [PATCH 03/21] make btree root in inode support generic Message-ID: <20080729193016.GD19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-generic-inode-root-support User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359820 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17244 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs The bmap btree is rooted in the inode and not in a single disk block. Make the support for this feature more generic by: (a) adding a btree flag to check for instead of the XFS_BTNUM_BMAP type (b) add a get_root_from_inode btree operation to get a btree block from the inode, with the implementation details left to the individual btree. Also clean up xfs_btree_get_block, which is the place these two features are used. The XFS_BTREE_ROOT_IN_INODE is based upon a patch from Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-08 20:05:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-08 20:41:49.000000000 +0200 @@ -2630,8 +2630,19 @@ xfs_bmbt_dup_cursor( return new; } +STATIC struct xfs_btree_block * +xfs_bmbt_get_root_from_inode( + struct xfs_btree_cur *cur) +{ + struct xfs_ifork *ifp; + + ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, cur->bc_private.b.whichfork); + return (struct xfs_btree_block *)ifp->if_broot; +} + static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, + .get_root_from_inode = xfs_bmbt_get_root_from_inode, }; /* @@ -2656,6 +2667,7 @@ xfs_bmbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_bmbt_ops; + cur->bc_flags = XFS_BTREE_ROOT_IN_INODE; cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); cur->bc_private.b.ip = ip; Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-08 20:05:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-08 20:42:43.000000000 +0200 @@ -425,29 +425,20 @@ xfs_btree_dup_cursor( * Retrieve the block pointer from the cursor at the given level. * This may be a bmap btree root or from a buffer. */ -STATIC xfs_btree_block_t * /* generic btree block pointer */ +STATIC struct xfs_btree_block * /* generic btree block pointer */ xfs_btree_get_block( - xfs_btree_cur_t *cur, /* btree cursor */ + struct xfs_btree_cur *cur, /* btree cursor */ int level, /* level in btree */ - xfs_buf_t **bpp) /* buffer containing the block */ + struct xfs_buf **bpp) /* buffer containing the block */ { - xfs_btree_block_t *block; /* return value */ - xfs_buf_t *bp; /* return buffer */ - xfs_ifork_t *ifp; /* inode fork pointer */ - int whichfork; /* data or attr fork */ - - if (cur->bc_btnum == XFS_BTNUM_BMAP && level == cur->bc_nlevels - 1) { - whichfork = cur->bc_private.b.whichfork; - ifp = XFS_IFORK_PTR(cur->bc_private.b.ip, whichfork); - block = (xfs_btree_block_t *)ifp->if_broot; - bp = NULL; - } else { - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_BLOCK(bp); + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) { + *bpp = NULL; + return cur->bc_ops->get_root_from_inode(cur); } - ASSERT(block != NULL); - *bpp = bp; - return block; + + *bpp = cur->bc_bufs[level]; + return XFS_BUF_TO_BLOCK(*bpp); } /* Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-08 20:06:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-08 20:41:49.000000000 +0200 @@ -164,6 +164,9 @@ extern const __uint32_t xfs_magics[]; struct xfs_btree_ops { /* cursor operations */ struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); + + /* get inode rooted btree root */ + struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); }; /* @@ -175,6 +178,7 @@ typedef struct xfs_btree_cur struct xfs_trans *bc_tp; /* transaction we're in, if any */ struct xfs_mount *bc_mp; /* file system mount struct */ const struct xfs_btree_ops *bc_ops; + uint bc_flags; /* btree features - below */ union { xfs_alloc_rec_incore_t a; xfs_bmbt_irec_t b; @@ -206,6 +210,10 @@ typedef struct xfs_btree_cur } bc_private; /* per-btree type data */ } xfs_btree_cur_t; +/* cursor flags */ +#define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ + + #define XFS_BTREE_NOERROR 0 #define XFS_BTREE_ERROR 1 -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:15 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTAeQ031347 for ; Tue, 29 Jul 2008 12:29:10 -0700 X-ASG-Debug-ID: 1217359821-0cd900860000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 08741ECE21B for ; Tue, 29 Jul 2008 12:30:21 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id cNF4xOpmTwDKC3CY for ; Tue, 29 Jul 2008 12:30:21 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUNIF019191 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:23 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUNSd019189 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:23 +0200 Date: Tue, 29 Jul 2008 21:30:23 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 04/21] add a long pointers flag to xfs_btree_cur Subject: [PATCH 04/21] add a long pointers flag to xfs_btree_cur Message-ID: <20080729193023.GE19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-long-flag User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359823 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17245 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Add a flag to the xfs btree cursor when using long (64bit) block pointers instead of checking btnum == XFS_BTNUM_BMAP. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-11 11:13:15.000000000 +0200 @@ -90,7 +90,7 @@ xfs_btree_check_block( int level, /* level of the btree block */ xfs_buf_t *bp) /* buffer containing block, if any */ { - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level, bp); else @@ -500,7 +500,7 @@ xfs_btree_islastblock( block = xfs_btree_get_block(cur, level, &bp); xfs_btree_check_block(cur, block, level, bp); - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) return be64_to_cpu(block->bb_u.l.bb_rightsib) == NULLDFSBNO; else return be32_to_cpu(block->bb_u.s.bb_rightsib) == NULLAGBLOCK; @@ -792,7 +792,7 @@ xfs_btree_setbuf( if (!bp) return; b = XFS_BUF_TO_BLOCK(bp); - if (XFS_BTREE_LONG_PTRS(cur->bc_btnum)) { + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { if (be64_to_cpu(b->bb_u.l.bb_leftsib) == NULLDFSBNO) cur->bc_ra[lev] |= XFS_BTCUR_LEFTRA; if (be64_to_cpu(b->bb_u.l.bb_rightsib) == NULLDFSBNO) Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-11 11:13:15.000000000 +0200 @@ -121,11 +121,6 @@ union xfs_btree_rec { #define XFS_BB_ALL_BITS ((1 << XFS_BB_NUM_BITS) - 1) /* - * Boolean to select which form of xfs_btree_block_t.bb_u to use. - */ -#define XFS_BTREE_LONG_PTRS(btnum) ((btnum) == XFS_BTNUM_BMAP) - -/* * Magic numbers for btree blocks. */ extern const __uint32_t xfs_magics[]; @@ -211,6 +206,7 @@ typedef struct xfs_btree_cur } xfs_btree_cur_t; /* cursor flags */ +#define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:12:37.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-11 11:13:15.000000000 +0200 @@ -2667,7 +2667,7 @@ xfs_bmbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_bmbt_ops; - cur->bc_flags = XFS_BTREE_ROOT_IN_INODE; + cur->bc_flags = XFS_BTREE_LONG_PTRS | XFS_BTREE_ROOT_IN_INODE; cur->bc_private.b.forksize = XFS_IFORK_SIZE(ip, whichfork); cur->bc_private.b.ip = ip; -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:16 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTGJL031464 for ; Tue, 29 Jul 2008 12:29:16 -0700 X-ASG-Debug-ID: 1217359827-0bf702fb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D56721947CC5 for ; Tue, 29 Jul 2008 12:30:27 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id P9SBAxQyHQCQnleo for ; Tue, 29 Jul 2008 12:30:27 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUUIF019203 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:30 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUTFb019201 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:29 +0200 Date: Tue, 29 Jul 2008 21:30:29 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 05/21] refactor xfs_btree_readahead Subject: [PATCH 05/21] refactor xfs_btree_readahead Message-ID: <20080729193029.GF19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-readahead-refactor User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359828 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17246 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Refactor xfs_btree_readahead to make it more readable: (a) remove the inline xfs_btree_readahead wrapper and move all checks out of line into the main routine. (b) factor out helpers for short/long form btrees (c) move check for root in inodes from the callers into xfs_btree_readahead [hch: split out from a big patch and minor cleanups] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-27 13:06:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-28 17:41:41.000000000 +0200 @@ -709,66 +709,85 @@ xfs_btree_reada_bufs( xfs_baread(mp->m_ddev_targp, d, mp->m_bsize * count); } +STATIC int +xfs_btree_readahead_lblock( + struct xfs_btree_cur *cur, + int lr, + struct xfs_btree_lblock *lb) +{ + int rval = 0; + xfs_fsblock_t left = be64_to_cpu(lb->bb_leftsib); + xfs_fsblock_t right = be64_to_cpu(lb->bb_rightsib); + + if ((lr & XFS_BTCUR_LEFTRA) && left != NULLDFSBNO) { + xfs_btree_reada_bufl(cur->bc_mp, left, 1); + rval++; + } + + if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLDFSBNO) { + xfs_btree_reada_bufl(cur->bc_mp, right, 1); + rval++; + } + + return rval; +} + +STATIC int +xfs_btree_readahead_sblock( + struct xfs_btree_cur *cur, + int lr, + struct xfs_btree_sblock *sb) +{ + int rval = 0; + xfs_agblock_t left = be32_to_cpu(sb->bb_leftsib); + xfs_agblock_t right = be32_to_cpu(sb->bb_rightsib); + + + if ((lr & XFS_BTCUR_LEFTRA) && left != NULLAGBLOCK) { + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, + left, 1); + rval++; + } + + if ((lr & XFS_BTCUR_RIGHTRA) && right != NULLAGBLOCK) { + xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, + right, 1); + rval++; + } + + return rval; +} + /* * Read-ahead btree blocks, at the given level. * Bits in lr are set from XFS_BTCUR_{LEFT,RIGHT}RA. */ int -xfs_btree_readahead_core( - xfs_btree_cur_t *cur, /* btree cursor */ +xfs_btree_readahead( + struct xfs_btree_cur *cur, /* btree cursor */ int lev, /* level in btree */ int lr) /* left/right bits */ { - xfs_alloc_block_t *a; - xfs_bmbt_block_t *b; - xfs_inobt_block_t *i; - int rval = 0; + struct xfs_buf *bp; + + /* + * No readahead needed if we are at the root level and the + * btree root is stored in the inode. + */ + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (lev == cur->bc_nlevels - 1)) + return 0; + + if ((cur->bc_ra[lev] | lr) == cur->bc_ra[lev]) + return 0; - ASSERT(cur->bc_bufs[lev] != NULL); cur->bc_ra[lev] |= lr; - switch (cur->bc_btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - a = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be32_to_cpu(a->bb_leftsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(a->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be32_to_cpu(a->bb_rightsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(a->bb_rightsib), 1); - rval++; - } - break; - case XFS_BTNUM_BMAP: - b = XFS_BUF_TO_BMBT_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be64_to_cpu(b->bb_leftsib) != NULLDFSBNO) { - xfs_btree_reada_bufl(cur->bc_mp, be64_to_cpu(b->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be64_to_cpu(b->bb_rightsib) != NULLDFSBNO) { - xfs_btree_reada_bufl(cur->bc_mp, be64_to_cpu(b->bb_rightsib), 1); - rval++; - } - break; - case XFS_BTNUM_INO: - i = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[lev]); - if ((lr & XFS_BTCUR_LEFTRA) && be32_to_cpu(i->bb_leftsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(i->bb_leftsib), 1); - rval++; - } - if ((lr & XFS_BTCUR_RIGHTRA) && be32_to_cpu(i->bb_rightsib) != NULLAGBLOCK) { - xfs_btree_reada_bufs(cur->bc_mp, cur->bc_private.a.agno, - be32_to_cpu(i->bb_rightsib), 1); - rval++; - } - break; - default: - ASSERT(0); - } - return rval; + bp = cur->bc_bufs[lev]; + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + return xfs_btree_readahead_lblock(cur, lr, + XFS_BUF_TO_LBLOCK(bp)); + return xfs_btree_readahead_sblock(cur, lr, XFS_BUF_TO_SBLOCK(bp)); } /* Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-27 13:06:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-28 17:37:23.000000000 +0200 @@ -429,23 +429,10 @@ xfs_btree_reada_bufs( * Bits in lr are set from XFS_BTCUR_{LEFT,RIGHT}RA. */ int /* readahead block count */ -xfs_btree_readahead_core( - xfs_btree_cur_t *cur, /* btree cursor */ - int lev, /* level in btree */ - int lr); /* left/right bits */ - -static inline int /* readahead block count */ xfs_btree_readahead( xfs_btree_cur_t *cur, /* btree cursor */ int lev, /* level in btree */ - int lr) /* left/right bits */ -{ - if ((cur->bc_ra[lev] | lr) == cur->bc_ra[lev]) - return 0; - - return xfs_btree_readahead_core(cur, lev, lr); -} - + int lr); /* left/right bits */ /* * Set the buffer for level "lev" in the cursor to bp, releasing Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-27 13:06:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-28 17:37:21.000000000 +0200 @@ -1721,8 +1721,9 @@ xfs_bmbt_decrement( XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, level); ASSERT(level < cur->bc_nlevels); - if (level < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + + xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + if (--cur->bc_ptrs[level] > 0) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); *stat = 1; @@ -1743,8 +1744,7 @@ xfs_bmbt_decrement( for (lev = level + 1; lev < cur->bc_nlevels; lev++) { if (--cur->bc_ptrs[lev] > 0) break; - if (lev < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); + xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); } if (lev == cur->bc_nlevels) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); @@ -1995,8 +1995,8 @@ xfs_bmbt_increment( XFS_BMBT_TRACE_CURSOR(cur, ENTRY); XFS_BMBT_TRACE_ARGI(cur, level); ASSERT(level < cur->bc_nlevels); - if (level < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); + + xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); block = xfs_bmbt_get_block(cur, level, &bp); #ifdef DEBUG if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { @@ -2024,8 +2024,7 @@ xfs_bmbt_increment( #endif if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) break; - if (lev < cur->bc_nlevels - 1) - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); + xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); } if (lev == cur->bc_nlevels) { XFS_BMBT_TRACE_CURSOR(cur, EXIT); -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:36 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTM59031556 for ; Tue, 29 Jul 2008 12:29:22 -0700 X-ASG-Debug-ID: 1217359832-0cdc00950000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7EEA9ECE21F for ; Tue, 29 Jul 2008 12:30:33 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id JtOqQV0RmepM2dP3 for ; Tue, 29 Jul 2008 12:30:33 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUYIF019217 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:34 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUYqO019215 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:34 +0200 Date: Tue, 29 Jul 2008 21:30:34 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 06/21] refactor btree validation helpers Subject: [PATCH 06/21] refactor btree validation helpers Message-ID: <20080729193034.GG19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-check-refactor User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359834 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17247 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Move the various btree validation helpers around in xfs_btree.c so that they are close to each other and in common #ifdef DEBUG sections. Also add a new xfs_btree_check_ptr helper to check a btree ptr that can be either long or short form. Split out from a bigger patch from Dave Chinner with various small changes applied by me. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-14 18:02:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-14 18:08:27.000000000 +0200 @@ -81,24 +81,6 @@ xfs_btree_maxrecs( #ifdef DEBUG /* - * Debug routine: check that block header is ok. - */ -void -xfs_btree_check_block( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block, /* generic btree block pointer */ - int level, /* level of the btree block */ - xfs_buf_t *bp) /* buffer containing block, if any */ -{ - if (cur->bc_flags & XFS_BTREE_LONG_PTRS) - xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, level, - bp); - else - xfs_btree_check_sblock(cur, (xfs_btree_sblock_t *)block, level, - bp); -} - -/* * Debug routine: check that keys are in the right order. */ void @@ -150,66 +132,8 @@ xfs_btree_check_key( ASSERT(0); } } -#endif /* DEBUG */ /* - * Checking routine: check that long form block header is ok. - */ -/* ARGSUSED */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lblock( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_lblock_t *block, /* btree long form block pointer */ - int level, /* level of the btree block */ - xfs_buf_t *bp) /* buffer for block, if any */ -{ - int lblock_ok; /* block passes checks */ - xfs_mount_t *mp; /* file system mount point */ - - mp = cur->bc_mp; - lblock_ok = - be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && - be16_to_cpu(block->bb_level) == level && - be16_to_cpu(block->bb_numrecs) <= - xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && - block->bb_leftsib && - (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || - XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && - block->bb_rightsib && - (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO || - XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_rightsib))); - if (unlikely(XFS_TEST_ERROR(!lblock_ok, mp, XFS_ERRTAG_BTREE_CHECK_LBLOCK, - XFS_RANDOM_BTREE_CHECK_LBLOCK))) { - if (bp) - xfs_buftrace("LBTREE ERROR", bp); - XFS_ERROR_REPORT("xfs_btree_check_lblock", XFS_ERRLEVEL_LOW, - mp); - return XFS_ERROR(EFSCORRUPTED); - } - return 0; -} - -/* - * Checking routine: check that (long) pointer is ok. - */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lptr( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_dfsbno_t ptr, /* btree block disk address */ - int level) /* btree block level */ -{ - xfs_mount_t *mp; /* file system mount point */ - - mp = cur->bc_mp; - XFS_WANT_CORRUPTED_RETURN( - level > 0 && - ptr != NULLDFSBNO && - XFS_FSB_SANITY_CHECK(mp, ptr)); - return 0; -} - -#ifdef DEBUG -/* * Debug routine: check that records are in the right order. */ void @@ -268,10 +192,39 @@ xfs_btree_check_rec( } #endif /* DEBUG */ -/* - * Checking routine: check that block header is ok. - */ -/* ARGSUSED */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_lblock( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_lblock_t *block, /* btree long form block pointer */ + int level, /* level of the btree block */ + xfs_buf_t *bp) /* buffer for block, if any */ +{ + int lblock_ok; /* block passes checks */ + xfs_mount_t *mp; /* file system mount point */ + + mp = cur->bc_mp; + lblock_ok = + be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && + be16_to_cpu(block->bb_level) == level && + be16_to_cpu(block->bb_numrecs) <= + xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && + block->bb_leftsib && + (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || + XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && + block->bb_rightsib && + (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO || + XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_rightsib))); + if (unlikely(XFS_TEST_ERROR(!lblock_ok, mp, XFS_ERRTAG_BTREE_CHECK_LBLOCK, + XFS_RANDOM_BTREE_CHECK_LBLOCK))) { + if (bp) + xfs_buftrace("LBTREE ERROR", bp); + XFS_ERROR_REPORT("xfs_btree_check_lblock", XFS_ERRLEVEL_LOW, + mp); + return XFS_ERROR(EFSCORRUPTED); + } + return 0; +} + int /* error (0 or EFSCORRUPTED) */ xfs_btree_check_sblock( xfs_btree_cur_t *cur, /* btree cursor */ @@ -311,27 +264,81 @@ xfs_btree_check_sblock( } /* - * Checking routine: check that (short) pointer is ok. + * Debug routine: check that block header is ok. + */ +int +xfs_btree_check_block( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_block_t *block, /* generic btree block pointer */ + int level, /* level of the btree block */ + xfs_buf_t *bp) /* buffer containing block, if any */ +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + return xfs_btree_check_lblock(cur, (xfs_btree_lblock_t *)block, + level, bp); + } + + return xfs_btree_check_sblock(cur, (xfs_btree_sblock_t *)block, + level, bp); +} + +/* + * Check that (long) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sptr( +xfs_btree_check_lptr( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t ptr, /* btree block disk address */ + xfs_dfsbno_t bno, /* btree block disk address */ int level) /* btree block level */ { - xfs_buf_t *agbp; /* buffer for ag. freespace struct */ - xfs_agf_t *agf; /* ag. freespace structure */ + xfs_mount_t *mp; /* file system mount point */ + + mp = cur->bc_mp; + XFS_WANT_CORRUPTED_RETURN( + level > 0 && + bno != NULLDFSBNO && + XFS_FSB_SANITY_CHECK(mp, bno)); + return 0; +} + +/* + * Check that (short) pointer is ok. + */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_sptr( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_agblock_t bno, /* btree block disk address */ + int level) /* btree block level */ +{ + xfs_agblock_t agblocks = cur->bc_mp->m_sb.sb_agblocks; - agbp = cur->bc_private.a.agbp; - agf = XFS_BUF_TO_AGF(agbp); XFS_WANT_CORRUPTED_RETURN( level > 0 && - ptr != NULLAGBLOCK && ptr != 0 && - ptr < be32_to_cpu(agf->agf_length)); + bno != NULLAGBLOCK && + bno != 0 && + bno < agblocks); return 0; } /* + * Check that block ptr is ok. + */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_ptr( + struct xfs_btree_cur *cur, /* btree cursor */ + union xfs_btree_ptr *ptr, /* btree block disk address */ + int index, /* offset from ptr to check */ + int level) /* btree block level */ +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + return xfs_btree_check_lptr(cur, + be64_to_cpu((&ptr->l)[index]), + level); + } + return xfs_btree_check_sptr(cur, be32_to_cpu((&ptr->s)[index]), level); +} + +/* * Delete the btree cursor. */ void Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 18:02:56.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 18:07:55.000000000 +0200 @@ -223,52 +223,38 @@ typedef struct xfs_btree_cur #ifdef __KERNEL__ -#ifdef DEBUG /* - * Debug routine: check that block header is ok. + * Check that long form block header is ok. */ -void -xfs_btree_check_block( +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_lblock( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block, /* generic btree block pointer */ + xfs_btree_lblock_t *block, /* btree long form block pointer */ int level, /* level of the btree block */ struct xfs_buf *bp); /* buffer containing block, if any */ /* - * Debug routine: check that keys are in the right order. - */ -void -xfs_btree_check_key( - xfs_btnum_t btnum, /* btree identifier */ - void *ak1, /* pointer to left (lower) key */ - void *ak2); /* pointer to right (higher) key */ - -/* - * Debug routine: check that records are in the right order. + * Check that short form block header is ok. */ -void -xfs_btree_check_rec( - xfs_btnum_t btnum, /* btree identifier */ - void *ar1, /* pointer to left (lower) record */ - void *ar2); /* pointer to right (higher) record */ -#else -#define xfs_btree_check_block(a,b,c,d) -#define xfs_btree_check_key(a,b,c) -#define xfs_btree_check_rec(a,b,c) -#endif /* DEBUG */ +int /* error (0 or EFSCORRUPTED) */ +xfs_btree_check_sblock( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_btree_sblock_t *block, /* btree short form block pointer */ + int level, /* level of the btree block */ + struct xfs_buf *bp); /* buffer containing block */ /* - * Checking routine: check that long form block header is ok. + * Check that block header is ok. */ -int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_lblock( +int +xfs_btree_check_block( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_lblock_t *block, /* btree long form block pointer */ + xfs_btree_block_t *block, /* generic btree block pointer */ int level, /* level of the btree block */ struct xfs_buf *bp); /* buffer containing block, if any */ /* - * Checking routine: check that (long) pointer is ok. + * Check that (long) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ xfs_btree_check_lptr( @@ -279,25 +265,50 @@ xfs_btree_check_lptr( #define xfs_btree_check_lptr_disk(cur, ptr, level) \ xfs_btree_check_lptr(cur, be64_to_cpu(ptr), level) + /* - * Checking routine: check that short form block header is ok. + * Check that (short) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sblock( +xfs_btree_check_sptr( xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_sblock_t *block, /* btree short form block pointer */ - int level, /* level of the btree block */ - struct xfs_buf *bp); /* buffer containing block */ + xfs_agblock_t ptr, /* btree block disk address */ + int level); /* btree block level */ /* - * Checking routine: check that (short) pointer is ok. + * Check that (short) pointer is ok. */ int /* error (0 or EFSCORRUPTED) */ -xfs_btree_check_sptr( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t ptr, /* btree block disk address */ +xfs_btree_check_ptr( + struct xfs_btree_cur *cur, /* btree cursor */ + union xfs_btree_ptr *ptr, /* btree block disk address */ + int index, /* offset from ptr to check */ int level); /* btree block level */ +#ifdef DEBUG + +/* + * Debug routine: check that keys are in the right order. + */ +void +xfs_btree_check_key( + xfs_btnum_t btnum, /* btree identifier */ + void *ak1, /* pointer to left (lower) key */ + void *ak2); /* pointer to right (higher) key */ + +/* + * Debug routine: check that records are in the right order. + */ +void +xfs_btree_check_rec( + xfs_btnum_t btnum, /* btree identifier */ + void *ar1, /* pointer to left (lower) record */ + void *ar2); /* pointer to right (higher) record */ +#else +#define xfs_btree_check_key(a,b,c) +#define xfs_btree_check_rec(a,b,c) +#endif /* DEBUG */ + /* * Delete the btree cursor. */ -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:27 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTRql031627 for ; Tue, 29 Jul 2008 12:29:27 -0700 X-ASG-Debug-ID: 1217359837-0cdb006c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id DA67AECE226 for ; Tue, 29 Jul 2008 12:30:38 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id UW0BUtiXKyzqVlJV for ; Tue, 29 Jul 2008 12:30:38 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUdIF019229 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Tue, 29 Jul 2008 21:30:39 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUdsw019227; Tue, 29 Jul 2008 21:30:39 +0200 Date: Tue, 29 Jul 2008 21:30:39 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com Cc: Dave Chinner X-ASG-Orig-Subj: [PATCH 07/21] add new btree statistics Subject: [PATCH 07/21] add new btree statistics Message-ID: <20080729193039.GH19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-stats User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359839 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.92 X-Barracuda-Spam-Status: No, SCORE=-0.92 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_SA081 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.10 BSF_SC0_SA081 Custom Rule SA081 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17248 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Introduce statistics coverage of all the btrees and cover all the btree operations, not just some. Invaluable for determining test code coverage of all the btree operations.... Signed-off-by: Dave Chinner Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.c 2008-07-14 17:24:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.c 2008-07-14 17:29:17.000000000 +0200 @@ -53,6 +53,10 @@ xfs_read_xfsstats( { "icluster", XFSSTAT_END_INODE_CLUSTER }, { "vnodes", XFSSTAT_END_VNODE_OPS }, { "buf", XFSSTAT_END_BUF }, + { "abtb2", XFSSTAT_END_ABTB_V2 }, + { "abtc2", XFSSTAT_END_ABTC_V2 }, + { "bmbt2", XFSSTAT_END_BMBT_V2 }, + { "ibt2", XFSSTAT_END_IBT_V2 }, }; /* Loop over all stats groups */ Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_stats.h 2008-07-14 17:24:05.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_stats.h 2008-07-14 17:29:17.000000000 +0200 @@ -118,6 +118,71 @@ struct xfsstats { __uint32_t xb_page_retries; __uint32_t xb_page_found; __uint32_t xb_get_read; +/* Version 2 btree counters */ +#define XFSSTAT_END_ABTB_V2 (XFSSTAT_END_BUF+15) + __uint32_t xs_abtb_2_lookup; + __uint32_t xs_abtb_2_compare; + __uint32_t xs_abtb_2_insrec; + __uint32_t xs_abtb_2_delrec; + __uint32_t xs_abtb_2_newroot; + __uint32_t xs_abtb_2_killroot; + __uint32_t xs_abtb_2_increment; + __uint32_t xs_abtb_2_decrement; + __uint32_t xs_abtb_2_lshift; + __uint32_t xs_abtb_2_rshift; + __uint32_t xs_abtb_2_split; + __uint32_t xs_abtb_2_join; + __uint32_t xs_abtb_2_alloc; + __uint32_t xs_abtb_2_free; + __uint32_t xs_abtb_2_moves; +#define XFSSTAT_END_ABTC_V2 (XFSSTAT_END_ABTB_V2+15) + __uint32_t xs_abtc_2_lookup; + __uint32_t xs_abtc_2_compare; + __uint32_t xs_abtc_2_insrec; + __uint32_t xs_abtc_2_delrec; + __uint32_t xs_abtc_2_newroot; + __uint32_t xs_abtc_2_killroot; + __uint32_t xs_abtc_2_increment; + __uint32_t xs_abtc_2_decrement; + __uint32_t xs_abtc_2_lshift; + __uint32_t xs_abtc_2_rshift; + __uint32_t xs_abtc_2_split; + __uint32_t xs_abtc_2_join; + __uint32_t xs_abtc_2_alloc; + __uint32_t xs_abtc_2_free; + __uint32_t xs_abtc_2_moves; +#define XFSSTAT_END_BMBT_V2 (XFSSTAT_END_ABTC_V2+15) + __uint32_t xs_bmbt_2_lookup; + __uint32_t xs_bmbt_2_compare; + __uint32_t xs_bmbt_2_insrec; + __uint32_t xs_bmbt_2_delrec; + __uint32_t xs_bmbt_2_newroot; + __uint32_t xs_bmbt_2_killroot; + __uint32_t xs_bmbt_2_increment; + __uint32_t xs_bmbt_2_decrement; + __uint32_t xs_bmbt_2_lshift; + __uint32_t xs_bmbt_2_rshift; + __uint32_t xs_bmbt_2_split; + __uint32_t xs_bmbt_2_join; + __uint32_t xs_bmbt_2_alloc; + __uint32_t xs_bmbt_2_free; + __uint32_t xs_bmbt_2_moves; +#define XFSSTAT_END_IBT_V2 (XFSSTAT_END_BMBT_V2+15) + __uint32_t xs_ibt_2_lookup; + __uint32_t xs_ibt_2_compare; + __uint32_t xs_ibt_2_insrec; + __uint32_t xs_ibt_2_delrec; + __uint32_t xs_ibt_2_newroot; + __uint32_t xs_ibt_2_killroot; + __uint32_t xs_ibt_2_increment; + __uint32_t xs_ibt_2_decrement; + __uint32_t xs_ibt_2_lshift; + __uint32_t xs_ibt_2_rshift; + __uint32_t xs_ibt_2_split; + __uint32_t xs_ibt_2_join; + __uint32_t xs_ibt_2_alloc; + __uint32_t xs_ibt_2_free; + __uint32_t xs_ibt_2_moves; /* Extra precision counters */ __uint64_t xs_xstrat_bytes; __uint64_t xs_write_bytes; Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-14 17:28:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-14 17:29:17.000000000 +0200 @@ -126,6 +126,34 @@ union xfs_btree_rec { extern const __uint32_t xfs_magics[]; /* + * Generic stats interface + */ +#define __XFS_BTREE_STATS_INC(type, stat) \ + XFS_STATS_INC(xs_ ## type ## _2_ ## stat) +#define XFS_BTREE_STATS_INC(cur, stat) \ +do { \ + switch (cur->bc_btnum) { \ + case XFS_BTNUM_BNO: __XFS_BTREE_STATS_INC(abtb, stat); break; \ + case XFS_BTNUM_CNT: __XFS_BTREE_STATS_INC(abtc, stat); break; \ + case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_INC(bmbt, stat); break; \ + case XFS_BTNUM_INO: __XFS_BTREE_STATS_INC(ibt, stat); break; \ + case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + } \ +} while (0) + +#define __XFS_BTREE_STATS_ADD(type, stat, val) \ + XFS_STATS_ADD(xs_ ## type ## _2_ ## stat, val) +#define XFS_BTREE_STATS_ADD(cur, stat, val) \ +do { \ + switch (cur->bc_btnum) { \ + case XFS_BTNUM_BNO: __XFS_BTREE_STATS_ADD(abtb, stat, val); break; \ + case XFS_BTNUM_CNT: __XFS_BTREE_STATS_ADD(abtc, stat, val); break; \ + case XFS_BTNUM_BMAP: __XFS_BTREE_STATS_ADD(bmbt, stat, val); break; \ + case XFS_BTNUM_INO: __XFS_BTREE_STATS_ADD(ibt, stat, val); break; \ + case XFS_BTNUM_MAX: ASSERT(0); /* fucking gcc */ ; break; \ + } \ +} while (0) +/* * Maximum and minimum records in a btree block. * Given block size, type prefix, and leaf flag (0 or 1). * The divisor below is equivalent to lf ? (e1) : (e2) but that produces -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTYaH031686 for ; Tue, 29 Jul 2008 12:29:34 -0700 X-ASG-Debug-ID: 1217359842-2d3c034b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3F68B33F1FC for ; Tue, 29 Jul 2008 12:30:43 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id pUYUs8CxWIOMcvMn for ; Tue, 29 Jul 2008 12:30:43 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUiIF019247 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:44 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUiDQ019240 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:44 +0200 Date: Tue, 29 Jul 2008 21:30:44 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 08/21] make btree tracing generic Subject: [PATCH 08/21] make btree tracing generic Message-ID: <20080729193044.GI19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-trace User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359846 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17249 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs make the existing bmap btree tracing generic so that it applies to all btree types. Some fragments lifted from a patch by Dave Chinner. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 16:23:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 16:52:06.000000000 +0200 @@ -190,6 +190,25 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + + /* btree tracing */ +#ifdef XFS_BTREE_TRACE + void (*trace_enter)(struct xfs_btree_cur *, const char *, + char *, int, int, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t, + __psunsigned_t, __psunsigned_t); + void (*trace_cursor)(struct xfs_btree_cur *, __uint32_t *, + __uint64_t *, __uint64_t *); + void (*trace_key)(struct xfs_btree_cur *, + union xfs_btree_key *, __uint64_t *, + __uint64_t *); + void (*trace_record)(struct xfs_btree_cur *, + union xfs_btree_rec *, __uint64_t *, + __uint64_t *, __uint64_t *); +#endif }; /* Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.c 2008-07-29 16:59:40.000000000 +0200 @@ -0,0 +1,247 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#include "xfs.h" +#include "xfs_types.h" +#include "xfs_inum.h" +#include "xfs_bmap_btree.h" +#include "xfs_alloc_btree.h" +#include "xfs_ialloc_btree.h" +#include "xfs_inode.h" +#include "xfs_btree.h" +#include "xfs_btree_trace.h" + +STATIC void +xfs_btree_trace_ptr( + struct xfs_btree_cur *cur, + union xfs_btree_ptr ptr, + __psunsigned_t *high, + __psunsigned_t *low) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __u64 val = be64_to_cpu(ptr.l); + *high = val >> 32; + *low = (int)val; + } else { + *high = 0; + *low = be32_to_cpu(ptr.s); + } +} + +/* + * Add a trace buffer entry for arguments, for a buffer & 1 integer arg. + */ +void +xfs_btree_trace_argbi( + const char *func, + struct xfs_btree_cur *cur, + struct xfs_buf *b, + int i, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGBI, + line, (__psunsigned_t)b, i, 0, 0, 0, 0, 0, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for a buffer & 2 integer args. + */ +void +xfs_btree_trace_argbii( + const char *func, + struct xfs_btree_cur *cur, + struct xfs_buf *b, + int i0, + int i1, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGBII, + line, (__psunsigned_t)b, i0, i1, 0, 0, 0, 0, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for 3 block-length args + * and an integer arg. + */ +void +xfs_btree_trace_argfffi( + const char *func, + struct xfs_btree_cur *cur, + xfs_dfiloff_t o, + xfs_dfsbno_t b, + xfs_dfilblks_t i, + int j, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGFFFI, line, + o >> 32, (int)o, b >> 32, (int)b, + i >> 32, (int)i, (int)j, 0, + 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for one integer arg. + */ +void +xfs_btree_trace_argi( + const char *func, + struct xfs_btree_cur *cur, + int i, + int line) +{ + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGI, + line, i, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, fsblock, key. + */ +void +xfs_btree_trace_argipk( + const char *func, + struct xfs_btree_cur *cur, + int i, + union xfs_btree_ptr ptr, + union xfs_btree_key *key, + int line) +{ + __psunsigned_t high, low; + __uint64_t l0, l1; + + xfs_btree_trace_ptr(cur, ptr, &high, &low); + cur->bc_ops->trace_key(cur, key, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIPK, + line, i, high, low, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, fsblock, rec. + */ +void +xfs_btree_trace_argipr( + const char *func, + struct xfs_btree_cur *cur, + int i, + union xfs_btree_ptr ptr, + union xfs_btree_rec *rec, + int line) +{ + __psunsigned_t high, low; + __uint64_t l0, l1, l2; + + xfs_btree_trace_ptr(cur, ptr, &high, &low); + cur->bc_ops->trace_record(cur, rec, &l0, &l1, &l2); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIPR, + line, i, + high, low, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + l2 >> 32, (int)l2, + 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for int, key. + */ +void +xfs_btree_trace_argik( + const char *func, + struct xfs_btree_cur *cur, + int i, + union xfs_btree_key *key, + int line) +{ + __uint64_t l0, l1; + + cur->bc_ops->trace_key(cur, key, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGIK, + line, i, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + 0, 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for arguments, for record. + */ +void +xfs_btree_trace_argr( + const char *func, + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + int line) +{ + __uint64_t l0, l1, l2; + + cur->bc_ops->trace_record(cur, rec, &l0, &l1, &l2); + cur->bc_ops->trace_enter(cur, func, XBT_ARGS, XFS_BTREE_KTRACE_ARGR, + line, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + l2 >> 32, (int)l2, + 0, 0, 0, 0, 0); +} + +/* + * Add a trace buffer entry for the cursor/operation. + */ +void +xfs_btree_trace_cursor( + const char *func, + struct xfs_btree_cur *cur, + int type, + int line) +{ + __uint32_t s0; + __uint64_t l0, l1; + char *s; + + switch (type) { + case XBT_ARGS: + s = "args"; + break; + case XBT_ENTRY: + s = "entry"; + break; + case XBT_ERROR: + s = "error"; + break; + case XBT_EXIT: + s = "exit"; + break; + default: + s = "unknown"; + break; + } + + cur->bc_ops->trace_cursor(cur, &s0, &l0, &l1); + cur->bc_ops->trace_enter(cur, func, s, XFS_BTREE_KTRACE_CUR, line, + s0, + l0 >> 32, (int)l0, + l1 >> 32, (int)l1, + (__psunsigned_t)cur->bc_bufs[0], + (__psunsigned_t)cur->bc_bufs[1], + (__psunsigned_t)cur->bc_bufs[2], + (__psunsigned_t)cur->bc_bufs[3], + (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], + (cur->bc_ptrs[2] << 16) | cur->bc_ptrs[3]); +} Index: linux-2.6-xfs/fs/xfs/Makefile =================================================================== --- linux-2.6-xfs.orig/fs/xfs/Makefile 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/Makefile 2008-07-29 16:23:24.000000000 +0200 @@ -81,7 +81,8 @@ xfs-y += xfs_alloc.o \ xfs_dmops.o \ xfs_qmops.o -xfs-$(CONFIG_XFS_TRACE) += xfs_dir2_trace.o +xfs-$(CONFIG_XFS_TRACE) += xfs_btree_trace.o \ + xfs_dir2_trace.o # Objects in linux/ xfs-y += $(addprefix $(XFS_LINUX)/, \ Index: linux-2.6-xfs/fs/xfs/xfs.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs.h 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs.h 2008-07-29 16:23:24.000000000 +0200 @@ -30,7 +30,7 @@ #define XFS_ATTR_TRACE 1 #define XFS_BLI_TRACE 1 #define XFS_BMAP_TRACE 1 -#define XFS_BMBT_TRACE 1 +#define XFS_BTREE_TRACE 1 #define XFS_DIR2_TRACE 1 #define XFS_DQUOT_TRACE 1 #define XFS_ILOCK_TRACE 1 Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:57:57.000000000 +0200 @@ -37,16 +37,13 @@ #include "xfs_inode_item.h" #include "xfs_alloc.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_itable.h" #include "xfs_bmap.h" #include "xfs_error.h" #include "xfs_quota.h" -#if defined(XFS_BMBT_TRACE) -ktrace_t *xfs_bmbt_trace_buf; -#endif - /* * Prototypes for internal btree functions. */ @@ -61,245 +58,33 @@ STATIC int xfs_bmbt_split(xfs_btree_cur_ __uint64_t *, xfs_btree_cur_t **, int *); STATIC int xfs_bmbt_updkey(xfs_btree_cur_t *, xfs_bmbt_key_t *, int); - -#if defined(XFS_BMBT_TRACE) - -static char ARGS[] = "args"; -static char ENTRY[] = "entry"; -static char ERROR[] = "error"; #undef EXIT -static char EXIT[] = "exit"; -/* - * Add a trace buffer entry for the arguments given to the routine, - * generic form. - */ -STATIC void -xfs_bmbt_trace_enter( - const char *func, - xfs_btree_cur_t *cur, - char *s, - int type, - int line, - __psunsigned_t a0, - __psunsigned_t a1, - __psunsigned_t a2, - __psunsigned_t a3, - __psunsigned_t a4, - __psunsigned_t a5, - __psunsigned_t a6, - __psunsigned_t a7, - __psunsigned_t a8, - __psunsigned_t a9, - __psunsigned_t a10) -{ - xfs_inode_t *ip; - int whichfork; - - ip = cur->bc_private.b.ip; - whichfork = cur->bc_private.b.whichfork; - ktrace_enter(xfs_bmbt_trace_buf, - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), - (void *)func, (void *)s, (void *)ip, (void *)cur, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)a8, (void *)a9, (void *)a10); - ASSERT(ip->i_btrace); - ktrace_enter(ip->i_btrace, - (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), - (void *)func, (void *)s, (void *)ip, (void *)cur, - (void *)a0, (void *)a1, (void *)a2, (void *)a3, - (void *)a4, (void *)a5, (void *)a6, (void *)a7, - (void *)a8, (void *)a9, (void *)a10); -} -/* - * Add a trace buffer entry for arguments, for a buffer & 1 integer arg. - */ -STATIC void -xfs_bmbt_trace_argbi( - const char *func, - xfs_btree_cur_t *cur, - xfs_buf_t *b, - int i, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGBI, line, - (__psunsigned_t)b, i, 0, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for a buffer & 2 integer args. - */ -STATIC void -xfs_bmbt_trace_argbii( - const char *func, - xfs_btree_cur_t *cur, - xfs_buf_t *b, - int i0, - int i1, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGBII, line, - (__psunsigned_t)b, i0, i1, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for 3 block-length args - * and an integer arg. - */ -STATIC void -xfs_bmbt_trace_argfffi( - const char *func, - xfs_btree_cur_t *cur, - xfs_dfiloff_t o, - xfs_dfsbno_t b, - xfs_dfilblks_t i, - int j, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGFFFI, line, - o >> 32, (int)o, b >> 32, (int)b, - i >> 32, (int)i, (int)j, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for one integer arg. - */ -STATIC void -xfs_bmbt_trace_argi( - const char *func, - xfs_btree_cur_t *cur, - int i, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGI, line, - i, 0, 0, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, fsblock, key. - */ -STATIC void -xfs_bmbt_trace_argifk( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_fsblock_t f, - xfs_dfiloff_t o, - int line) -{ - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFK, line, - i, (xfs_dfsbno_t)f >> 32, (int)f, o >> 32, - (int)o, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, fsblock, rec. - */ -STATIC void -xfs_bmbt_trace_argifr( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_fsblock_t f, - xfs_bmbt_rec_t *r, - int line) -{ - xfs_dfsbno_t b; - xfs_dfilblks_t c; - xfs_dfsbno_t d; - xfs_dfiloff_t o; - xfs_bmbt_irec_t s; - - d = (xfs_dfsbno_t)f; - xfs_bmbt_disk_get_all(r, &s); - o = (xfs_dfiloff_t)s.br_startoff; - b = (xfs_dfsbno_t)s.br_startblock; - c = s.br_blockcount; - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFR, line, - i, d >> 32, (int)d, o >> 32, - (int)o, b >> 32, (int)b, c >> 32, - (int)c, 0, 0); -} - -/* - * Add a trace buffer entry for arguments, for int, key. - */ -STATIC void -xfs_bmbt_trace_argik( - const char *func, - xfs_btree_cur_t *cur, - int i, - xfs_bmbt_key_t *k, - int line) -{ - xfs_dfiloff_t o; - - o = be64_to_cpu(k->br_startoff); - xfs_bmbt_trace_enter(func, cur, ARGS, XFS_BMBT_KTRACE_ARGIFK, line, - i, o >> 32, (int)o, 0, - 0, 0, 0, 0, - 0, 0, 0); -} - -/* - * Add a trace buffer entry for the cursor/operation. - */ -STATIC void -xfs_bmbt_trace_cursor( - const char *func, - xfs_btree_cur_t *cur, - char *s, - int line) -{ - xfs_bmbt_rec_host_t r; - - xfs_bmbt_set_all(&r, &cur->bc_rec.b); - xfs_bmbt_trace_enter(func, cur, s, XFS_BMBT_KTRACE_CUR, line, - (cur->bc_nlevels << 24) | (cur->bc_private.b.flags << 16) | - cur->bc_private.b.allocated, - r.l0 >> 32, (int)r.l0, - r.l1 >> 32, (int)r.l1, - (unsigned long)cur->bc_bufs[0], (unsigned long)cur->bc_bufs[1], - (unsigned long)cur->bc_bufs[2], (unsigned long)cur->bc_bufs[3], - (cur->bc_ptrs[0] << 16) | cur->bc_ptrs[1], - (cur->bc_ptrs[2] << 16) | cur->bc_ptrs[3]); -} - -#define XFS_BMBT_TRACE_ARGBI(c,b,i) \ - xfs_bmbt_trace_argbi(__func__, c, b, i, __LINE__) -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ - xfs_bmbt_trace_argbii(__func__, c, b, i, j, __LINE__) -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ - xfs_bmbt_trace_argfffi(__func__, c, o, b, i, j, __LINE__) -#define XFS_BMBT_TRACE_ARGI(c,i) \ - xfs_bmbt_trace_argi(__func__, c, i, __LINE__) -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ - xfs_bmbt_trace_argifk(__func__, c, i, f, s, __LINE__) -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ - xfs_bmbt_trace_argifr(__func__, c, i, f, r, __LINE__) -#define XFS_BMBT_TRACE_ARGIK(c,i,k) \ - xfs_bmbt_trace_argik(__func__, c, i, k, __LINE__) -#define XFS_BMBT_TRACE_CURSOR(c,s) \ - xfs_bmbt_trace_cursor(__func__, c, s, __LINE__) -#else -#define XFS_BMBT_TRACE_ARGBI(c,b,i) -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) -#define XFS_BMBT_TRACE_ARGI(c,i) -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) -#define XFS_BMBT_TRACE_ARGIK(c,i,k) -#define XFS_BMBT_TRACE_CURSOR(c,s) -#endif /* XFS_BMBT_TRACE */ +#define ENTRY XBT_ENTRY +#define ERROR XBT_ERROR +#define EXIT XBT_EXIT + +/* + * Keep the XFS_BMBT_TRACE_ names around for now until all code using them + * is converted to be generic and thus switches to the XFS_BTREE_TRACE_ names. + */ +#define XFS_BMBT_TRACE_ARGBI(c,b,i) \ + XFS_BTREE_TRACE_ARGBI(c,b,i) +#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ + XFS_BTREE_TRACE_ARGBII(c,b,i,j) +#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ + XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) +#define XFS_BMBT_TRACE_ARGI(c,i) \ + XFS_BTREE_TRACE_ARGI(c,i) +#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ + XFS_BTREE_TRACE_ARGIPK(c,i,(union xfs_btree_ptr)f,s) +#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ + XFS_BTREE_TRACE_ARGIPR(c,i, \ + (union xfs_btree_ptr)f, (union xfs_btree_rec *)r) +#define XFS_BMBT_TRACE_ARGIK(c,i,k) \ + XFS_BTREE_TRACE_ARGIK(c,i,(union xfs_btree_key *)k) +#define XFS_BMBT_TRACE_CURSOR(c,s) \ + XFS_BTREE_TRACE_CURSOR(c,s) /* @@ -1485,7 +1270,8 @@ xfs_bmbt_split( xfs_bmbt_rec_t *rrp; /* right record pointer */ XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGIFK(cur, level, *bnop, *startoff); + // disable until merged into common code +// XFS_BMBT_TRACE_ARGIFK(cur, level, *bnop, *startoff); args.tp = cur->bc_tp; args.mp = cur->bc_mp; lbp = cur->bc_bufs[level]; @@ -2639,9 +2425,102 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_bmbt_trace_buf; + +STATIC void +xfs_bmbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + struct xfs_inode *ip = cur->bc_private.b.ip; + int whichfork = cur->bc_private.b.whichfork; + + ktrace_enter(xfs_bmbt_trace_buf, + (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), + (void *)func, (void *)s, (void *)ip, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); + ktrace_enter(ip->i_btrace, + (void *)((__psint_t)type | (whichfork << 8) | (line << 16)), + (void *)func, (void *)s, (void *)ip, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_bmbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + struct xfs_bmbt_rec_host r; + + xfs_bmbt_set_all(&r, &cur->bc_rec.b); + + *s0 = (cur->bc_nlevels << 24) | + (cur->bc_private.b.flags << 16) | + cur->bc_private.b.allocated; + *l0 = r.l0; + *l1 = r.l1; +} + +STATIC void +xfs_bmbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be64_to_cpu(key->bmbt.br_startoff); + *l1 = 0; +} + +STATIC void +xfs_bmbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + struct xfs_bmbt_irec irec; + + xfs_bmbt_disk_get_all(&rec->bmbt, &irec); + *l0 = irec.br_startoff; + *l1 = irec.br_startblock; + *l2 = irec.br_blockcount; +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_bmbt_trace_enter, + .trace_cursor = xfs_bmbt_trace_cursor, + .trace_key = xfs_bmbt_trace_key, + .trace_record = xfs_bmbt_trace_record, +#endif }; /* Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c 2008-07-29 16:23:24.000000000 +0200 @@ -39,6 +39,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" #include "xfs_rtalloc.h" @@ -97,7 +98,9 @@ EXPORT_SYMBOL(xfs_alloc_trace_buf); #ifdef XFS_BMAP_TRACE EXPORT_SYMBOL(xfs_bmap_trace_buf); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE +EXPORT_SYMBOL(xfs_allocbt_trace_buf); +EXPORT_SYMBOL(xfs_inobt_trace_buf); EXPORT_SYMBOL(xfs_bmbt_trace_buf); #endif #ifdef XFS_ATTR_TRACE Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_super.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_super.c 2008-07-29 16:23:24.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" #include "xfs_rtalloc.h" @@ -1744,10 +1745,18 @@ xfs_alloc_trace_bufs(void) if (!xfs_bmap_trace_buf) goto out_free_alloc_trace; #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE + xfs_allocbt_trace_buf = ktrace_alloc(XFS_ALLOCBT_TRACE_SIZE, KM_MAYFAIL); + if (!xfs_allocbt_trace_buf) + goto out_free_bmap_trace; + + xfs_inobt_trace_buf = ktrace_alloc(XFS_INOBT_TRACE_SIZE, KM_MAYFAIL); + if (!xfs_inobt_trace_buf) + goto out_free_allocbt_trace; + xfs_bmbt_trace_buf = ktrace_alloc(XFS_BMBT_TRACE_SIZE, KM_MAYFAIL); if (!xfs_bmbt_trace_buf) - goto out_free_bmap_trace; + goto out_free_inobt_trace; #endif #ifdef XFS_ATTR_TRACE xfs_attr_trace_buf = ktrace_alloc(XFS_ATTR_TRACE_SIZE, KM_MAYFAIL); @@ -1769,8 +1778,12 @@ xfs_alloc_trace_bufs(void) ktrace_free(xfs_attr_trace_buf); out_free_bmbt_trace: #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(xfs_bmbt_trace_buf); + out_free_inobt_trace: + ktrace_free(xfs_inobt_trace_buf); + out_free_allocbt_trace: + ktrace_free(xfs_allocbt_trace_buf); out_free_bmap_trace: #endif #ifdef XFS_BMAP_TRACE @@ -1793,8 +1806,10 @@ xfs_free_trace_bufs(void) #ifdef XFS_ATTR_TRACE ktrace_free(xfs_attr_trace_buf); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(xfs_bmbt_trace_buf); + ktrace_free(xfs_inobt_trace_buf); + ktrace_free(xfs_allocbt_trace_buf); #endif #ifdef XFS_BMAP_TRACE ktrace_free(xfs_bmap_trace_buf); Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-29 16:52:06.000000000 +0200 @@ -233,24 +233,6 @@ typedef struct xfs_btree_lblock xfs_bmbt #ifdef __KERNEL__ -#if defined(XFS_BMBT_TRACE) -/* - * Trace buffer entry types. - */ -#define XFS_BMBT_KTRACE_ARGBI 1 -#define XFS_BMBT_KTRACE_ARGBII 2 -#define XFS_BMBT_KTRACE_ARGFFFI 3 -#define XFS_BMBT_KTRACE_ARGI 4 -#define XFS_BMBT_KTRACE_ARGIFK 5 -#define XFS_BMBT_KTRACE_ARGIFR 6 -#define XFS_BMBT_KTRACE_ARGIK 7 -#define XFS_BMBT_KTRACE_CUR 8 - -#define XFS_BMBT_TRACE_SIZE 4096 /* size of global trace buffer */ -#define XFS_BMBT_KTRACE_SIZE 32 /* size of per-inode trace buffer */ -extern ktrace_t *xfs_bmbt_trace_buf; -#endif - /* * Prototypes for xfs_bmap.c to call. */ Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.c 2008-07-29 16:23:24.000000000 +0200 @@ -41,6 +41,7 @@ #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_alloc.h" #include "xfs_ialloc.h" #include "xfs_bmap.h" @@ -841,7 +842,7 @@ xfs_iread( #ifdef XFS_BMAP_TRACE ip->i_xtrace = ktrace_alloc(XFS_BMAP_KTRACE_SIZE, KM_SLEEP); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ip->i_btrace = ktrace_alloc(XFS_BMBT_KTRACE_SIZE, KM_SLEEP); #endif #ifdef XFS_RW_TRACE @@ -2600,7 +2601,7 @@ xfs_idestroy( #ifdef XFS_BMAP_TRACE ktrace_free(ip->i_xtrace); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE ktrace_free(ip->i_btrace); #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfs_inode.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.h 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_inode.h 2008-07-29 16:23:24.000000000 +0200 @@ -251,7 +251,7 @@ typedef struct xfs_inode { #ifdef XFS_BMAP_TRACE struct ktrace *i_xtrace; /* inode extent list trace */ #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE struct ktrace *i_btrace; /* inode bmap btree trace */ #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfsidbg.c 2008-07-29 16:59:55.000000000 +0200 @@ -45,6 +45,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_buf_item.h" #include "xfs_inode_item.h" #include "xfs_extfree_item.h" @@ -88,7 +89,7 @@ static void xfsidbg_xattrtrace(int); static void xfsidbg_xblitrace(xfs_buf_log_item_t *); #endif #ifdef XFS_BMAP_TRACE -static void xfsidbg_xbmatrace(int); +static void xfsidbg_xbtatrace(int, struct ktrace *, int); static void xfsidbg_xbmitrace(xfs_inode_t *); static void xfsidbg_xbmstrace(xfs_inode_t *); static void xfsidbg_xbxatrace(int); @@ -133,7 +134,7 @@ static void xfsidbg_xattrleaf(xfs_attr_l static void xfsidbg_xattrsf(xfs_attr_shortform_t *); static void xfsidbg_xbirec(xfs_bmbt_irec_t *r); static void xfsidbg_xbmalla(xfs_bmalloca_t *); -static void xfsidbg_xbrec(xfs_bmbt_rec_host_t *); +static void xfsidbg_xbmbtrec(xfs_bmbt_rec_host_t *); static void xfsidbg_xbroot(xfs_inode_t *); static void xfsidbg_xbroota(xfs_inode_t *); static void xfsidbg_xbtcur(xfs_btree_cur_t *); @@ -198,9 +199,6 @@ static int xfs_attr_trace_entry(ktrace_e #ifdef XFS_BMAP_TRACE static int xfs_bmap_trace_entry(ktrace_entry_t *ktep); #endif -#ifdef XFS_BMAP_TRACE -static int xfs_bmbt_trace_entry(ktrace_entry_t *ktep); -#endif #ifdef XFS_DIR2_TRACE static int xfs_dir2_trace_entry(ktrace_entry_t *ktep); #endif @@ -421,10 +419,52 @@ static int kdbm_xfs_xbmatrace( if (diag) return diag; - xfsidbg_xbmatrace((int) addr); + xfsidbg_xbtatrace(XFS_BTNUM_BMAP, xfs_bmbt_trace_buf, (int)addr); return 0; } +static int kdbm_xfs_xbtaatrace( + int argc, + const char **argv) +{ + unsigned long addr; + int nextarg = 1; + long offset = 0; + int diag; + + if (argc != 1) + return KDB_ARGCOUNT; + + diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); + if (diag) + return diag; + + /* also contains XFS_BTNUM_CNT */ + xfsidbg_xbtatrace(XFS_BTNUM_BNO, xfs_allocbt_trace_buf, (int)addr); + return 0; +} + +static int kdbm_xfs_xbtiatrace( + int argc, + const char **argv) +{ + unsigned long addr; + int nextarg = 1; + long offset = 0; + int diag; + + if (argc != 1) + return KDB_ARGCOUNT; + + diag = kdbgetaddrarg(argc, argv, &nextarg, &addr, &offset, NULL); + if (diag) + return diag; + + xfsidbg_xbtatrace(XFS_BTNUM_INO, xfs_inobt_trace_buf, (int)addr); + return 0; +} + + static int kdbm_xfs_xbmitrace( int argc, const char **argv) @@ -902,7 +942,7 @@ static int kdbm_xfs_xbrec( if (diag) return diag; - xfsidbg_xbrec((xfs_bmbt_rec_host_t *) addr); + xfsidbg_xbmbtrec((xfs_bmbt_rec_host_t *) addr); return 0; } @@ -2273,6 +2313,10 @@ static struct xif xfsidbg_funcs[] = { "Dump XFS bmap btree per-inode trace" }, { "xbmstrc", kdbm_xfs_xbmstrace, "", "Dump XFS bmap btree inode trace" }, + { "xbtaatrc", kdbm_xfs_xbtaatrace, "", + "Dump XFS alloc btree count trace" }, + { "xbtiatrc", kdbm_xfs_xbtiatrace, "", + "Dump XFS inobt btree count trace" }, #endif { "xbrec", kdbm_xfs_xbrec, "", "Dump XFS bmap record"}, @@ -2706,16 +2750,115 @@ xfs_bmap_trace_entry(ktrace_entry_t *kte return 1; } +static void +xfsidb_btree_trace_record( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3, + unsigned long l4, + unsigned long l5) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + { + struct xfs_bmbt_irec s; + + s.br_startoff = ((xfs_dfiloff_t)l0 << 32) | (xfs_dfiloff_t)l1; + s.br_startblock = ((xfs_dfsbno_t)l2 << 32) | (xfs_dfsbno_t)l3; + s.br_blockcount = ((xfs_dfilblks_t)l4 << 32) | (xfs_dfilblks_t)l5; + + xfsidbg_xbirec(&s); + break; + } + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" startblock = %d, blockcount = %d\n", + (unsigned int)l0, (unsigned int)l2); + break; + case XFS_BTNUM_INO: + qprintf(" startino = %d, freecount = %d, free = %lld\n", + (unsigned int)l0, (unsigned int)l2, + ((xfs_inofree_t)l4 << 32) | (xfs_inofree_t)l5); + break; + default: + break; + } +} + +static void +xfsidb_btree_trace_key( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + qprintf(" startoff 0x%x%08x\n", (unsigned int)l0, (unsigned int)l1); + break; + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" startblock %d blockcount %d\n", + (unsigned int)l0, (unsigned int)l3); + break; + case XFS_BTNUM_INO: + qprintf(" startino %d\n", (unsigned int)l0); + break; + default: + break; + } +} + +static void +xfsidb_btree_trace_cursor( + int btnum, + unsigned long l0, + unsigned long l1, + unsigned long l2, + unsigned long l3, + unsigned long l4) +{ + switch (btnum) { + case XFS_BTNUM_BMAP: + { + struct xfs_bmbt_rec_host r; + + qprintf(" nlevels %ld flags %ld allocated %ld ", + (l0 >> 24) & 0xff, (l0 >> 16) & 0xff, l0 & 0xffff); + + r.l0 = (unsigned long long)l1 << 32 | l2; + r.l1 = (unsigned long long)l3 << 32 | l4; + + xfsidbg_xbmbtrec(&r); + break; + } + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + qprintf(" agno %d startblock %d blockcount %d\n", + (unsigned int)l0, (unsigned int)l1, (unsigned int)l3); + break; + case XFS_BTNUM_INO: + qprintf(" agno %d startino %d free %lld\n", + (unsigned int)l0, (unsigned int)l1, + ((xfs_inofree_t)l3 << 32) | (xfs_inofree_t)l4); + break; + default: + break; + } +} + /* * Print xfs bmap btree trace buffer entry. */ static int -xfs_bmbt_trace_entry( - ktrace_entry_t *ktep) +xfs_btree_trace_entry( + int btnum, + ktrace_entry_t *ktep) { int line; - xfs_bmbt_rec_host_t r; - xfs_bmbt_irec_t s; int type; int whichfork; @@ -2732,18 +2875,18 @@ xfs_bmbt_trace_entry( "da"[whichfork], (xfs_btree_cur_t *)ktep->val[4]); switch (type) { - case XFS_BMBT_KTRACE_ARGBI: + case XFS_BTREE_KTRACE_ARGBI: qprintf(" buf 0x%p i %ld\n", (xfs_buf_t *)ktep->val[5], (long)ktep->val[6]); break; - case XFS_BMBT_KTRACE_ARGBII: + case XFS_BTREE_KTRACE_ARGBII: qprintf(" buf 0x%p i0 %ld i1 %ld\n", (xfs_buf_t *)ktep->val[5], (long)ktep->val[6], (long)ktep->val[7]); break; - case XFS_BMBT_KTRACE_ARGFFFI: + case XFS_BTREE_KTRACE_ARGFFFI: qprintf(" o 0x%x%08x b 0x%x%08x i 0x%x%08x j %ld\n", (unsigned int)(long)ktep->val[5], (unsigned int)(long)ktep->val[6], @@ -2753,11 +2896,11 @@ xfs_bmbt_trace_entry( (unsigned int)(long)ktep->val[10], (long)ktep->val[11]); break; - case XFS_BMBT_KTRACE_ARGI: + case XFS_BTREE_KTRACE_ARGI: qprintf(" i 0x%lx\n", (long)ktep->val[5]); break; - case XFS_BMBT_KTRACE_ARGIFK: + case XFS_BTREE_KTRACE_ARGIPK: qprintf(" i 0x%lx f 0x%x%08x o 0x%x%08x\n", (long)ktep->val[5], (unsigned int)(long)ktep->val[6], @@ -2765,39 +2908,45 @@ xfs_bmbt_trace_entry( (unsigned int)(long)ktep->val[8], (unsigned int)(long)ktep->val[9]); break; - case XFS_BMBT_KTRACE_ARGIFR: + case XFS_BTREE_KTRACE_ARGIPR: qprintf(" i 0x%lx f 0x%x%08x ", (long)ktep->val[5], (unsigned int)(long)ktep->val[6], (unsigned int)(long)ktep->val[7]); - s.br_startoff = (xfs_fileoff_t) - (((xfs_dfiloff_t)(unsigned long)ktep->val[8] << 32) | - (xfs_dfiloff_t)(unsigned long)ktep->val[9]); - s.br_startblock = (xfs_fsblock_t) - (((xfs_dfsbno_t)(unsigned long)ktep->val[10] << 32) | - (xfs_dfsbno_t)(unsigned long)ktep->val[11]); - s.br_blockcount = (xfs_filblks_t) - (((xfs_dfilblks_t)(unsigned long)ktep->val[12] << 32) | - (xfs_dfilblks_t)(unsigned long)ktep->val[13]); - xfsidbg_xbirec(&s); - break; - case XFS_BMBT_KTRACE_ARGIK: - qprintf(" i 0x%lx o 0x%x%08x\n", - (long)ktep->val[5], - (unsigned int)(long)ktep->val[6], - (unsigned int)(long)ktep->val[7]); - break; - case XFS_BMBT_KTRACE_CUR: - qprintf(" nlevels %ld flags %ld allocated %ld ", - ((long)ktep->val[5] >> 24) & 0xff, - ((long)ktep->val[5] >> 16) & 0xff, - (long)ktep->val[5] & 0xffff); - r.l0 = (unsigned long long)(unsigned long)ktep->val[6] << 32 | - (unsigned long)ktep->val[7]; - r.l1 = (unsigned long long)(unsigned long)ktep->val[8] << 32 | - (unsigned long)ktep->val[9]; + xfsidb_btree_trace_record(btnum, + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9], + (unsigned long)ktep->val[10], + (unsigned long)ktep->val[11], + (unsigned long)ktep->val[12], + (unsigned long)ktep->val[13]); + break; + case XFS_BTREE_KTRACE_ARGIK: + qprintf(" i 0x%lx\n", (long)ktep->val[5]); + xfsidb_btree_trace_key(btnum, + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9]); + break; + case XFS_BTREE_KTRACE_ARGR: + xfsidb_btree_trace_record(btnum, + (unsigned long)ktep->val[5], + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9], + (unsigned long)ktep->val[10]); + break; + case XFS_BTREE_KTRACE_CUR: + + xfsidb_btree_trace_cursor(btnum, + (unsigned long)ktep->val[5], + (unsigned long)ktep->val[6], + (unsigned long)ktep->val[7], + (unsigned long)ktep->val[8], + (unsigned long)ktep->val[9]); - xfsidbg_xbrec(&r); qprintf(" bufs 0x%p 0x%p 0x%p 0x%p ", (xfs_buf_t *)ktep->val[10], (xfs_buf_t *)ktep->val[11], @@ -4383,21 +4532,21 @@ xfsidbg_xbmalla(xfs_bmalloca_t *a) #ifdef XFS_BMAP_TRACE /* - * Print out the last "count" entries in the bmap btree trace buffer. + * Print out the last "count" entries in a btree trace buffer. * The "a" is for "all" inodes. */ static void -xfsidbg_xbmatrace(int count) +xfsidbg_xbtatrace(int btnum, struct ktrace *trace_buf, int count) { ktrace_entry_t *ktep; ktrace_snap_t kts; int nentries; int skip_entries; - if (xfs_bmbt_trace_buf == NULL) { + if (trace_buf == NULL) { qprintf("The xfs bmap btree trace buffer is not initialized\n"); return; } - nentries = ktrace_nentries(xfs_bmbt_trace_buf); + nentries = ktrace_nentries(trace_buf); if (count == -1) { count = nentries; } @@ -4406,23 +4555,23 @@ xfsidbg_xbmatrace(int count) return; } - ktep = ktrace_first(xfs_bmbt_trace_buf, &kts); + ktep = ktrace_first(trace_buf, &kts); if (count != nentries) { /* * Skip the total minus the number to look at minus one * for the entry returned by ktrace_first(). */ skip_entries = nentries - count - 1; - ktep = ktrace_skip(xfs_bmbt_trace_buf, skip_entries, &kts); + ktep = ktrace_skip(trace_buf, skip_entries, &kts); if (ktep == NULL) { qprintf("Skipped them all\n"); return; } } while (ktep != NULL) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(btnum, ktep)) qprintf("\n"); - ktep = ktrace_next(xfs_bmbt_trace_buf, &kts); + ktep = ktrace_next(trace_buf, &kts); } } @@ -4442,7 +4591,7 @@ xfsidbg_xbmitrace(xfs_inode_t *ip) ktep = ktrace_first(ip->i_btrace, &kts); while (ktep != NULL) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(XFS_BTNUM_BMAP, ktep)) qprintf("\n"); ktep = ktrace_next(ip->i_btrace, &kts); } @@ -4465,7 +4614,7 @@ xfsidbg_xbmstrace(xfs_inode_t *ip) ktep = ktrace_first(xfs_bmbt_trace_buf, &kts); while (ktep != NULL) { if ((xfs_inode_t *)(ktep->val[2]) == ip) { - if (xfs_bmbt_trace_entry(ktep)) + if (xfs_btree_trace_entry(XFS_BTNUM_BMAP, ktep)) qprintf("\n"); } ktep = ktrace_next(xfs_bmbt_trace_buf, &kts); @@ -4477,7 +4626,7 @@ xfsidbg_xbmstrace(xfs_inode_t *ip) * Print xfs bmap record */ static void -xfsidbg_xbrec(xfs_bmbt_rec_host_t *r) +xfsidbg_xbmbtrec(xfs_bmbt_rec_host_t *r) { xfs_bmbt_irec_t irec; @@ -6398,7 +6547,7 @@ xfsidbg_xnode(xfs_inode_t *ip) #ifdef XFS_BMAP_TRACE qprintf(" bmap_trace 0x%p\n", ip->i_xtrace); #endif -#ifdef XFS_BMBT_TRACE +#ifdef XFS_BTREE_TRACE qprintf(" bmbt trace 0x%p\n", ip->i_btrace); #endif #ifdef XFS_RW_TRACE Index: linux-2.6-xfs/fs/xfs/xfs_btree_trace.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux-2.6-xfs/fs/xfs/xfs_btree_trace.h 2008-07-29 16:53:44.000000000 +0200 @@ -0,0 +1,116 @@ +/* + * Copyright (c) 2008 Silicon Graphics, Inc. + * All Rights Reserved. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it would be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ +#ifndef __XFS_BTREE_TRACE_H__ +#define __XFS_BTREE_TRACE_H__ + +struct xfs_btree_cur; +struct xfs_buf; + + +/* + * Trace hooks. + * i,j = integer (32 bit) + * b = btree block buffer (xfs_buf_t) + * p = btree ptr + * r = btree record + * k = btree key + */ + +#ifdef XFS_BTREE_TRACE + +/* + * Trace buffer entry types. + */ +#define XFS_BTREE_KTRACE_ARGBI 1 +#define XFS_BTREE_KTRACE_ARGBII 2 +#define XFS_BTREE_KTRACE_ARGFFFI 3 +#define XFS_BTREE_KTRACE_ARGI 4 +#define XFS_BTREE_KTRACE_ARGIPK 5 +#define XFS_BTREE_KTRACE_ARGIPR 6 +#define XFS_BTREE_KTRACE_ARGIK 7 +#define XFS_BTREE_KTRACE_ARGR 8 +#define XFS_BTREE_KTRACE_CUR 9 + +/* + * Sub-types for cursor traces. + */ +#define XBT_ARGS 0 +#define XBT_ENTRY 1 +#define XBT_ERROR 2 +#define XBT_EXIT 3 + +void xfs_btree_trace_argbi(const char *, struct xfs_btree_cur *, + struct xfs_buf *, int, int); +void xfs_btree_trace_argbii(const char *, struct xfs_btree_cur *, + struct xfs_buf *, int, int, int); +void xfs_btree_trace_argfffi(const char *, struct xfs_btree_cur *, + xfs_dfiloff_t, xfs_dfsbno_t, xfs_dfilblks_t, int, int); +void xfs_btree_trace_argi(const char *, struct xfs_btree_cur *, int, int); +void xfs_btree_trace_argipk(const char *, struct xfs_btree_cur *, int, + union xfs_btree_ptr, union xfs_btree_key *, int); +void xfs_btree_trace_argipr(const char *, struct xfs_btree_cur *, int, + union xfs_btree_ptr, union xfs_btree_rec *, int); +void xfs_btree_trace_argik(const char *, struct xfs_btree_cur *, int, + union xfs_btree_key *, int); +void xfs_btree_trace_argr(const char *, struct xfs_btree_cur *, + union xfs_btree_rec *, int); +void xfs_btree_trace_cursor(const char *, struct xfs_btree_cur *, int, int); + + +#define XFS_ALLOCBT_TRACE_SIZE 4096 /* size of global trace buffer */ +extern ktrace_t *xfs_allocbt_trace_buf; + +#define XFS_INOBT_TRACE_SIZE 4096 /* size of global trace buffer */ +extern ktrace_t *xfs_inobt_trace_buf; + +#define XFS_BMBT_TRACE_SIZE 4096 /* size of global trace buffer */ +#define XFS_BMBT_KTRACE_SIZE 32 /* size of per-inode trace buffer */ +extern ktrace_t *xfs_bmbt_trace_buf; + + +#define XFS_BTREE_TRACE_ARGBI(c,b,i) \ + xfs_btree_trace_argbi(__func__, c, b, i, __LINE__) +#define XFS_BTREE_TRACE_ARGBII(c,b,i,j) \ + xfs_btree_trace_argbii(__func__, c, b, i, j, __LINE__) +#define XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) \ + xfs_btree_trace_argfffi(__func__, c, o, b, i, j, __LINE__) +#define XFS_BTREE_TRACE_ARGI(c,i) \ + xfs_btree_trace_argi(__func__, c, i, __LINE__) +#define XFS_BTREE_TRACE_ARGIPK(c,i,p,k) \ + xfs_btree_trace_argipk(__func__, c, i, p, k, __LINE__) +#define XFS_BTREE_TRACE_ARGIPR(c,i,p,r) \ + xfs_btree_trace_argipr(__func__, c, i, p, r, __LINE__) +#define XFS_BTREE_TRACE_ARGIK(c,i,k) \ + xfs_btree_trace_argik(__func__, c, i, k, __LINE__) +#define XFS_BTREE_TRACE_ARGR(c,r) \ + xfs_btree_trace_argr(__func__, c, r, __LINE__) +#define XFS_BTREE_TRACE_CURSOR(c,t) \ + xfs_btree_trace_cursor(__func__, c, t, __LINE__) +#else +#define XFS_BTREE_TRACE_ARGBI(c,b,i) +#define XFS_BTREE_TRACE_ARGBII(c,b,i,j) +#define XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) +#define XFS_BTREE_TRACE_ARGI(c,i) +#define XFS_BTREE_TRACE_ARGIPK(c,i,p,s) +#define XFS_BTREE_TRACE_ARGIPR(c,i,p,r) +#define XFS_BTREE_TRACE_ARGIK(c,i,k) +#define XFS_BTREE_TRACE_ARGR(c,r) +#define XFS_BTREE_TRACE_CURSOR(c,t) +#endif /* XFS_BTREE_TRACE */ + +#endif /* __XFS_BTREE_TRACE_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:52:06.000000000 +0200 @@ -2219,8 +2219,82 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_allocbt_trace_buf; + +STATIC void +xfs_allocbt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + ktrace_enter(xfs_allocbt_trace_buf, (void *)(__psint_t)type, + (void *)func, (void *)s, NULL, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_allocbt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.a.ar_startblock; + *l1 = cur->bc_rec.a.ar_blockcount; +} + +STATIC void +xfs_allocbt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->alloc.ar_startblock); + *l1 = be32_to_cpu(key->alloc.ar_blockcount); +} + +STATIC void +xfs_allocbt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(rec->alloc.ar_startblock); + *l1 = be32_to_cpu(rec->alloc.ar_blockcount); + *l2 = 0; +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_allocbt_trace_enter, + .trace_cursor = xfs_allocbt_trace_cursor, + .trace_key = xfs_allocbt_trace_key, + .trace_record = xfs_allocbt_trace_record, +#endif }; /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:23:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:52:06.000000000 +0200 @@ -2085,8 +2085,82 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +#ifdef XFS_BTREE_TRACE + +ktrace_t *xfs_inobt_trace_buf; + +STATIC void +xfs_inobt_trace_enter( + struct xfs_btree_cur *cur, + const char *func, + char *s, + int type, + int line, + __psunsigned_t a0, + __psunsigned_t a1, + __psunsigned_t a2, + __psunsigned_t a3, + __psunsigned_t a4, + __psunsigned_t a5, + __psunsigned_t a6, + __psunsigned_t a7, + __psunsigned_t a8, + __psunsigned_t a9, + __psunsigned_t a10) +{ + ktrace_enter(xfs_inobt_trace_buf, (void *)(__psint_t)type, + (void *)func, (void *)s, NULL, (void *)cur, + (void *)a0, (void *)a1, (void *)a2, (void *)a3, + (void *)a4, (void *)a5, (void *)a6, (void *)a7, + (void *)a8, (void *)a9, (void *)a10); +} + +STATIC void +xfs_inobt_trace_cursor( + struct xfs_btree_cur *cur, + __uint32_t *s0, + __uint64_t *l0, + __uint64_t *l1) +{ + *s0 = cur->bc_private.a.agno; + *l0 = cur->bc_rec.i.ir_startino; + *l1 = cur->bc_rec.i.ir_free; +} + +STATIC void +xfs_inobt_trace_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + __uint64_t *l0, + __uint64_t *l1) +{ + *l0 = be32_to_cpu(key->inobt.ir_startino); + *l1 = 0; +} + +STATIC void +xfs_inobt_trace_record( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec, + __uint64_t *l0, + __uint64_t *l1, + __uint64_t *l2) +{ + *l0 = be32_to_cpu(rec->inobt.ir_startino); + *l1 = be32_to_cpu(rec->inobt.ir_freecount); + *l2 = be64_to_cpu(rec->inobt.ir_free); +} +#endif /* XFS_BTREE_TRACE */ + static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + +#ifdef XFS_BTREE_TRACE + .trace_enter = xfs_inobt_trace_enter, + .trace_cursor = xfs_inobt_trace_cursor, + .trace_key = xfs_inobt_trace_key, + .trace_record = xfs_inobt_trace_record, +#endif }; /* -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:47 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63, J_CHICKENPOX_65,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTkOp031874 for ; Tue, 29 Jul 2008 12:29:47 -0700 X-ASG-Debug-ID: 1217359856-0c3a03160000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D05871947CF2 for ; Tue, 29 Jul 2008 12:30:57 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id 2jGH4JGEBSxQUIBO for ; Tue, 29 Jul 2008 12:30:57 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUwIF019278 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:59 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUwG8019276 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:58 +0200 Date: Tue, 29 Jul 2008 21:30:58 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 10/21] implement generic xfs_btree_decrement Subject: [PATCH 10/21] implement generic xfs_btree_decrement Message-ID: <20080729193058.GK19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-decrement User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359858 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17250 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-15 17:51:36.000000000 +0200 @@ -1057,3 +1057,99 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +/* + * Decrement cursor by one record at the level. + * For nonzero levels the leaf-ward information is untouched. + */ +int /* error */ +xfs_btree_decrement( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; + xfs_buf_t *bp; + int error; /* error return value */ + int lev; + union xfs_btree_ptr ptr; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + ASSERT(level < cur->bc_nlevels); + + /* Read-ahead to the left at this level. */ + xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); + + /* We're done if we remain in the block after the decrement. */ + if (--cur->bc_ptrs[level] > 0) + goto out1; + + /* Get a pointer to the btree block. */ + block = xfs_btree_get_block(cur, level, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* Fail if we just went off the left edge of the tree. */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_LEFTSIB); + if (xfs_btree_ptr_is_null(cur, &ptr)) + goto out0; + + XFS_BTREE_STATS_INC(cur, decrement); + + /* + * March up the tree decrementing pointers. + * Stop when we don't go off the left edge of a block. + */ + for (lev = level + 1; lev < cur->bc_nlevels; lev++) { + if (--cur->bc_ptrs[lev] > 0) + break; + /* Read-ahead the left block for the next loop. */ + xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); + } + + /* + * If we went off the root then we are seriously confused. + * or the root of the tree is in an inode. + */ + if (lev == cur->bc_nlevels) { + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); + goto out0; + } + ASSERT(lev < cur->bc_nlevels); + + /* + * Now walk back down the tree, fixing up the cursor's buffer + * pointers and key numbers. + */ + for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { + union xfs_btree_ptr *ptrp; + + ptrp = cur->bc_ops->ptr_addr(cur, cur->bc_ptrs[lev], block); + error = xfs_btree_read_buf_block(cur, ptrp, --lev, + 0, &block, &bp); + if (error) + goto error0; + xfs_btree_setbuf(cur, lev, bp); + cur->bc_ptrs[lev] = xfs_btree_get_numrecs(block); + } +out1: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-15 17:46:52.000000000 +0200 @@ -961,7 +961,7 @@ xfs_alloc_ag_vextent_near( args->minlen, <bnoa, <lena); if (ltlena >= args->minlen) break; - if ((error = xfs_alloc_decrement(bno_cur_lt, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur_lt, 0, &i))) goto error0; if (!i) { xfs_btree_del_cursor(bno_cur_lt, @@ -1162,7 +1162,7 @@ xfs_alloc_ag_vextent_near( /* * Fell off the left end. */ - if ((error = xfs_alloc_decrement( + if ((error = xfs_btree_decrement( bno_cur_lt, 0, &i))) goto error0; if (!i) { @@ -1321,7 +1321,7 @@ xfs_alloc_ag_vextent_size( bestflen = flen; bestfbno = fbno; for (;;) { - if ((error = xfs_alloc_decrement(cnt_cur, 0, &i))) + if ((error = xfs_btree_decrement(cnt_cur, 0, &i))) goto error0; if (i == 0) break; @@ -1416,7 +1416,7 @@ xfs_alloc_ag_vextent_small( xfs_extlen_t flen; int i; - if ((error = xfs_alloc_decrement(ccur, 0, &i))) + if ((error = xfs_btree_decrement(ccur, 0, &i))) goto error0; if (i) { if ((error = xfs_alloc_get_rec(ccur, &fbno, &flen, &i))) @@ -1607,7 +1607,7 @@ xfs_free_ag_extent( /* * Move the by-block cursor back to the left neighbor. */ - if ((error = xfs_alloc_decrement(bno_cur, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); #ifdef DEBUG @@ -1653,7 +1653,7 @@ xfs_free_ag_extent( * Back up the by-block cursor to the left neighbor, and * update its length. */ - if ((error = xfs_alloc_decrement(bno_cur, 0, &i))) + if ((error = xfs_btree_decrement(bno_cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); nbno = ltbno; Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:46:52.000000000 +0200 @@ -256,7 +256,7 @@ xfs_alloc_delrec( xfs_btree_setbuf(cur, level, NULL); cur->bc_nlevels--; } else if (level > 0 && - (error = xfs_alloc_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -272,7 +272,7 @@ xfs_alloc_delrec( * the minimum, we're done. */ if (numrecs >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -336,7 +336,7 @@ xfs_alloc_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); if (level > 0 && - (error = xfs_alloc_decrement(cur, level, + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; @@ -352,7 +352,7 @@ xfs_alloc_delrec( if (lbno != NULLAGBLOCK) { i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); } @@ -368,7 +368,7 @@ xfs_alloc_delrec( */ i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); xfs_btree_firstrec(tcur, level); @@ -468,7 +468,7 @@ xfs_alloc_delrec( * Just return. This is probably a logic error, but it's not fatal. */ else { - if (level > 0 && (error = xfs_alloc_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -1780,90 +1780,6 @@ xfs_alloc_updkey( */ /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_alloc_decrement( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_alloc_block_t *block; /* btree block */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the left at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - /* - * Decrement the ptr at this level. If we're still in the block - * then we're done. - */ - if (--cur->bc_ptrs[level] > 0) { - *stat = 1; - return 0; - } - /* - * Get a pointer to the btree block. - */ - block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[level]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, - cur->bc_bufs[level]))) - return error; -#endif - /* - * If we just went off the left edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree decrementing pointers. - * Stop when we don't go off the left edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - /* - * Read-ahead the left block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[lev]); lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - xfs_buf_t *bp; /* buffer pointer for block */ - - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_ALLOC_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. @@ -1889,7 +1805,7 @@ xfs_alloc_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_alloc_decrement(cur, level, &i))) + if ((error = xfs_btree_decrement(cur, level, &i))) return error; break; } Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -95,12 +95,6 @@ typedef struct xfs_btree_sblock xfs_allo XFS_BTREE_PTR_ADDR(xfs_alloc, bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur)) /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_alloc_decrement(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-15 17:46:52.000000000 +0200 @@ -820,7 +820,7 @@ xfs_bmap_add_extent_delay_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1381,13 +1381,13 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1430,7 +1430,7 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, LEFT.br_startoff, @@ -1473,7 +1473,7 @@ xfs_bmap_add_extent_unwritten_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, new->br_startoff, @@ -1556,7 +1556,7 @@ xfs_bmap_add_extent_unwritten_real( PREV.br_blockcount - new->br_blockcount, oldext))) goto done; - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; if (xfs_bmbt_update(cur, LEFT.br_startoff, LEFT.br_startblock, @@ -2108,7 +2108,7 @@ xfs_bmap_add_extent_hole_real( if ((error = xfs_bmbt_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_decrement(cur, 0, &i))) + if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_bmbt_update(cur, left.br_startoff, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:46:52.000000000 +0200 @@ -202,7 +202,7 @@ xfs_bmbt_delrec( XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &j))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -215,7 +215,7 @@ xfs_bmbt_delrec( goto error0; } if (numrecs >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &j))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -236,7 +236,7 @@ xfs_bmbt_delrec( XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &i))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -281,7 +281,7 @@ xfs_bmbt_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); tcur = NULL; if (level > 0) { - if ((error = xfs_bmbt_decrement(cur, + if ((error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); @@ -297,7 +297,7 @@ xfs_bmbt_delrec( if (lbno != NULLFSBLOCK) { i = xfs_btree_firstrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_decrement(tcur, level, &i))) { + if ((error = xfs_btree_decrement(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -310,7 +310,7 @@ xfs_bmbt_delrec( /* * decrement to last in block */ - if ((error = xfs_bmbt_decrement(tcur, level, &i))) { + if ((error = xfs_btree_decrement(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -382,7 +382,7 @@ xfs_bmbt_delrec( } lrecs = be16_to_cpu(left->bb_numrecs); } else { - if (level > 0 && (error = xfs_bmbt_decrement(cur, level, &i))) { + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -1485,80 +1485,6 @@ xfs_bmdr_to_bmbt( } /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_bmbt_decrement( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; /* error return value */ - xfs_fsblock_t fsbno; - int lev; - xfs_mount_t *mp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ASSERT(level < cur->bc_nlevels); - - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - - if (--cur->bc_ptrs[level] > 0) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - if (lev == cur->bc_nlevels) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - tp = cur->bc_tp; - mp = cur->bc_mp; - for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) { - fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. */ int /* error */ @@ -1580,7 +1506,7 @@ xfs_bmbt_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_bmbt_decrement(cur, level, + if ((error = xfs_btree_decrement(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -237,7 +237,6 @@ typedef struct xfs_btree_lblock xfs_bmbt * Prototypes for xfs_bmap.c to call. */ extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int); -extern int xfs_bmbt_decrement(struct xfs_btree_cur *, int, int *); extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *); extern void xfs_bmbt_get_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-15 17:46:52.000000000 +0200 @@ -739,7 +739,7 @@ nextag: /* * Search left with tcur, back up 1 record. */ - if ((error = xfs_inobt_decrement(tcur, 0, &i))) + if ((error = xfs_btree_decrement(tcur, 0, &i))) goto error1; doneleft = !i; if (!doneleft) { @@ -815,7 +815,7 @@ nextag: * further left. */ if (useleft) { - if ((error = xfs_inobt_decrement(tcur, 0, + if ((error = xfs_btree_decrement(tcur, 0, &i))) goto error1; doneleft = !i; Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:46:52.000000000 +0200 @@ -205,7 +205,7 @@ xfs_inobt_delrec( cur->bc_bufs[level] = NULL; cur->bc_nlevels--; } else if (level > 0 && - (error = xfs_inobt_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -222,7 +222,7 @@ xfs_inobt_delrec( */ if (numrecs >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { if (level > 0 && - (error = xfs_inobt_decrement(cur, level, &i))) + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -286,7 +286,7 @@ xfs_inobt_delrec( xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); if (level > 0 && - (error = xfs_inobt_decrement(cur, level, + (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; @@ -301,7 +301,7 @@ xfs_inobt_delrec( rrecs = be16_to_cpu(right->bb_numrecs); if (lbno != NULLAGBLOCK) { xfs_btree_firstrec(tcur, level); - if ((error = xfs_inobt_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; } } @@ -315,7 +315,7 @@ xfs_inobt_delrec( * previous block. */ xfs_btree_firstrec(tcur, level); - if ((error = xfs_inobt_decrement(tcur, level, &i))) + if ((error = xfs_btree_decrement(tcur, level, &i))) goto error0; xfs_btree_firstrec(tcur, level); /* @@ -414,7 +414,7 @@ xfs_inobt_delrec( * Just return. This is probably a logic error, but it's not fatal. */ else { - if (level > 0 && (error = xfs_inobt_decrement(cur, level, &i))) + if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) return error; *stat = 1; return 0; @@ -1656,90 +1656,6 @@ xfs_inobt_updkey( */ /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_inobt_decrement( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_inobt_block_t *block; /* btree block */ - int error; - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the left at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_LEFTRA); - /* - * Decrement the ptr at this level. If we're still in the block - * then we're done. - */ - if (--cur->bc_ptrs[level] > 0) { - *stat = 1; - return 0; - } - /* - * Get a pointer to the btree block. - */ - block = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[level]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, - cur->bc_bufs[level]))) - return error; -#endif - /* - * If we just went off the left edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree decrementing pointers. - * Stop when we don't go off the left edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - if (--cur->bc_ptrs[lev] > 0) - break; - /* - * Read-ahead the left block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_LEFTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (block = XFS_BUF_TO_INOBT_BLOCK(cur->bc_bufs[lev]); lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - xfs_buf_t *bp; /* buffer containing btree block */ - - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_INO_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = be16_to_cpu(block->bb_numrecs); - } - *stat = 1; - return 0; -} - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. @@ -1765,7 +1681,7 @@ xfs_inobt_delete( if (i == 0) { for (level = 1; level < cur->bc_nlevels; level++) { if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_inobt_decrement(cur, level, &i))) + if ((error = xfs_btree_decrement(cur, level, &i))) return error; break; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -117,12 +117,6 @@ typedef struct xfs_btree_sblock xfs_inob i, XFS_INOBT_BLOCK_MAXRECS(1, cur))) /* - * Decrement cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_inobt_decrement(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Delete the record pointed to by cur. * The cursor refers to the place where the record was (could be inserted) * when the operation returns. Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-15 17:46:47.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-15 17:46:52.000000000 +0200 @@ -511,6 +511,7 @@ xfs_btree_setbuf( */ int xfs_btree_increment(struct xfs_btree_cur *, int, int *); +int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); /* -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:46 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:29:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_62,J_CHICKENPOX_63,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTjti031840 for ; Tue, 29 Jul 2008 12:29:45 -0700 X-ASG-Debug-ID: 1217359854-5a6900320000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C15BD33F1FF for ; Tue, 29 Jul 2008 12:30:55 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id OGZwb7t6EBvrhFGj for ; Tue, 29 Jul 2008 12:30:55 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJUrIF019266 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:30:53 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJUrMP019264 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:30:53 +0200 Date: Tue, 29 Jul 2008 21:30:53 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 09/21] implement generic xfs_btree_increment Subject: [PATCH 09/21] implement generic xfs_btree_increment Message-ID: <20080729193053.GJ19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-increment User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359857 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17251 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Because this is the first major generic btree routine this patch includes some infrastrucure, fistly a few routines to deal with a btree block that can be either in short or long form, and secondly xfs_btree_read_buf_block, which is the new central routine to read a btree block given a cursor. [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Notes: - xfs_btree_read_buf_block now includes a xfs_btree_check_block, removed duplicate call Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -191,6 +191,10 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* return address of btree structures */ + union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + /* btree tracing */ #ifdef XFS_BTREE_TRACE void (*trace_enter)(struct xfs_btree_cur *, const char *, @@ -502,6 +506,23 @@ xfs_btree_setbuf( int lev, /* level in btree */ struct xfs_buf *bp); /* new buffer to set */ +/* + * Common btree core entry points. + */ + +int xfs_btree_increment(struct xfs_btree_cur *, int, int *); + + +/* + * Helpers. + */ + +static inline int +xfs_btree_get_numrecs(struct xfs_btree_block *block) +{ + return be16_to_cpu(block->bb_h.bb_numrecs); +} + #endif /* __KERNEL__ */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 04:41:51.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 06:47:21.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_error.h" @@ -829,3 +830,230 @@ xfs_btree_setbuf( cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA; } } + +STATIC int +xfs_btree_ptr_is_null( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + return be64_to_cpu(ptr->l) == NULLFSBLOCK; + else + return be32_to_cpu(ptr->s) == NULLAGBLOCK; +} + +/* + * Get/set/init sibling pointers + */ +STATIC void +xfs_btree_get_sibling( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_ptr *ptr, + int lr) +{ + ASSERT(lr == XFS_BB_LEFTSIB || lr == XFS_BB_RIGHTSIB); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + if (lr == XFS_BB_RIGHTSIB) + ptr->l = block->bb_u.l.bb_rightsib; + else + ptr->l = block->bb_u.l.bb_leftsib; + } else { + if (lr == XFS_BB_RIGHTSIB) + ptr->s = block->bb_u.s.bb_rightsib; + else + ptr->s = block->bb_u.s.bb_leftsib; + } +} + +STATIC struct xfs_btree_block * +xfs_btree_buf_to_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + if (!bp) { + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); + return cur->bc_ops->get_root_from_inode(cur); + } + return XFS_BUF_TO_BLOCK(bp); +} + +STATIC xfs_daddr_t +xfs_btree_ptr_to_daddr( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + ASSERT(be64_to_cpu(ptr->l) != NULLFSBLOCK); + + return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l)); + } else { + ASSERT(cur->bc_private.a.agno != NULLAGNUMBER); + ASSERT(be32_to_cpu(ptr->s) != NULLAGBLOCK); + + return XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_private.a.agno, + be32_to_cpu(ptr->s)); + } +} + +STATIC void +xfs_btree_set_refs( + struct xfs_btree_cur *cur, + struct xfs_buf *bp) +{ + switch (cur->bc_btnum) { + case XFS_BTNUM_BNO: + case XFS_BTNUM_CNT: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_ALLOC_BTREE_REF); + break; + case XFS_BTNUM_INO: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_INOMAP, XFS_INO_BTREE_REF); + break; + case XFS_BTNUM_BMAP: + XFS_BUF_SET_VTYPE_REF(*bpp, B_FS_MAP, XFS_BMAP_BTREE_REF); + break; + default: + ASSERT(0); + } +} + +/* + * Read in the buffer at the given ptr and return the buffer and + * the block pointer within the buffer. + */ +STATIC int +xfs_btree_read_buf_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr, + int level, + int flags, + struct xfs_btree_block **block, + struct xfs_buf **bpp) +{ + struct xfs_mount *mp = cur->bc_mp; + xfs_daddr_t d; + int error; + + /* need to sort out how callers deal with failures first */ + ASSERT(!(flags & XFS_BUF_TRYLOCK)); + + d = xfs_btree_ptr_to_daddr(cur, ptr); + error = xfs_trans_read_buf(mp, cur->bc_tp, mp->m_ddev_targp, d, + mp->m_bsize, flags, bpp); + if (error) + return error; + + ASSERT(*bpp != NULL); + ASSERT(!XFS_BUF_GETERROR(*bpp)); + + xfs_btree_set_refs(cur, *bpp); + *block = XFS_BUF_TO_BLOCK(*bpp); + + return xfs_btree_check_block(cur, *block, level, *bpp); +} + +/* + * Increment cursor by one record at the level. + * For nonzero levels the leaf-ward information is untouched. + */ +int /* error */ +xfs_btree_increment( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; + union xfs_btree_ptr ptr; + struct xfs_buf *bp; + int error; /* error return value */ + int lev; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + ASSERT(level < cur->bc_nlevels); + + /* Read-ahead to the right at this level. */ + xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); + + /* Get a pointer to the btree block. */ + block = xfs_btree_get_block(cur, level, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* We're done if we remain in the block after the increment. */ + if (++cur->bc_ptrs[level] <= xfs_btree_get_numrecs(block)) + goto out1; + + /* Fail if we just went off the right edge of the tree. */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (xfs_btree_ptr_is_null(cur, &ptr)) + goto out0; + + XFS_BTREE_STATS_INC(cur, increment); + + /* + * March up the tree incrementing pointers. + * Stop when we don't go off the right edge of a block. + */ + for (lev = level + 1; lev < cur->bc_nlevels; lev++) { + block = xfs_btree_get_block(cur, lev, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, lev, bp); + if (error) + goto error0; +#endif + + if (++cur->bc_ptrs[lev] <= xfs_btree_get_numrecs(block)) + break; + + /* Read-ahead the right block for the next loop. */ + xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); + } + + /* + * If we went off the root then we are either seriously + * confused or have the tree root in an inode. + */ + if (lev == cur->bc_nlevels) { + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); + goto out0; + } + ASSERT(lev < cur->bc_nlevels); + + /* + * Now walk back down the tree, fixing up the cursor's buffer + * pointers and key numbers. + */ + for (block = xfs_btree_get_block(cur, lev, &bp); lev > level; ) { + union xfs_btree_ptr *ptrp; + + ptrp = cur->bc_ops->ptr_addr(cur, cur->bc_ptrs[lev], block); + error = xfs_btree_read_buf_block(cur, ptrp, --lev, + 0, &block, &bp); + if (error) + goto error0; + + xfs_btree_setbuf(cur, lev, bp); + cur->bc_ptrs[lev] = 1; + } +out1: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-21 06:46:13.000000000 +0200 @@ -303,7 +303,7 @@ xfs_alloc_delrec( */ i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_increment(tcur, level, &i))) + if ((error = xfs_btree_increment(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); i = xfs_btree_lastrec(tcur, level); @@ -517,7 +517,7 @@ xfs_alloc_delrec( * us, increment the cursor at that level. */ else if (level + 1 < cur->bc_nlevels && - (error = xfs_alloc_increment(cur, level + 1, &i))) + (error = xfs_btree_increment(cur, level + 1, &i))) return error; /* * Fix up the number of records in the surviving block. @@ -1134,7 +1134,7 @@ xfs_alloc_lookup( int i; cur->bc_ptrs[0] = keyno; - if ((error = xfs_alloc_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); *stat = 1; @@ -1570,7 +1570,7 @@ xfs_alloc_rshift( return error; i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_increment(tcur, level, &i)) || + if ((error = xfs_btree_increment(tcur, level, &i)) || (error = xfs_alloc_updkey(tcur, rkp, level + 1))) goto error0; xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); @@ -1943,97 +1943,6 @@ xfs_alloc_get_rec( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_alloc_increment( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* tree block buffer */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the right at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - /* - * Get a pointer to the btree block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Increment the ptr at this level. If we're still in the block - * then we're done. - */ - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - *stat = 1; - return 0; - } - /* - * If we just went off the right edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree incrementing pointers. - * Stop when we don't go off the right edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - bp = cur->bc_bufs[lev]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - /* - * Read-ahead the right block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (bp = cur->bc_bufs[lev], block = XFS_BUF_TO_ALLOC_BLOCK(bp); - lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_ALLOC_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = 1; - } - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ @@ -2219,6 +2128,16 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC union xfs_btree_ptr * +xfs_allocbt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *) + XFS_ALLOC_PTR_ADDR(&block->bb_h, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -2288,6 +2207,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .ptr_addr = xfs_allocbt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -114,12 +114,6 @@ extern int xfs_alloc_get_rec(struct xfs_ xfs_extlen_t *len, int *stat); /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_alloc_increment(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-21 06:46:13.000000000 +0200 @@ -818,7 +818,7 @@ xfs_alloc_ag_vextent_near( XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if (ltlen >= args->minlen) break; - if ((error = xfs_alloc_increment(cnt_cur, 0, &i))) + if ((error = xfs_btree_increment(cnt_cur, 0, &i))) goto error0; } while (i); ASSERT(ltlen >= args->minlen); @@ -828,7 +828,7 @@ xfs_alloc_ag_vextent_near( i = cnt_cur->bc_ptrs[0]; for (j = 1, blen = 0, bdiff = 0; !error && j && (blen < args->maxlen || bdiff > 0); - error = xfs_alloc_increment(cnt_cur, 0, &j)) { + error = xfs_btree_increment(cnt_cur, 0, &j)) { /* * For each entry, decide if it's better than * the previous best entry. @@ -938,7 +938,7 @@ xfs_alloc_ag_vextent_near( * Increment the cursor, so we will point at the entry just right * of the leftward entry if any, or to the leftmost entry. */ - if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) + if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) goto error0; if (!i) { /* @@ -977,7 +977,7 @@ xfs_alloc_ag_vextent_near( args->minlen, >bnoa, >lena); if (gtlena >= args->minlen) break; - if ((error = xfs_alloc_increment(bno_cur_gt, 0, &i))) + if ((error = xfs_btree_increment(bno_cur_gt, 0, &i))) goto error0; if (!i) { xfs_btree_del_cursor(bno_cur_gt, @@ -1066,7 +1066,7 @@ xfs_alloc_ag_vextent_near( /* * Fell off the right end. */ - if ((error = xfs_alloc_increment( + if ((error = xfs_btree_increment( bno_cur_gt, 0, &i))) goto error0; if (!i) { @@ -1548,7 +1548,7 @@ xfs_free_ag_extent( * Look for a neighboring block on the right (higher block numbers) * that is contiguous with this space. */ - if ((error = xfs_alloc_increment(bno_cur, 0, &haveright))) + if ((error = xfs_btree_increment(bno_cur, 0, &haveright))) goto error0; if (haveright) { /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-21 06:46:13.000000000 +0200 @@ -253,7 +253,7 @@ xfs_inobt_delrec( */ i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_inobt_increment(tcur, level, &i))) + if ((error = xfs_btree_increment(tcur, level, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); i = xfs_btree_lastrec(tcur, level); @@ -463,7 +463,7 @@ xfs_inobt_delrec( * us, increment the cursor at that level. */ else if (level + 1 < cur->bc_nlevels && - (error = xfs_alloc_increment(cur, level + 1, &i))) + (error = xfs_btree_increment(cur, level + 1, &i))) return error; /* * Fix up the number of records in the surviving block. @@ -1014,7 +1014,7 @@ xfs_inobt_lookup( int i; cur->bc_ptrs[0] = keyno; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) return error; ASSERT(i == 1); *stat = 1; @@ -1443,7 +1443,7 @@ xfs_inobt_rshift( if ((error = xfs_btree_dup_cursor(cur, &tcur))) return error; xfs_btree_lastrec(tcur, level); - if ((error = xfs_inobt_increment(tcur, level, &i)) || + if ((error = xfs_btree_increment(tcur, level, &i)) || (error = xfs_inobt_updkey(tcur, rkp, level + 1))) { xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); return error; @@ -1821,97 +1821,6 @@ xfs_inobt_get_rec( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_inobt_increment( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level in btree, 0 is leaf */ - int *stat) /* success/failure */ -{ - xfs_inobt_block_t *block; /* btree block */ - xfs_buf_t *bp; /* buffer containing btree block */ - int error; /* error return value */ - int lev; /* btree level */ - - ASSERT(level < cur->bc_nlevels); - /* - * Read-ahead to the right at this level. - */ - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - /* - * Get a pointer to the btree block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Increment the ptr at this level. If we're still in the block - * then we're done. - */ - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - *stat = 1; - return 0; - } - /* - * If we just went off the right edge of the tree, return failure. - */ - if (be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * March up the tree incrementing pointers. - * Stop when we don't go off the right edge of a block. - */ - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - bp = cur->bc_bufs[lev]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - /* - * Read-ahead the right block, we're going to read it - * in the next loop. - */ - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - /* - * If we went off the root then we are seriously confused. - */ - ASSERT(lev < cur->bc_nlevels); - /* - * Now walk back down the tree, fixing up the cursor's buffer - * pointers and key numbers. - */ - for (bp = cur->bc_bufs[lev], block = XFS_BUF_TO_INOBT_BLOCK(bp); - lev > level; ) { - xfs_agblock_t agbno; /* block number of btree block */ - - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, agbno, 0, &bp, - XFS_INO_BTREE_REF))) - return error; - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, lev, bp))) - return error; - cur->bc_ptrs[lev] = 1; - } - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ @@ -2085,6 +1994,16 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC union xfs_btree_ptr * +xfs_inobt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *) + XFS_INOBT_PTR_ADDR(&block->bb_h, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -2154,6 +2073,7 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .ptr_addr = xfs_inobt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-21 06:46:13.000000000 +0200 @@ -695,7 +695,7 @@ nextag: goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } while (i == 1); @@ -753,7 +753,7 @@ nextag: /* * Search right with cur, go forward 1 record. */ - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error1; doneright = !i; if (!doneright) { @@ -835,7 +835,7 @@ nextag: * further right. */ else { - if ((error = xfs_inobt_increment(cur, 0, + if ((error = xfs_btree_increment(cur, 0, &i))) goto error1; doneright = !i; @@ -890,7 +890,7 @@ nextag: XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if (rec.ir_freecount > 0) break; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); } @@ -924,7 +924,7 @@ nextag: goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } while (i == 1); ASSERT(freecount == be32_to_cpu(agi->agi_freecount) || @@ -1033,7 +1033,7 @@ xfs_difree( goto error0; if (i) { freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } } while (i == 1); @@ -1138,7 +1138,7 @@ xfs_difree( goto error0; if (i) { freecount += rec.ir_freecount; - if ((error = xfs_inobt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto error0; } } while (i == 1); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -136,12 +136,6 @@ extern int xfs_inobt_get_rec(struct xfs_ __int32_t *fcnt, xfs_inofree_t *free, int *stat); /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -extern int xfs_inobt_increment(struct xfs_btree_cur *cur, int level, int *stat); - -/* * Insert the current record at the point referenced by cur. * The cursor may be inconsistent on return if splits have been done. */ Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_itable.c 2008-07-21 04:42:09.000000000 +0200 @@ -473,7 +473,7 @@ xfs_bulkstat( * In any case, increment to the next record. */ if (!error) - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); } else { /* * Start of ag. Lookup the first inode chunk. @@ -540,7 +540,7 @@ xfs_bulkstat( * Set agino to after this chunk and bump the cursor. */ agino = gino + XFS_INODES_PER_CHUNK; - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); cond_resched(); } /* @@ -887,7 +887,7 @@ xfs_inumbers( bufidx = 0; } if (left) { - error = xfs_inobt_increment(cur, 0, &tmp); + error = xfs_btree_increment(cur, 0, &tmp); if (error) { xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); cur = NULL; Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-21 04:41:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-21 06:46:13.000000000 +0200 @@ -1646,7 +1646,7 @@ xfs_bmap_add_extent_unwritten_real( PREV.br_blockcount - new->br_blockcount, oldext))) goto done; - if ((error = xfs_bmbt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto done; if ((error = xfs_bmbt_update(cur, new->br_startoff, new->br_startblock, @@ -3253,7 +3253,7 @@ xfs_bmap_del_extent( got.br_startblock, temp, got.br_state))) goto done; - if ((error = xfs_bmbt_increment(cur, 0, &i))) + if ((error = xfs_btree_increment(cur, 0, &i))) goto done; cur->bc_rec.b = new; error = xfs_bmbt_insert(cur, &i); Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-21 06:46:13.000000000 +0200 @@ -253,7 +253,7 @@ xfs_bmbt_delrec( if (rbno != NULLFSBLOCK) { i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_increment(tcur, level, &i))) { + if ((error = xfs_btree_increment(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -444,7 +444,7 @@ xfs_bmbt_delrec( cur->bc_bufs[level] = lbp; cur->bc_ptrs[level] += lrecs; cur->bc_ra[level] = 0; - } else if ((error = xfs_bmbt_increment(cur, level + 1, &i))) { + } else if ((error = xfs_btree_increment(cur, level + 1, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -928,7 +928,7 @@ xfs_bmbt_lookup( if (dir == XFS_LOOKUP_GE && keyno > be16_to_cpu(block->bb_numrecs) && be64_to_cpu(block->bb_rightsib) != NULLDFSBNO) { cur->bc_ptrs[0] = keyno; - if ((error = xfs_bmbt_increment(cur, 0, &i))) { + if ((error = xfs_btree_increment(cur, 0, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -1201,7 +1201,7 @@ xfs_bmbt_rshift( } i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_increment(tcur, level, &i))) { + if ((error = xfs_btree_increment(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(tcur, ERROR); goto error1; } @@ -1759,86 +1759,6 @@ xfs_bmbt_disk_get_startoff( } /* - * Increment cursor by one record at the level. - * For nonzero levels the leaf-ward information is untouched. - */ -int /* error */ -xfs_bmbt_increment( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; /* error return value */ - xfs_fsblock_t fsbno; - int lev; - xfs_mount_t *mp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ASSERT(level < cur->bc_nlevels); - - xfs_btree_readahead(cur, level, XFS_BTCUR_RIGHTRA); - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (++cur->bc_ptrs[level] <= be16_to_cpu(block->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - if (be64_to_cpu(block->bb_rightsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - for (lev = level + 1; lev < cur->bc_nlevels; lev++) { - block = xfs_bmbt_get_block(cur, lev, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (++cur->bc_ptrs[lev] <= be16_to_cpu(block->bb_numrecs)) - break; - xfs_btree_readahead(cur, lev, XFS_BTCUR_RIGHTRA); - } - if (lev == cur->bc_nlevels) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - tp = cur->bc_tp; - mp = cur->bc_mp; - for (block = xfs_bmbt_get_block(cur, lev, &bp); lev > level; ) { - fsbno = be64_to_cpu(*XFS_BMAP_PTR_IADDR(block, cur->bc_ptrs[lev], cur)); - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, 0, &bp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - lev--; - xfs_btree_setbuf(cur, lev, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, lev, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[lev] = 1; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Insert the current record at the point referenced by cur. * * A multi-level split of the tree on insert will invalidate the original @@ -2423,6 +2343,16 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC union xfs_btree_ptr * +xfs_bmbt_ptr_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_ptr *) + XFS_BMAP_PTR_IADDR(&block->bb_h, index, cur); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2512,6 +2442,7 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .ptr_addr = xfs_bmbt_ptr_addr, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-21 04:41:59.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-21 06:46:13.000000000 +0200 @@ -251,7 +251,6 @@ extern void xfs_bmbt_disk_get_all(xfs_bm extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r); extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r); -extern int xfs_bmbt_increment(struct xfs_btree_cur *, int, int *); extern int xfs_bmbt_insert(struct xfs_btree_cur *, int *); extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, -- From owner-xfs@oss.sgi.com Tue Jul 29 12:29:54 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:13 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_61, J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTs6h032022 for ; Tue, 29 Jul 2008 12:29:54 -0700 X-ASG-Debug-ID: 1217359862-5a62004e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3064733F201 for ; Tue, 29 Jul 2008 12:31:03 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id FSS2SoR00p2ZOEVU for ; Tue, 29 Jul 2008 12:31:03 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJV4IF019295 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:04 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJV4Mf019293 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:04 +0200 Date: Tue, 29 Jul 2008 21:31:04 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 11/21] implement generic xfs_btree_lookup Subject: [PATCH 11/21] implement generic xfs_btree_lookup Message-ID: <20080729193104.GL19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-lookup User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359866 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17252 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-15 17:51:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-15 18:24:15.000000000 +0200 @@ -1153,3 +1153,220 @@ error0: return error; } + +STATIC int +xfs_btree_lookup_get_block( + struct xfs_btree_cur *cur, /* btree cursor */ + int level, /* level in the btree */ + union xfs_btree_ptr *pp, /* ptr to btree block */ + struct xfs_btree_block **blkp) /* return btree block */ +{ + struct xfs_buf *bp; /* buffer pointer for btree block */ + int error = 0; + + /* special case the root block if in an inode */ + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) { + *blkp = cur->bc_ops->get_root_from_inode(cur); + return 0; + } + + /* + * If the old buffer at this level for the disk address we are + * looking for re-use it. + * + * Otherwise throw it away and get a new one. + */ + bp = cur->bc_bufs[level]; + if (bp && XFS_BUF_ADDR(bp) == xfs_btree_ptr_to_daddr(cur, pp)) { + *blkp = XFS_BUF_TO_BLOCK(bp); + return 0; + } + + error = xfs_btree_read_buf_block(cur, pp, level, 0, blkp, &bp); + if (error) + return error; + + xfs_btree_setbuf(cur, level, bp); + return 0; +} + +/* + * Get current search key. For level 0 we don't actually have a key + * structure so we make one up from the record. For all other levels + * we just return the right key. + */ +STATIC union xfs_btree_key * +xfs_lookup_get_search_key( + struct xfs_btree_cur *cur, + int level, + int keyno, + struct xfs_btree_block *block, + union xfs_btree_key *kp) +{ + if (level == 0) { + union xfs_btree_rec *krp; + + krp = cur->bc_ops->rec_addr(cur, keyno, block); + cur->bc_ops->init_key_from_rec(cur, kp, krp); + return kp; + } + + return cur->bc_ops->key_addr(cur, keyno, block); +} + +/* + * Lookup the record. The cursor is made to point to it, based on dir. + * Return 0 if can't find any such record, 1 for success. + */ +int /* error */ +xfs_btree_lookup( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_lookup_t dir, /* <=, ==, or >= */ + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; /* current btree block */ + __int64_t diff; /* difference for the current key */ + int error; /* error return value */ + int keyno; /* current key number */ + int level; /* level in the btree */ + union xfs_btree_ptr *pp; /* ptr to btree block */ + union xfs_btree_ptr ptr; /* ptr to btree block */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, dir); + + XFS_BTREE_STATS_INC(cur, lookup); + + block = NULL; + keyno = 0; + + /* initialise start pointer from cursor */ + cur->bc_ops->init_ptr_from_cur(cur, &ptr); + pp = &ptr; + + /* + * Iterate over each level in the btree, starting at the root. + * For each level above the leaves, find the key we need, based + * on the lookup record, then follow the corresponding block + * pointer down to the next level. + */ + for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { + /* Get the block we need to do the lookup on. */ + error = xfs_btree_lookup_get_block(cur, level, pp, &block); + if (error) + goto error0; + + /* + * If we already had a key match at a higher level, we know + * we need to use the first entry in this block. + */ + if (diff == 0) + keyno = 1; + + /* Otherwise search this block. Do a binary search. */ + else { + int high; /* high entry number */ + int low; /* low entry number */ + + /* Set low and high entry numbers, 1-based. */ + low = 1; + high = xfs_btree_get_numrecs(block); + if (!high) { + /* Block is empty, must be an empty leaf. */ + ASSERT(level == 0 && cur->bc_nlevels == 1); + cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + /* Binary search the block. */ + while (low <= high) { + union xfs_btree_key key; + union xfs_btree_key *kp; + + XFS_BTREE_STATS_INC(cur, compare); + + /* keyno is average of low and high. */ + keyno = (low + high) >> 1; + + /* Get current search key */ + kp = xfs_lookup_get_search_key(cur, level, + keyno, block, &key); + + /* + * Compute difference to get next direction: + * - less than, move right + * - greater than, move left + * - equal, we're done + */ + diff = cur->bc_ops->key_diff(cur, kp); + if (diff < 0) + low = keyno + 1; + else if (diff > 0) + high = keyno - 1; + else + break; + } + } + + /* + * If there are more levels, set up for the next level + * by getting the block number and filling in the cursor. + */ + if (level > 0) { + /* + * If we moved left, need the previous key number, + * unless there isn't one. + */ + if (diff > 0 && --keyno < 1) + keyno = 1; + pp = cur->bc_ops->ptr_addr(cur, keyno, block); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, pp, 0, level); + if (error) + goto error0; +#endif + cur->bc_ptrs[level] = keyno; + } + } + + /* Done with the search. See if we need to adjust the results. */ + if (dir != XFS_LOOKUP_LE && diff < 0) { + keyno++; + /* + * If ge search and we went off the end of the block, but it's + * not the last block, we're in the wrong block. + */ + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (dir == XFS_LOOKUP_GE && + keyno > xfs_btree_get_numrecs(block) && + !xfs_btree_ptr_is_null(cur, &ptr)) { + int i; + + cur->bc_ptrs[0] = keyno; + error = xfs_btree_increment(cur, 0, &i); + if (error) + goto error0; + XFS_WANT_CORRUPTED_RETURN(i == 1); + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + } + } else if (dir == XFS_LOOKUP_LE && diff > 0) + keyno--; + cur->bc_ptrs[0] = keyno; + + /* Return if we succeeded or not. */ + if (keyno == 0 || keyno > xfs_btree_get_numrecs(block)) + *stat = 0; + else + *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -194,6 +194,21 @@ struct xfs_btree_ops { /* return address of btree structures */ union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); + union xfs_btree_key *(*key_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + union xfs_btree_rec *(*rec_addr)(struct xfs_btree_cur *cur, int index, + struct xfs_btree_block *block); + + /* init values of btree structures */ + void (*init_key_from_rec)(struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec); + void (*init_ptr_from_cur)(struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr); + + /* difference between key value and cursor value */ + __int64_t (*key_diff)(struct xfs_btree_cur *cur, + union xfs_btree_key *key); /* btree tracing */ #ifdef XFS_BTREE_TRACE @@ -512,6 +527,7 @@ xfs_btree_setbuf( int xfs_btree_increment(struct xfs_btree_cur *, int, int *); int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); +int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-15 17:51:41.000000000 +0200 @@ -938,223 +938,6 @@ xfs_alloc_log_recs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - * Return 0 if can't find any such record, 1 for success. - */ -STATIC int /* error */ -xfs_alloc_lookup( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_lookup_t dir, /* <=, ==, or >= */ - int *stat) /* success/failure */ -{ - xfs_agblock_t agbno; /* a.g. relative btree block number */ - xfs_agnumber_t agno; /* allocation group number */ - xfs_alloc_block_t *block=NULL; /* current btree block */ - int diff; /* difference for the current key */ - int error; /* error return value */ - int keyno=0; /* current key number */ - int level; /* level in the btree */ - xfs_mount_t *mp; /* file system mount point */ - - XFS_STATS_INC(xs_abt_lookup); - /* - * Get the allocation group header, and the root block number. - */ - mp = cur->bc_mp; - - { - xfs_agf_t *agf; /* a.g. freespace header */ - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - agno = be32_to_cpu(agf->agf_seqno); - agbno = be32_to_cpu(agf->agf_roots[cur->bc_btnum]); - } - /* - * Iterate over each level in the btree, starting at the root. - * For each level above the leaves, find the key we need, based - * on the lookup record, then follow the corresponding block - * pointer down to the next level. - */ - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - xfs_buf_t *bp; /* buffer pointer for btree block */ - xfs_daddr_t d; /* disk address of btree block */ - - /* - * Get the disk address we're looking for. - */ - d = XFS_AGB_TO_DADDR(mp, agno, agbno); - /* - * If the old buffer at this level is for a different block, - * throw it away, otherwise just use it. - */ - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - /* - * Need to get a new buffer. Read it, then - * set it in the cursor, releasing the old one. - */ - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, agno, - agbno, 0, &bp, XFS_ALLOC_BTREE_REF))) - return error; - xfs_btree_setbuf(cur, level, bp); - /* - * Point to the btree block, now that we have the buffer - */ - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, level, - bp))) - return error; - } else - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - /* - * If we already had a key match at a higher level, we know - * we need to use the first entry in this block. - */ - if (diff == 0) - keyno = 1; - /* - * Otherwise we need to search this block. Do a binary search. - */ - else { - int high; /* high entry number */ - xfs_alloc_key_t *kkbase=NULL;/* base of keys in block */ - xfs_alloc_rec_t *krbase=NULL;/* base of records in block */ - int low; /* low entry number */ - - /* - * Get a pointer to keys or records. - */ - if (level > 0) - kkbase = XFS_ALLOC_KEY_ADDR(block, 1, cur); - else - krbase = XFS_ALLOC_REC_ADDR(block, 1, cur); - /* - * Set low and high entry numbers, 1-based. - */ - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - /* - * If the block is empty, the tree must - * be an empty leaf. - */ - ASSERT(level == 0 && cur->bc_nlevels == 1); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - *stat = 0; - return 0; - } - /* - * Binary search the block. - */ - while (low <= high) { - xfs_extlen_t blockcount; /* key value */ - xfs_agblock_t startblock; /* key value */ - - XFS_STATS_INC(xs_abt_compare); - /* - * keyno is average of low and high. - */ - keyno = (low + high) >> 1; - /* - * Get startblock & blockcount. - */ - if (level > 0) { - xfs_alloc_key_t *kkp; - - kkp = kkbase + keyno - 1; - startblock = be32_to_cpu(kkp->ar_startblock); - blockcount = be32_to_cpu(kkp->ar_blockcount); - } else { - xfs_alloc_rec_t *krp; - - krp = krbase + keyno - 1; - startblock = be32_to_cpu(krp->ar_startblock); - blockcount = be32_to_cpu(krp->ar_blockcount); - } - /* - * Compute difference to get next direction. - */ - if (cur->bc_btnum == XFS_BTNUM_BNO) - diff = (int)startblock - - (int)cur->bc_rec.a.ar_startblock; - else if (!(diff = (int)blockcount - - (int)cur->bc_rec.a.ar_blockcount)) - diff = (int)startblock - - (int)cur->bc_rec.a.ar_startblock; - /* - * Less than, move right. - */ - if (diff < 0) - low = keyno + 1; - /* - * Greater than, move left. - */ - else if (diff > 0) - high = keyno - 1; - /* - * Equal, we're done. - */ - else - break; - } - } - /* - * If there are more levels, set up for the next level - * by getting the block number and filling in the cursor. - */ - if (level > 0) { - /* - * If we moved left, need the previous key number, - * unless there isn't one. - */ - if (diff > 0 && --keyno < 1) - keyno = 1; - agbno = be32_to_cpu(*XFS_ALLOC_PTR_ADDR(block, keyno, cur)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, agbno, level))) - return error; -#endif - cur->bc_ptrs[level] = keyno; - } - } - /* - * Done with the search. - * See if we need to adjust the results. - */ - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && - keyno > be16_to_cpu(block->bb_numrecs) && - be32_to_cpu(block->bb_rightsib) != NULLAGBLOCK) { - int i; - - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) - return error; - XFS_WANT_CORRUPTED_RETURN(i == 1); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - /* - * Return if we succeeded or not. - */ - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) - *stat = 0; - else - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1919,53 +1702,6 @@ xfs_alloc_insert( } /* - * Lookup the record equal to [bno, len] in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_eq( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -/* - * Lookup the first record greater than or equal to [bno, len] - * in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_ge( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_GE, stat); -} - -/* - * Lookup the first record less than or equal to [bno, len] - * in the btree given by cur. - */ -int /* error */ -xfs_alloc_lookup_le( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len, /* length of extent */ - int *stat) /* success/failure */ -{ - cur->bc_rec.a.ar_startblock = bno; - cur->bc_rec.a.ar_blockcount = len; - return xfs_alloc_lookup(cur, XFS_LOOKUP_LE, stat); -} - -/* * Update the record referred to by cur, to the value given by [bno, len]. * This either works (return 0) or gets an EFSCORRUPTED error. */ @@ -2044,6 +1780,31 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC void +xfs_allocbt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + ASSERT(rec->alloc.ar_startblock != 0); + + key->alloc.ar_startblock = rec->alloc.ar_startblock; + key->alloc.ar_blockcount = rec->alloc.ar_blockcount; +} + +STATIC void +xfs_allocbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agf->agf_seqno)); + ASSERT(agf->agf_roots[cur->bc_btnum] != 0); + + ptr->s = agf->agf_roots[cur->bc_btnum]; +} + STATIC union xfs_btree_ptr * xfs_allocbt_ptr_addr( struct xfs_btree_cur *cur, @@ -2054,6 +1815,47 @@ xfs_allocbt_ptr_addr( XFS_ALLOC_PTR_ADDR(&block->bb_h, index, cur); } +STATIC union xfs_btree_key * +xfs_allocbt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *) + XFS_ALLOC_KEY_ADDR(&block->bb_h, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_allocbt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *) + XFS_ALLOC_REC_ADDR(&block->bb_h, index, cur); +} + +STATIC __int64_t +xfs_allocbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + xfs_alloc_rec_incore_t *rec = &cur->bc_rec.a; + xfs_alloc_key_t *kp = &key->alloc; + __int64_t diff; + + if (cur->bc_btnum == XFS_BTNUM_BNO) { + return (__int64_t)be32_to_cpu(kp->ar_startblock) - + rec->ar_startblock; + } + + diff = (__int64_t)be32_to_cpu(kp->ar_blockcount) - rec->ar_blockcount; + if (diff) + return diff; + + return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -2123,7 +1925,12 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .init_key_from_rec = xfs_allocbt_init_key_from_rec, + .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, + .key_addr = xfs_allocbt_key_addr, + .rec_addr = xfs_allocbt_rec_addr, + .key_diff = xfs_allocbt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-15 17:51:41.000000000 +0200 @@ -829,212 +829,6 @@ xfs_inobt_log_recs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - * Return 0 if can't find any such record, 1 for success. - */ -STATIC int /* error */ -xfs_inobt_lookup( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_lookup_t dir, /* <=, ==, or >= */ - int *stat) /* success/failure */ -{ - xfs_agblock_t agbno; /* a.g. relative btree block number */ - xfs_agnumber_t agno; /* allocation group number */ - xfs_inobt_block_t *block=NULL; /* current btree block */ - __int64_t diff; /* difference for the current key */ - int error; /* error return value */ - int keyno=0; /* current key number */ - int level; /* level in the btree */ - xfs_mount_t *mp; /* file system mount point */ - - /* - * Get the allocation group header, and the root block number. - */ - mp = cur->bc_mp; - { - xfs_agi_t *agi; /* a.g. inode header */ - - agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); - agno = be32_to_cpu(agi->agi_seqno); - agbno = be32_to_cpu(agi->agi_root); - } - /* - * Iterate over each level in the btree, starting at the root. - * For each level above the leaves, find the key we need, based - * on the lookup record, then follow the corresponding block - * pointer down to the next level. - */ - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - xfs_buf_t *bp; /* buffer pointer for btree block */ - xfs_daddr_t d; /* disk address of btree block */ - - /* - * Get the disk address we're looking for. - */ - d = XFS_AGB_TO_DADDR(mp, agno, agbno); - /* - * If the old buffer at this level is for a different block, - * throw it away, otherwise just use it. - */ - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - /* - * Need to get a new buffer. Read it, then - * set it in the cursor, releasing the old one. - */ - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - agno, agbno, 0, &bp, XFS_INO_BTREE_REF))) - return error; - xfs_btree_setbuf(cur, level, bp); - /* - * Point to the btree block, now that we have the buffer - */ - block = XFS_BUF_TO_INOBT_BLOCK(bp); - if ((error = xfs_btree_check_sblock(cur, block, level, - bp))) - return error; - } else - block = XFS_BUF_TO_INOBT_BLOCK(bp); - /* - * If we already had a key match at a higher level, we know - * we need to use the first entry in this block. - */ - if (diff == 0) - keyno = 1; - /* - * Otherwise we need to search this block. Do a binary search. - */ - else { - int high; /* high entry number */ - xfs_inobt_key_t *kkbase=NULL;/* base of keys in block */ - xfs_inobt_rec_t *krbase=NULL;/* base of records in block */ - int low; /* low entry number */ - - /* - * Get a pointer to keys or records. - */ - if (level > 0) - kkbase = XFS_INOBT_KEY_ADDR(block, 1, cur); - else - krbase = XFS_INOBT_REC_ADDR(block, 1, cur); - /* - * Set low and high entry numbers, 1-based. - */ - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - /* - * If the block is empty, the tree must - * be an empty leaf. - */ - ASSERT(level == 0 && cur->bc_nlevels == 1); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - *stat = 0; - return 0; - } - /* - * Binary search the block. - */ - while (low <= high) { - xfs_agino_t startino; /* key value */ - - /* - * keyno is average of low and high. - */ - keyno = (low + high) >> 1; - /* - * Get startino. - */ - if (level > 0) { - xfs_inobt_key_t *kkp; - - kkp = kkbase + keyno - 1; - startino = be32_to_cpu(kkp->ir_startino); - } else { - xfs_inobt_rec_t *krp; - - krp = krbase + keyno - 1; - startino = be32_to_cpu(krp->ir_startino); - } - /* - * Compute difference to get next direction. - */ - diff = (__int64_t) - startino - cur->bc_rec.i.ir_startino; - /* - * Less than, move right. - */ - if (diff < 0) - low = keyno + 1; - /* - * Greater than, move left. - */ - else if (diff > 0) - high = keyno - 1; - /* - * Equal, we're done. - */ - else - break; - } - } - /* - * If there are more levels, set up for the next level - * by getting the block number and filling in the cursor. - */ - if (level > 0) { - /* - * If we moved left, need the previous key number, - * unless there isn't one. - */ - if (diff > 0 && --keyno < 1) - keyno = 1; - agbno = be32_to_cpu(*XFS_INOBT_PTR_ADDR(block, keyno, cur)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, agbno, level))) - return error; -#endif - cur->bc_ptrs[level] = keyno; - } - } - /* - * Done with the search. - * See if we need to adjust the results. - */ - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && - keyno > be16_to_cpu(block->bb_numrecs) && - be32_to_cpu(block->bb_rightsib) != NULLAGBLOCK) { - int i; - - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) - return error; - ASSERT(i == 1); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - /* - * Return if we succeeded or not. - */ - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) - *stat = 0; - else - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1798,59 +1592,6 @@ xfs_inobt_insert( } /* - * Lookup the record equal to ino in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_eq( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -/* - * Lookup the first record greater than or equal to ino - * in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_ge( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_GE, stat); -} - -/* - * Lookup the first record less than or equal to ino - * in the btree given by cur. - */ -int /* error */ -xfs_inobt_lookup_le( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free, /* free inode mask */ - int *stat) /* success/failure */ -{ - cur->bc_rec.i.ir_startino = ino; - cur->bc_rec.i.ir_freecount = fcnt; - cur->bc_rec.i.ir_free = free; - return xfs_inobt_lookup(cur, XFS_LOOKUP_LE, stat); -} - -/* * Update the record referred to by cur, to the value given * by [ino, fcnt, free]. * This either works (return 0) or gets an EFSCORRUPTED error. @@ -1910,6 +1651,30 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC void +xfs_inobt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->inobt.ir_startino = rec->inobt.ir_startino; +} + +/* + * intial value of ptr for lookup + */ +STATIC void +xfs_inobt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + struct xfs_agi *agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); + + ASSERT(cur->bc_private.a.agno == be32_to_cpu(agi->agi_seqno)); + + ptr->s = agi->agi_root; +} + STATIC union xfs_btree_ptr * xfs_inobt_ptr_addr( struct xfs_btree_cur *cur, @@ -1920,6 +1685,35 @@ xfs_inobt_ptr_addr( XFS_INOBT_PTR_ADDR(&block->bb_h, index, cur); } +STATIC union xfs_btree_key * +xfs_inobt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *) + XFS_INOBT_KEY_ADDR(&block->bb_h, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_inobt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *) + XFS_INOBT_REC_ADDR(&block->bb_h, index, cur); +} + +STATIC __int64_t +xfs_inobt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + return (__int64_t)be32_to_cpu(key->inobt.ir_startino) - + cur->bc_rec.i.ir_startino; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1989,7 +1783,12 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .init_key_from_rec = xfs_inobt_init_key_from_rec, + .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, .ptr_addr = xfs_inobt_ptr_addr, + .key_addr = xfs_inobt_key_addr, + .rec_addr = xfs_inobt_rec_addr, + .key_diff = xfs_inobt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-15 17:51:41.000000000 +0200 @@ -812,146 +812,6 @@ xfs_bmbt_log_ptrs( } /* - * Lookup the record. The cursor is made to point to it, based on dir. - */ -STATIC int /* error */ -xfs_bmbt_lookup( - xfs_btree_cur_t *cur, - xfs_lookup_t dir, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block=NULL; - xfs_buf_t *bp; - xfs_daddr_t d; - xfs_sfiloff_t diff; - int error; /* error return value */ - xfs_fsblock_t fsbno=0; - int high; - int i; - int keyno=0; - xfs_bmbt_key_t *kkbase=NULL; - xfs_bmbt_key_t *kkp; - xfs_bmbt_rec_t *krbase=NULL; - xfs_bmbt_rec_t *krp; - int level; - int low; - xfs_mount_t *mp; - xfs_bmbt_ptr_t *pp; - xfs_bmbt_irec_t *rp; - xfs_fileoff_t startoff; - xfs_trans_t *tp; - - XFS_STATS_INC(xs_bmbt_lookup); - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, (int)dir); - tp = cur->bc_tp; - mp = cur->bc_mp; - rp = &cur->bc_rec.b; - for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { - if (level < cur->bc_nlevels - 1) { - d = XFS_FSB_TO_DADDR(mp, fsbno); - bp = cur->bc_bufs[level]; - if (bp && XFS_BUF_ADDR(bp) != d) - bp = NULL; - if (!bp) { - if ((error = xfs_btree_read_bufl(mp, tp, fsbno, - 0, &bp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - xfs_btree_setbuf(cur, level, bp); - block = XFS_BUF_TO_BMBT_BLOCK(bp); - if ((error = xfs_btree_check_lblock(cur, block, - level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } else - block = XFS_BUF_TO_BMBT_BLOCK(bp); - } else - block = xfs_bmbt_get_block(cur, level, &bp); - if (diff == 0) - keyno = 1; - else { - if (level > 0) - kkbase = XFS_BMAP_KEY_IADDR(block, 1, cur); - else - krbase = XFS_BMAP_REC_IADDR(block, 1, cur); - low = 1; - if (!(high = be16_to_cpu(block->bb_numrecs))) { - ASSERT(level == 0); - cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - while (low <= high) { - XFS_STATS_INC(xs_bmbt_compare); - keyno = (low + high) >> 1; - if (level > 0) { - kkp = kkbase + keyno - 1; - startoff = be64_to_cpu(kkp->br_startoff); - } else { - krp = krbase + keyno - 1; - startoff = xfs_bmbt_disk_get_startoff(krp); - } - diff = (xfs_sfiloff_t) - (startoff - rp->br_startoff); - if (diff < 0) - low = keyno + 1; - else if (diff > 0) - high = keyno - 1; - else - break; - } - } - if (level > 0) { - if (diff > 0 && --keyno < 1) - keyno = 1; - pp = XFS_BMAP_PTR_IADDR(block, keyno, cur); - fsbno = be64_to_cpu(*pp); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr(cur, fsbno, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - cur->bc_ptrs[level] = keyno; - } - } - if (dir != XFS_LOOKUP_LE && diff < 0) { - keyno++; - /* - * If ge search and we went off the end of the block, but it's - * not the last block, we're in the wrong block. - */ - if (dir == XFS_LOOKUP_GE && keyno > be16_to_cpu(block->bb_numrecs) && - be64_to_cpu(block->bb_rightsib) != NULLDFSBNO) { - cur->bc_ptrs[0] = keyno; - if ((error = xfs_btree_increment(cur, 0, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - XFS_WANT_CORRUPTED_RETURN(i == 1); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - } - else if (dir == XFS_LOOKUP_LE && diff > 0) - keyno--; - cur->bc_ptrs[0] = keyno; - if (keyno == 0 || keyno > be16_to_cpu(block->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - } else { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); - } - return 0; -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1807,34 +1667,6 @@ xfs_bmbt_log_recs( XFS_BMBT_TRACE_CURSOR(cur, EXIT); } -int /* error */ -xfs_bmbt_lookup_eq( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - int *stat) /* success/failure */ -{ - cur->bc_rec.b.br_startoff = off; - cur->bc_rec.b.br_startblock = bno; - cur->bc_rec.b.br_blockcount = len; - return xfs_bmbt_lookup(cur, XFS_LOOKUP_EQ, stat); -} - -int /* error */ -xfs_bmbt_lookup_ge( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - int *stat) /* success/failure */ -{ - cur->bc_rec.b.br_startoff = off; - cur->bc_rec.b.br_startblock = bno; - cur->bc_rec.b.br_blockcount = len; - return xfs_bmbt_lookup(cur, XFS_LOOKUP_GE, stat); -} - /* * Give the bmap btree a new root block. Copy the old broot contents * down into a real block and make the broot point to it. @@ -2269,6 +2101,24 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC void +xfs_bmbt_init_key_from_rec( + struct xfs_btree_cur *cur, + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + key->bmbt.br_startoff = + cpu_to_be64(xfs_bmbt_disk_get_startoff(&rec->bmbt)); +} + +STATIC void +xfs_bmbt_init_ptr_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + ptr->l = 0; +} + STATIC union xfs_btree_ptr * xfs_bmbt_ptr_addr( struct xfs_btree_cur *cur, @@ -2279,6 +2129,35 @@ xfs_bmbt_ptr_addr( XFS_BMAP_PTR_IADDR(&block->bb_h, index, cur); } +STATIC union xfs_btree_key * +xfs_bmbt_key_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_key *) + XFS_BMAP_KEY_IADDR(&block->bb_h, index, cur); +} + +STATIC union xfs_btree_rec * +xfs_bmbt_rec_addr( + struct xfs_btree_cur *cur, + int index, + struct xfs_btree_block *block) +{ + return (union xfs_btree_rec *) + XFS_BMAP_REC_IADDR(&block->bb_h, index, cur); +} + +STATIC __int64_t +xfs_bmbt_key_diff( + struct xfs_btree_cur *cur, + union xfs_btree_key *key) +{ + return (__int64_t)be64_to_cpu(key->bmbt.br_startoff) - + cur->bc_rec.b.br_startoff; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2366,7 +2245,12 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .init_key_from_rec = xfs_bmbt_init_key_from_rec, + .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, .ptr_addr = xfs_bmbt_ptr_addr, + .key_addr = xfs_bmbt_key_addr, + .rec_addr = xfs_bmbt_rec_addr, + .key_diff = xfs_bmbt_key_diff, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-15 17:51:41.000000000 +0200 @@ -90,6 +90,54 @@ STATIC int xfs_alloc_ag_vextent_small(xf */ /* + * Lookup the record equal to [bno, len] in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to [bno, len] + * in the btree given by cur. + */ +STATIC int /* error */ +xfs_alloc_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len, /* length of extent */ + int *stat) /* success/failure */ +{ + cur->bc_rec.a.ar_startblock = bno; + cur->bc_rec.a.ar_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + + +/* * Compute aligned version of the found extent. * Takes alignment and min length into account. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -114,26 +114,6 @@ extern int xfs_alloc_get_rec(struct xfs_ extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat); /* - * Lookup the record equal to [bno, len] in the btree given by cur. - */ -extern int xfs_alloc_lookup_eq(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* - * Lookup the first record greater than or equal to [bno, len] - * in the btree given by cur. - */ -extern int xfs_alloc_lookup_ge(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* - * Lookup the first record less than or equal to [bno, len] - * in the btree given by cur. - */ -extern int xfs_alloc_lookup_le(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len, int *stat); - -/* * Update the record referred to by cur, to the value given by [bno, len]. * This either works (return 0) or gets an EFSCORRUPTED error. */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-15 17:51:41.000000000 +0200 @@ -402,6 +402,35 @@ xfs_bmap_disk_count_leaves( * Bmap internal routines. */ +STATIC int /* error */ +xfs_bmbt_lookup_eq( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + int *stat) /* success/failure */ +{ + cur->bc_rec.b.br_startoff = off; + cur->bc_rec.b.br_startblock = bno; + cur->bc_rec.b.br_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +STATIC int /* error */ +xfs_bmbt_lookup_ge( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + int *stat) /* success/failure */ +{ + cur->bc_rec.b.br_startoff = off; + cur->bc_rec.b.br_startblock = bno; + cur->bc_rec.b.br_blockcount = len; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + + /* * Called from xfs_bmap_add_attrfork to handle btree format files. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-15 17:51:41.000000000 +0200 @@ -119,6 +119,59 @@ xfs_ialloc_cluster_alignment( } /* + * Lookup the record equal to ino in the btree given by cur. + */ +STATIC int /* error */ +xfs_inobt_lookup_eq( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_EQ, stat); +} + +/* + * Lookup the first record greater than or equal to ino + * in the btree given by cur. + */ +int /* error */ +xfs_inobt_lookup_ge( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); +} + +/* + * Lookup the first record less than or equal to ino + * in the btree given by cur. + */ +int /* error */ +xfs_inobt_lookup_le( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free, /* free inode mask */ + int *stat) /* success/failure */ +{ + cur->bc_rec.i.ir_startino = ino; + cur->bc_rec.i.ir_freecount = fcnt; + cur->bc_rec.i.ir_free = free; + return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); +} + +/* * Allocate new inodes in the allocation group specified by agbp. * Return 0 for success, else error code. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.h 2008-07-15 15:11:29.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.h 2008-07-15 17:51:41.000000000 +0200 @@ -154,6 +154,21 @@ xfs_ialloc_pagi_init( struct xfs_trans *tp, /* transaction pointer */ xfs_agnumber_t agno); /* allocation group number */ +/* + * Lookup the first record greater than or equal to ino + * in the btree given by cur. + */ +int xfs_inobt_lookup_ge(struct xfs_btree_cur *cur, xfs_agino_t ino, + __int32_t fcnt, xfs_inofree_t free, int *stat); + +/* + * Lookup the first record less than or equal to ino + * in the btree given by cur. + */ +int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino, + __int32_t fcnt, xfs_inofree_t free, int *stat); + + #endif /* __KERNEL__ */ #endif /* __XFS_IALLOC_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -136,26 +136,6 @@ extern int xfs_inobt_get_rec(struct xfs_ extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat); /* - * Lookup the record equal to ino in the btree given by cur. - */ -extern int xfs_inobt_lookup_eq(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* - * Lookup the first record greater than or equal to ino - * in the btree given by cur. - */ -extern int xfs_inobt_lookup_ge(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* - * Lookup the first record less than or equal to ino - * in the btree given by cur. - */ -extern int xfs_inobt_lookup_le(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free, int *stat); - -/* * Update the record referred to by cur, to the value given * by [ino, fcnt, free]. * This either works (return 0) or gets an EFSCORRUPTED error. Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:46:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-15 17:51:41.000000000 +0200 @@ -254,10 +254,6 @@ extern int xfs_bmbt_insert(struct xfs_bt extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int); -extern int xfs_bmbt_lookup_eq(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, int *); -extern int xfs_bmbt_lookup_ge(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, int *); /* * Give the bmap btree a new root block. Copy the old broot contents -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_63, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJU5SN032294 for ; Tue, 29 Jul 2008 12:30:06 -0700 X-ASG-Debug-ID: 1217359874-09fb03830000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 89CD81947D01 for ; Tue, 29 Jul 2008 12:31:14 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id DOMvCcBVmNkrLb5F for ; Tue, 29 Jul 2008 12:31:14 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVGIF019321 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:16 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVGYm019319 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:16 +0200 Date: Tue, 29 Jul 2008 21:31:16 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 13/21] implement generic xfs_btree_update Subject: [PATCH 13/21] implement generic xfs_btree_update Message-ID: <20080729193116.GN19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline; filename=xfs-common-btree-update Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359876 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17253 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner The most complicated part here is the lastrec tracking for the alloc btree. Most logic is in the update_lastrec method which has to do some hopefully good enough dirty magic to maintain it. [hch: split out from bigger patch and a rework of the lastrec logic] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 05:10:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 05:24:20.000000000 +0200 @@ -867,6 +867,30 @@ xfs_btree_get_sibling( } } +/* + * Return true if ptr is the last record in the btree and + * we need to track updateÑ• to this record. The decision + * will be further refined in the update_lastrec method. + */ +STATIC int +xfs_btree_is_lastrec( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + int level) +{ + union xfs_btree_ptr ptr; + + if (level > 0) + return 0; + if (!(cur->bc_flags & XFS_BTREE_LASTREC_UPDATE)) + return 0; + + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); + if (!xfs_btree_ptr_is_null(cur, &ptr)) + return 0; + return 1; +} + STATIC struct xfs_btree_block * xfs_btree_buf_to_block( struct xfs_btree_cur *cur, @@ -1417,3 +1441,66 @@ xfs_btree_updkey( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); return 0; } + +/* + * Update the record referred to by cur to the value in the + * given record. This either works (return 0) or gets an + * EFSCORRUPTED error. + */ +int +xfs_btree_update( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + struct xfs_btree_block *block; + struct xfs_buf *bp; + int error; + int ptr; + union xfs_btree_rec *rp; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGR(cur, rec); + + /* Pick up the current block. */ + block = xfs_btree_get_block(cur, 0, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, 0, bp); + if (error) + goto error0; +#endif + /* Get the address of the rec to be updated. */ + ptr = cur->bc_ptrs[0]; + rp = cur->bc_ops->rec_addr(cur, ptr, block); + + /* Fill in the new contents and log them. */ + cur->bc_ops->copy_recs(cur, rec, rp, 1); + cur->bc_ops->log_recs(cur, bp, ptr, ptr); + + /* + * If we are tracking the last record in the tree and + * we are at the far right edge of the tree, update it. + */ + if (xfs_btree_is_lastrec(cur, block, 0)) { + cur->bc_ops->update_lastrec(cur, block, rec, + ptr, LASTREC_UPDATE); + } + + /* Updating first rec in leaf. Pass new key value up to our parent. */ + if (ptr == 1) { + union xfs_btree_key key; + + cur->bc_ops->init_key_from_rec(cur, &key, rec); + error = xfs_btree_updkey(cur, &key, 1); + if (error) + goto error0; + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-21 05:10:35.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-21 05:45:02.000000000 +0200 @@ -49,7 +49,9 @@ STATIC void xfs_allocbt_log_keys(xfs_btr #define xfs_alloc_log_keys(c, b, i, j) \ xfs_allocbt_log_keys(c, b, i, j) STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_alloc_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); +STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); +#define xfs_alloc_log_recs(c, b, i, j) \ + xfs_allocbt_log_recs(c, b, i, j) STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); @@ -883,41 +885,6 @@ xfs_alloc_log_ptrs( } /* - * Log records from a btree block (leaf). - */ -STATIC void -xfs_alloc_log_recs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int rfirst, /* index of first record to log */ - int rlast) /* index of last record to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_alloc_rec_t *rp; /* record pointer for btree block */ - - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - rp = XFS_ALLOC_REC_ADDR(block, 1, cur); -#ifdef DEBUG - { - xfs_agf_t *agf; - xfs_alloc_rec_t *p; - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - for (p = &rp[rfirst - 1]; p <= &rp[rlast - 1]; p++) - ASSERT(be32_to_cpu(p->ar_startblock) + - be32_to_cpu(p->ar_blockcount) <= - be32_to_cpu(agf->agf_length)); - } -#endif - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1642,83 +1609,50 @@ xfs_alloc_insert( return 0; } +STATIC struct xfs_btree_cur * +xfs_allocbt_dup_cursor( + struct xfs_btree_cur *cur) +{ + return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, + cur->bc_private.a.agbp, cur->bc_private.a.agno, + cur->bc_btnum); +} + /* - * Update the record referred to by cur, to the value given by [bno, len]. - * This either works (return 0) or gets an EFSCORRUPTED error. + * Update the longest extent in the AGF */ -int /* error */ -xfs_alloc_update( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agblock_t bno, /* starting block of extent */ - xfs_extlen_t len) /* length of extent */ +STATIC void +xfs_allocbt_update_lastrec( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_rec *rec, + int ptr, + int reason) { - xfs_alloc_block_t *block; /* btree block to update */ - int error; /* error return value */ - int ptr; /* current record number (updating) */ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); + __be32 len; - ASSERT(len > 0); - /* - * Pick up the a.g. freelist struct and the current block. - */ - block = XFS_BUF_TO_ALLOC_BLOCK(cur->bc_bufs[0]); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, 0, cur->bc_bufs[0]))) - return error; -#endif - /* - * Get the address of the rec to be updated. - */ - ptr = cur->bc_ptrs[0]; - { - xfs_alloc_rec_t *rp; /* pointer to updated record */ + ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); - rp = XFS_ALLOC_REC_ADDR(block, ptr, cur); + switch (reason) { + case LASTREC_UPDATE: /* - * Fill in the new contents and log them. + * If this is the last leaf block and it's the last record, + * then update the size of the longest extent in the AG. */ - rp->ar_startblock = cpu_to_be32(bno); - rp->ar_blockcount = cpu_to_be32(len); - xfs_alloc_log_recs(cur, cur->bc_bufs[0], ptr, ptr); + if (ptr != xfs_btree_get_numrecs(block)) + return; + len = rec->alloc.ar_blockcount; + break; + default: + ASSERT(0); + return; } - /* - * If it's the by-size btree and it's the last leaf block and - * it's the last record... then update the size of the longest - * extent in the a.g., which we cache in the a.g. freelist header. - */ - if (cur->bc_btnum == XFS_BTNUM_CNT && - be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK && - ptr == be16_to_cpu(block->bb_numrecs)) { - xfs_agf_t *agf; /* a.g. freespace header */ - xfs_agnumber_t seqno; - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - seqno = be32_to_cpu(agf->agf_seqno); - cur->bc_mp->m_perag[seqno].pagf_longest = len; - agf->agf_longest = cpu_to_be32(len); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_LONGEST); - } - /* - * Updating first record in leaf. Pass new key value up to our parent. - */ - if (ptr == 1) { - xfs_alloc_key_t key; /* key containing [bno, len] */ - - key.ar_startblock = cpu_to_be32(bno); - key.ar_blockcount = cpu_to_be32(len); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) - return error; - } - return 0; -} -STATIC struct xfs_btree_cur * -xfs_allocbt_dup_cursor( - struct xfs_btree_cur *cur) -{ - return xfs_allocbt_init_cursor(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agbp, cur->bc_private.a.agno, - cur->bc_btnum); + agf->agf_longest = len; + cur->bc_mp->m_perag[seqno].pagf_longest = be32_to_cpu(len); + xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST); } STATIC void @@ -1808,6 +1742,17 @@ xfs_allocbt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_alloc_key_t)); } +STATIC void +xfs_allocbt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_alloc_rec_t)); +} + /* * Log keys from a btree block (nonleaf). */ @@ -1835,6 +1780,44 @@ xfs_allocbt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log records from a btree block (leaf). + */ +STATIC void +xfs_alloc_log_recs( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int rfirst, /* index of first record to log */ + int rlast) /* index of last record to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + int last; /* last byte offset logged */ + xfs_alloc_rec_t *rp; /* record pointer for btree block */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, rfirst, rlast); + + block = XFS_BUF_TO_SBLOCK(bp); + rp = XFS_ALLOC_REC_ADDR(block, 1, cur); +#ifdef DEBUG + { + struct xfs_agf *agf; + xfs_alloc_rec_t *p; + + agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + for (p = &rp[rfirst - 1]; p <= &rp[rlast - 1]; p++) + ASSERT(be32_to_cpu(p->ar_startblock) + + be32_to_cpu(p->ar_blockcount) <= + be32_to_cpu(agf->agf_length)); + } +#endif + first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} #ifdef XFS_BTREE_TRACE @@ -1905,6 +1888,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .update_lastrec = xfs_allocbt_update_lastrec, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, @@ -1912,7 +1896,9 @@ static const struct xfs_btree_ops xfs_al .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, .copy_keys = xfs_allocbt_copy_keys, + .copy_recs = xfs_allocbt_copy_recs, .log_keys = xfs_allocbt_log_keys, + .log_recs = xfs_allocbt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, @@ -1947,6 +1933,8 @@ xfs_allocbt_init_cursor( cur->bc_blocklog = mp->m_sb.sb_blocklog; cur->bc_ops = &xfs_allocbt_ops; + if (btnum == XFS_BTNUM_CNT) + cur->bc_flags = XFS_BTREE_LASTREC_UPDATE; cur->bc_private.a.agbp = agbp; cur->bc_private.a.agno = agno; Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 05:11:01.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 05:23:07.000000000 +0200 @@ -191,6 +191,11 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* updated last record information */ + void (*update_lastrec)(struct xfs_btree_cur *, + struct xfs_btree_block *, + union xfs_btree_rec *, int, int); + /* return address of btree structures */ union xfs_btree_ptr *(*ptr_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); @@ -214,11 +219,15 @@ struct xfs_btree_ops { void (*copy_keys)(struct xfs_btree_cur *cur, union xfs_btree_key *src_key, union xfs_btree_key *dst_key, int numkeys); + void (*copy_recs)(struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, int numkeys); /* log changes to btree structures */ void (*log_keys)(struct xfs_btree_cur *cur, struct xfs_buf *bp, int first, int last); - + void (*log_recs)(struct xfs_btree_cur *cur, struct xfs_buf *bp, + int first, int last); /* btree tracing */ #ifdef XFS_BTREE_TRACE @@ -241,6 +250,12 @@ struct xfs_btree_ops { }; /* + * Reasons for the update_lastrec method to be called. + */ +#define LASTREC_UPDATE 0 + + +/* * Btree cursor structure. * This collects all information needed by the btree code in one place. */ @@ -284,6 +299,7 @@ typedef struct xfs_btree_cur /* cursor flags */ #define XFS_BTREE_LONG_PTRS (1<<0) /* pointers are 64bits long */ #define XFS_BTREE_ROOT_IN_INODE (1<<1) /* root may be variable size */ +#define XFS_BTREE_LASTREC_UPDATE (1<<2) /* track last rec externally */ #define XFS_BTREE_NOERROR 0 @@ -539,6 +555,7 @@ int xfs_btree_increment(struct xfs_btree int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); +int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-21 05:08:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-21 05:22:00.000000000 +0200 @@ -136,6 +136,23 @@ xfs_alloc_lookup_le( return xfs_btree_lookup(cur, XFS_LOOKUP_LE, stat); } +/* + * Update the record referred to by cur to the value given + * by [bno, len]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_alloc_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agblock_t bno, /* starting block of extent */ + xfs_extlen_t len) /* length of extent */ +{ + union xfs_btree_rec rec; + + rec.alloc.ar_startblock = cpu_to_be32(bno); + rec.alloc.ar_blockcount = cpu_to_be32(len); + return xfs_btree_update(cur, &rec); +} /* * Compute aligned version of the found extent. Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-21 05:08:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-21 05:17:12.000000000 +0200 @@ -113,13 +113,6 @@ extern int xfs_alloc_get_rec(struct xfs_ */ extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat); -/* - * Update the record referred to by cur, to the value given by [bno, len]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -extern int xfs_alloc_update(struct xfs_btree_cur *cur, xfs_agblock_t bno, - xfs_extlen_t len); - extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-21 05:25:57.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-21 05:30:09.000000000 +0200 @@ -172,6 +172,26 @@ xfs_inobt_lookup_le( } /* + * Update the record referred to by cur to the value given + * by [ino, fcnt, free]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int /* error */ +xfs_inobt_update( + struct xfs_btree_cur *cur, /* btree cursor */ + xfs_agino_t ino, /* starting inode of chunk */ + __int32_t fcnt, /* free inode count */ + xfs_inofree_t free) /* free inode mask */ +{ + union xfs_btree_rec rec; + + rec.inobt.ir_startino = cpu_to_be32(ino); + rec.inobt.ir_freecount = cpu_to_be32(fcnt); + rec.inobt.ir_free = cpu_to_be64(free); + return xfs_btree_update(cur, &rec); +} + +/* * Allocate new inodes in the allocation group specified by agbp. * Return 0 for success, else error code. */ Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-21 05:25:48.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-21 05:44:35.000000000 +0200 @@ -785,28 +785,6 @@ xfs_inobt_log_ptrs( } /* - * Log records from a btree block (leaf). - */ -STATIC void -xfs_inobt_log_recs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int rfirst, /* index of first record to log */ - int rlast) /* index of last record to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_inobt_rec_t *rp; /* record pointer for btree block */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - rp = XFS_INOBT_REC_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Move 1 record left from cur/level if possible. * Update cur to reflect the new path. */ @@ -1530,58 +1508,6 @@ xfs_inobt_insert( return 0; } -/* - * Update the record referred to by cur, to the value given - * by [ino, fcnt, free]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -int /* error */ -xfs_inobt_update( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_agino_t ino, /* starting inode of chunk */ - __int32_t fcnt, /* free inode count */ - xfs_inofree_t free) /* free inode mask */ -{ - xfs_inobt_block_t *block; /* btree block to update */ - xfs_buf_t *bp; /* buffer containing btree block */ - int error; /* error return value */ - int ptr; /* current record number (updating) */ - xfs_inobt_rec_t *rp; /* pointer to updated record */ - - /* - * Pick up the current block. - */ - bp = cur->bc_bufs[0]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, 0, bp))) - return error; -#endif - /* - * Get the address of the rec to be updated. - */ - ptr = cur->bc_ptrs[0]; - rp = XFS_INOBT_REC_ADDR(block, ptr, cur); - /* - * Fill in the new contents and log them. - */ - rp->ir_startino = cpu_to_be32(ino); - rp->ir_freecount = cpu_to_be32(fcnt); - rp->ir_free = cpu_to_be64(free); - xfs_inobt_log_recs(cur, bp, ptr, ptr); - /* - * Updating first record in leaf. Pass new key value up to our parent. - */ - if (ptr == 1) { - xfs_inobt_key_t key; /* key containing [ino] */ - - key.ir_startino = cpu_to_be32(ino); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) - return error; - } - return 0; -} - STATIC struct xfs_btree_cur * xfs_inobt_dup_cursor( struct xfs_btree_cur *cur) @@ -1664,6 +1590,17 @@ xfs_inobt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_inobt_key_t)); } +STATIC void +xfs_inobt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_inobt_rec_t)); +} + /* * Log keys from a btree block (nonleaf). */ @@ -1691,6 +1628,34 @@ xfs_inobt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log records from a btree block (leaf). + */ +STATIC void +xfs_inobt_log_recs( + xfs_btree_cur_t *cur, /* btree cursor */ + xfs_buf_t *bp, /* buffer containing btree block */ + int rfirst, /* index of first record to log */ + int rlast) /* index of last record to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + int last; /* last byte offset logged */ + xfs_inobt_rec_t *rp; /* record pointer for btree block */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, rfirst, rlast); + + block = XFS_BUF_TO_SBLOCK(bp); + rp = XFS_INOBT_REC_ADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1767,7 +1732,9 @@ static const struct xfs_btree_ops xfs_in .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, .copy_keys = xfs_inobt_copy_keys, + .copy_recs = xfs_inobt_copy_recs, .log_keys = xfs_inobt_log_keys, + .log_recs = xfs_inobt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-21 05:25:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-21 05:25:47.000000000 +0200 @@ -135,14 +135,6 @@ extern int xfs_inobt_get_rec(struct xfs_ */ extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat); -/* - * Update the record referred to by cur, to the value given - * by [ino, fcnt, free]. - * This either works (return 0) or gets an EFSCORRUPTED error. - */ -extern int xfs_inobt_update(struct xfs_btree_cur *cur, xfs_agino_t ino, - __int32_t fcnt, xfs_inofree_t free); - extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-21 05:27:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-21 05:29:42.000000000 +0200 @@ -430,6 +430,24 @@ xfs_bmbt_lookup_ge( return xfs_btree_lookup(cur, XFS_LOOKUP_GE, stat); } +/* +* Update the record referred to by cur to the value given + * by [off, bno, len, state]. + * This either works (return 0) or gets an EFSCORRUPTED error. + */ +STATIC int +xfs_bmbt_update( + struct xfs_btree_cur *cur, + xfs_fileoff_t off, + xfs_fsblock_t bno, + xfs_filblks_t len, + xfs_exntst_t state) +{ + union xfs_btree_rec rec; + + xfs_bmbt_disk_set_allf(&rec.bmbt, off, bno, len, state); + return xfs_btree_update(cur, &rec); +} /* * Called from xfs_bmap_add_attrfork to handle btree format files. Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-21 05:27:36.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-21 05:49:46.000000000 +0200 @@ -1565,34 +1565,6 @@ xfs_bmbt_log_block( } /* - * Log record values from the btree block. - */ -void -xfs_bmbt_log_recs( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int rfirst, - int rlast) -{ - xfs_bmbt_block_t *block; - int first; - int last; - xfs_bmbt_rec_t *rp; - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, rfirst, rlast); - ASSERT(bp); - tp = cur->bc_tp; - block = XFS_BUF_TO_BMBT_BLOCK(bp); - rp = XFS_BMAP_REC_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* * Give the bmap btree a new root block. Copy the old broot contents * down into a real block and make the broot point to it. */ @@ -1926,51 +1898,6 @@ xfs_bmbt_to_bmdr( } /* - * Update the record to the passed values. - */ -int -xfs_bmbt_update( - xfs_btree_cur_t *cur, - xfs_fileoff_t off, - xfs_fsblock_t bno, - xfs_filblks_t len, - xfs_exntst_t state) -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; - int error; - xfs_bmbt_key_t key; - int ptr; - xfs_bmbt_rec_t *rp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGFFFI(cur, (xfs_dfiloff_t)off, (xfs_dfsbno_t)bno, - (xfs_dfilblks_t)len, (int)state); - block = xfs_bmbt_get_block(cur, 0, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, 0, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - ptr = cur->bc_ptrs[0]; - rp = XFS_BMAP_REC_IADDR(block, ptr, cur); - xfs_bmbt_disk_set_allf(rp, off, bno, len, state); - xfs_bmbt_log_recs(cur, bp, ptr, ptr); - if (ptr > 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; - } - key.br_startoff = cpu_to_be64(off); - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; -} - -/* * Check extent records, which have just been read, for * any bit in the extent flag field. ASSERT on debug * kernels, as this condition should not occur. @@ -2094,6 +2021,17 @@ xfs_bmbt_copy_keys( memcpy(dst_key, src_key, numkeys * sizeof(xfs_bmbt_key_t)); } +STATIC void +xfs_bmbt_copy_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *src_rec, + union xfs_btree_rec *dst_rec, + int numrecs) +{ + ASSERT(numrecs >= 0); + memcpy(dst_rec, src_rec, numrecs * sizeof(xfs_bmbt_rec_t)); +} + /* * Log key values from the btree block. */ @@ -2126,6 +2064,33 @@ xfs_bmbt_log_keys( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Log record values from the btree block. + */ +void +xfs_bmbt_log_recs( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int rfirst, + int rlast) +{ + struct xfs_btree_lblock *block; + int first; + int last; + xfs_bmbt_rec_t *rp; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, rfirst, rlast); + + block = XFS_BUF_TO_LBLOCK(bp); + rp = XFS_BMAP_REC_DADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&rp[rfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&rp[rlast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2222,7 +2187,9 @@ static const struct xfs_btree_ops xfs_bm .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, .copy_keys = xfs_bmbt_copy_keys, + .copy_recs = xfs_bmbt_copy_recs, .log_keys = xfs_bmbt_log_keys, + .log_recs = xfs_bmbt_log_recs, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-21 05:27:31.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-21 05:27:35.000000000 +0200 @@ -274,8 +274,6 @@ extern void xfs_bmbt_disk_set_allf(xfs_b xfs_fsblock_t b, xfs_filblks_t c, xfs_exntst_t v); extern void xfs_bmbt_to_bmdr(xfs_bmbt_block_t *, int, xfs_bmdr_block_t *, int); -extern int xfs_bmbt_update(struct xfs_btree_cur *, xfs_fileoff_t, - xfs_fsblock_t, xfs_filblks_t, xfs_exntst_t); extern struct xfs_btree_cur *xfs_bmbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_inode *, int); -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJUAJv032407 for ; Tue, 29 Jul 2008 12:30:11 -0700 X-ASG-Debug-ID: 1217359879-0cdf00960000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 7A866ECE243 for ; Tue, 29 Jul 2008 12:31:19 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id lpgLbua3R1seLtD1 for ; Tue, 29 Jul 2008 12:31:19 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVLIF019334 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:21 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVLGZ019332 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:21 +0200 Date: Tue, 29 Jul 2008 21:31:21 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 14/21] add get_maxrecs btree operation Subject: [PATCH 14/21] add get_maxrecs btree operation Message-ID: <20080729193121.GO19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-btree-get_maxrecs-method User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359883 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17255 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Factor xfs_btree_maxrecs into a per-btree operation. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-24 08:58:28.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-24 09:01:57.000000000 +0200 @@ -52,31 +52,6 @@ const __uint32_t xfs_magics[XFS_BTNUM_MA }; /* - * Checking routine: return maxrecs for the block. - */ -STATIC int /* number of records fitting in block */ -xfs_btree_maxrecs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_btree_block_t *block) /* generic btree block pointer */ -{ - switch (cur->bc_btnum) { - case XFS_BTNUM_BNO: - case XFS_BTNUM_CNT: - return (int)XFS_ALLOC_BLOCK_MAXRECS( - be16_to_cpu(block->bb_h.bb_level), cur); - case XFS_BTNUM_BMAP: - return (int)XFS_BMAP_BLOCK_IMAXRECS( - be16_to_cpu(block->bb_h.bb_level), cur); - case XFS_BTNUM_INO: - return (int)XFS_INOBT_BLOCK_MAXRECS( - be16_to_cpu(block->bb_h.bb_level), cur); - default: - ASSERT(0); - return 0; - } -} - -/* * External routines. */ @@ -208,7 +183,7 @@ xfs_btree_check_lblock( be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && be16_to_cpu(block->bb_level) == level && be16_to_cpu(block->bb_numrecs) <= - xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && + cur->bc_ops->get_maxrecs(cur, level) && block->bb_leftsib && (be64_to_cpu(block->bb_leftsib) == NULLDFSBNO || XFS_FSB_SANITY_CHECK(mp, be64_to_cpu(block->bb_leftsib))) && @@ -245,7 +220,7 @@ xfs_btree_check_sblock( be32_to_cpu(block->bb_magic) == xfs_magics[cur->bc_btnum] && be16_to_cpu(block->bb_level) == level && be16_to_cpu(block->bb_numrecs) <= - xfs_btree_maxrecs(cur, (xfs_btree_block_t *)block) && + cur->bc_ops->get_maxrecs(cur, level) && (be32_to_cpu(block->bb_leftsib) == NULLAGBLOCK || be32_to_cpu(block->bb_leftsib) < agflen) && block->bb_leftsib && Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-24 08:57:24.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-24 08:58:17.000000000 +0200 @@ -204,6 +204,9 @@ struct xfs_btree_ops { union xfs_btree_rec *(*rec_addr)(struct xfs_btree_cur *cur, int index, struct xfs_btree_block *block); + /* records in block/level */ + int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); + /* init values of btree structures */ void (*init_key_from_rec)(struct xfs_btree_cur *cur, union xfs_btree_key *key, Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-24 09:03:09.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-24 09:04:29.000000000 +0200 @@ -1655,6 +1655,14 @@ xfs_allocbt_update_lastrec( xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, XFS_AGF_LONGEST); } +STATIC int +xfs_allocbt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mxr[level != 0]; +} + STATIC void xfs_allocbt_init_key_from_rec( struct xfs_btree_cur *cur, @@ -1889,6 +1897,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, .update_lastrec = xfs_allocbt_update_lastrec, + .get_maxrecs = xfs_allocbt_get_maxrecs, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-24 09:04:44.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-24 09:08:34.000000000 +0200 @@ -1953,6 +1953,14 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC int +xfs_bmbt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return XFS_BMAP_BLOCK_IMAXRECS(level, cur); +} + STATIC void xfs_bmbt_init_key_from_rec( struct xfs_btree_cur *cur, @@ -2182,6 +2190,7 @@ static const struct xfs_btree_ops xfs_bm .get_root_from_inode = xfs_bmbt_get_root_from_inode, .init_key_from_rec = xfs_bmbt_init_key_from_rec, .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, + .get_maxrecs = xfs_bmbt_get_maxrecs, .ptr_addr = xfs_bmbt_ptr_addr, .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-24 09:06:55.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-24 09:08:06.000000000 +0200 @@ -1516,6 +1516,14 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC int +xfs_inobt_get_maxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_inobt_mxr[level != 0]; +} + STATIC void xfs_inobt_init_key_from_rec( struct xfs_btree_cur *cur, @@ -1725,6 +1733,7 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .get_maxrecs = xfs_inobt_get_maxrecs, .init_key_from_rec = xfs_inobt_init_key_from_rec, .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, .ptr_addr = xfs_inobt_ptr_addr, -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_64,J_CHICKENPOX_66,J_CHICKENPOX_73,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJUEOI032480 for ; Tue, 29 Jul 2008 12:30:15 -0700 X-ASG-Debug-ID: 1217359884-275601f40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 1AA6B1947D1B for ; Tue, 29 Jul 2008 12:31:24 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id AL5rE9mQV9rgB63K for ; Tue, 29 Jul 2008 12:31:24 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVQIF019347 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:26 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVQNl019345 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:26 +0200 Date: Tue, 29 Jul 2008 21:31:25 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 15/21] implement generic xfs_btree_rshift Subject: [PATCH 15/21] implement generic xfs_btree_rshift Message-ID: <20080729193125.GP19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-rshift User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359886 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17256 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Make the btree right shift code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-27 17:40:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-28 16:13:33.000000000 +0200 @@ -34,6 +34,7 @@ #include "xfs_attr_sf.h" #include "xfs_dinode.h" #include "xfs_inode.h" +#include "xfs_inode_item.h" #include "xfs_btree.h" #include "xfs_btree_trace.h" #include "xfs_ialloc.h" @@ -952,6 +953,123 @@ xfs_btree_read_buf_block( return xfs_btree_check_block(cur, *block, level, *bpp); } +STATIC void +xfs_btree_move_ptrs( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *base, + int from, + int to, + int numptrs) +{ + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numptrs >= 0); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __be64 *lpp = &base->l; + + memmove(&lpp[to], &lpp[from], numptrs * sizeof(*lpp)); + } else { + __be32 *spp = &base->s; + + memmove(&spp[to], &spp[from], numptrs * sizeof(*spp)); + } +} + +/* + * Log block pointer fields from a btree block (nonleaf). + */ +STATIC void +xfs_btree_log_ptrs( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int pfirst, /* index of first pointer to log */ + int plast) /* index of last pointer to log */ +{ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, pfirst, plast); + + if (bp) { + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); + union xfs_btree_ptr *pp; + int first; /* first byte offset logged */ + int last; /* last byte offset logged */ + + pp = cur->bc_ops->ptr_addr(cur, 1, block); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __be64 *lpp = &pp->l; + + first = (int)((xfs_caddr_t)&lpp[pfirst - 1] - + (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&lpp[plast] - 1) - + (xfs_caddr_t)block); + } else { + __be32 *spp = &pp->s; + + first = (int)((xfs_caddr_t)&spp[pfirst - 1] - + (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&spp[plast] - 1) - + (xfs_caddr_t)block); + } + + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + } else { + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + +/* + * Log fields from the short from btree block header. + */ +STATIC void +xfs_btree_log_block( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int fields) /* mask of fields: XFS_BB_... */ +{ + int first; /* first byte offset logged */ + int last; /* last byte offset logged */ + static const short soffsets[] = { /* table of offsets (short) */ + offsetof(struct xfs_btree_sblock, bb_magic), + offsetof(struct xfs_btree_sblock, bb_level), + offsetof(struct xfs_btree_sblock, bb_numrecs), + offsetof(struct xfs_btree_sblock, bb_leftsib), + offsetof(struct xfs_btree_sblock, bb_rightsib), + sizeof(struct xfs_btree_sblock) + }; + static const short loffsets[] = { /* table of offsets (long) */ + offsetof(struct xfs_btree_lblock, bb_magic), + offsetof(struct xfs_btree_lblock, bb_level), + offsetof(struct xfs_btree_lblock, bb_numrecs), + offsetof(struct xfs_btree_lblock, bb_leftsib), + offsetof(struct xfs_btree_lblock, bb_rightsib), + sizeof(struct xfs_btree_lblock) + }; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBI(cur, bp, fields); + + if (bp) { + xfs_btree_offsets(fields, + (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? + loffsets : soffsets, + XFS_BB_NUM_BITS, &first, &last); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + } else { + /* XXX(hch): maybe factor out into a method? */ + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + /* * Increment cursor by one record at the level. * For nonzero levels the leaf-ward information is untouched. @@ -1152,7 +1270,6 @@ error0: return error; } - STATIC int xfs_btree_lookup_get_block( struct xfs_btree_cur *cur, /* btree cursor */ @@ -1479,3 +1596,177 @@ error0: return error; } +/* + * Move 1 record right from cur/level if possible. + * Update cur to reflect the new path. + */ +int /* error */ +xfs_btree_rshift( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + union xfs_btree_key key; /* btree key */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + struct xfs_btree_cur *tcur; /* temporary btree cursor */ + union xfs_btree_ptr rptr; /* right block pointer */ + union xfs_btree_key *rkp; /* right btree key */ + int rrecs; /* right record count */ + int lrecs; /* left record count */ + int error; /* error return value */ + int i; /* loop counter */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level == cur->bc_nlevels - 1)) + goto out0; + + /* Set up variables for this block as "left". */ + left = xfs_btree_get_block(cur, level, &lbp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, left, level, lbp); + if (error) + goto error0; +#endif + + /* If we've got no right sibling then we can't shift an entry right. */ + xfs_btree_get_sibling(cur, left, &rptr, XFS_BB_RIGHTSIB); + if (xfs_btree_ptr_is_null(cur, &rptr)) + goto out0; + + /* + * If the cursor entry is the one that would be moved, don't + * do it... it's too complicated. + */ + lrecs = xfs_btree_get_numrecs(left); + if (cur->bc_ptrs[level] >= lrecs) + goto out0; + + /* Set up the right neighbor as "right". */ + error = xfs_btree_read_buf_block(cur, &rptr, level, 0, &right, &rbp); + if (error) + goto error0; + + /* If it's full, it can't take another entry. */ + rrecs = xfs_btree_get_numrecs(right); + if (rrecs == cur->bc_ops->get_maxrecs(cur, level)) + goto out0; + + XFS_BTREE_STATS_INC(cur, rshift); + XFS_BTREE_STATS_ADD(cur, moves, rrecs); + + /* + * Make a hole at the start of the right neighbor block, then + * copy the last left block entry to the hole. + */ + if (level > 0) { + /* It's a nonleaf. make a hole in the keys and ptrs */ + union xfs_btree_key *lkp; + union xfs_btree_ptr *lpp; + union xfs_btree_ptr *rpp; + + lkp = cur->bc_ops->key_addr(cur, lrecs, left); + lpp = cur->bc_ops->ptr_addr(cur, lrecs, left); + rkp = cur->bc_ops->key_addr(cur, 1, right); + rpp = cur->bc_ops->ptr_addr(cur, 1, right); + +#ifdef DEBUG + for (i = rrecs - 1; i >= 0; i--) { + error = xfs_btree_check_ptr(cur, rpp, i, level); + if (error) + goto error0; + } +#endif + + cur->bc_ops->move_keys(cur, rkp, 0, 1, rrecs); + xfs_btree_move_ptrs(cur, rpp, 0, 1, rrecs); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, lpp, 0, level); + if (error) + goto error0; +#endif + + /* Now put the new data in, and log it. */ + cur->bc_ops->set_key(cur, rkp, 0, lkp); + *rpp = *lpp; + + cur->bc_ops->log_keys(cur, rbp, 1, rrecs + 1); + xfs_btree_log_ptrs(cur, rbp, 1, rrecs + 1); + + xfs_btree_check_key(cur->bc_btnum, rkp, + cur->bc_ops->key_addr(cur, 2, right)); + } else { + /* It's a leaf. make a hole in the records */ + union xfs_btree_rec *lrp; + union xfs_btree_rec *rrp; + + lrp = cur->bc_ops->rec_addr(cur, lrecs, left); + rrp = cur->bc_ops->rec_addr(cur, 1, right); + + cur->bc_ops->move_recs(cur, rrp, 0, 1, rrecs); + + /* Now put the new data in, and log it. */ + cur->bc_ops->set_rec(cur, rrp, 0, lrp); + cur->bc_ops->log_recs(cur, rbp, 1, rrecs + 1); + + cur->bc_ops->init_key_from_rec(cur, &key, rrp); + rkp = &key; + + xfs_btree_check_rec(cur->bc_btnum, rrp, + cur->bc_ops->rec_addr(cur, 2, right)); + } + + /* + * Decrement and log left's numrecs, bump and log right's numrecs. + */ + xfs_btree_set_numrecs(left, --lrecs); + xfs_btree_log_block(cur, lbp, XFS_BB_NUMRECS); + + xfs_btree_set_numrecs(right, ++rrecs); + xfs_btree_log_block(cur, rbp, XFS_BB_NUMRECS); + + /* + * Using a temporary cursor, update the parent key values of the + * block on the right. + */ + error = xfs_btree_dup_cursor(cur, &tcur); + if (error) + goto error0; + i = xfs_btree_lastrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_increment(tcur, level, &i); + if (error) + goto error1; + + error = xfs_btree_updkey(tcur, rkp, level + 1); + if (error) + goto error1; + + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + +error1: + XFS_BTREE_TRACE_CURSOR(tcur, XBT_ERROR); + xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-27 17:40:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-27 17:48:40.000000000 +0200 @@ -218,6 +218,22 @@ struct xfs_btree_ops { __int64_t (*key_diff)(struct xfs_btree_cur *cur, union xfs_btree_key *key); + /* set values of btree structures */ + void (*set_key)(struct xfs_btree_cur *cur, + union xfs_btree_key *oldkey, int index, + union xfs_btree_key *newkey); + void (*set_rec)(struct xfs_btree_cur *cur, + union xfs_btree_rec *oldrec, int index, + union xfs_btree_rec *newrec); + + /* move bits of btree blocks within a block */ + void (*move_keys)(struct xfs_btree_cur *cur, + union xfs_btree_key *base, int src_index, + int dst_index, int numkeys); + void (*move_recs)(struct xfs_btree_cur *cur, + union xfs_btree_rec *base, int src_index, + int dst_index, int numrecs); + /* copy bits of btree blocks between blocks */ void (*copy_keys)(struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -559,6 +575,7 @@ int xfs_btree_decrement(struct xfs_btree int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); +int xfs_btree_rshift(struct xfs_btree_cur *, int, int *); /* @@ -571,6 +588,12 @@ xfs_btree_get_numrecs(struct xfs_btree_b return be16_to_cpu(block->bb_h.bb_numrecs); } +static inline void +xfs_btree_set_numrecs(struct xfs_btree_block *block, __uint16_t numrecs) +{ + block->bb_h.bb_numrecs = cpu_to_be16(numrecs); +} + #endif /* __KERNEL__ */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-27 17:40:52.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-27 17:49:24.000000000 +0200 @@ -54,7 +54,6 @@ STATIC void xfs_allocbt_log_recs(xfs_btr xfs_allocbt_log_recs(c, b, i, j) STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); -STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); @@ -396,7 +395,7 @@ xfs_alloc_delrec( */ if (be16_to_cpu(left->bb_numrecs) - 1 >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_alloc_rshift(tcur, level, &i))) + if ((error = xfs_btree_rshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -688,7 +687,7 @@ xfs_alloc_insrec( /* * First, try shifting an entry to the right neighbor. */ - if ((error = xfs_alloc_rshift(cur, level, &i))) + if ((error = xfs_btree_rshift(cur, level, &i))) return error; if (i) { /* nothing */ @@ -1181,137 +1180,6 @@ xfs_alloc_newroot( } /* - * Move 1 record right from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_alloc_rshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* loop index */ - xfs_alloc_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left (current) block */ - xfs_alloc_block_t *left; /* left (current) btree block */ - xfs_buf_t *rbp; /* buffer for right neighbor block */ - xfs_alloc_block_t *right; /* right neighbor btree block */ - xfs_alloc_key_t *rkp; /* key pointer for right block */ - xfs_btree_cur_t *tcur; /* temporary cursor */ - - /* - * Set up variables for this block as "left". - */ - lbp = cur->bc_bufs[level]; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; -#endif - /* - * If we've got no right sibling then we can't shift an entry right. - */ - if (be32_to_cpu(left->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] >= be16_to_cpu(left->bb_numrecs)) { - *stat = 0; - return 0; - } - /* - * Set up the right neighbor as "right". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), - 0, &rbp, XFS_ALLOC_BTREE_REF))) - return error; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(right->bb_numrecs) == XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - /* - * Make a hole at the start of the right neighbor block, then - * copy the last left block entry to the hole. - */ - if (level > 0) { - xfs_alloc_key_t *lkp; /* key pointer for left block */ - xfs_alloc_ptr_t *lpp; /* address pointer for left block */ - xfs_alloc_ptr_t *rpp; /* address pointer for right block */ - - lkp = XFS_ALLOC_KEY_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - lpp = XFS_ALLOC_PTR_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur); - rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*lpp), level))) - return error; -#endif - *rkp = *lkp; - *rpp = *lpp; - xfs_alloc_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_alloc_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_btree_check_key(cur->bc_btnum, rkp, rkp + 1); - } else { - xfs_alloc_rec_t *lrp; /* record pointer for left block */ - xfs_alloc_rec_t *rrp; /* record pointer for right block */ - - lrp = XFS_ALLOC_REC_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rrp = XFS_ALLOC_REC_ADDR(right, 1, cur); - memmove(rrp + 1, rrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - *rrp = *lrp; - xfs_alloc_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - key.ar_startblock = rrp->ar_startblock; - key.ar_blockcount = rrp->ar_blockcount; - rkp = &key; - xfs_btree_check_rec(cur->bc_btnum, rrp, rrp + 1); - } - /* - * Decrement and log left's numrecs, bump and log right's numrecs. - */ - be16_add(&left->bb_numrecs, -1); - xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, 1); - xfs_alloc_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Using a temporary cursor, update the parent key values of the - * block on the right. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) - goto error0; - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - *stat = 1; - return 0; -error0: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* * Split cur/level block in half. * Return new block number and its first record (to be inserted into parent). */ @@ -1740,6 +1608,64 @@ xfs_allocbt_key_diff( } STATIC void +xfs_allocbt_set_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key_addr, + int index, + union xfs_btree_key *newkey) +{ + xfs_alloc_key_t *kp = &key_addr->alloc; + + kp[index] = newkey->alloc; +} + +STATIC void +xfs_allocbt_set_rec( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec_addr, + int index, + union xfs_btree_rec *newrec) +{ + xfs_alloc_rec_t *rp = &rec_addr->alloc; + + rp[index] = newrec->alloc; +} + +STATIC void +xfs_allocbt_move_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *base, + int from, + int to, + int numkeys) +{ + xfs_alloc_key_t *kp = &base->alloc; + + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numkeys >= 0); + + memmove(&kp[to], &kp[from], numkeys * sizeof(*kp)); +} + +STATIC void +xfs_allocbt_move_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *base, + int from, + int to, + int numrecs) +{ + xfs_alloc_rec_t *rp = &base->alloc; + + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numrecs >= 0); + + memmove(&rp[to], &rp[from], numrecs * sizeof(*rp)); +} + +STATIC void xfs_allocbt_copy_keys( struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -1904,6 +1830,10 @@ static const struct xfs_btree_ops xfs_al .key_addr = xfs_allocbt_key_addr, .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, + .set_key = xfs_allocbt_set_key, + .set_rec = xfs_allocbt_set_rec, + .move_keys = xfs_allocbt_move_keys, + .move_recs = xfs_allocbt_move_recs, .copy_keys = xfs_allocbt_copy_keys, .copy_recs = xfs_allocbt_copy_recs, .log_keys = xfs_allocbt_log_keys, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-27 17:49:43.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-27 17:53:33.000000000 +0200 @@ -46,7 +46,6 @@ STATIC void xfs_inobt_log_ptrs(xfs_btree STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_inobt_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_newroot(xfs_btree_cur_t *, int *); -STATIC int xfs_inobt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_inobt_key_t *, xfs_btree_cur_t **, int *); @@ -338,7 +337,7 @@ xfs_inobt_delrec( */ if (be16_to_cpu(left->bb_numrecs) - 1 >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_inobt_rshift(tcur, level, &i))) + if ((error = xfs_btree_rshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -609,7 +608,7 @@ xfs_inobt_insrec( /* * First, try shifting an entry to the right neighbor. */ - if ((error = xfs_inobt_rshift(cur, level, &i))) + if ((error = xfs_btree_rshift(cur, level, &i))) return error; if (i) { /* nothing */ @@ -1074,136 +1073,6 @@ xfs_inobt_newroot( } /* - * Move 1 record right from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_inobt_rshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* loop index */ - xfs_inobt_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left (current) block */ - xfs_inobt_block_t *left; /* left (current) btree block */ - xfs_inobt_key_t *lkp; /* key pointer for left block */ - xfs_inobt_ptr_t *lpp; /* address pointer for left block */ - xfs_inobt_rec_t *lrp; /* record pointer for left block */ - xfs_buf_t *rbp; /* buffer for right neighbor block */ - xfs_inobt_block_t *right; /* right neighbor btree block */ - xfs_inobt_key_t *rkp; /* key pointer for right block */ - xfs_inobt_ptr_t *rpp; /* address pointer for right block */ - xfs_inobt_rec_t *rrp=NULL; /* record pointer for right block */ - xfs_btree_cur_t *tcur; /* temporary cursor */ - - /* - * Set up variables for this block as "left". - */ - lbp = cur->bc_bufs[level]; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; -#endif - /* - * If we've got no right sibling then we can't shift an entry right. - */ - if (be32_to_cpu(left->bb_rightsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] >= be16_to_cpu(left->bb_numrecs)) { - *stat = 0; - return 0; - } - /* - * Set up the right neighbor as "right". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), - 0, &rbp, XFS_INO_BTREE_REF))) - return error; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(right->bb_numrecs) == XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - /* - * Make a hole at the start of the right neighbor block, then - * copy the last left block entry to the hole. - */ - if (level > 0) { - lkp = XFS_INOBT_KEY_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - lpp = XFS_INOBT_PTR_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rkp = XFS_INOBT_KEY_ADDR(right, 1, cur); - rpp = XFS_INOBT_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*lpp), level))) - return error; -#endif - *rkp = *lkp; - *rpp = *lpp; - xfs_inobt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_inobt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - } else { - lrp = XFS_INOBT_REC_ADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rrp = XFS_INOBT_REC_ADDR(right, 1, cur); - memmove(rrp + 1, rrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - *rrp = *lrp; - xfs_inobt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - key.ir_startino = rrp->ir_startino; - rkp = &key; - } - /* - * Decrement and log left's numrecs, bump and log right's numrecs. - */ - be16_add(&left->bb_numrecs, -1); - xfs_inobt_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, 1); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(cur->bc_btnum, rkp, rkp + 1); - else - xfs_btree_check_rec(cur->bc_btnum, rrp, rrp + 1); -#endif - xfs_inobt_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Using a temporary cursor, update the parent key values of the - * block on the right. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - xfs_btree_lastrec(tcur, level); - if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; - } - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - *stat = 1; - return 0; -} - -/* * Split cur/level block in half. * Return new block number and its first record (to be inserted into parent). */ @@ -1588,6 +1457,64 @@ xfs_inobt_key_diff( } STATIC void +xfs_inobt_set_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key_addr, + int index, + union xfs_btree_key *newkey) +{ + xfs_inobt_key_t *kp = &key_addr->inobt; + + kp[index] = newkey->inobt; +} + +STATIC void +xfs_inobt_set_rec( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec_addr, + int index, + union xfs_btree_rec *newrec) +{ + xfs_inobt_rec_t *rp = &rec_addr->inobt; + + rp[index] = newrec->inobt; +} + +STATIC void +xfs_inobt_move_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *base, + int from, + int to, + int numkeys) +{ + xfs_inobt_key_t *kp = &base->inobt; + + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numkeys >= 0); + + memmove(&kp[to], &kp[from], numkeys * sizeof(*kp)); +} + +STATIC void +xfs_inobt_move_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *base, + int from, + int to, + int numrecs) +{ + xfs_inobt_rec_t *rp = &base->inobt; + + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numrecs >= 0); + + memmove(&rp[to], &rp[from], numrecs * sizeof(*rp)); +} + +STATIC void xfs_inobt_copy_keys( struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -1740,6 +1667,11 @@ static const struct xfs_btree_ops xfs_in .key_addr = xfs_inobt_key_addr, .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, + .set_key = xfs_inobt_set_key, + .set_rec = xfs_inobt_set_rec, + .move_keys = xfs_inobt_move_keys, + .move_recs = xfs_inobt_move_recs, + .copy_keys = xfs_inobt_copy_keys, .copy_recs = xfs_inobt_copy_recs, .log_keys = xfs_inobt_log_keys, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-27 17:53:50.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-27 17:57:11.000000000 +0200 @@ -53,7 +53,6 @@ STATIC int xfs_bmbt_killroot(xfs_btree_c STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_bmbt_lshift(xfs_btree_cur_t *, int, int *); -STATIC int xfs_bmbt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, __uint64_t *, xfs_btree_cur_t **, int *); @@ -326,7 +325,7 @@ xfs_bmbt_delrec( bno = be64_to_cpu(left->bb_rightsib); if (be16_to_cpu(left->bb_numrecs) - 1 >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_bmbt_rshift(tcur, level, &i))) { + if ((error = xfs_btree_rshift(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -537,7 +536,7 @@ xfs_bmbt_insrec( logflags); block = xfs_bmbt_get_block(cur, level, &bp); } else { - if ((error = xfs_bmbt_rshift(cur, level, &i))) { + if ((error = xfs_btree_rshift(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -908,143 +907,6 @@ xfs_bmbt_lshift( } /* - * Move 1 record right from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_bmbt_rshift( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* loop counter */ - xfs_bmbt_key_t key; /* bmap btree key */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_bmbt_block_t *left; /* left btree block */ - xfs_bmbt_key_t *lkp; /* left btree key */ - xfs_bmbt_ptr_t *lpp; /* left address pointer */ - xfs_bmbt_rec_t *lrp; /* left record pointer */ - xfs_mount_t *mp; /* file system mount point */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_bmbt_block_t *right; /* right btree block */ - xfs_bmbt_key_t *rkp; /* right btree key */ - xfs_bmbt_ptr_t *rpp; /* right address pointer */ - xfs_bmbt_rec_t *rrp=NULL; /* right record pointer */ - struct xfs_btree_cur *tcur; /* temporary btree cursor */ - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - if (level == cur->bc_nlevels - 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - lbp = cur->bc_bufs[level]; - left = XFS_BUF_TO_BMBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (be64_to_cpu(left->bb_rightsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - if (cur->bc_ptrs[level] >= be16_to_cpu(left->bb_numrecs)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - mp = cur->bc_mp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, be64_to_cpu(left->bb_rightsib), 0, - &rbp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - right = XFS_BUF_TO_BMBT_BLOCK(rbp); - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (be16_to_cpu(right->bb_numrecs) == XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - if (level > 0) { - lkp = XFS_BMAP_KEY_IADDR(left, be16_to_cpu(left->bb_numrecs), cur); - lpp = XFS_BMAP_PTR_IADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rkp = XFS_BMAP_KEY_IADDR(right, 1, cur); - rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); -#ifdef DEBUG - for (i = be16_to_cpu(right->bb_numrecs) - 1; i >= 0; i--) { - if ((error = xfs_btree_check_lptr_disk(cur, rpp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memmove(rkp + 1, rkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp + 1, rpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr_disk(cur, *lpp, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - *rkp = *lkp; - *rpp = *lpp; - xfs_bmbt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - xfs_bmbt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - } else { - lrp = XFS_BMAP_REC_IADDR(left, be16_to_cpu(left->bb_numrecs), cur); - rrp = XFS_BMAP_REC_IADDR(right, 1, cur); - memmove(rrp + 1, rrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - *rrp = *lrp; - xfs_bmbt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs) + 1); - key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(rrp)); - rkp = &key; - } - be16_add(&left->bb_numrecs, -1); - xfs_bmbt_log_block(cur, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, 1); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(XFS_BTNUM_BMAP, rkp, rkp + 1); - else - xfs_btree_check_rec(XFS_BTNUM_BMAP, rrp, rrp + 1); -#endif - xfs_bmbt_log_block(cur, rbp, XFS_BB_NUMRECS); - if ((error = xfs_btree_dup_cursor(cur, &tcur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(tcur, ERROR); - goto error1; - } - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { - XFS_BMBT_TRACE_CURSOR(tcur, ERROR); - goto error1; - } - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -error0: - XFS_BMBT_TRACE_CURSOR(cur, ERROR); -error1: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* * Determine the extent state. */ /* ARGSUSED */ @@ -2019,6 +1881,64 @@ xfs_bmbt_key_diff( } STATIC void +xfs_bmbt_set_key( + struct xfs_btree_cur *cur, + union xfs_btree_key *key_addr, + int index, + union xfs_btree_key *newkey) +{ + xfs_bmbt_key_t *kp = &key_addr->bmbt; + + kp[index] = newkey->bmbt; +} + +STATIC void +xfs_bmbt_set_rec( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec_addr, + int index, + union xfs_btree_rec *newrec) +{ + xfs_bmbt_rec_t *rp = &rec_addr->bmbt; + + rp[index] = newrec->bmbt; +} + +STATIC void +xfs_bmbt_move_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *base, + int from, + int to, + int numkeys) +{ + xfs_bmbt_key_t *kp = &base->bmbt; + + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numkeys >= 0); + + memmove(&kp[to], &kp[from], numkeys * sizeof(*kp)); +} + +STATIC void +xfs_bmbt_move_recs( + struct xfs_btree_cur *cur, + union xfs_btree_rec *base, + int from, + int to, + int numrecs) +{ + xfs_bmbt_rec_t *rp = &base->bmbt; + + ASSERT(from >= 0 && from <= 1000); + ASSERT(to >= 0 && to <= 1000); + ASSERT(numrecs >= 0); + + memmove(&rp[to], &rp[from], numrecs * sizeof(*rp)); +} + +STATIC void xfs_bmbt_copy_keys( struct xfs_btree_cur *cur, union xfs_btree_key *src_key, @@ -2195,6 +2115,10 @@ static const struct xfs_btree_ops xfs_bm .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, + .set_key = xfs_bmbt_set_key, + .set_rec = xfs_bmbt_set_rec, + .move_keys = xfs_bmbt_move_keys, + .move_recs = xfs_bmbt_move_recs, .copy_keys = xfs_bmbt_copy_keys, .copy_recs = xfs_bmbt_copy_recs, .log_keys = xfs_bmbt_log_keys, -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:00 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:28 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJTxUx032155 for ; Tue, 29 Jul 2008 12:30:00 -0700 X-ASG-Debug-ID: 1217359868-0cd800880000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AABB2ECE233 for ; Tue, 29 Jul 2008 12:31:09 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id uGTh6paBgwhQv7Of for ; Tue, 29 Jul 2008 12:31:09 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVAIF019309 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:10 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVAps019307 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:10 +0200 Date: Tue, 29 Jul 2008 21:31:10 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 12/21] implement generic xfs_btree_updkey Subject: [PATCH 12/21] implement generic xfs_btree_updkey Message-ID: <20080729193110.GM19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-updkey User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359871 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17254 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Note that there are many > 80 char lines introduced due to the xfs_btree_key casts. But the places where this happens is throw-away code once the whole btree code gets merged into a common implementation. The same is true for the temporary xfs_alloc_log_keys define to the new name. All old users will be gone after a few patches. [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 05:10:43.000000000 +0200 @@ -1370,3 +1370,50 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +/* + * Update keys at all levels from here to the root along the cursor's path. + */ +int +xfs_btree_updkey( + struct xfs_btree_cur *cur, + union xfs_btree_key *keyp, + int level) +{ + struct xfs_btree_block *block; + struct xfs_buf *bp; + union xfs_btree_key *kp; + int ptr; +#ifdef DEBUG + int error; +#endif + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGIK(cur, level, keyp); + + ASSERT(!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) || level >= 1); + + /* + * Go up the tree from this level toward the root. + * At each level, update the key value to the value input. + * Stop when we reach a level where the cursor isn't pointing + * at the first entry in the block. + */ + for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { + block = xfs_btree_get_block(cur, level, &bp); +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } +#endif + ptr = cur->bc_ptrs[level]; + kp = cur->bc_ops->key_addr(cur, ptr, block); + cur->bc_ops->copy_keys(cur, keyp, kp, 1); + cur->bc_ops->log_keys(cur, bp, ptr, ptr); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 05:11:01.000000000 +0200 @@ -210,6 +210,16 @@ struct xfs_btree_ops { __int64_t (*key_diff)(struct xfs_btree_cur *cur, union xfs_btree_key *key); + /* copy bits of btree blocks between blocks */ + void (*copy_keys)(struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, int numkeys); + + /* log changes to btree structures */ + void (*log_keys)(struct xfs_btree_cur *cur, struct xfs_buf *bp, + int first, int last); + + /* btree tracing */ #ifdef XFS_BTREE_TRACE void (*trace_enter)(struct xfs_btree_cur *, const char *, @@ -528,6 +538,7 @@ xfs_btree_setbuf( int xfs_btree_increment(struct xfs_btree_cur *, int, int *); int xfs_btree_decrement(struct xfs_btree_cur *, int, int *); int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); +int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-21 05:10:35.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" @@ -44,7 +45,9 @@ */ STATIC void xfs_alloc_log_block(xfs_trans_t *, xfs_buf_t *, int); -STATIC void xfs_alloc_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); +STATIC void xfs_allocbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); +#define xfs_alloc_log_keys(c, b, i, j) \ + xfs_allocbt_log_keys(c, b, i, j) STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_alloc_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); @@ -52,7 +55,6 @@ STATIC int xfs_alloc_newroot(xfs_btree_c STATIC int xfs_alloc_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_alloc_updkey(xfs_btree_cur_t *, xfs_alloc_key_t *, int); /* * Internal functions. @@ -265,7 +267,7 @@ xfs_alloc_delrec( * If we deleted the leftmost entry in the block, update the * key values above us in the tree. */ - if (ptr == 1 && (error = xfs_alloc_updkey(cur, lkp, level + 1))) + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)lkp, level + 1))) return error; /* * If the number of records remaining in the block is at least @@ -798,7 +800,7 @@ xfs_alloc_insrec( /* * If we inserted at the start of a block, update the parents' keys. */ - if (optr == 1 && (error = xfs_alloc_updkey(cur, &key, level + 1))) + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) return error; /* * Look to see if the longest extent in the allocation group @@ -859,28 +861,6 @@ xfs_alloc_log_block( } /* - * Log keys from a btree block (nonleaf). - */ -STATIC void -xfs_alloc_log_keys( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int kfirst, /* index of first key to log */ - int klast) /* index of last key to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - xfs_alloc_key_t *kp; /* key pointer in btree block */ - int last; /* last byte offset logged */ - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Log block pointer fields from a btree block (nonleaf). */ STATIC void @@ -1068,7 +1048,7 @@ xfs_alloc_lshift( /* * Update the parent key values of right. */ - if ((error = xfs_alloc_updkey(cur, rkp, level + 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) return error; /* * Slide the cursor value left one. @@ -1354,7 +1334,7 @@ xfs_alloc_rshift( i = xfs_btree_lastrec(tcur, level); XFS_WANT_CORRUPTED_GOTO(i == 1, error0); if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_alloc_updkey(tcur, rkp, level + 1))) + (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) goto error0; xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); *stat = 1; @@ -1520,45 +1500,6 @@ xfs_alloc_split( } /* - * Update keys at all levels from here to the root along the cursor's path. - */ -STATIC int /* error */ -xfs_alloc_updkey( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_alloc_key_t *keyp, /* new key value to update to */ - int level) /* starting level for update */ -{ - int ptr; /* index of key in block */ - - /* - * Go up the tree from this level toward the root. - * At each level, update the key value to the value input. - * Stop when we reach a level where the cursor isn't pointing - * at the first entry in the block. - */ - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - xfs_alloc_block_t *block; /* btree block */ - xfs_buf_t *bp; /* buffer for block */ -#ifdef DEBUG - int error; /* error return value */ -#endif - xfs_alloc_key_t *kp; /* ptr to btree block keys */ - - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_ALLOC_KEY_ADDR(block, ptr, cur); - *kp = *keyp; - xfs_alloc_log_keys(cur, bp, ptr, ptr); - } - return 0; -} - -/* * Externally visible routines. */ @@ -1765,7 +1706,7 @@ xfs_alloc_update( key.ar_startblock = cpu_to_be32(bno); key.ar_blockcount = cpu_to_be32(len); - if ((error = xfs_alloc_updkey(cur, &key, 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) return error; } return 0; @@ -1856,6 +1797,45 @@ xfs_allocbt_key_diff( return (__int64_t)be32_to_cpu(kp->ar_startblock) - rec->ar_startblock; } +STATIC void +xfs_allocbt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_alloc_key_t)); +} + +/* + * Log keys from a btree block (nonleaf). + */ +STATIC void +xfs_allocbt_log_keys( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int kfirst, /* index of first key to log */ + int klast) /* index of last key to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + xfs_alloc_key_t *kp; /* key pointer in btree block */ + int last; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, kfirst, klast); + + block = XFS_BUF_TO_SBLOCK(bp); + kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_allocbt_trace_buf; @@ -1931,6 +1911,8 @@ static const struct xfs_btree_ops xfs_al .key_addr = xfs_allocbt_key_addr, .rec_addr = xfs_allocbt_rec_addr, .key_diff = xfs_allocbt_key_diff, + .copy_keys = xfs_allocbt_copy_keys, + .log_keys = xfs_allocbt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_allocbt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-21 05:16:01.000000000 +0200 @@ -35,6 +35,7 @@ #include "xfs_dinode.h" #include "xfs_inode.h" #include "xfs_btree.h" +#include "xfs_btree_trace.h" #include "xfs_ialloc.h" #include "xfs_alloc.h" #include "xfs_error.h" @@ -48,7 +49,6 @@ STATIC int xfs_inobt_newroot(xfs_btree_c STATIC int xfs_inobt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_inobt_key_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_inobt_updkey(xfs_btree_cur_t *, xfs_inobt_key_t *, int); /* * Single level of the xfs_inobt_delete record deletion routine. @@ -214,7 +214,7 @@ xfs_inobt_delrec( * If we deleted the leftmost entry in the block, update the * key values above us in the tree. */ - if (ptr == 1 && (error = xfs_inobt_updkey(cur, kp, level + 1))) + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) return error; /* * If the number of records remaining in the block is at least @@ -723,7 +723,7 @@ xfs_inobt_insrec( /* * If we inserted at the start of a block, update the parents' keys. */ - if (optr == 1 && (error = xfs_inobt_updkey(cur, &key, level + 1))) + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) return error; /* * Return the new block number, if any. @@ -763,28 +763,6 @@ xfs_inobt_log_block( } /* - * Log keys from a btree block (nonleaf). - */ -STATIC void -xfs_inobt_log_keys( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int kfirst, /* index of first key to log */ - int klast) /* index of last key to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - xfs_inobt_key_t *kp; /* key pointer in btree block */ - int last; /* last byte offset logged */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - kp = XFS_INOBT_KEY_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - -/* * Log block pointer fields from a btree block (nonleaf). */ STATIC void @@ -960,7 +938,7 @@ xfs_inobt_lshift( /* * Update the parent key values of right. */ - if ((error = xfs_inobt_updkey(cur, rkp, level + 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) return error; /* * Slide the cursor value left one. @@ -1238,7 +1216,7 @@ xfs_inobt_rshift( return error; xfs_btree_lastrec(tcur, level); if ((error = xfs_btree_increment(tcur, level, &i)) || - (error = xfs_inobt_updkey(tcur, rkp, level + 1))) { + (error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); return error; } @@ -1407,45 +1385,6 @@ xfs_inobt_split( } /* - * Update keys at all levels from here to the root along the cursor's path. - */ -STATIC int /* error */ -xfs_inobt_updkey( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_inobt_key_t *keyp, /* new key value to update to */ - int level) /* starting level for update */ -{ - int ptr; /* index of key in block */ - - /* - * Go up the tree from this level toward the root. - * At each level, update the key value to the value input. - * Stop when we reach a level where the cursor isn't pointing - * at the first entry in the block. - */ - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - xfs_buf_t *bp; /* buffer for block */ - xfs_inobt_block_t *block; /* btree block */ -#ifdef DEBUG - int error; /* error return value */ -#endif - xfs_inobt_key_t *kp; /* ptr to btree block keys */ - - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_INOBT_KEY_ADDR(block, ptr, cur); - *kp = *keyp; - xfs_inobt_log_keys(cur, bp, ptr, ptr); - } - return 0; -} - -/* * Externally visible routines. */ @@ -1637,7 +1576,7 @@ xfs_inobt_update( xfs_inobt_key_t key; /* key containing [ino] */ key.ir_startino = cpu_to_be32(ino); - if ((error = xfs_inobt_updkey(cur, &key, 1))) + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) return error; } return 0; @@ -1714,6 +1653,44 @@ xfs_inobt_key_diff( cur->bc_rec.i.ir_startino; } +STATIC void +xfs_inobt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_inobt_key_t)); +} + +/* + * Log keys from a btree block (nonleaf). + */ +STATIC void +xfs_inobt_log_keys( + struct xfs_btree_cur *cur, /* btree cursor */ + struct xfs_buf *bp, /* buffer containing btree block */ + int kfirst, /* index of first key to log */ + int klast) /* index of last key to log */ +{ + struct xfs_btree_sblock *block; /* btree block to log from */ + int first; /* first byte offset logged */ + xfs_inobt_key_t *kp; /* key pointer in btree block */ + int last; /* last byte offset logged */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, kfirst, klast); + + block = XFS_BUF_TO_SBLOCK(bp); + kp = XFS_INOBT_KEY_ADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_inobt_trace_buf; @@ -1789,6 +1766,8 @@ static const struct xfs_btree_ops xfs_in .key_addr = xfs_inobt_key_addr, .rec_addr = xfs_inobt_rec_addr, .key_diff = xfs_inobt_key_diff, + .copy_keys = xfs_inobt_copy_keys, + .log_keys = xfs_inobt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_inobt_trace_enter, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-21 04:42:18.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-21 05:15:11.000000000 +0200 @@ -56,7 +56,6 @@ STATIC int xfs_bmbt_lshift(xfs_btree_cur STATIC int xfs_bmbt_rshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, __uint64_t *, xfs_btree_cur_t **, int *); -STATIC int xfs_bmbt_updkey(xfs_btree_cur_t *, xfs_bmbt_key_t *, int); #undef EXIT @@ -210,7 +209,7 @@ xfs_bmbt_delrec( *stat = 1; return 0; } - if (ptr == 1 && (error = xfs_bmbt_updkey(cur, kp, level + 1))) { + if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -634,7 +633,7 @@ xfs_bmbt_insrec( kp + ptr); } #endif - if (optr == 1 && (error = xfs_bmbt_updkey(cur, &key, level + 1))) { + if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -740,42 +739,6 @@ xfs_bmbt_killroot( } /* - * Log key values from the btree block. - */ -STATIC void -xfs_bmbt_log_keys( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int kfirst, - int klast) -{ - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, kfirst, klast); - tp = cur->bc_tp; - if (bp) { - xfs_bmbt_block_t *block; - int first; - xfs_bmbt_key_t *kp; - int last; - - block = XFS_BUF_TO_BMBT_BLOCK(bp); - kp = XFS_BMAP_KEY_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - } else { - xfs_inode_t *ip; - - ip = cur->bc_private.b.ip; - xfs_trans_log_inode(tp, ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* * Log pointer values from the btree block. */ STATIC void @@ -934,7 +897,7 @@ xfs_bmbt_lshift( key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(rrp)); rkp = &key; } - if ((error = xfs_bmbt_updkey(cur, rkp, level + 1))) { + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -1066,7 +1029,7 @@ xfs_bmbt_rshift( goto error1; } XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_bmbt_updkey(tcur, rkp, level + 1))) { + if ((error = xfs_btree_updkey(tcur, (union xfs_btree_key *)rkp, level + 1))) { XFS_BMBT_TRACE_CURSOR(tcur, ERROR); goto error1; } @@ -1274,44 +1237,6 @@ xfs_bmbt_split( return 0; } - -/* - * Update keys for the record. - */ -STATIC int -xfs_bmbt_updkey( - xfs_btree_cur_t *cur, - xfs_bmbt_key_t *keyp, /* on-disk format */ - int level) -{ - xfs_bmbt_block_t *block; - xfs_buf_t *bp; -#ifdef DEBUG - int error; -#endif - xfs_bmbt_key_t *kp; - int ptr; - - ASSERT(level >= 1); - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGIK(cur, level, keyp); - for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { - block = xfs_bmbt_get_block(cur, level, &bp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - ptr = cur->bc_ptrs[level]; - kp = XFS_BMAP_KEY_IADDR(block, ptr, cur); - *kp = *keyp; - xfs_bmbt_log_keys(cur, bp, ptr, ptr); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; -} - /* * Convert on-disk form of btree root to in-memory form. */ @@ -2037,7 +1962,7 @@ xfs_bmbt_update( return 0; } key.br_startoff = cpu_to_be64(off); - if ((error = xfs_bmbt_updkey(cur, &key, 1))) { + if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, 1))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -2158,6 +2083,49 @@ xfs_bmbt_key_diff( cur->bc_rec.b.br_startoff; } +STATIC void +xfs_bmbt_copy_keys( + struct xfs_btree_cur *cur, + union xfs_btree_key *src_key, + union xfs_btree_key *dst_key, + int numkeys) +{ + ASSERT(numkeys >= 0); + memcpy(dst_key, src_key, numkeys * sizeof(xfs_bmbt_key_t)); +} + +/* + * Log key values from the btree block. + */ +STATIC void +xfs_bmbt_log_keys( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int kfirst, + int klast) +{ + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGBII(cur, bp, kfirst, klast); + + if (bp) { + struct xfs_btree_lblock *block; + int first; + xfs_bmbt_key_t *kp; + int last; + + block = XFS_BUF_TO_LBLOCK(bp); + kp = XFS_BMAP_KEY_DADDR(block, 1, cur); + first = (int)((xfs_caddr_t)&kp[kfirst - 1] - (xfs_caddr_t)block); + last = (int)(((xfs_caddr_t)&kp[klast] - 1) - (xfs_caddr_t)block); + xfs_trans_log_buf(cur->bc_tp, bp, first, last); + } else { + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; @@ -2253,6 +2221,8 @@ static const struct xfs_btree_ops xfs_bm .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, .key_diff = xfs_bmbt_key_diff, + .copy_keys = xfs_bmbt_copy_keys, + .log_keys = xfs_bmbt_log_keys, #ifdef XFS_BTREE_TRACE .trace_enter = xfs_bmbt_trace_enter, -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:23 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:40 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_31, J_CHICKENPOX_73 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJULwi032630 for ; Tue, 29 Jul 2008 12:30:22 -0700 X-ASG-Debug-ID: 1217359890-5a6400480000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 8E42B33F402 for ; Tue, 29 Jul 2008 12:31:31 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id DMfE0OFqJ06LKDIV for ; Tue, 29 Jul 2008 12:31:31 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVWIF019365 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:32 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVWdG019363 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:32 +0200 Date: Tue, 29 Jul 2008 21:31:32 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 16/21] implement generic xfs_btree_lshift Subject: [PATCH 16/21] implement generic xfs_btree_lshift Message-ID: <20080729193132.GQ19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-lshift User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359893 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17257 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Make the btree left shift code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-28 16:13:33.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-28 16:16:22.000000000 +0200 @@ -976,6 +976,21 @@ xfs_btree_move_ptrs( } } +STATIC void +xfs_btree_copy_ptrs( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *src_ptr, + union xfs_btree_ptr *dst_ptr, + int numptrs) +{ + ASSERT(numptrs > 0); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be64)); + else + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be32)); +} + /* * Log block pointer fields from a btree block (nonleaf). */ @@ -1597,6 +1612,188 @@ error0: } /* + * Move 1 record left from cur/level if possible. + * Update cur to reflect the new path. + */ +int /* error */ +xfs_btree_lshift( + struct xfs_btree_cur *cur, + int level, + int *stat) /* success/failure */ +{ + union xfs_btree_key key; /* btree key */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + int lrecs; /* left record count */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + int rrecs; /* right record count */ + union xfs_btree_ptr lptr; /* left btree pointer */ + union xfs_btree_key *rkp = NULL; /* right btree key */ + union xfs_btree_ptr *rpp = NULL; /* right address pointer */ + union xfs_btree_rec *rrp = NULL; /* right record pointer */ + int error; /* error return value */ +#ifdef DEBUG + int i; /* loop index */ +#endif + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + level == cur->bc_nlevels - 1) + goto out0; + + /* Set up variables for this block as "right". */ + right = xfs_btree_get_block(cur, level, &rbp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, right, level, rbp); + if (error) + goto error0; +#endif + + /* If we've got no left sibling then we can't shift an entry left. */ + xfs_btree_get_sibling(cur, right, &lptr, XFS_BB_LEFTSIB); + if (xfs_btree_ptr_is_null(cur, &lptr)) + goto out0; + + /* + * If the cursor entry is the one that would be moved, don't + * do it... it's too complicated. + */ + if (cur->bc_ptrs[level] <= 1) + goto out0; + + /* Set up the left neighbor as "left". */ + error = xfs_btree_read_buf_block(cur, &lptr, level, 0, &left, &lbp); + if (error) + goto error0; + + /* If it's full, it can't take another entry. */ + lrecs = xfs_btree_get_numrecs(left); + if (lrecs == cur->bc_ops->get_maxrecs(cur, level)) + goto out0; + + rrecs = xfs_btree_get_numrecs(right); + + /* + * We add one entry to the left side and remove one for the right side. + * Accout for it here, the changes will be updated on disk and logged + * later. + */ + lrecs++; + rrecs--; + + XFS_BTREE_STATS_INC(cur, lshift); + + /* + * If non-leaf, copy a key and a ptr to the left block. + * Log the changes to the left block. + */ + XFS_BTREE_STATS_ADD(cur, moves, 1); + if (level > 0) { + /* It's a non-leaf. Move keys and pointers. */ + union xfs_btree_key *lkp; /* left btree key */ + union xfs_btree_ptr *lpp; /* left address pointer */ + + lkp = cur->bc_ops->key_addr(cur, lrecs, left); + rkp = cur->bc_ops->key_addr(cur, 1, right); + + lpp = cur->bc_ops->ptr_addr(cur, lrecs, left); + rpp = cur->bc_ops->ptr_addr(cur, 1, right); +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, rpp, 0, level); + if (error) + goto error0; +#endif + cur->bc_ops->copy_keys(cur, rkp, lkp, 1); + xfs_btree_copy_ptrs(cur, rpp, lpp, 1); + + cur->bc_ops->log_keys(cur, lbp, lrecs, lrecs); + xfs_btree_log_ptrs(cur, lbp, lrecs, lrecs); + + xfs_btree_check_key(cur->bc_btnum, + cur->bc_ops->key_addr(cur, lrecs - 1, left), + lkp); + } else { + /* It's a leaf. Move records. */ + union xfs_btree_rec *lrp; /* left record pointer */ + + lrp = cur->bc_ops->rec_addr(cur, lrecs, left); + rrp = cur->bc_ops->rec_addr(cur, 1, right); + + cur->bc_ops->copy_recs(cur, rrp, lrp, 1); + cur->bc_ops->log_recs(cur, lbp, lrecs, lrecs); + + xfs_btree_check_rec(cur->bc_btnum, + cur->bc_ops->rec_addr(cur, lrecs - 1, left), + lrp); + } + + xfs_btree_set_numrecs(left, lrecs); + xfs_btree_log_block(cur, lbp, XFS_BB_NUMRECS); + + xfs_btree_set_numrecs(right, rrecs); + xfs_btree_log_block(cur, rbp, XFS_BB_NUMRECS); + + /* + * Slide the contents of right down one entry. + */ + XFS_BTREE_STATS_ADD(cur, moves, rrecs - 1); + if (level > 0) { + /* It's a nonleaf. operate on keys and ptrs */ + +#ifdef DEBUG + for (i = 0; i < rrecs; i++) { + error = xfs_btree_check_ptr(cur, rpp, i + 1, level); + if (error) + goto error0; + } +#endif + + cur->bc_ops->move_keys(cur, rkp, 1, 0, rrecs); + xfs_btree_move_ptrs(cur, rpp, 1, 0, rrecs); + cur->bc_ops->log_keys(cur, rbp, 1, rrecs); + xfs_btree_log_ptrs(cur, rbp, 1, rrecs); + } else { + /* It's a leaf. operate on records */ + + rrp = cur->bc_ops->rec_addr(cur, 1, right); + cur->bc_ops->move_recs(cur, rrp, 1, 0, rrecs); + cur->bc_ops->log_recs(cur, rbp, 1, rrecs); + + /* + * If it's the first record in the block, we'll need a key + * structure to pass up to the next level (updkey). + */ + cur->bc_ops->init_key_from_rec(cur, &key, rrp); + rkp = &key; + } + + /* Update the parent key values of right. */ + error = xfs_btree_updkey(cur, rkp, level + 1); + if (error) + goto error0; + + /* Slide the cursor value left one. */ + cur->bc_ptrs[level]--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + +/* * Move 1 record right from cur/level if possible. * Update cur to reflect the new path. */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-28 16:16:51.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-28 16:17:20.000000000 +0200 @@ -52,7 +52,6 @@ STATIC void xfs_alloc_log_ptrs(xfs_btree STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); #define xfs_alloc_log_recs(c, b, i, j) \ xfs_allocbt_log_recs(c, b, i, j) -STATIC int xfs_alloc_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_alloc_key_t *, xfs_btree_cur_t **, int *); @@ -331,7 +330,7 @@ xfs_alloc_delrec( */ if (be16_to_cpu(right->bb_numrecs) - 1 >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_alloc_lshift(tcur, level, &i))) + if ((error = xfs_btree_lshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -696,7 +695,7 @@ xfs_alloc_insrec( * Next, try shifting an entry to the left neighbor. */ else { - if ((error = xfs_alloc_lshift(cur, level, &i))) + if ((error = xfs_btree_lshift(cur, level, &i))) return error; if (i) optr = ptr = cur->bc_ptrs[level]; @@ -884,147 +883,6 @@ xfs_alloc_log_ptrs( } /* - * Move 1 record left from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_alloc_lshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ -#ifdef DEBUG - int i; /* loop index */ -#endif - xfs_alloc_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left neighbor block */ - xfs_alloc_block_t *left; /* left neighbor btree block */ - int nrec; /* new number of left block entries */ - xfs_buf_t *rbp; /* buffer for right (current) block */ - xfs_alloc_block_t *right; /* right (current) btree block */ - xfs_alloc_key_t *rkp=NULL; /* key pointer for right block */ - xfs_alloc_ptr_t *rpp=NULL; /* address pointer for right block */ - xfs_alloc_rec_t *rrp=NULL; /* record pointer for right block */ - - /* - * Set up variables for this block as "right". - */ - rbp = cur->bc_bufs[level]; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; -#endif - /* - * If we've got no left sibling then we can't shift an entry left. - */ - if (be32_to_cpu(right->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] <= 1) { - *stat = 0; - return 0; - } - /* - * Set up the left neighbor as "left". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(right->bb_leftsib), - 0, &lbp, XFS_ALLOC_BTREE_REF))) - return error; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(left->bb_numrecs) == XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - nrec = be16_to_cpu(left->bb_numrecs) + 1; - /* - * If non-leaf, copy a key and a ptr to the left block. - */ - if (level > 0) { - xfs_alloc_key_t *lkp; /* key pointer for left block */ - xfs_alloc_ptr_t *lpp; /* address pointer for left block */ - - lkp = XFS_ALLOC_KEY_ADDR(left, nrec, cur); - rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur); - *lkp = *rkp; - xfs_alloc_log_keys(cur, lbp, nrec, nrec); - lpp = XFS_ALLOC_PTR_ADDR(left, nrec, cur); - rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*rpp), level))) - return error; -#endif - *lpp = *rpp; - xfs_alloc_log_ptrs(cur, lbp, nrec, nrec); - xfs_btree_check_key(cur->bc_btnum, lkp - 1, lkp); - } - /* - * If leaf, copy a record to the left block. - */ - else { - xfs_alloc_rec_t *lrp; /* record pointer for left block */ - - lrp = XFS_ALLOC_REC_ADDR(left, nrec, cur); - rrp = XFS_ALLOC_REC_ADDR(right, 1, cur); - *lrp = *rrp; - xfs_alloc_log_recs(cur, lbp, nrec, nrec); - xfs_btree_check_rec(cur->bc_btnum, lrp - 1, lrp); - } - /* - * Bump and log left's numrecs, decrement and log right's numrecs. - */ - be16_add(&left->bb_numrecs, 1); - xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); - be16_add(&right->bb_numrecs, -1); - xfs_alloc_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Slide the contents of right down one entry. - */ - if (level > 0) { -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i + 1]), - level))) - return error; - } -#endif - memmove(rkp, rkp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp, rpp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); - xfs_alloc_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - xfs_alloc_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - } else { - memmove(rrp, rrp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - xfs_alloc_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - key.ar_startblock = rrp->ar_startblock; - key.ar_blockcount = rrp->ar_blockcount; - rkp = &key; - } - /* - * Update the parent key values of right. - */ - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) - return error; - /* - * Slide the cursor value left one. - */ - cur->bc_ptrs[level]--; - *stat = 1; - return 0; -} - -/* * Allocate a new root block, fill it in. */ STATIC int /* error */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-28 16:18:13.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-28 16:19:02.000000000 +0200 @@ -52,7 +52,6 @@ STATIC int xfs_bmbt_killroot(xfs_btree_cur_t *); STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC int xfs_bmbt_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, __uint64_t *, xfs_btree_cur_t **, int *); @@ -269,7 +268,7 @@ xfs_bmbt_delrec( bno = be64_to_cpu(right->bb_leftsib); if (be16_to_cpu(right->bb_numrecs) - 1 >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_bmbt_lshift(tcur, level, &i))) { + if ((error = xfs_btree_lshift(tcur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); goto error0; } @@ -543,7 +542,7 @@ xfs_bmbt_insrec( if (i) { /* nothing */ } else { - if ((error = xfs_bmbt_lshift(cur, level, &i))) { + if ((error = xfs_btree_lshift(cur, level, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } @@ -774,139 +773,6 @@ xfs_bmbt_log_ptrs( } /* - * Move 1 record left from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_bmbt_lshift( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - int error; /* error return value */ -#ifdef DEBUG - int i; /* loop counter */ -#endif - xfs_bmbt_key_t key; /* bmap btree key */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_bmbt_block_t *left; /* left btree block */ - xfs_bmbt_key_t *lkp=NULL; /* left btree key */ - xfs_bmbt_ptr_t *lpp; /* left address pointer */ - int lrecs; /* left record count */ - xfs_bmbt_rec_t *lrp=NULL; /* left record pointer */ - xfs_mount_t *mp; /* file system mount point */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_bmbt_block_t *right; /* right btree block */ - xfs_bmbt_key_t *rkp=NULL; /* right btree key */ - xfs_bmbt_ptr_t *rpp=NULL; /* right address pointer */ - xfs_bmbt_rec_t *rrp=NULL; /* right record pointer */ - int rrecs; /* right record count */ - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - if (level == cur->bc_nlevels - 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - rbp = cur->bc_bufs[level]; - right = XFS_BUF_TO_BMBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - if (be64_to_cpu(right->bb_leftsib) == NULLDFSBNO) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - if (cur->bc_ptrs[level] <= 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - mp = cur->bc_mp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, be64_to_cpu(right->bb_leftsib), 0, - &lbp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - left = XFS_BUF_TO_BMBT_BLOCK(lbp); - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (be16_to_cpu(left->bb_numrecs) == XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - lrecs = be16_to_cpu(left->bb_numrecs) + 1; - if (level > 0) { - lkp = XFS_BMAP_KEY_IADDR(left, lrecs, cur); - rkp = XFS_BMAP_KEY_IADDR(right, 1, cur); - *lkp = *rkp; - xfs_bmbt_log_keys(cur, lbp, lrecs, lrecs); - lpp = XFS_BMAP_PTR_IADDR(left, lrecs, cur); - rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr_disk(cur, *rpp, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - *lpp = *rpp; - xfs_bmbt_log_ptrs(cur, lbp, lrecs, lrecs); - } else { - lrp = XFS_BMAP_REC_IADDR(left, lrecs, cur); - rrp = XFS_BMAP_REC_IADDR(right, 1, cur); - *lrp = *rrp; - xfs_bmbt_log_recs(cur, lbp, lrecs, lrecs); - } - left->bb_numrecs = cpu_to_be16(lrecs); - xfs_bmbt_log_block(cur, lbp, XFS_BB_NUMRECS); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(XFS_BTNUM_BMAP, lkp - 1, lkp); - else - xfs_btree_check_rec(XFS_BTNUM_BMAP, lrp - 1, lrp); -#endif - rrecs = be16_to_cpu(right->bb_numrecs) - 1; - right->bb_numrecs = cpu_to_be16(rrecs); - xfs_bmbt_log_block(cur, rbp, XFS_BB_NUMRECS); - if (level > 0) { -#ifdef DEBUG - for (i = 0; i < rrecs; i++) { - if ((error = xfs_btree_check_lptr_disk(cur, rpp[i + 1], - level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memmove(rkp, rkp + 1, rrecs * sizeof(*rkp)); - memmove(rpp, rpp + 1, rrecs * sizeof(*rpp)); - xfs_bmbt_log_keys(cur, rbp, 1, rrecs); - xfs_bmbt_log_ptrs(cur, rbp, 1, rrecs); - } else { - memmove(rrp, rrp + 1, rrecs * sizeof(*rrp)); - xfs_bmbt_log_recs(cur, rbp, 1, rrecs); - key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(rrp)); - rkp = &key; - } - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_ptrs[level]--; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - -/* * Determine the extent state. */ /* ARGSUSED */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-28 16:16:29.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-28 16:16:39.000000000 +0200 @@ -575,6 +575,7 @@ int xfs_btree_decrement(struct xfs_btree int xfs_btree_lookup(struct xfs_btree_cur *, xfs_lookup_t, int *); int xfs_btree_updkey(struct xfs_btree_cur *, union xfs_btree_key *, int); int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); +int xfs_btree_lshift(struct xfs_btree_cur *, int, int *); int xfs_btree_rshift(struct xfs_btree_cur *, int, int *); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-28 16:17:23.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-28 16:18:09.000000000 +0200 @@ -44,7 +44,6 @@ STATIC void xfs_inobt_log_block(xfs_tran STATIC void xfs_inobt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_inobt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC int xfs_inobt_lshift(xfs_btree_cur_t *, int, int *); STATIC int xfs_inobt_newroot(xfs_btree_cur_t *, int *); STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, xfs_inobt_key_t *, xfs_btree_cur_t **, int *); @@ -277,7 +276,7 @@ xfs_inobt_delrec( */ if (be16_to_cpu(right->bb_numrecs) - 1 >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_inobt_lshift(tcur, level, &i))) + if ((error = xfs_btree_lshift(tcur, level, &i))) goto error0; if (i) { ASSERT(be16_to_cpu(block->bb_numrecs) >= @@ -617,7 +616,7 @@ xfs_inobt_insrec( * Next, try shifting an entry to the left neighbor. */ else { - if ((error = xfs_inobt_lshift(cur, level, &i))) + if ((error = xfs_btree_lshift(cur, level, &i))) return error; if (i) { optr = ptr = cur->bc_ptrs[level]; @@ -784,148 +783,6 @@ xfs_inobt_log_ptrs( } /* - * Move 1 record left from cur/level if possible. - * Update cur to reflect the new path. - */ -STATIC int /* error */ -xfs_inobt_lshift( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to shift record on */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ -#ifdef DEBUG - int i; /* loop index */ -#endif - xfs_inobt_key_t key; /* key value for leaf level upward */ - xfs_buf_t *lbp; /* buffer for left neighbor block */ - xfs_inobt_block_t *left; /* left neighbor btree block */ - xfs_inobt_key_t *lkp=NULL; /* key pointer for left block */ - xfs_inobt_ptr_t *lpp; /* address pointer for left block */ - xfs_inobt_rec_t *lrp=NULL; /* record pointer for left block */ - int nrec; /* new number of left block entries */ - xfs_buf_t *rbp; /* buffer for right (current) block */ - xfs_inobt_block_t *right; /* right (current) btree block */ - xfs_inobt_key_t *rkp=NULL; /* key pointer for right block */ - xfs_inobt_ptr_t *rpp=NULL; /* address pointer for right block */ - xfs_inobt_rec_t *rrp=NULL; /* record pointer for right block */ - - /* - * Set up variables for this block as "right". - */ - rbp = cur->bc_bufs[level]; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; -#endif - /* - * If we've got no left sibling then we can't shift an entry left. - */ - if (be32_to_cpu(right->bb_leftsib) == NULLAGBLOCK) { - *stat = 0; - return 0; - } - /* - * If the cursor entry is the one that would be moved, don't - * do it... it's too complicated. - */ - if (cur->bc_ptrs[level] <= 1) { - *stat = 0; - return 0; - } - /* - * Set up the left neighbor as "left". - */ - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(right->bb_leftsib), - 0, &lbp, XFS_INO_BTREE_REF))) - return error; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - /* - * If it's full, it can't take another entry. - */ - if (be16_to_cpu(left->bb_numrecs) == XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - *stat = 0; - return 0; - } - nrec = be16_to_cpu(left->bb_numrecs) + 1; - /* - * If non-leaf, copy a key and a ptr to the left block. - */ - if (level > 0) { - lkp = XFS_INOBT_KEY_ADDR(left, nrec, cur); - rkp = XFS_INOBT_KEY_ADDR(right, 1, cur); - *lkp = *rkp; - xfs_inobt_log_keys(cur, lbp, nrec, nrec); - lpp = XFS_INOBT_PTR_ADDR(left, nrec, cur); - rpp = XFS_INOBT_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(*rpp), level))) - return error; -#endif - *lpp = *rpp; - xfs_inobt_log_ptrs(cur, lbp, nrec, nrec); - } - /* - * If leaf, copy a record to the left block. - */ - else { - lrp = XFS_INOBT_REC_ADDR(left, nrec, cur); - rrp = XFS_INOBT_REC_ADDR(right, 1, cur); - *lrp = *rrp; - xfs_inobt_log_recs(cur, lbp, nrec, nrec); - } - /* - * Bump and log left's numrecs, decrement and log right's numrecs. - */ - be16_add(&left->bb_numrecs, 1); - xfs_inobt_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS); -#ifdef DEBUG - if (level > 0) - xfs_btree_check_key(cur->bc_btnum, lkp - 1, lkp); - else - xfs_btree_check_rec(cur->bc_btnum, lrp - 1, lrp); -#endif - be16_add(&right->bb_numrecs, -1); - xfs_inobt_log_block(cur->bc_tp, rbp, XFS_BB_NUMRECS); - /* - * Slide the contents of right down one entry. - */ - if (level > 0) { -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i + 1]), - level))) - return error; - } -#endif - memmove(rkp, rkp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memmove(rpp, rpp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); - xfs_inobt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - xfs_inobt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - } else { - memmove(rrp, rrp + 1, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - xfs_inobt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - key.ir_startino = rrp->ir_startino; - rkp = &key; - } - /* - * Update the parent key values of right. - */ - if ((error = xfs_btree_updkey(cur, (union xfs_btree_key *)rkp, level + 1))) - return error; - /* - * Slide the cursor value left one. - */ - cur->bc_ptrs[level]--; - *stat = 1; - return 0; -} - -/* * Allocate a new root block, fill it in. */ STATIC int /* error */ -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:54 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42, J_CHICKENPOX_43,J_CHICKENPOX_44,J_CHICKENPOX_45,J_CHICKENPOX_46, J_CHICKENPOX_47,J_CHICKENPOX_48,J_CHICKENPOX_64,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJUVKN000348 for ; Tue, 29 Jul 2008 12:30:32 -0700 X-ASG-Debug-ID: 1217359901-0c3203180000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 33DC81947DCA for ; Tue, 29 Jul 2008 12:31:41 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id rtCESdpBV9fWAu6e for ; Tue, 29 Jul 2008 12:31:41 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVhIF019396 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:43 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVhEl019394 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:43 +0200 Date: Tue, 29 Jul 2008 21:31:43 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 18/21] implement semi-generic xfs_btree_new_root Subject: [PATCH 18/21] implement semi-generic xfs_btree_new_root Message-ID: <20080729193143.GS19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-newroot User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359903 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17259 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Add a xfs_btree_new_root helper for the alloc and ialloc btrees. The bmap btree needs it's own version and is not converted. [hch: split out from bigger patch and minor adaptions] Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-29 17:00:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-29 17:03:51.000000000 +0200 @@ -52,7 +52,6 @@ STATIC void xfs_alloc_log_ptrs(xfs_btree STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); #define xfs_alloc_log_recs(c, b, i, j) \ xfs_allocbt_log_recs(c, b, i, j) -STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); /* * Internal functions. @@ -632,7 +631,7 @@ xfs_alloc_insrec( */ if (level >= cur->bc_nlevels) { XFS_STATS_INC(xs_abt_insrec); - if ((error = xfs_alloc_newroot(cur, &i))) + if ((error = xfs_btree_new_root(cur, &i))) return error; *bnop = NULLAGBLOCK; *stat = i; @@ -883,161 +882,6 @@ xfs_alloc_log_ptrs( xfs_trans_log_buf(cur->bc_tp, bp, first, last); } -/* - * Allocate a new root block, fill it in. - */ -STATIC int /* error */ -xfs_alloc_newroot( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - xfs_agblock_t lbno; /* left block number */ - xfs_buf_t *lbp; /* left btree buffer */ - xfs_alloc_block_t *left; /* left btree block */ - xfs_mount_t *mp; /* mount structure */ - xfs_agblock_t nbno; /* new block number */ - xfs_buf_t *nbp; /* new (root) buffer */ - xfs_alloc_block_t *new; /* new (root) btree block */ - int nptr; /* new value for key index, 1 or 2 */ - xfs_agblock_t rbno; /* right block number */ - xfs_buf_t *rbp; /* right btree buffer */ - xfs_alloc_block_t *right; /* right btree block */ - - mp = cur->bc_mp; - - ASSERT(cur->bc_nlevels < XFS_AG_MAXLEVELS(mp)); - /* - * Get a buffer from the freelist blocks, for the new root. - */ - error = xfs_alloc_get_freelist(cur->bc_tp, - cur->bc_private.a.agbp, &nbno, 1); - if (error) - return error; - /* - * None available, we fail. - */ - if (nbno == NULLAGBLOCK) { - *stat = 0; - return 0; - } - xfs_trans_agbtree_delta(cur->bc_tp, 1); - nbp = xfs_btree_get_bufs(mp, cur->bc_tp, cur->bc_private.a.agno, nbno, - 0); - new = XFS_BUF_TO_ALLOC_BLOCK(nbp); - /* - * Set the root data in the a.g. freespace structure. - */ - { - xfs_agf_t *agf; /* a.g. freespace header */ - xfs_agnumber_t seqno; - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - agf->agf_roots[cur->bc_btnum] = cpu_to_be32(nbno); - be32_add(&agf->agf_levels[cur->bc_btnum], 1); - seqno = be32_to_cpu(agf->agf_seqno); - mp->m_perag[seqno].pagf_levels[cur->bc_btnum]++; - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_ROOTS | XFS_AGF_LEVELS); - } - /* - * At the previous root level there are now two blocks: the old - * root, and the new block generated when it was split. - * We don't know which one the cursor is pointing at, so we - * set up variables "left" and "right" for each case. - */ - lbp = cur->bc_bufs[cur->bc_nlevels - 1]; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, cur->bc_nlevels - 1, lbp))) - return error; -#endif - if (be32_to_cpu(left->bb_rightsib) != NULLAGBLOCK) { - /* - * Our block is left, pick up the right block. - */ - lbno = XFS_DADDR_TO_AGBNO(mp, XFS_BUF_ADDR(lbp)); - rbno = be32_to_cpu(left->bb_rightsib); - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, rbno, 0, &rbp, - XFS_ALLOC_BTREE_REF))) - return error; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); - if ((error = xfs_btree_check_sblock(cur, right, - cur->bc_nlevels - 1, rbp))) - return error; - nptr = 1; - } else { - /* - * Our block is right, pick up the left block. - */ - rbp = lbp; - right = left; - rbno = XFS_DADDR_TO_AGBNO(mp, XFS_BUF_ADDR(rbp)); - lbno = be32_to_cpu(right->bb_leftsib); - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, lbno, 0, &lbp, - XFS_ALLOC_BTREE_REF))) - return error; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); - if ((error = xfs_btree_check_sblock(cur, left, - cur->bc_nlevels - 1, lbp))) - return error; - nptr = 2; - } - /* - * Fill in the new block's btree header and log it. - */ - new->bb_magic = cpu_to_be32(xfs_magics[cur->bc_btnum]); - new->bb_level = cpu_to_be16(cur->bc_nlevels); - new->bb_numrecs = cpu_to_be16(2); - new->bb_leftsib = cpu_to_be32(NULLAGBLOCK); - new->bb_rightsib = cpu_to_be32(NULLAGBLOCK); - xfs_alloc_log_block(cur->bc_tp, nbp, XFS_BB_ALL_BITS); - ASSERT(lbno != NULLAGBLOCK && rbno != NULLAGBLOCK); - /* - * Fill in the key data in the new root. - */ - { - xfs_alloc_key_t *kp; /* btree key pointer */ - - kp = XFS_ALLOC_KEY_ADDR(new, 1, cur); - if (be16_to_cpu(left->bb_level) > 0) { - kp[0] = *XFS_ALLOC_KEY_ADDR(left, 1, cur); - kp[1] = *XFS_ALLOC_KEY_ADDR(right, 1, cur); - } else { - xfs_alloc_rec_t *rp; /* btree record pointer */ - - rp = XFS_ALLOC_REC_ADDR(left, 1, cur); - kp[0].ar_startblock = rp->ar_startblock; - kp[0].ar_blockcount = rp->ar_blockcount; - rp = XFS_ALLOC_REC_ADDR(right, 1, cur); - kp[1].ar_startblock = rp->ar_startblock; - kp[1].ar_blockcount = rp->ar_blockcount; - } - } - xfs_alloc_log_keys(cur, nbp, 1, 2); - /* - * Fill in the pointer data in the new root. - */ - { - xfs_alloc_ptr_t *pp; /* btree address pointer */ - - pp = XFS_ALLOC_PTR_ADDR(new, 1, cur); - pp[0] = cpu_to_be32(lbno); - pp[1] = cpu_to_be32(rbno); - } - xfs_alloc_log_ptrs(cur, nbp, 1, 2); - /* - * Fix up the cursor. - */ - xfs_btree_setbuf(cur, cur->bc_nlevels, nbp); - cur->bc_ptrs[cur->bc_nlevels] = nptr; - cur->bc_nlevels++; - *stat = 1; - return 0; -} - /* * Externally visible routines. @@ -1191,6 +1035,26 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC void +xfs_allocbt_set_root( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr, + int inc) +{ + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); + int btnum = cur->bc_btnum; + + ASSERT(ptr->s != 0); + + agf->agf_roots[btnum] = ptr->s; + be32_add(&agf->agf_levels[btnum], inc); + cur->bc_mp->m_perag[seqno].pagf_levels[btnum] += inc; + + xfs_alloc_log_agf(cur->bc_tp, agbp, XFS_AGF_ROOTS | XFS_AGF_LEVELS); +} + STATIC int xfs_allocbt_alloc_block( struct xfs_btree_cur *cur, @@ -1562,6 +1426,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .set_root = xfs_allocbt_set_root, .alloc_block = xfs_allocbt_alloc_block, .update_lastrec = xfs_allocbt_update_lastrec, .get_maxrecs = xfs_allocbt_get_maxrecs, Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-29 17:00:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-29 17:04:14.000000000 +0200 @@ -1037,6 +1037,24 @@ xfs_btree_read_buf_block( } STATIC void +xfs_btree_set_ptr( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr_addr, + int index, + union xfs_btree_ptr *newptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + __be64 *pp = &ptr_addr->l; + + pp[index] = newptr->l; + } else { + __be32 *pp = &ptr_addr->s; + + pp[index] = newptr->s; + } +} + +STATIC void xfs_btree_move_ptrs( struct xfs_btree_cur *cur, union xfs_btree_ptr *base, @@ -2236,3 +2254,131 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +/* + * Allocate a new root block, fill it in. + */ +int /* error */ +xfs_btree_new_root( + struct xfs_btree_cur *cur, /* btree cursor */ + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; /* one half of the old root block */ + struct xfs_buf *bp; /* buffer containing block */ + int error; /* error return value */ + union xfs_btree_key *kp; /* btree key pointer */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + struct xfs_buf *nbp; /* new (root) buffer */ + struct xfs_btree_block *new; /* new (root) btree block */ + int nptr; /* new value for key index, 1 or 2 */ + union xfs_btree_ptr *pp; /* btree address pointer */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + union xfs_btree_ptr rptr; + union xfs_btree_ptr lptr; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, newroot); + + /* initialise our start point from the cursor */ + cur->bc_ops->init_ptr_from_cur(cur, &rptr); + + /* Allocate the new block. If we can't do it, we're toast. Give up. */ + error = cur->bc_ops->alloc_block(cur, &rptr, &lptr, 1, stat); + if (error) + goto error0; + if (*stat == 0) + goto out0; + XFS_BTREE_STATS_INC(cur, alloc); + + /* Set up the new block. */ + error = xfs_btree_get_buf_block(cur, &lptr, 0, &new, &nbp); + if (error) + goto error0; + + /* Set the root in the holding structure increasing the level by 1. */ + cur->bc_ops->set_root(cur, &lptr, 1); + + /* + * At the previous root level there are now two blocks: the old root, + * and the new block generated when it was split. We don't know which + * one the cursor is pointing at, so we set up variables "left" and + * "right" for each case. + */ + block = xfs_btree_get_block(cur, cur->bc_nlevels - 1, &bp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, cur->bc_nlevels - 1, bp); + if (error) + goto error0; +#endif + + xfs_btree_get_sibling(cur, block, &rptr, XFS_BB_RIGHTSIB); + if (!xfs_btree_ptr_is_null(cur, &rptr)) { + /* Our block is left, pick up the right block. */ + lbp = bp; + xfs_btree_buf_to_ptr(cur, lbp, &lptr); + left = block; + error = xfs_btree_read_buf_block(cur, &rptr, + cur->bc_nlevels - 1, 0, &right, &rbp); + if (error) + goto error0; + bp = rbp; + nptr = 1; + } else { + /* Our block is right, pick up the left block. */ + rbp = bp; + xfs_btree_buf_to_ptr(cur, rbp, &rptr); + right = block; + xfs_btree_get_sibling(cur, right, &lptr, XFS_BB_LEFTSIB); + error = xfs_btree_read_buf_block(cur, &lptr, + cur->bc_nlevels - 1, 0, &left, &lbp); + if (error) + goto error0; + bp = lbp; + nptr = 2; + } + /* Fill in the new block's btree header and log it. */ + xfs_btree_init_block(cur, cur->bc_nlevels, 2, new); + xfs_btree_log_block(cur, nbp, XFS_BB_ALL_BITS); + ASSERT(!xfs_btree_ptr_is_null(cur, &lptr) && + !xfs_btree_ptr_is_null(cur, &rptr)); + + /* Fill in the key data in the new root. */ + kp = cur->bc_ops->key_addr(cur, 1, new); + if (be16_to_cpu(left->bb_h.bb_level) > 0) { + cur->bc_ops->set_key(cur, kp, 0, + cur->bc_ops->key_addr(cur, 1, left)); + cur->bc_ops->set_key(cur, kp, 1, + cur->bc_ops->key_addr(cur, 1, right)); + } else { + cur->bc_ops->init_key_from_rec(cur, kp, + cur->bc_ops->rec_addr(cur, 1, left)); + kp = cur->bc_ops->key_addr(cur, 2, new); + cur->bc_ops->init_key_from_rec(cur, + kp, cur->bc_ops->rec_addr(cur, 1, right)); + } + cur->bc_ops->log_keys(cur, nbp, 1, 2); + + /* Fill in the pointer data in the new root. */ + pp = cur->bc_ops->ptr_addr(cur, 1, new); + xfs_btree_set_ptr(cur, pp, 0, &lptr); + xfs_btree_set_ptr(cur, pp, 1, &rptr); + xfs_btree_log_ptrs(cur, nbp, 1, 2); + + /* Fix up the cursor. */ + xfs_btree_setbuf(cur, cur->bc_nlevels, nbp); + cur->bc_ptrs[cur->bc_nlevels] = nptr; + cur->bc_nlevels++; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 17:00:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 17:03:50.000000000 +0200 @@ -191,6 +191,10 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* btree root operations */ + void (*set_root)(struct xfs_btree_cur *cur, + union xfs_btree_ptr *nptr, int level_change); + /* block allocation / freeing */ int (*alloc_block)(struct xfs_btree_cur *cur, union xfs_btree_ptr *sbno, @@ -585,6 +589,7 @@ int xfs_btree_lshift(struct xfs_btree_cu int xfs_btree_rshift(struct xfs_btree_cur *, int, int *); int xfs_btree_split(struct xfs_btree_cur *, int, union xfs_btree_ptr *, union xfs_btree_key *, struct xfs_btree_cur **, int *); +int xfs_btree_new_root(struct xfs_btree_cur *, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-29 17:00:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-29 17:03:50.000000000 +0200 @@ -44,7 +44,6 @@ STATIC void xfs_inobt_log_block(xfs_tran STATIC void xfs_inobt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_inobt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC int xfs_inobt_newroot(xfs_btree_cur_t *, int *); /* * Single level of the xfs_inobt_delete record deletion routine. @@ -556,7 +555,7 @@ xfs_inobt_insrec( * and we're done. */ if (level >= cur->bc_nlevels) { - error = xfs_inobt_newroot(cur, &i); + error = xfs_btree_new_root(cur, &i); *bnop = NULLAGBLOCK; *stat = i; return error; @@ -783,152 +782,6 @@ xfs_inobt_log_ptrs( xfs_trans_log_buf(cur->bc_tp, bp, first, last); } -/* - * Allocate a new root block, fill it in. - */ -STATIC int /* error */ -xfs_inobt_newroot( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - xfs_agi_t *agi; /* a.g. inode header */ - xfs_alloc_arg_t args; /* allocation argument structure */ - xfs_inobt_block_t *block; /* one half of the old root block */ - xfs_buf_t *bp; /* buffer containing block */ - int error; /* error return value */ - xfs_inobt_key_t *kp; /* btree key pointer */ - xfs_agblock_t lbno; /* left block number */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_inobt_block_t *left; /* left btree block */ - xfs_buf_t *nbp; /* new (root) buffer */ - xfs_inobt_block_t *new; /* new (root) btree block */ - int nptr; /* new value for key index, 1 or 2 */ - xfs_inobt_ptr_t *pp; /* btree address pointer */ - xfs_agblock_t rbno; /* right block number */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_inobt_block_t *right; /* right btree block */ - xfs_inobt_rec_t *rp; /* btree record pointer */ - - ASSERT(cur->bc_nlevels < XFS_IN_MAXLEVELS(cur->bc_mp)); - - /* - * Get a block & a buffer. - */ - agi = XFS_BUF_TO_AGI(cur->bc_private.a.agbp); - args.tp = cur->bc_tp; - args.mp = cur->bc_mp; - args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, - be32_to_cpu(agi->agi_root)); - args.mod = args.minleft = args.alignment = args.total = args.wasdel = - args.isfl = args.userdata = args.minalignslop = 0; - args.minlen = args.maxlen = args.prod = 1; - args.type = XFS_ALLOCTYPE_NEAR_BNO; - if ((error = xfs_alloc_vextent(&args))) - return error; - /* - * None available, we fail. - */ - if (args.fsbno == NULLFSBLOCK) { - *stat = 0; - return 0; - } - ASSERT(args.len == 1); - nbp = xfs_btree_get_bufs(args.mp, args.tp, args.agno, args.agbno, 0); - new = XFS_BUF_TO_INOBT_BLOCK(nbp); - /* - * Set the root data in the a.g. inode structure. - */ - agi->agi_root = cpu_to_be32(args.agbno); - be32_add(&agi->agi_level, 1); - xfs_ialloc_log_agi(args.tp, cur->bc_private.a.agbp, - XFS_AGI_ROOT | XFS_AGI_LEVEL); - /* - * At the previous root level there are now two blocks: the old - * root, and the new block generated when it was split. - * We don't know which one the cursor is pointing at, so we - * set up variables "left" and "right" for each case. - */ - bp = cur->bc_bufs[cur->bc_nlevels - 1]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, cur->bc_nlevels - 1, bp))) - return error; -#endif - if (be32_to_cpu(block->bb_rightsib) != NULLAGBLOCK) { - /* - * Our block is left, pick up the right block. - */ - lbp = bp; - lbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(lbp)); - left = block; - rbno = be32_to_cpu(left->bb_rightsib); - if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno, - rbno, 0, &rbp, XFS_INO_BTREE_REF))) - return error; - bp = rbp; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); - if ((error = xfs_btree_check_sblock(cur, right, - cur->bc_nlevels - 1, rbp))) - return error; - nptr = 1; - } else { - /* - * Our block is right, pick up the left block. - */ - rbp = bp; - rbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(rbp)); - right = block; - lbno = be32_to_cpu(right->bb_leftsib); - if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno, - lbno, 0, &lbp, XFS_INO_BTREE_REF))) - return error; - bp = lbp; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); - if ((error = xfs_btree_check_sblock(cur, left, - cur->bc_nlevels - 1, lbp))) - return error; - nptr = 2; - } - /* - * Fill in the new block's btree header and log it. - */ - new->bb_magic = cpu_to_be32(xfs_magics[cur->bc_btnum]); - new->bb_level = cpu_to_be16(cur->bc_nlevels); - new->bb_numrecs = cpu_to_be16(2); - new->bb_leftsib = cpu_to_be32(NULLAGBLOCK); - new->bb_rightsib = cpu_to_be32(NULLAGBLOCK); - xfs_inobt_log_block(args.tp, nbp, XFS_BB_ALL_BITS); - ASSERT(lbno != NULLAGBLOCK && rbno != NULLAGBLOCK); - /* - * Fill in the key data in the new root. - */ - kp = XFS_INOBT_KEY_ADDR(new, 1, cur); - if (be16_to_cpu(left->bb_level) > 0) { - kp[0] = *XFS_INOBT_KEY_ADDR(left, 1, cur); - kp[1] = *XFS_INOBT_KEY_ADDR(right, 1, cur); - } else { - rp = XFS_INOBT_REC_ADDR(left, 1, cur); - kp[0].ir_startino = rp->ir_startino; - rp = XFS_INOBT_REC_ADDR(right, 1, cur); - kp[1].ir_startino = rp->ir_startino; - } - xfs_inobt_log_keys(cur, nbp, 1, 2); - /* - * Fill in the pointer data in the new root. - */ - pp = XFS_INOBT_PTR_ADDR(new, 1, cur); - pp[0] = cpu_to_be32(lbno); - pp[1] = cpu_to_be32(rbno); - xfs_inobt_log_ptrs(cur, nbp, 1, 2); - /* - * Fix up the cursor. - */ - xfs_btree_setbuf(cur, cur->bc_nlevels, nbp); - cur->bc_ptrs[cur->bc_nlevels] = nptr; - cur->bc_nlevels++; - *stat = 1; - return 0; -} /* * Externally visible routines. @@ -1084,6 +937,20 @@ xfs_inobt_dup_cursor( cur->bc_private.a.agbp, cur->bc_private.a.agno); } +STATIC void +xfs_inobt_set_root( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *nptr, + int inc) /* level change */ +{ + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); + + agi->agi_root = nptr->s; + be32_add(&agi->agi_level, inc); + xfs_ialloc_log_agi(cur->bc_tp, agbp, XFS_AGI_ROOT | XFS_AGI_LEVEL); +} + STATIC int xfs_inobt_alloc_block( struct xfs_btree_cur *cur, @@ -1401,6 +1268,7 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .set_root = xfs_inobt_set_root, .alloc_block = xfs_inobt_alloc_block, .get_maxrecs = xfs_inobt_get_maxrecs, .init_key_from_rec = xfs_inobt_init_key_from_rec, -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:32 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42, J_CHICKENPOX_43,J_CHICKENPOX_44,J_CHICKENPOX_45,J_CHICKENPOX_46, J_CHICKENPOX_47,J_CHICKENPOX_48,J_CHICKENPOX_62,J_CHICKENPOX_63,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJURFr032760 for ; Tue, 29 Jul 2008 12:30:30 -0700 X-ASG-Debug-ID: 1217359896-0c36032a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 3DE9D1947DC0 for ; Tue, 29 Jul 2008 12:31:36 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id lZEENjion2EsdT7k for ; Tue, 29 Jul 2008 12:31:36 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVbIF019381 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:37 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVbb2019379 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:37 +0200 Date: Tue, 29 Jul 2008 21:31:37 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 17/21] implement generic xfs_btree_split Subject: [PATCH 17/21] implement generic xfs_btree_split Message-ID: <20080729193137.GR19104@lst.de> References: <20080729192113.493074843@verein.lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=unknown-8bit Content-Disposition: inline; filename=xfs-common-btree-split Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359898 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17258 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Make the btree split code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-29 16:48:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-29 16:49:06.000000000 +0200 @@ -844,6 +844,48 @@ xfs_btree_get_sibling( } } +STATIC void +xfs_btree_set_sibling( + struct xfs_btree_cur *cur, + struct xfs_btree_block *block, + union xfs_btree_ptr *ptr, + int lr) +{ + ASSERT(lr == XFS_BB_LEFTSIB || lr == XFS_BB_RIGHTSIB); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + if (lr == XFS_BB_RIGHTSIB) + block->bb_u.l.bb_rightsib = ptr->l; + else + block->bb_u.l.bb_leftsib = ptr->l; + } else { + if (lr == XFS_BB_RIGHTSIB) + block->bb_u.s.bb_rightsib = ptr->s; + else + block->bb_u.s.bb_leftsib = ptr->s; + } +} + +STATIC void +xfs_btree_init_block( + struct xfs_btree_cur *cur, + int level, + int numrecs, + struct xfs_btree_block *new) /* new block */ +{ + new->bb_h.bb_magic = cpu_to_be32(xfs_magics[cur->bc_btnum]); + new->bb_h.bb_level = cpu_to_be16(level); + new->bb_h.bb_numrecs = cpu_to_be16(numrecs); + + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { + new->bb_u.l.bb_leftsib = cpu_to_be64(NULLFSBLOCK); + new->bb_u.l.bb_rightsib = cpu_to_be64(NULLFSBLOCK); + } else { + new->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK); + new->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK); + } +} + /* * Return true if ptr is the last record in the btree and * we need to track updateÑ• to this record. The decision @@ -880,6 +922,21 @@ xfs_btree_buf_to_block( return XFS_BUF_TO_BLOCK(bp); } +STATIC void +xfs_btree_buf_to_ptr( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + ptr->l = cpu_to_be64(XFS_DADDR_TO_FSB(cur->bc_mp, + XFS_BUF_ADDR(bp))); + else { + ptr->s = cpu_to_be32(XFS_DADDR_TO_AGBNO(cur->bc_mp, + XFS_BUF_ADDR(bp))); + } +} + STATIC xfs_daddr_t xfs_btree_ptr_to_daddr( struct xfs_btree_cur *cur, @@ -919,6 +976,31 @@ xfs_btree_set_refs( } } +STATIC int +xfs_btree_get_buf_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr, + int flags, + struct xfs_btree_block **block, + struct xfs_buf **bpp) +{ + struct xfs_mount *mp = cur->bc_mp; + xfs_daddr_t d; + + /* need to sort out how callers deal with failures first */ + ASSERT(!(flags & XFS_BUF_TRYLOCK)); + + d = xfs_btree_ptr_to_daddr(cur, ptr); + *bpp = xfs_trans_get_buf(cur->bc_tp, mp->m_ddev_targp, d, + mp->m_bsize, flags); + + ASSERT(*bpp); + ASSERT(!XFS_BUF_GETERROR(*bpp)); + + *block = XFS_BUF_TO_BLOCK(*bpp); + return 0; +} + /* * Read in the buffer at the given ptr and return the buffer and * the block pointer within the buffer. @@ -1968,3 +2050,189 @@ error1: xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); return error; } + +/* + * Split cur/level block in half. + * Return new block number and the key to its first + * record (to be inserted into parent). + */ +int /* error */ +xfs_btree_split( + struct xfs_btree_cur *cur, + int level, + union xfs_btree_ptr *ptrp, + union xfs_btree_key *key, + struct xfs_btree_cur **curp, + int *stat) /* success/failure */ +{ + union xfs_btree_ptr lptr; /* left sibling block ptr */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + union xfs_btree_ptr rptr; /* right sibling block ptr */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + union xfs_btree_ptr rrptr; /* right-right sibling ptr */ + struct xfs_buf *rrbp; /* right-right buffer pointer */ + struct xfs_btree_block *rrblock; /* right-right btree block */ + int lrecs; + int rrecs; + int src_index; + int error; /* error return value */ +#ifdef DEBUG + int i; +#endif + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGIPK(cur, level, *ptrp, key); + + XFS_BTREE_STATS_INC(cur, split); + + /* Set up left block (current one). */ + left = xfs_btree_get_block(cur, level, &lbp); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, left, level, lbp); + if (error) + goto error0; +#endif + + xfs_btree_buf_to_ptr(cur, lbp, &lptr); + + /* Allocate the new block. If we can't do it, we're toast. Give up. */ + error = cur->bc_ops->alloc_block(cur, &lptr, &rptr, 1, stat); + if (error) + goto error0; + if (*stat == 0) + goto out0; + XFS_BTREE_STATS_INC(cur, alloc); + + /* Set up the new block as "right". */ + error = xfs_btree_get_buf_block(cur, &rptr, 0, &right, &rbp); + if (error) + goto error0; + + /* Fill in the btree header for the new right block. */ + xfs_btree_init_block(cur, be16_to_cpu(left->bb_h.bb_level), 0, right); + + /* + * Split the entries between the old and the new block evenly. + * Make sure that if there's an odd number of entries now, that + * each new block will have the same number of entries. + */ + lrecs = xfs_btree_get_numrecs(left); + rrecs = lrecs / 2; + if ((lrecs & 1) && cur->bc_ptrs[level] <= rrecs + 1) + rrecs++; + src_index = (lrecs - rrecs + 1); + + XFS_BTREE_STATS_ADD(cur, moves, rrecs); + + /* + * Copy btree block entries from the left block over to the + * new block, the right. Update the right block and log the + * changes. + */ + if (level > 0) { + /* It's a non-leaf. Move keys and pointers. */ + union xfs_btree_key *lkp; /* left btree key */ + union xfs_btree_ptr *lpp; /* left address pointer */ + union xfs_btree_key *rkp; /* right btree key */ + union xfs_btree_ptr *rpp; /* right address pointer */ + + lkp = cur->bc_ops->key_addr(cur, src_index, left); + lpp = cur->bc_ops->ptr_addr(cur, src_index, left); + rkp = cur->bc_ops->key_addr(cur, 1, right); + rpp = cur->bc_ops->ptr_addr(cur, 1, right); + +#ifdef DEBUG + for (i = src_index; i < rrecs; i++) { + error = xfs_btree_check_ptr(cur, lpp, i, level); + if (error) + goto error0; + } +#endif + + cur->bc_ops->copy_keys(cur, lkp, rkp, rrecs); + xfs_btree_copy_ptrs(cur, lpp, rpp, rrecs); + + cur->bc_ops->log_keys(cur, rbp, 1, rrecs); + xfs_btree_log_ptrs(cur, rbp, 1, rrecs); + + /* Grab the keys to the entries moved to the right block */ + cur->bc_ops->copy_keys(cur, rkp, key, 1); + } else { + /* It's a leaf. Move records. */ + union xfs_btree_rec *lrp; /* left record pointer */ + union xfs_btree_rec *rrp; /* right record pointer */ + + lrp = cur->bc_ops->rec_addr(cur, src_index, left); + rrp = cur->bc_ops->rec_addr(cur, 1, right); + + cur->bc_ops->copy_recs(cur, lrp, rrp, rrecs); + cur->bc_ops->log_recs(cur, rbp, 1, rrecs); + + cur->bc_ops->init_key_from_rec(cur, key, + cur->bc_ops->rec_addr(cur, 1, right)); + } + + + /* + * Find the left block number by looking in the buffer. + * Adjust numrecs, sibling pointers. + */ + xfs_btree_get_sibling(cur, left, &rrptr, XFS_BB_RIGHTSIB); + xfs_btree_set_sibling(cur, right, &rrptr, XFS_BB_RIGHTSIB); + xfs_btree_set_sibling(cur, right, &lptr, XFS_BB_LEFTSIB); + xfs_btree_set_sibling(cur, left, &rptr, XFS_BB_RIGHTSIB); + + lrecs -= rrecs; + xfs_btree_set_numrecs(left, lrecs); + xfs_btree_set_numrecs(right, xfs_btree_get_numrecs(right) + rrecs); + + xfs_btree_log_block(cur, rbp, XFS_BB_ALL_BITS); + xfs_btree_log_block(cur, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); + + /* + * If there's a block to the new block's right, make that block + * point back to right instead of to left. + */ + if (!xfs_btree_ptr_is_null(cur, &rrptr)) { + error = xfs_btree_read_buf_block(cur, &rrptr, level, + 0, &rrblock, &rrbp); + if (error) + goto error0; + xfs_btree_set_sibling(cur, rrblock, &rptr, XFS_BB_LEFTSIB); + xfs_btree_log_block(cur, rrbp, XFS_BB_LEFTSIB); + } + /* + * If the cursor is really in the right block, move it there. + * If it's just pointing past the last entry in left, then we'll + * insert there, so don't change anything in that case. + */ + if (cur->bc_ptrs[level] > lrecs + 1) { + xfs_btree_setbuf(cur, level, rbp); + cur->bc_ptrs[level] -= lrecs; + } + /* + * If there are more levels, we'll need another cursor which refers + * the right block, no matter where this cursor was. + */ + if (level + 1 < cur->bc_nlevels) { + error = xfs_btree_dup_cursor(cur, curp); + if (error) + goto error0; + (*curp)->bc_ptrs[level + 1]++; + } + *ptrp = rptr; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 16:48:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 16:48:46.000000000 +0200 @@ -191,6 +191,12 @@ struct xfs_btree_ops { /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); + /* block allocation / freeing */ + int (*alloc_block)(struct xfs_btree_cur *cur, + union xfs_btree_ptr *sbno, + union xfs_btree_ptr *nbno, + int length, int *stat); + /* updated last record information */ void (*update_lastrec)(struct xfs_btree_cur *, struct xfs_btree_block *, @@ -577,6 +583,8 @@ int xfs_btree_updkey(struct xfs_btree_cu int xfs_btree_update(struct xfs_btree_cur *, union xfs_btree_rec *); int xfs_btree_lshift(struct xfs_btree_cur *, int, int *); int xfs_btree_rshift(struct xfs_btree_cur *, int, int *); +int xfs_btree_split(struct xfs_btree_cur *, int, union xfs_btree_ptr *, + union xfs_btree_key *, struct xfs_btree_cur **, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:48:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:48:46.000000000 +0200 @@ -53,8 +53,6 @@ STATIC void xfs_allocbt_log_recs(xfs_btr #define xfs_alloc_log_recs(c, b, i, j) \ xfs_allocbt_log_recs(c, b, i, j) STATIC int xfs_alloc_newroot(xfs_btree_cur_t *, int *); -STATIC int xfs_alloc_split(xfs_btree_cur_t *, int, xfs_agblock_t *, - xfs_alloc_key_t *, xfs_btree_cur_t **, int *); /* * Internal functions. @@ -700,15 +698,18 @@ xfs_alloc_insrec( if (i) optr = ptr = cur->bc_ptrs[level]; else { + union xfs_btree_ptr bno = { .s = cpu_to_be32(nbno) }; /* * Next, try splitting the current block in * half. If this works we have to re-set our * variables because we could be in a * different block now. */ - if ((error = xfs_alloc_split(cur, level, &nbno, - &nkey, &ncur, &i))) + if ((error = xfs_btree_split(cur, level, &bno, + (union xfs_btree_key *)&nkey, + &ncur, &i))) return error; + nbno = be32_to_cpu(bno.s); if (i) { bp = cur->bc_bufs[level]; block = XFS_BUF_TO_ALLOC_BLOCK(bp); @@ -1037,160 +1038,6 @@ xfs_alloc_newroot( return 0; } -/* - * Split cur/level block in half. - * Return new block number and its first record (to be inserted into parent). - */ -STATIC int /* error */ -xfs_alloc_split( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to split */ - xfs_agblock_t *bnop, /* output: block number allocated */ - xfs_alloc_key_t *keyp, /* output: first key of new block */ - xfs_btree_cur_t **curp, /* output: new cursor */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* loop index/record number */ - xfs_agblock_t lbno; /* left (current) block number */ - xfs_buf_t *lbp; /* buffer for left block */ - xfs_alloc_block_t *left; /* left (current) btree block */ - xfs_agblock_t rbno; /* right (new) block number */ - xfs_buf_t *rbp; /* buffer for right block */ - xfs_alloc_block_t *right; /* right (new) btree block */ - - /* - * Allocate the new block from the freelist. - * If we can't do it, we're toast. Give up. - */ - error = xfs_alloc_get_freelist(cur->bc_tp, - cur->bc_private.a.agbp, &rbno, 1); - if (error) - return error; - if (rbno == NULLAGBLOCK) { - *stat = 0; - return 0; - } - xfs_trans_agbtree_delta(cur->bc_tp, 1); - rbp = xfs_btree_get_bufs(cur->bc_mp, cur->bc_tp, cur->bc_private.a.agno, - rbno, 0); - /* - * Set up the new block as "right". - */ - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); - /* - * "Left" is the current (according to the cursor) block. - */ - lbp = cur->bc_bufs[level]; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; -#endif - /* - * Fill in the btree header for the new block. - */ - right->bb_magic = cpu_to_be32(xfs_magics[cur->bc_btnum]); - right->bb_level = left->bb_level; - right->bb_numrecs = cpu_to_be16(be16_to_cpu(left->bb_numrecs) / 2); - /* - * Make sure that if there's an odd number of entries now, that - * each new block will have the same number of entries. - */ - if ((be16_to_cpu(left->bb_numrecs) & 1) && - cur->bc_ptrs[level] <= be16_to_cpu(right->bb_numrecs) + 1) - be16_add(&right->bb_numrecs, 1); - i = be16_to_cpu(left->bb_numrecs) - be16_to_cpu(right->bb_numrecs) + 1; - /* - * For non-leaf blocks, copy keys and addresses over to the new block. - */ - if (level > 0) { - xfs_alloc_key_t *lkp; /* left btree key pointer */ - xfs_alloc_ptr_t *lpp; /* left btree address pointer */ - xfs_alloc_key_t *rkp; /* right btree key pointer */ - xfs_alloc_ptr_t *rpp; /* right btree address pointer */ - - lkp = XFS_ALLOC_KEY_ADDR(left, i, cur); - lpp = XFS_ALLOC_PTR_ADDR(left, i, cur); - rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur); - rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(lpp[i]), level))) - return error; - } -#endif - memcpy(rkp, lkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memcpy(rpp, lpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); - xfs_alloc_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - xfs_alloc_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - *keyp = *rkp; - } - /* - * For leaf blocks, copy records over to the new block. - */ - else { - xfs_alloc_rec_t *lrp; /* left btree record pointer */ - xfs_alloc_rec_t *rrp; /* right btree record pointer */ - - lrp = XFS_ALLOC_REC_ADDR(left, i, cur); - rrp = XFS_ALLOC_REC_ADDR(right, 1, cur); - memcpy(rrp, lrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - xfs_alloc_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - keyp->ar_startblock = rrp->ar_startblock; - keyp->ar_blockcount = rrp->ar_blockcount; - } - /* - * Find the left block number by looking in the buffer. - * Adjust numrecs, sibling pointers. - */ - lbno = XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(lbp)); - be16_add(&left->bb_numrecs, -(be16_to_cpu(right->bb_numrecs))); - right->bb_rightsib = left->bb_rightsib; - left->bb_rightsib = cpu_to_be32(rbno); - right->bb_leftsib = cpu_to_be32(lbno); - xfs_alloc_log_block(cur->bc_tp, rbp, XFS_BB_ALL_BITS); - xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); - /* - * If there's a block to the new block's right, make that block - * point back to right instead of to left. - */ - if (be32_to_cpu(right->bb_rightsib) != NULLAGBLOCK) { - xfs_alloc_block_t *rrblock; /* rr btree block */ - xfs_buf_t *rrbp; /* buffer for rrblock */ - - if ((error = xfs_btree_read_bufs(cur->bc_mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(right->bb_rightsib), 0, - &rrbp, XFS_ALLOC_BTREE_REF))) - return error; - rrblock = XFS_BUF_TO_ALLOC_BLOCK(rrbp); - if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))) - return error; - rrblock->bb_leftsib = cpu_to_be32(rbno); - xfs_alloc_log_block(cur->bc_tp, rrbp, XFS_BB_LEFTSIB); - } - /* - * If the cursor is really in the right block, move it there. - * If it's just pointing past the last entry in left, then we'll - * insert there, so don't change anything in that case. - */ - if (cur->bc_ptrs[level] > be16_to_cpu(left->bb_numrecs) + 1) { - xfs_btree_setbuf(cur, level, rbp); - cur->bc_ptrs[level] -= be16_to_cpu(left->bb_numrecs); - } - /* - * If there are more levels, we'll need another cursor which refers to - * the right block, no matter where this cursor was. - */ - if (level + 1 < cur->bc_nlevels) { - if ((error = xfs_btree_dup_cursor(cur, curp))) - return error; - (*curp)->bc_ptrs[level + 1]++; - } - *bnop = rbno; - *stat = 1; - return 0; -} /* * Externally visible routines. @@ -1344,6 +1191,41 @@ xfs_allocbt_dup_cursor( cur->bc_btnum); } +STATIC int +xfs_allocbt_alloc_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *start, + union xfs_btree_ptr *new, + int length, + int *stat) +{ + int error; + xfs_agblock_t bno; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + + /* Allocate the new block from the freelist. If we can't, give up. */ + error = xfs_alloc_get_freelist(cur->bc_tp, cur->bc_private.a.agbp, + &bno, 1); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + + if (bno == NULLAGBLOCK) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + + xfs_trans_agbtree_delta(cur->bc_tp, 1); + new->s = cpu_to_be32(bno); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; +} + /* * Update the longest extent in the AGF */ @@ -1680,6 +1562,7 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, + .alloc_block = xfs_allocbt_alloc_block, .update_lastrec = xfs_allocbt_update_lastrec, .get_maxrecs = xfs_allocbt_get_maxrecs, .init_key_from_rec = xfs_allocbt_init_key_from_rec, Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:48:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:48:46.000000000 +0200 @@ -45,8 +45,6 @@ STATIC void xfs_inobt_log_keys(xfs_btree STATIC void xfs_inobt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC int xfs_inobt_newroot(xfs_btree_cur_t *, int *); -STATIC int xfs_inobt_split(xfs_btree_cur_t *, int, xfs_agblock_t *, - xfs_inobt_key_t *, xfs_btree_cur_t **, int *); /* * Single level of the xfs_inobt_delete record deletion routine. @@ -621,15 +619,18 @@ xfs_inobt_insrec( if (i) { optr = ptr = cur->bc_ptrs[level]; } else { + union xfs_btree_ptr bno = { .s = cpu_to_be32(nbno) }; /* * Next, try splitting the current block * in half. If this works we have to * re-set our variables because * we could be in a different block now. */ - if ((error = xfs_inobt_split(cur, level, &nbno, - &nkey, &ncur, &i))) + if ((error = xfs_btree_split(cur, level, &bno, + (union xfs_btree_key *)&nkey, + &ncur, &i))) return error; + nbno = be32_to_cpu(bno.s); if (i) { bp = cur->bc_bufs[level]; block = XFS_BUF_TO_INOBT_BLOCK(bp); @@ -930,165 +931,6 @@ xfs_inobt_newroot( } /* - * Split cur/level block in half. - * Return new block number and its first record (to be inserted into parent). - */ -STATIC int /* error */ -xfs_inobt_split( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to split */ - xfs_agblock_t *bnop, /* output: block number allocated */ - xfs_inobt_key_t *keyp, /* output: first key of new block */ - xfs_btree_cur_t **curp, /* output: new cursor */ - int *stat) /* success/failure */ -{ - xfs_alloc_arg_t args; /* allocation argument structure */ - int error; /* error return value */ - int i; /* loop index/record number */ - xfs_agblock_t lbno; /* left (current) block number */ - xfs_buf_t *lbp; /* buffer for left block */ - xfs_inobt_block_t *left; /* left (current) btree block */ - xfs_inobt_key_t *lkp; /* left btree key pointer */ - xfs_inobt_ptr_t *lpp; /* left btree address pointer */ - xfs_inobt_rec_t *lrp; /* left btree record pointer */ - xfs_buf_t *rbp; /* buffer for right block */ - xfs_inobt_block_t *right; /* right (new) btree block */ - xfs_inobt_key_t *rkp; /* right btree key pointer */ - xfs_inobt_ptr_t *rpp; /* right btree address pointer */ - xfs_inobt_rec_t *rrp; /* right btree record pointer */ - - /* - * Set up left block (current one). - */ - lbp = cur->bc_bufs[level]; - args.tp = cur->bc_tp; - args.mp = cur->bc_mp; - lbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(lbp)); - /* - * Allocate the new block. - * If we can't do it, we're toast. Give up. - */ - args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, lbno); - args.mod = args.minleft = args.alignment = args.total = args.wasdel = - args.isfl = args.userdata = args.minalignslop = 0; - args.minlen = args.maxlen = args.prod = 1; - args.type = XFS_ALLOCTYPE_NEAR_BNO; - if ((error = xfs_alloc_vextent(&args))) - return error; - if (args.fsbno == NULLFSBLOCK) { - *stat = 0; - return 0; - } - ASSERT(args.len == 1); - rbp = xfs_btree_get_bufs(args.mp, args.tp, args.agno, args.agbno, 0); - /* - * Set up the new block as "right". - */ - right = XFS_BUF_TO_INOBT_BLOCK(rbp); - /* - * "Left" is the current (according to the cursor) block. - */ - left = XFS_BUF_TO_INOBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; -#endif - /* - * Fill in the btree header for the new block. - */ - right->bb_magic = cpu_to_be32(xfs_magics[cur->bc_btnum]); - right->bb_level = left->bb_level; - right->bb_numrecs = cpu_to_be16(be16_to_cpu(left->bb_numrecs) / 2); - /* - * Make sure that if there's an odd number of entries now, that - * each new block will have the same number of entries. - */ - if ((be16_to_cpu(left->bb_numrecs) & 1) && - cur->bc_ptrs[level] <= be16_to_cpu(right->bb_numrecs) + 1) - be16_add(&right->bb_numrecs, 1); - i = be16_to_cpu(left->bb_numrecs) - be16_to_cpu(right->bb_numrecs) + 1; - /* - * For non-leaf blocks, copy keys and addresses over to the new block. - */ - if (level > 0) { - lkp = XFS_INOBT_KEY_ADDR(left, i, cur); - lpp = XFS_INOBT_PTR_ADDR(left, i, cur); - rkp = XFS_INOBT_KEY_ADDR(right, 1, cur); - rpp = XFS_INOBT_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(lpp[i]), level))) - return error; - } -#endif - memcpy(rkp, lkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memcpy(rpp, lpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); - xfs_inobt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - xfs_inobt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - *keyp = *rkp; - } - /* - * For leaf blocks, copy records over to the new block. - */ - else { - lrp = XFS_INOBT_REC_ADDR(left, i, cur); - rrp = XFS_INOBT_REC_ADDR(right, 1, cur); - memcpy(rrp, lrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - xfs_inobt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - keyp->ir_startino = rrp->ir_startino; - } - /* - * Find the left block number by looking in the buffer. - * Adjust numrecs, sibling pointers. - */ - be16_add(&left->bb_numrecs, -(be16_to_cpu(right->bb_numrecs))); - right->bb_rightsib = left->bb_rightsib; - left->bb_rightsib = cpu_to_be32(args.agbno); - right->bb_leftsib = cpu_to_be32(lbno); - xfs_inobt_log_block(args.tp, rbp, XFS_BB_ALL_BITS); - xfs_inobt_log_block(args.tp, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); - /* - * If there's a block to the new block's right, make that block - * point back to right instead of to left. - */ - if (be32_to_cpu(right->bb_rightsib) != NULLAGBLOCK) { - xfs_inobt_block_t *rrblock; /* rr btree block */ - xfs_buf_t *rrbp; /* buffer for rrblock */ - - if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno, - be32_to_cpu(right->bb_rightsib), 0, &rrbp, - XFS_INO_BTREE_REF))) - return error; - rrblock = XFS_BUF_TO_INOBT_BLOCK(rrbp); - if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))) - return error; - rrblock->bb_leftsib = cpu_to_be32(args.agbno); - xfs_inobt_log_block(args.tp, rrbp, XFS_BB_LEFTSIB); - } - /* - * If the cursor is really in the right block, move it there. - * If it's just pointing past the last entry in left, then we'll - * insert there, so don't change anything in that case. - */ - if (cur->bc_ptrs[level] > be16_to_cpu(left->bb_numrecs) + 1) { - xfs_btree_setbuf(cur, level, rbp); - cur->bc_ptrs[level] -= be16_to_cpu(left->bb_numrecs); - } - /* - * If there are more levels, we'll need another cursor which refers - * the right block, no matter where this cursor was. - */ - if (level + 1 < cur->bc_nlevels) { - if ((error = xfs_btree_dup_cursor(cur, curp))) - return error; - (*curp)->bc_ptrs[level + 1]++; - } - *bnop = args.agbno; - *stat = 1; - return 0; -} - -/* * Externally visible routines. */ @@ -1243,6 +1085,48 @@ xfs_inobt_dup_cursor( } STATIC int +xfs_inobt_alloc_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *start, + union xfs_btree_ptr *new, + int length, + int *stat) +{ + xfs_alloc_arg_t args; /* block allocation args */ + int error; /* error return value */ + xfs_agblock_t sbno = be32_to_cpu(start->s); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + + memset(&args, 0, sizeof(args)); + args.tp = cur->bc_tp; + args.mp = cur->bc_mp; + args.fsbno = XFS_AGB_TO_FSB(args.mp, cur->bc_private.a.agno, sbno); + args.minlen = 1; + args.maxlen = 1; + args.prod = 1; + args.type = XFS_ALLOCTYPE_NEAR_BNO; + + error = xfs_alloc_vextent(&args); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + if (args.fsbno == NULLFSBLOCK) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + ASSERT(args.len == 1); + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + + new->s = cpu_to_be32(XFS_FSB_TO_AGBNO(args.mp, args.fsbno)); + *stat = 1; + return 0; +} + + +STATIC int xfs_inobt_get_maxrecs( struct xfs_btree_cur *cur, int level) @@ -1517,6 +1401,7 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, + .alloc_block = xfs_inobt_alloc_block, .get_maxrecs = xfs_inobt_get_maxrecs, .init_key_from_rec = xfs_inobt_init_key_from_rec, .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:48:45.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:48:46.000000000 +0200 @@ -52,8 +52,6 @@ STATIC int xfs_bmbt_killroot(xfs_btree_cur_t *); STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC int xfs_bmbt_split(xfs_btree_cur_t *, int, xfs_fsblock_t *, - __uint64_t *, xfs_btree_cur_t **, int *); #undef EXIT @@ -549,13 +547,17 @@ xfs_bmbt_insrec( if (i) { optr = ptr = cur->bc_ptrs[level]; } else { - if ((error = xfs_bmbt_split(cur, level, - &nbno, &startoff, &ncur, + union xfs_btree_ptr bno = { .l = cpu_to_be64(nbno) }; + union xfs_btree_key skey; + if ((error = xfs_btree_split(cur, level, + &bno, &skey, &ncur, &i))) { XFS_BMBT_TRACE_CURSOR(cur, ERROR); return error; } + nbno = be64_to_cpu(bno.l); + startoff = be64_to_cpu(skey.bmbt.br_startoff); if (i) { block = xfs_bmbt_get_block( cur, level, &bp); @@ -788,184 +790,6 @@ xfs_extent_state( return XFS_EXT_NORM; } - -/* - * Split cur/level block in half. - * Return new block number and its first record (to be inserted into parent). - */ -STATIC int /* error */ -xfs_bmbt_split( - xfs_btree_cur_t *cur, - int level, - xfs_fsblock_t *bnop, - __uint64_t *startoff, - xfs_btree_cur_t **curp, - int *stat) /* success/failure */ -{ - xfs_alloc_arg_t args; /* block allocation args */ - int error; /* error return value */ - int i; /* loop counter */ - xfs_fsblock_t lbno; /* left sibling block number */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_bmbt_block_t *left; /* left btree block */ - xfs_bmbt_key_t *lkp; /* left btree key */ - xfs_bmbt_ptr_t *lpp; /* left address pointer */ - xfs_bmbt_rec_t *lrp; /* left record pointer */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_bmbt_block_t *right; /* right btree block */ - xfs_bmbt_key_t *rkp; /* right btree key */ - xfs_bmbt_ptr_t *rpp; /* right address pointer */ - xfs_bmbt_block_t *rrblock; /* right-right btree block */ - xfs_buf_t *rrbp; /* right-right buffer pointer */ - xfs_bmbt_rec_t *rrp; /* right record pointer */ - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - // disable until merged into common code -// XFS_BMBT_TRACE_ARGIFK(cur, level, *bnop, *startoff); - args.tp = cur->bc_tp; - args.mp = cur->bc_mp; - lbp = cur->bc_bufs[level]; - lbno = XFS_DADDR_TO_FSB(args.mp, XFS_BUF_ADDR(lbp)); - left = XFS_BUF_TO_BMBT_BLOCK(lbp); - args.fsbno = cur->bc_private.b.firstblock; - args.firstblock = args.fsbno; - args.minleft = 0; - if (args.fsbno == NULLFSBLOCK) { - args.fsbno = lbno; - args.type = XFS_ALLOCTYPE_START_BNO; - /* - * Make sure there is sufficient room left in the AG to - * complete a full tree split for an extent insert. If - * we are converting the middle part of an extent then - * we may need space for two tree splits. - * - * We are relying on the caller to make the correct block - * reservation for this operation to succeed. If the - * reservation amount is insufficient then we may fail a - * block allocation here and corrupt the filesystem. - */ - args.minleft = xfs_trans_get_block_res(args.tp); - } else if (cur->bc_private.b.flist->xbf_low) - args.type = XFS_ALLOCTYPE_START_BNO; - else - args.type = XFS_ALLOCTYPE_NEAR_BNO; - args.mod = args.alignment = args.total = args.isfl = - args.userdata = args.minalignslop = 0; - args.minlen = args.maxlen = args.prod = 1; - args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL; - if (!args.wasdel && xfs_trans_get_block_res(args.tp) == 0) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return XFS_ERROR(ENOSPC); - } - if ((error = xfs_alloc_vextent(&args))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (args.fsbno == NULLFSBLOCK && args.minleft) { - /* - * Could not find an AG with enough free space to satisfy - * a full btree split. Try again without minleft and if - * successful activate the lowspace algorithm. - */ - args.fsbno = 0; - args.type = XFS_ALLOCTYPE_FIRST_AG; - args.minleft = 0; - if ((error = xfs_alloc_vextent(&args))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - cur->bc_private.b.flist->xbf_low = 1; - } - if (args.fsbno == NULLFSBLOCK) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - ASSERT(args.len == 1); - cur->bc_private.b.firstblock = args.fsbno; - cur->bc_private.b.allocated++; - cur->bc_private.b.ip->i_d.di_nblocks++; - xfs_trans_log_inode(args.tp, cur->bc_private.b.ip, XFS_ILOG_CORE); - XFS_TRANS_MOD_DQUOT_BYINO(args.mp, args.tp, cur->bc_private.b.ip, - XFS_TRANS_DQ_BCOUNT, 1L); - rbp = xfs_btree_get_bufl(args.mp, args.tp, args.fsbno, 0); - right = XFS_BUF_TO_BMBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, left, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - right->bb_magic = cpu_to_be32(XFS_BMAP_MAGIC); - right->bb_level = left->bb_level; - right->bb_numrecs = cpu_to_be16(be16_to_cpu(left->bb_numrecs) / 2); - if ((be16_to_cpu(left->bb_numrecs) & 1) && - cur->bc_ptrs[level] <= be16_to_cpu(right->bb_numrecs) + 1) - be16_add(&right->bb_numrecs, 1); - i = be16_to_cpu(left->bb_numrecs) - be16_to_cpu(right->bb_numrecs) + 1; - if (level > 0) { - lkp = XFS_BMAP_KEY_IADDR(left, i, cur); - lpp = XFS_BMAP_PTR_IADDR(left, i, cur); - rkp = XFS_BMAP_KEY_IADDR(right, 1, cur); - rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(right->bb_numrecs); i++) { - if ((error = xfs_btree_check_lptr_disk(cur, lpp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memcpy(rkp, lkp, be16_to_cpu(right->bb_numrecs) * sizeof(*rkp)); - memcpy(rpp, lpp, be16_to_cpu(right->bb_numrecs) * sizeof(*rpp)); - xfs_bmbt_log_keys(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - xfs_bmbt_log_ptrs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - *startoff = be64_to_cpu(rkp->br_startoff); - } else { - lrp = XFS_BMAP_REC_IADDR(left, i, cur); - rrp = XFS_BMAP_REC_IADDR(right, 1, cur); - memcpy(rrp, lrp, be16_to_cpu(right->bb_numrecs) * sizeof(*rrp)); - xfs_bmbt_log_recs(cur, rbp, 1, be16_to_cpu(right->bb_numrecs)); - *startoff = xfs_bmbt_disk_get_startoff(rrp); - } - be16_add(&left->bb_numrecs, -(be16_to_cpu(right->bb_numrecs))); - right->bb_rightsib = left->bb_rightsib; - left->bb_rightsib = cpu_to_be64(args.fsbno); - right->bb_leftsib = cpu_to_be64(lbno); - xfs_bmbt_log_block(cur, rbp, XFS_BB_ALL_BITS); - xfs_bmbt_log_block(cur, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); - if (be64_to_cpu(right->bb_rightsib) != NULLDFSBNO) { - if ((error = xfs_btree_read_bufl(args.mp, args.tp, - be64_to_cpu(right->bb_rightsib), 0, &rrbp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - rrblock = XFS_BUF_TO_BMBT_BLOCK(rrbp); - if ((error = xfs_btree_check_lblock(cur, rrblock, level, rrbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - rrblock->bb_leftsib = cpu_to_be64(args.fsbno); - xfs_bmbt_log_block(cur, rrbp, XFS_BB_LEFTSIB); - } - if (cur->bc_ptrs[level] > be16_to_cpu(left->bb_numrecs) + 1) { - xfs_btree_setbuf(cur, level, rbp); - cur->bc_ptrs[level] -= be16_to_cpu(left->bb_numrecs); - } - if (level + 1 < cur->bc_nlevels) { - if ((error = xfs_btree_dup_cursor(cur, curp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - (*curp)->bc_ptrs[level + 1]++; - } - *bnop = args.fsbno; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - /* * Convert on-disk form of btree root to in-memory form. */ @@ -1672,6 +1496,92 @@ xfs_bmbt_dup_cursor( return new; } +STATIC int +xfs_bmbt_alloc_block( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *start, + union xfs_btree_ptr *new, + int length, + int *stat) +{ + xfs_alloc_arg_t args; /* block allocation args */ + int error; /* error return value */ + + memset(&args, 0, sizeof(args)); + args.tp = cur->bc_tp; + args.mp = cur->bc_mp; + args.fsbno = cur->bc_private.b.firstblock; + args.firstblock = args.fsbno; + + if (args.fsbno == NULLFSBLOCK) { + args.fsbno = be64_to_cpu(start->l); + args.type = XFS_ALLOCTYPE_START_BNO; + /* + * Make sure there is sufficient room left in the AG to + * complete a full tree split for an extent insert. If + * we are converting the middle part of an extent then + * we may need space for two tree splits. + * + * We are relying on the caller to make the correct block + * reservation for this operation to succeed. If the + * reservation amount is insufficient then we may fail a + * block allocation here and corrupt the filesystem. + */ + args.minleft = xfs_trans_get_block_res(args.tp); + } else if (cur->bc_private.b.flist->xbf_low) { + args.type = XFS_ALLOCTYPE_START_BNO; + } else { + args.type = XFS_ALLOCTYPE_NEAR_BNO; + } + + args.minlen = args.maxlen = args.prod = 1; + args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL; + if (!args.wasdel && xfs_trans_get_block_res(args.tp) == 0) { + error = XFS_ERROR(ENOSPC); + goto error0; + } + error = xfs_alloc_vextent(&args); + if (error) + goto error0; + + if (args.fsbno == NULLFSBLOCK && args.minleft) { + /* + * Could not find an AG with enough free space to satisfy + * a full btree split. Try again without minleft and if + * successful activate the lowspace algorithm. + */ + args.fsbno = 0; + args.type = XFS_ALLOCTYPE_FIRST_AG; + args.minleft = 0; + error = xfs_alloc_vextent(&args); + if (error) + goto error0; + cur->bc_private.b.flist->xbf_low = 1; + } + if (args.fsbno == NULLFSBLOCK) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + ASSERT(args.len == 1); + cur->bc_private.b.firstblock = args.fsbno; + cur->bc_private.b.allocated++; + cur->bc_private.b.ip->i_d.di_nblocks++; + xfs_trans_log_inode(args.tp, cur->bc_private.b.ip, XFS_ILOG_CORE); + XFS_TRANS_MOD_DQUOT_BYINO(args.mp, args.tp, cur->bc_private.b.ip, + XFS_TRANS_DQ_BCOUNT, 1L); + + new->l = cpu_to_be64(args.fsbno); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + + error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + STATIC struct xfs_btree_block * xfs_bmbt_get_root_from_inode( struct xfs_btree_cur *cur) @@ -1975,6 +1885,7 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .alloc_block = xfs_bmbt_alloc_block, .init_key_from_rec = xfs_bmbt_init_key_from_rec, .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, .get_maxrecs = xfs_bmbt_get_maxrecs, -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:31:08 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_42, J_CHICKENPOX_43,J_CHICKENPOX_44,J_CHICKENPOX_45,J_CHICKENPOX_46, J_CHICKENPOX_47,J_CHICKENPOX_48,J_CHICKENPOX_62,J_CHICKENPOX_63, J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJUnen000700 for ; Tue, 29 Jul 2008 12:30:52 -0700 X-ASG-Debug-ID: 1217359918-3cb801e40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 50F9633F45E for ; Tue, 29 Jul 2008 12:31:59 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id zKoYe0byGbx72xPC for ; Tue, 29 Jul 2008 12:31:59 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJW0IF019435 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:32:00 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJW0r0019433 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:32:00 +0200 Date: Tue, 29 Jul 2008 21:32:00 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 21/21] clean up xfs_bmap_btree.c Subject: [PATCH 21/21] clean up xfs_bmap_btree.c Message-ID: <20080729193200.GV19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-bmap_btree-cleanup User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359921 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17261 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs From: Dave Chinner Reimplement xfs_bmbt_newroot and xfs_bmbt_kill_root using the new generic btree helpers and clean out all cruft needed for the old implementations. This requires exporting some functionality from xfs_btree.c that's only used locally otherwise. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-29 17:04:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-29 17:08:43.000000000 +0200 @@ -44,82 +44,6 @@ #include "xfs_error.h" #include "xfs_quota.h" -/* - * Prototypes for internal btree functions. - */ - - -STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); - -#undef EXIT - -#define ENTRY XBT_ENTRY -#define ERROR XBT_ERROR -#define EXIT XBT_EXIT - -/* - * Keep the XFS_BMBT_TRACE_ names around for now until all code using them - * is converted to be generic and thus switches to the XFS_BTREE_TRACE_ names. - */ -#define XFS_BMBT_TRACE_ARGBI(c,b,i) \ - XFS_BTREE_TRACE_ARGBI(c,b,i) -#define XFS_BMBT_TRACE_ARGBII(c,b,i,j) \ - XFS_BTREE_TRACE_ARGBII(c,b,i,j) -#define XFS_BMBT_TRACE_ARGFFFI(c,o,b,i,j) \ - XFS_BTREE_TRACE_ARGFFFI(c,o,b,i,j) -#define XFS_BMBT_TRACE_ARGI(c,i) \ - XFS_BTREE_TRACE_ARGI(c,i) -#define XFS_BMBT_TRACE_ARGIFK(c,i,f,s) \ - XFS_BTREE_TRACE_ARGIPK(c,i,(union xfs_btree_ptr)f,s) -#define XFS_BMBT_TRACE_ARGIFR(c,i,f,r) \ - XFS_BTREE_TRACE_ARGIPR(c,i, \ - (union xfs_btree_ptr)f, (union xfs_btree_rec *)r) -#define XFS_BMBT_TRACE_ARGIK(c,i,k) \ - XFS_BTREE_TRACE_ARGIK(c,i,(union xfs_btree_key *)k) -#define XFS_BMBT_TRACE_CURSOR(c,s) \ - XFS_BTREE_TRACE_CURSOR(c,s) - - -/* - * Internal functions. - */ - -/* - * Log pointer values from the btree block. - */ -STATIC void -xfs_bmbt_log_ptrs( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int pfirst, - int plast) -{ - xfs_trans_t *tp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBII(cur, bp, pfirst, plast); - tp = cur->bc_tp; - if (bp) { - xfs_bmbt_block_t *block; - int first; - int last; - xfs_bmbt_ptr_t *pp; - - block = XFS_BUF_TO_BMBT_BLOCK(bp); - pp = XFS_BMAP_PTR_DADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&pp[pfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&pp[plast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(tp, bp, first, last); - } else { - xfs_inode_t *ip; - - ip = cur->bc_private.b.ip; - xfs_trans_log_inode(tp, ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} /* * Determine the extent state. @@ -334,151 +258,6 @@ xfs_bmbt_disk_get_startoff( } /* - * Log fields from the btree block header. - */ -void -xfs_bmbt_log_block( - xfs_btree_cur_t *cur, - xfs_buf_t *bp, - int fields) -{ - int first; - int last; - xfs_trans_t *tp; - static const short offsets[] = { - offsetof(xfs_bmbt_block_t, bb_magic), - offsetof(xfs_bmbt_block_t, bb_level), - offsetof(xfs_bmbt_block_t, bb_numrecs), - offsetof(xfs_bmbt_block_t, bb_leftsib), - offsetof(xfs_bmbt_block_t, bb_rightsib), - sizeof(xfs_bmbt_block_t) - }; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGBI(cur, bp, fields); - tp = cur->bc_tp; - if (bp) { - xfs_btree_offsets(fields, offsets, XFS_BB_NUM_BITS, &first, - &last); - xfs_trans_log_buf(tp, bp, first, last); - } else - xfs_trans_log_inode(tp, cur->bc_private.b.ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); -} - -/* - * Give the bmap btree a new root block. Copy the old broot contents - * down into a real block and make the broot point to it. - */ -int /* error */ -xfs_bmbt_newroot( - xfs_btree_cur_t *cur, /* btree cursor */ - int *logflags, /* logging flags for inode */ - int *stat) /* return status - 0 fail */ -{ - xfs_alloc_arg_t args; /* allocation arguments */ - xfs_bmbt_block_t *block; /* bmap btree block */ - xfs_buf_t *bp; /* buffer for block */ - xfs_bmbt_block_t *cblock; /* child btree block */ - xfs_bmbt_key_t *ckp; /* child key pointer */ - xfs_bmbt_ptr_t *cpp; /* child ptr pointer */ - int error; /* error return code */ -#ifdef DEBUG - int i; /* loop counter */ -#endif - xfs_bmbt_key_t *kp; /* pointer to bmap btree key */ - int level; /* btree level */ - xfs_bmbt_ptr_t *pp; /* pointer to bmap block addr */ - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - level = cur->bc_nlevels - 1; - block = xfs_bmbt_get_block(cur, level, &bp); - /* - * Copy the root into a real block. - */ - args.mp = cur->bc_mp; - pp = XFS_BMAP_PTR_IADDR(block, 1, cur); - args.tp = cur->bc_tp; - args.fsbno = cur->bc_private.b.firstblock; - args.mod = args.minleft = args.alignment = args.total = args.isfl = - args.userdata = args.minalignslop = 0; - args.minlen = args.maxlen = args.prod = 1; - args.wasdel = cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL; - args.firstblock = args.fsbno; - if (args.fsbno == NULLFSBLOCK) { -#ifdef DEBUG - if ((error = xfs_btree_check_lptr_disk(cur, *pp, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - args.fsbno = be64_to_cpu(*pp); - args.type = XFS_ALLOCTYPE_START_BNO; - } else if (cur->bc_private.b.flist->xbf_low) - args.type = XFS_ALLOCTYPE_START_BNO; - else - args.type = XFS_ALLOCTYPE_NEAR_BNO; - if ((error = xfs_alloc_vextent(&args))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (args.fsbno == NULLFSBLOCK) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - ASSERT(args.len == 1); - cur->bc_private.b.firstblock = args.fsbno; - cur->bc_private.b.allocated++; - cur->bc_private.b.ip->i_d.di_nblocks++; - XFS_TRANS_MOD_DQUOT_BYINO(args.mp, args.tp, cur->bc_private.b.ip, - XFS_TRANS_DQ_BCOUNT, 1L); - bp = xfs_btree_get_bufl(args.mp, cur->bc_tp, args.fsbno, 0); - cblock = XFS_BUF_TO_BMBT_BLOCK(bp); - *cblock = *block; - be16_add(&block->bb_level, 1); - block->bb_numrecs = cpu_to_be16(1); - cur->bc_nlevels++; - cur->bc_ptrs[level + 1] = 1; - kp = XFS_BMAP_KEY_IADDR(block, 1, cur); - ckp = XFS_BMAP_KEY_IADDR(cblock, 1, cur); - memcpy(ckp, kp, be16_to_cpu(cblock->bb_numrecs) * sizeof(*kp)); - cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { - if ((error = xfs_btree_check_lptr_disk(cur, pp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memcpy(cpp, pp, be16_to_cpu(cblock->bb_numrecs) * sizeof(*pp)); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr(cur, args.fsbno, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - *pp = cpu_to_be64(args.fsbno); - xfs_iroot_realloc(cur->bc_private.b.ip, 1 - be16_to_cpu(cblock->bb_numrecs), - cur->bc_private.b.whichfork); - xfs_btree_setbuf(cur, level, bp); - /* - * Do all this logging at the end so that - * the root is at the right level. - */ - xfs_bmbt_log_block(cur, bp, XFS_BB_ALL_BITS); - xfs_bmbt_log_keys(cur, bp, 1, be16_to_cpu(cblock->bb_numrecs)); - xfs_bmbt_log_ptrs(cur, bp, 1, be16_to_cpu(cblock->bb_numrecs)); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *logflags |= - XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork); - *stat = 1; - return 0; -} - -/* * Set all the fields in a bmap extent record from the arguments. */ void @@ -875,114 +654,6 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } -STATIC int /* error */ -xfs_bmbt_new_root( - struct xfs_btree_cur *cur, /* btree cursor */ - int *stat) /* return status - 0 fail */ -{ - int logflags = 0; - int error; - - error = xfs_bmbt_newroot(cur, &logflags, stat); - if (error || *stat == 0) - return error; - - xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, logflags); - return 0; -} - -STATIC int -xfs_bmbt_kill_root( - struct xfs_btree_cur *cur, - int level, - union xfs_btree_ptr *newroot) -{ - struct xfs_inode *ip; - struct xfs_ifork *ifp; - struct xfs_btree_lblock *block; - struct xfs_btree_lblock *cblock; - struct xfs_buf *cbp; - xfs_bmbt_key_t *ckp; - xfs_bmbt_ptr_t *cpp; - xfs_bmbt_key_t *kp; - xfs_bmbt_ptr_t *pp; - int i; - int lev; - - ASSERT(newroot == NULL); - ASSERT(level == -1); - - XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); - lev = cur->bc_nlevels - 1; - ASSERT(lev >= 1); - /* - * Don't deal with the root block needs to be a leaf case. - * We're just going to turn the thing back into extents anyway. - */ - if (lev == 1) - goto out0; - - block = xfs_bmbt_get_block(cur, lev, &cbp); - - /* Give up if the root has multiple children. */ - if (be16_to_cpu(block->bb_numrecs) != 1) - goto out0; - /* - * Only do this if the next level will fit. - * Then the data must be copied up to the inode, - * instead of freeing the root you free the next level. - */ - cblock = xfs_bmbt_get_block(cur, lev - 1, &cbp); - if (be16_to_cpu(cblock->bb_numrecs) > XFS_BMAP_BLOCK_DMAXRECS(level, cur)) - goto out0; - XFS_BTREE_STATS_INC(cur, killroot); - - ASSERT(be64_to_cpu(cblock->bb_leftsib) == NULLDFSBNO); - ASSERT(be64_to_cpu(cblock->bb_rightsib) == NULLDFSBNO); - ip = cur->bc_private.b.ip; - ifp = XFS_IFORK_PTR(ip, cur->bc_private.b.whichfork); - ASSERT(XFS_BMAP_BLOCK_IMAXRECS(lev, cur) == - XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes)); - i = (int)(be16_to_cpu(cblock->bb_numrecs) - - XFS_BMAP_BLOCK_IMAXRECS(lev, cur)); - if (i) { - xfs_iroot_realloc(ip, i, cur->bc_private.b.whichfork); - block = (struct xfs_btree_lblock *)ifp->if_broot; - } - be16_add(&block->bb_numrecs, i); - ASSERT(block->bb_numrecs == cblock->bb_numrecs); - kp = XFS_BMAP_KEY_IADDR(block, 1, cur); - ckp = XFS_BMAP_KEY_IADDR(cblock, 1, cur); - memcpy(kp, ckp, be16_to_cpu(block->bb_numrecs) * sizeof(*kp)); - pp = XFS_BMAP_PTR_IADDR(block, 1, cur); - cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); - -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { - int error; - - error = xfs_btree_check_lptr_disk(cur, cpp[i], level - 1); - if (error) { - XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); - return error; - } - } -#endif - - memcpy(pp, cpp, be16_to_cpu(block->bb_numrecs) * sizeof(*pp)); - - xfs_bmbt_free_block(cur, cbp, 1); - XFS_BTREE_STATS_INC(cur, free); - cur->bc_bufs[lev - 1] = NULL; - be16_add(&block->bb_level, -1); - xfs_trans_log_inode(cur->bc_tp, ip, - XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - cur->bc_nlevels--; -out0: - XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); - return 0; -} - STATIC void xfs_bmbt_realloc_root( struct xfs_btree_cur *cur, @@ -1231,6 +902,217 @@ xfs_bmbt_log_recs( XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); } +/* + * Give the bmap btree a new root block. Copy the old broot contents + * down into a real block and make the broot point to it. + */ +int /* error */ +xfs_bmbt_newroot( + struct xfs_btree_cur *cur, /* btree cursor */ + int *logflags, /* logging flags for inode */ + int *stat) /* return status - 0 fail */ +{ + struct xfs_btree_block *block; /* bmap btree block */ + struct xfs_buf *bp; /* buffer for block */ + struct xfs_btree_block *cblock; /* child btree block */ + union xfs_btree_key *kp; /* pointer to bmap btree key */ + union xfs_btree_key *ckp; /* child key pointer */ + union xfs_btree_ptr *cpp; /* child ptr pointer */ + int error; /* error return code */ +#ifdef DEBUG + int i; /* loop counter */ +#endif + int level; /* btree level */ + union xfs_btree_ptr *pp; /* pointer to bmap block addr */ + union xfs_btree_ptr nptr; + int crecs; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, newroot); + + level = cur->bc_nlevels - 1; + block = xfs_btree_get_block(cur, level, &bp); + pp = xfs_bmbt_ptr_addr(cur, 1, block); + + error = xfs_bmbt_alloc_block(cur, pp, &nptr, 1, stat); + if (error) + goto error0; + + if (*stat == 0) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; + } + + XFS_BTREE_STATS_INC(cur, alloc); + + /* Copy the root into a real block. */ + error = xfs_btree_get_buf_block(cur, &nptr, 0, &cblock, &bp); + if (error) + goto error0; + + *cblock = *block; + be16_add(&block->bb_h.bb_level, 1); + xfs_btree_set_numrecs(block, 1); + cur->bc_nlevels++; + cur->bc_ptrs[level + 1] = 1; + kp = xfs_bmbt_key_addr(cur, 1, block); + ckp = xfs_bmbt_key_addr(cur, 1, cblock); + + crecs = xfs_btree_get_numrecs(cblock); + xfs_bmbt_copy_keys(cur, kp, ckp, crecs); + + cpp = xfs_bmbt_ptr_addr(cur, 1, cblock); + +#ifdef DEBUG + for (i = 0; i < crecs; i++) { + error = xfs_btree_check_ptr(cur, pp, i, level); + if (error) + goto error0; + } +#endif + + xfs_btree_copy_ptrs(cur, pp, cpp, crecs); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, &nptr, 0, level); + if (error) + goto error0; +#endif + + *pp = nptr; + xfs_bmbt_realloc_root(cur, 1 - crecs); + xfs_btree_setbuf(cur, level, bp); + + /* Log it at the end so that the root is at the right level. */ + xfs_btree_log_block(cur, bp, XFS_BB_ALL_BITS); + xfs_bmbt_log_keys(cur, bp, 1, crecs); + xfs_btree_log_ptrs(cur, bp, 1, crecs); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + + *logflags |= + XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork); + *stat = 1; + return 0; +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + +STATIC int /* error */ +xfs_bmbt_new_root( + struct xfs_btree_cur *cur, /* btree cursor */ + int *stat) /* return status - 0 fail */ +{ + int logflags = 0; + int error; + + error = xfs_bmbt_newroot(cur, &logflags, stat); + if (error || *stat == 0) + return error; + + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, logflags); + return 0; +} + +STATIC int +xfs_bmbt_kill_root( + struct xfs_btree_cur *cur, + int level, + union xfs_btree_ptr *newroot) +{ + struct xfs_inode *ip; + struct xfs_ifork *ifp; + struct xfs_btree_block *block; + struct xfs_btree_block *cblock; + struct xfs_buf *cbp; + union xfs_btree_key *ckp; + union xfs_btree_key *kp; + union xfs_btree_ptr *cpp; + union xfs_btree_ptr *pp; + int i; + int lev; + int nrecs; + int crecs; + + ASSERT(newroot == NULL); + ASSERT(level == -1); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + lev = cur->bc_nlevels - 1; + ASSERT(lev >= 1); + /* + * Don't deal with the root block needs to be a leaf case. + * We're just going to turn the thing back into extents anyway. + */ + if (lev == 1) + goto out0; + + block = xfs_btree_get_block(cur, lev, &cbp); + + /* Give up if the root has multiple children. */ + nrecs = xfs_btree_get_numrecs(block); + if (nrecs != 1) + goto out0; + /* + * Only do this if the next level will fit. + * Then the data must be copied up to the inode, + * instead of freeing the root you free the next level. + */ + cblock = xfs_btree_get_block(cur, lev - 1, &cbp); + crecs = xfs_btree_get_numrecs(cblock); + if (crecs > XFS_BMAP_BLOCK_DMAXRECS(level, cur)) + goto out0; + + XFS_BTREE_STATS_INC(cur, killroot); + + ip = cur->bc_private.b.ip; + ifp = XFS_IFORK_PTR(ip, cur->bc_private.b.whichfork); + ASSERT(XFS_BMAP_BLOCK_IMAXRECS(lev, cur) == + XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes)); + + i = crecs - XFS_BMAP_BLOCK_IMAXRECS(lev, cur); + if (i) { + xfs_iroot_realloc(ip, i, cur->bc_private.b.whichfork); + block = (struct xfs_btree_block *)ifp->if_broot; + } + + nrecs += i; + xfs_btree_set_numrecs(block, nrecs); + + ASSERT(nrecs == crecs); + kp = xfs_bmbt_key_addr(cur, 1, block); + ckp = xfs_bmbt_key_addr(cur, 1, cblock); + memcpy(kp, ckp, nrecs * sizeof(xfs_bmbt_key_t)); + pp = xfs_bmbt_ptr_addr(cur, 1, block); + cpp = xfs_bmbt_ptr_addr(cur, 1, cblock); + +#ifdef DEBUG + for (i = 0; i < crecs; i++) { + int error; + + error = xfs_btree_check_ptr(cur, cpp, i, level - 1); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + } +#endif + + memcpy(pp, cpp, nrecs * sizeof(xfs_bmbt_key_t)); + + xfs_bmbt_free_block(cur, cbp, 1); + XFS_BTREE_STATS_INC(cur, free); + cur->bc_bufs[lev - 1] = NULL; + be16_add(&block->bb_h.bb_level, -1); + xfs_trans_log_inode(cur->bc_tp, ip, + XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + cur->bc_nlevels--; +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} + #ifdef XFS_BTREE_TRACE ktrace_t *xfs_bmbt_trace_buf; Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-29 17:04:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-29 17:04:44.000000000 +0200 @@ -409,7 +409,7 @@ xfs_btree_dup_cursor( * Retrieve the block pointer from the cursor at the given level. * This may be a bmap btree root or from a buffer. */ -STATIC struct xfs_btree_block * /* generic btree block pointer */ +struct xfs_btree_block * /* generic btree block pointer */ xfs_btree_get_block( struct xfs_btree_cur *cur, /* btree cursor */ int level, /* level in btree */ @@ -987,7 +987,7 @@ xfs_btree_set_refs( } } -STATIC int +int xfs_btree_get_buf_block( struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr, @@ -1047,7 +1047,7 @@ xfs_btree_read_buf_block( return xfs_btree_check_block(cur, *block, level, *bpp); } -STATIC void +void xfs_btree_set_ptr( struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr_addr, @@ -1088,7 +1088,7 @@ xfs_btree_move_ptrs( } } -STATIC void +void xfs_btree_copy_ptrs( struct xfs_btree_cur *cur, union xfs_btree_ptr *src_ptr, @@ -1106,7 +1106,7 @@ xfs_btree_copy_ptrs( /* * Log block pointer fields from a btree block (nonleaf). */ -STATIC void +void xfs_btree_log_ptrs( struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_buf *bp, /* buffer containing btree block */ @@ -1153,7 +1153,7 @@ xfs_btree_log_ptrs( /* * Log fields from the short from btree block header. */ -STATIC void +void xfs_btree_log_block( struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_buf *bp, /* buffer containing btree block */ Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 17:04:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 17:04:44.000000000 +0200 @@ -612,6 +612,19 @@ int xfs_btree_delete(struct xfs_btree_cu /* + * Internal helpers also needed by xfs_bmap_btree.c. + */ +struct xfs_btree_block *xfs_btree_get_block(struct xfs_btree_cur *, int, + struct xfs_buf **); +int xfs_btree_get_buf_block(struct xfs_btree_cur *, union xfs_btree_ptr *, + int, struct xfs_btree_block **, struct xfs_buf **); +void xfs_btree_copy_ptrs(struct xfs_btree_cur *, union xfs_btree_ptr *, + union xfs_btree_ptr *, int); +void xfs_btree_log_ptrs(struct xfs_btree_cur *, struct xfs_buf *, int, int); +void xfs_btree_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); + + +/* * Helpers. */ Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-29 17:04:41.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-29 17:04:44.000000000 +0200 @@ -3563,7 +3563,7 @@ xfs_bmap_extents_to_btree( * Do all this logging at the end so that * the root is at the right level. */ - xfs_bmbt_log_block(cur, abp, XFS_BB_ALL_BITS); + xfs_btree_log_block(cur, abp, XFS_BB_ALL_BITS); xfs_bmbt_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs)); ASSERT(*curp == NULL); *curp = cur; -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:43 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:30:58 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_21, J_CHICKENPOX_23,J_CHICKENPOX_61,J_CHICKENPOX_65,MIME_8BIT_HEADER autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJUeE7000545 for ; Tue, 29 Jul 2008 12:30:40 -0700 X-ASG-Debug-ID: 1217359906-6cfa02720000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id CA233ECE252 for ; Tue, 29 Jul 2008 12:31:47 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id s5PH6tAKX7M5HFsa for ; Tue, 29 Jul 2008 12:31:47 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVmIF019408 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:48 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVmS6019406 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:48 +0200 Date: Tue, 29 Jul 2008 21:31:48 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 19/21] implement =?unknown-8bit?Q?g?= =?unknown-8bit?Q?eneric_xfs=5Fbtree=5Fin=D1=95ert=2Finsrec?= Subject: [PATCH 19/21] implement =?unknown-8bit?Q?g?= =?unknown-8bit?Q?eneric_xfs=5Fbtree=5Fin=D1=95ert=2Finsrec?= Message-ID: <20080729193148.GT19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-insert User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359911 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1221 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17260 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Make the btree insert code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-29 17:01:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-29 17:01:54.000000000 +0200 @@ -819,6 +819,17 @@ xfs_btree_ptr_is_null( return be32_to_cpu(ptr->s) == NULLAGBLOCK; } +STATIC void +xfs_btree_set_ptr_null( + struct xfs_btree_cur *cur, + union xfs_btree_ptr *ptr) +{ + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) + ptr->l = cpu_to_be64(NULLFSBLOCK); + else + ptr->s = cpu_to_be32(NULLAGBLOCK); +} + /* * Get/set/init sibling pointers */ @@ -2385,3 +2396,349 @@ out0: *stat = 0; return 0; } + +STATIC int +xfs_btree_make_block_unfull( + struct xfs_btree_cur *cur, /* btree cursor */ + int level, /* btree level */ + int numrecs,/* # of recs in block */ + int *oindex,/* old tree index */ + int *index, /* new tree index */ + union xfs_btree_ptr *nptr, /* new btree ptr */ + struct xfs_btree_cur **ncur, /* new btree cursor */ + union xfs_btree_rec *nrec, /* new record */ + int *stat) +{ + union xfs_btree_key key; /* new btree key value */ + int error = 0; + + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) { + if (numrecs < cur->bc_ops->get_dmaxrecs(cur, level)) { + /* A resizeable root block that can be made bigger. */ + cur->bc_ops->realloc_root(cur, 1); + return 0; + } + if (level == cur->bc_nlevels - 1) { + /* A root block that needs replacing */ + error = cur->bc_ops->new_root(cur, stat); + if (error || *stat == 0) + return error; + return 0; + } + } + + /* First, try shifting an entry to the right neighbor. */ + error = xfs_btree_rshift(cur, level, stat); + if (error || *stat) + return error; + + /* Next, try shifting an entry to the left neighbor. */ + error = xfs_btree_lshift(cur, level, stat); + if (error) + return error; + + if (*stat) { + *oindex = *index = cur->bc_ptrs[level]; + return 0; + } + + /* + * Next, try splitting the current block in half. + * + * If this works we have to re-set our variables because we + * could be in a different block now. + */ + error = xfs_btree_split(cur, level, nptr, &key, ncur, stat); + if (error || *stat == 0) + return error; + + + *index = cur->bc_ptrs[level]; + cur->bc_ops->init_rec_from_key(&key, nrec); + return 0; +} + +/* + * Insert one record/level. Return information to the caller + * allowing the next level up to proceed if necessary. + */ +STATIC int +xfs_btree_insrec( + struct xfs_btree_cur *cur, /* btree cursor */ + int level, /* level to insert record at */ + union xfs_btree_ptr *ptrp, /* i/o: block number inserted */ + union xfs_btree_rec *recp, /* i/o: record data inserted */ + struct xfs_btree_cur **curp, /* output: new cursor replacing cur */ + int *stat) /* success/failure */ +{ + struct xfs_btree_block *block; /* bmap btree block */ + struct xfs_buf *bp; /* buffer for block */ + union xfs_btree_key key; /* bmap btree key */ + union xfs_btree_ptr nptr; /* new block ptr */ + struct xfs_btree_cur *ncur; /* new btree cursor */ + union xfs_btree_rec nrec; /* new record count */ + int optr; /* old key/record index */ + int ptr; /* key/record index */ + int numrecs;/* number of records */ + int error; /* error return value */ +#ifdef DEBUG + int i; +#endif + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGIPR(cur, level, *ptrp, recp); + + ncur = NULL; + + /* + * If we have an external root pointer, and we've made it to the + * root level, allocate a new root block and we're done. + */ + if (!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) && + (level >= cur->bc_nlevels)) { + error = cur->bc_ops->new_root(cur, stat); + xfs_btree_set_ptr_null(cur, ptrp); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return error; + } + + /* Make a key out of the record data to be inserted, and save it. */ + cur->bc_ops->init_key_from_rec(cur, &key, recp); + + /* If we're off the left edge, return failure. */ + ptr = cur->bc_ptrs[level]; + if (ptr == 0) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + + optr = ptr; + + XFS_BTREE_STATS_INC(cur, insrec); + + /* Get pointers to the btree buffer and block. */ + block = xfs_btree_get_block(cur, level, &bp); + numrecs = xfs_btree_get_numrecs(block); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; + + /* Check that the new entry is being inserted in the right place. */ + if (ptr <= numrecs) { + if (level == 0) { + xfs_btree_check_rec(cur->bc_btnum, recp, + cur->bc_ops->rec_addr(cur, ptr, block)); + } else { + xfs_btree_check_key(cur->bc_btnum, &key, + cur->bc_ops->key_addr(cur, ptr, block)); + } + } +#endif + + /* + * If the block is full, we can't insert the new entry until we + * make the block un-full. + */ + xfs_btree_set_ptr_null(cur, &nptr); + if (numrecs == cur->bc_ops->get_maxrecs(cur, level)) { + error = xfs_btree_make_block_unfull(cur, level, numrecs, + &optr, &ptr, &nptr, &ncur, &nrec, stat); + if (error || *stat == 0) + goto error0; + } + + /* The current block may have changed during the split. */ + block = xfs_btree_get_block(cur, level, &bp); + numrecs = xfs_btree_get_numrecs(block); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + return error; +#endif + + /* + * At this point we know there's room for our new entry in the block + * we're pointing at. + */ + XFS_BTREE_STATS_ADD(cur, moves, numrecs - ptr + 1); + + if (level > 0) { + /* It's a nonleaf. make a hole in the keys and ptrs */ + union xfs_btree_key *kp; + union xfs_btree_ptr *pp; + + kp = cur->bc_ops->key_addr(cur, 1, block); + pp = cur->bc_ops->ptr_addr(cur, 1, block); + +#ifdef DEBUG + for (i = ptr; i < numrecs; i++) { + error = xfs_btree_check_ptr(cur, pp, i - 1, level); + if (error) + goto error0; + } +#endif + + cur->bc_ops->move_keys(cur, kp, ptr - 1, ptr, + numrecs - ptr + 1); + xfs_btree_move_ptrs(cur, pp, ptr - 1, ptr, + numrecs - ptr + 1); + +#ifdef DEBUG + error = xfs_btree_check_ptr(cur, ptrp, 0, level); + if (error) + goto error0; +#endif + + /* Now put the new data in, bump numrecs and log it. */ + cur->bc_ops->set_key(cur, kp, ptr - 1, &key); + xfs_btree_set_ptr(cur, pp, ptr - 1, ptrp); + numrecs++; + xfs_btree_set_numrecs(block, numrecs); + xfs_btree_log_ptrs(cur, bp, ptr, numrecs); + cur->bc_ops->log_keys(cur, bp, ptr, numrecs); +#ifdef DEBUG + if (ptr < numrecs) { + xfs_btree_check_key(cur->bc_btnum, + cur->bc_ops->key_addr(cur, ptr, block), + cur->bc_ops->key_addr(cur, ptr + 1, block)); + } +#endif + } else { + /* It's a leaf. make a hole in the records */ + union xfs_btree_rec *rp; + + rp = cur->bc_ops->rec_addr(cur, 1, block); + cur->bc_ops->move_recs(cur, rp, ptr - 1, ptr, + numrecs - ptr + 1); + + /* Now put the new data in, bump numrecs and log it. */ + cur->bc_ops->set_rec(cur, rp, ptr - 1, recp); + numrecs++; + xfs_btree_set_numrecs(block, numrecs); + cur->bc_ops->log_recs(cur, bp, ptr, numrecs); +#ifdef DEBUG + if (ptr < numrecs) { + xfs_btree_check_rec(cur->bc_btnum, + cur->bc_ops->rec_addr(cur, ptr, block), + cur->bc_ops->rec_addr(cur, ptr + 1, block)); + } +#endif + } + + /* Log the new number of records in the btree header. */ + xfs_btree_log_block(cur, bp, XFS_BB_NUMRECS); + + /* If we inserted at the start of a block, update the parents' keys. */ + if (optr == 1) { + error = xfs_btree_updkey(cur, &key, level + 1); + if (error) + goto error0; + } + + /* + * If we are tracking the last record in the tree and + * we are at the far right edge of the tree, update it. + */ + if (xfs_btree_is_lastrec(cur, block, level)) { + cur->bc_ops->update_lastrec(cur, block, recp, + ptr, LASTREC_INSREC); + } + + /* + * Return the new block number, if any. + * If there is one, give back a record value and a cursor too. + */ + *ptrp = nptr; + if (!xfs_btree_ptr_is_null(cur, &nptr)) { + *recp = nrec; + *curp = ncur; + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} + +/* + * Insert the record at the point referenced by cur. + * + * A multi-level split of the tree on insert will invalidate the original + * cursor. All callers of this function should assume that the cursor is + * no longer valid and revalidate it. + */ +int +xfs_btree_insert( + struct xfs_btree_cur *cur, + int *stat) +{ + int error; /* error return value */ + int i; /* result value, 0 for failure */ + int level; /* current level number in btree */ + union xfs_btree_ptr nptr; /* new block number (split result) */ + struct xfs_btree_cur *ncur; /* new cursor (split result) */ + struct xfs_btree_cur *pcur; /* previous level's cursor */ + union xfs_btree_rec rec; /* record to insert */ + + level = 0; + ncur = NULL; + pcur = cur; + + xfs_btree_set_ptr_null(cur, &nptr); + cur->bc_ops->init_rec_from_cur(cur, &rec); + + /* + * Loop going up the tree, starting at the leaf level. + * Stop when we don't get a split block, that must mean that + * the insert is finished with this level. + */ + do { + /* + * Insert nrec/nptr into this level of the tree. + * Note if we fail, nptr will be null. + */ + error = xfs_btree_insrec(pcur, level, &nptr, &rec, &ncur, &i); + if (error) { + if (pcur != cur) + xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR); + goto error0; + } + + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + level++; + + /* + * See if the cursor we just used is trash. + * Can't trash the caller's cursor, but otherwise we should + * if ncur is a new cursor or we're about to be done. + */ + if (pcur != cur && + (ncur || xfs_btree_ptr_is_null(cur, &nptr))) { + /* Save the state from the cursor before we trash it */ + if (cur->bc_ops->update_cursor) + cur->bc_ops->update_cursor(pcur, cur); + cur->bc_nlevels = pcur->bc_nlevels; + xfs_btree_del_cursor(pcur, XFS_BTREE_NOERROR); + } + /* If we got a new cursor, switch to it. */ + if (ncur) { + pcur = ncur; + ncur = NULL; + } + } while (!xfs_btree_ptr_is_null(cur, &nptr)); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = i; + return 0; +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-29 17:01:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-29 17:01:27.000000000 +0200 @@ -587,256 +587,6 @@ error0: } /* - * Insert one record/level. Return information to the caller - * allowing the next level up to proceed if necessary. - */ -STATIC int /* error */ -xfs_alloc_insrec( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to insert record at */ - xfs_agblock_t *bnop, /* i/o: block number inserted */ - xfs_alloc_rec_t *recp, /* i/o: record data inserted */ - xfs_btree_cur_t **curp, /* output: new cursor replacing cur */ - int *stat) /* output: success/failure */ -{ - xfs_agf_t *agf; /* allocation group freelist header */ - xfs_alloc_block_t *block; /* btree block record/key lives in */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop index */ - xfs_alloc_key_t key; /* key value being inserted */ - xfs_alloc_key_t *kp; /* pointer to btree keys */ - xfs_agblock_t nbno; /* block number of allocated block */ - xfs_btree_cur_t *ncur; /* new cursor to be used at next lvl */ - xfs_alloc_key_t nkey; /* new key value, from split */ - xfs_alloc_rec_t nrec; /* new record value, for caller */ - int numrecs; - int optr; /* old ptr value */ - xfs_alloc_ptr_t *pp; /* pointer to btree addresses */ - int ptr; /* index in btree block for this rec */ - xfs_alloc_rec_t *rp; /* pointer to btree records */ - - ASSERT(be32_to_cpu(recp->ar_blockcount) > 0); - - /* - * GCC doesn't understand the (arguably complex) control flow in - * this function and complains about uninitialized structure fields - * without this. - */ - memset(&nrec, 0, sizeof(nrec)); - - /* - * If we made it to the root level, allocate a new root block - * and we're done. - */ - if (level >= cur->bc_nlevels) { - XFS_STATS_INC(xs_abt_insrec); - if ((error = xfs_btree_new_root(cur, &i))) - return error; - *bnop = NULLAGBLOCK; - *stat = i; - return 0; - } - /* - * Make a key out of the record data to be inserted, and save it. - */ - key.ar_startblock = recp->ar_startblock; - key.ar_blockcount = recp->ar_blockcount; - optr = ptr = cur->bc_ptrs[level]; - /* - * If we're off the left edge, return failure. - */ - if (ptr == 0) { - *stat = 0; - return 0; - } - XFS_STATS_INC(xs_abt_insrec); - /* - * Get pointers to the btree buffer and block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - numrecs = be16_to_cpu(block->bb_numrecs); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; - /* - * Check that the new entry is being inserted in the right place. - */ - if (ptr <= numrecs) { - if (level == 0) { - rp = XFS_ALLOC_REC_ADDR(block, ptr, cur); - xfs_btree_check_rec(cur->bc_btnum, recp, rp); - } else { - kp = XFS_ALLOC_KEY_ADDR(block, ptr, cur); - xfs_btree_check_key(cur->bc_btnum, &key, kp); - } - } -#endif - nbno = NULLAGBLOCK; - ncur = NULL; - /* - * If the block is full, we can't insert the new entry until we - * make the block un-full. - */ - if (numrecs == XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - /* - * First, try shifting an entry to the right neighbor. - */ - if ((error = xfs_btree_rshift(cur, level, &i))) - return error; - if (i) { - /* nothing */ - } - /* - * Next, try shifting an entry to the left neighbor. - */ - else { - if ((error = xfs_btree_lshift(cur, level, &i))) - return error; - if (i) - optr = ptr = cur->bc_ptrs[level]; - else { - union xfs_btree_ptr bno = { .s = cpu_to_be32(nbno) }; - /* - * Next, try splitting the current block in - * half. If this works we have to re-set our - * variables because we could be in a - * different block now. - */ - if ((error = xfs_btree_split(cur, level, &bno, - (union xfs_btree_key *)&nkey, - &ncur, &i))) - return error; - nbno = be32_to_cpu(bno.s); - if (i) { - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = - xfs_btree_check_sblock(cur, - block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - nrec.ar_startblock = nkey.ar_startblock; - nrec.ar_blockcount = nkey.ar_blockcount; - } - /* - * Otherwise the insert fails. - */ - else { - *stat = 0; - return 0; - } - } - } - } - /* - * At this point we know there's room for our new entry in the block - * we're pointing at. - */ - numrecs = be16_to_cpu(block->bb_numrecs); - if (level > 0) { - /* - * It's a non-leaf entry. Make a hole for the new data - * in the key and ptr regions of the block. - */ - kp = XFS_ALLOC_KEY_ADDR(block, 1, cur); - pp = XFS_ALLOC_PTR_ADDR(block, 1, cur); -#ifdef DEBUG - for (i = numrecs; i >= ptr; i--) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(pp[i - 1]), level))) - return error; - } -#endif - memmove(&kp[ptr], &kp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*kp)); - memmove(&pp[ptr], &pp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*pp)); -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, *bnop, level))) - return error; -#endif - /* - * Now stuff the new data in, bump numrecs and log the new data. - */ - kp[ptr - 1] = key; - pp[ptr - 1] = cpu_to_be32(*bnop); - numrecs++; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_alloc_log_keys(cur, bp, ptr, numrecs); - xfs_alloc_log_ptrs(cur, bp, ptr, numrecs); -#ifdef DEBUG - if (ptr < numrecs) - xfs_btree_check_key(cur->bc_btnum, kp + ptr - 1, - kp + ptr); -#endif - } else { - /* - * It's a leaf entry. Make a hole for the new record. - */ - rp = XFS_ALLOC_REC_ADDR(block, 1, cur); - memmove(&rp[ptr], &rp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*rp)); - /* - * Now stuff the new record in, bump numrecs - * and log the new data. - */ - rp[ptr - 1] = *recp; - numrecs++; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_alloc_log_recs(cur, bp, ptr, numrecs); -#ifdef DEBUG - if (ptr < numrecs) - xfs_btree_check_rec(cur->bc_btnum, rp + ptr - 1, - rp + ptr); -#endif - } - /* - * Log the new number of records in the btree header. - */ - xfs_alloc_log_block(cur->bc_tp, bp, XFS_BB_NUMRECS); - /* - * If we inserted at the start of a block, update the parents' keys. - */ - if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) - return error; - /* - * Look to see if the longest extent in the allocation group - * needs to be updated. - */ - - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - if (level == 0 && - cur->bc_btnum == XFS_BTNUM_CNT && - be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK && - be32_to_cpu(recp->ar_blockcount) > be32_to_cpu(agf->agf_longest)) { - /* - * If this is a leaf in the by-size btree and there - * is no right sibling block and this block is bigger - * than the previous longest block, update it. - */ - agf->agf_longest = recp->ar_blockcount; - cur->bc_mp->m_perag[be32_to_cpu(agf->agf_seqno)].pagf_longest - = be32_to_cpu(recp->ar_blockcount); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_LONGEST); - } - /* - * Return the new block number, if any. - * If there is one, give back a record value and a cursor too. - */ - *bnop = nbno; - if (nbno != NULLAGBLOCK) { - *recp = nrec; - *curp = ncur; - } - *stat = 1; - return 0; -} - -/* * Log header fields from a btree block. */ STATIC void @@ -966,65 +716,6 @@ xfs_alloc_get_rec( return 0; } -/* - * Insert the current record at the point referenced by cur. - * The cursor may be inconsistent on return if splits have been done. - */ -int /* error */ -xfs_alloc_insert( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* result value, 0 for failure */ - int level; /* current level number in btree */ - xfs_agblock_t nbno; /* new block number (split result) */ - xfs_btree_cur_t *ncur; /* new cursor (split result) */ - xfs_alloc_rec_t nrec; /* record being inserted this level */ - xfs_btree_cur_t *pcur; /* previous level's cursor */ - - level = 0; - nbno = NULLAGBLOCK; - nrec.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock); - nrec.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount); - ncur = NULL; - pcur = cur; - /* - * Loop going up the tree, starting at the leaf level. - * Stop when we don't get a split block, that must mean that - * the insert is finished with this level. - */ - do { - /* - * Insert nrec/nbno into this level of the tree. - * Note if we fail, nbno will be null. - */ - if ((error = xfs_alloc_insrec(pcur, level++, &nbno, &nrec, &ncur, - &i))) { - if (pcur != cur) - xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR); - return error; - } - /* - * See if the cursor we just used is trash. - * Can't trash the caller's cursor, but otherwise we should - * if ncur is a new cursor or we're about to be done. - */ - if (pcur != cur && (ncur || nbno == NULLAGBLOCK)) { - cur->bc_nlevels = pcur->bc_nlevels; - xfs_btree_del_cursor(pcur, XFS_BTREE_NOERROR); - } - /* - * If we got a new cursor, switch to it. - */ - if (ncur) { - pcur = ncur; - ncur = NULL; - } - } while (nbno != NULLAGBLOCK); - *stat = i; - return 0; -} STATIC struct xfs_btree_cur * xfs_allocbt_dup_cursor( @@ -1117,6 +808,12 @@ xfs_allocbt_update_lastrec( return; len = rec->alloc.ar_blockcount; break; + case LASTREC_INSREC: + if (be32_to_cpu(rec->alloc.ar_blockcount) <= + be32_to_cpu(agf->agf_longest)) + return; + len = rec->alloc.ar_blockcount; + break; default: ASSERT(0); return; @@ -1160,6 +857,28 @@ xfs_allocbt_init_ptr_from_cur( ptr->s = agf->agf_roots[cur->bc_btnum]; } +STATIC void +xfs_allocbt_init_rec_from_key( + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + ASSERT(key->alloc.ar_startblock != 0); + + rec->alloc.ar_startblock = key->alloc.ar_startblock; + rec->alloc.ar_blockcount = key->alloc.ar_blockcount; +} + +STATIC void +xfs_allocbt_init_rec_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + ASSERT(cur->bc_rec.a.ar_startblock != 0); + + rec->alloc.ar_startblock = cpu_to_be32(cur->bc_rec.a.ar_startblock); + rec->alloc.ar_blockcount = cpu_to_be32(cur->bc_rec.a.ar_blockcount); +} + STATIC union xfs_btree_ptr * xfs_allocbt_ptr_addr( struct xfs_btree_cur *cur, @@ -1427,11 +1146,14 @@ xfs_allocbt_trace_record( static const struct xfs_btree_ops xfs_allocbt_ops = { .dup_cursor = xfs_allocbt_dup_cursor, .set_root = xfs_allocbt_set_root, + .new_root = xfs_btree_new_root, .alloc_block = xfs_allocbt_alloc_block, .update_lastrec = xfs_allocbt_update_lastrec, .get_maxrecs = xfs_allocbt_get_maxrecs, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, + .init_rec_from_key = xfs_allocbt_init_rec_from_key, + .init_rec_from_cur = xfs_allocbt_init_rec_from_cur, .ptr_addr = xfs_allocbt_ptr_addr, .key_addr = xfs_allocbt_key_addr, .rec_addr = xfs_allocbt_rec_addr, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-29 17:00:20.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-29 17:03:42.000000000 +0200 @@ -456,198 +456,6 @@ error0: return error; } -/* - * Insert one record/level. Return information to the caller - * allowing the next level up to proceed if necessary. - */ -STATIC int /* error */ -xfs_bmbt_insrec( - xfs_btree_cur_t *cur, - int level, - xfs_fsblock_t *bnop, - xfs_bmbt_rec_t *recp, - xfs_btree_cur_t **curp, - int *stat) /* no-go/done/continue */ -{ - xfs_bmbt_block_t *block; /* bmap btree block */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop index */ - xfs_bmbt_key_t key; /* bmap btree key */ - xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */ - int logflags; /* inode logging flags */ - xfs_fsblock_t nbno; /* new block number */ - struct xfs_btree_cur *ncur; /* new btree cursor */ - __uint64_t startoff; /* new btree key value */ - xfs_bmbt_rec_t nrec; /* new record count */ - int optr; /* old key/record index */ - xfs_bmbt_ptr_t *pp; /* pointer to bmap block addr */ - int ptr; /* key/record index */ - xfs_bmbt_rec_t *rp=NULL; /* pointer to bmap btree rec */ - int numrecs; - - ASSERT(level < cur->bc_nlevels); - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGIFR(cur, level, *bnop, recp); - ncur = NULL; - key.br_startoff = cpu_to_be64(xfs_bmbt_disk_get_startoff(recp)); - optr = ptr = cur->bc_ptrs[level]; - if (ptr == 0) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - XFS_STATS_INC(xs_bmbt_insrec); - block = xfs_bmbt_get_block(cur, level, &bp); - numrecs = be16_to_cpu(block->bb_numrecs); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (ptr <= numrecs) { - if (level == 0) { - rp = XFS_BMAP_REC_IADDR(block, ptr, cur); - xfs_btree_check_rec(XFS_BTNUM_BMAP, recp, rp); - } else { - kp = XFS_BMAP_KEY_IADDR(block, ptr, cur); - xfs_btree_check_key(XFS_BTNUM_BMAP, &key, kp); - } - } -#endif - nbno = NULLFSBLOCK; - if (numrecs == XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - if (numrecs < XFS_BMAP_BLOCK_DMAXRECS(level, cur)) { - /* - * A root block, that can be made bigger. - */ - xfs_iroot_realloc(cur->bc_private.b.ip, 1, - cur->bc_private.b.whichfork); - block = xfs_bmbt_get_block(cur, level, &bp); - } else if (level == cur->bc_nlevels - 1) { - if ((error = xfs_bmbt_newroot(cur, &logflags, stat)) || - *stat == 0) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, - logflags); - block = xfs_bmbt_get_block(cur, level, &bp); - } else { - if ((error = xfs_btree_rshift(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (i) { - /* nothing */ - } else { - if ((error = xfs_btree_lshift(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - if (i) { - optr = ptr = cur->bc_ptrs[level]; - } else { - union xfs_btree_ptr bno = { .l = cpu_to_be64(nbno) }; - union xfs_btree_key skey; - if ((error = xfs_btree_split(cur, level, - &bno, &skey, &ncur, - &i))) { - XFS_BMBT_TRACE_CURSOR(cur, - ERROR); - return error; - } - nbno = be64_to_cpu(bno.l); - startoff = be64_to_cpu(skey.bmbt.br_startoff); - if (i) { - block = xfs_bmbt_get_block( - cur, level, &bp); -#ifdef DEBUG - if ((error = - xfs_btree_check_lblock(cur, - block, level, bp))) { - XFS_BMBT_TRACE_CURSOR( - cur, ERROR); - return error; - } -#endif - ptr = cur->bc_ptrs[level]; - xfs_bmbt_disk_set_allf(&nrec, - startoff, 0, 0, - XFS_EXT_NORM); - } else { - XFS_BMBT_TRACE_CURSOR(cur, - EXIT); - *stat = 0; - return 0; - } - } - } - } - } - numrecs = be16_to_cpu(block->bb_numrecs); - if (level > 0) { - kp = XFS_BMAP_KEY_IADDR(block, 1, cur); - pp = XFS_BMAP_PTR_IADDR(block, 1, cur); -#ifdef DEBUG - for (i = numrecs; i >= ptr; i--) { - if ((error = xfs_btree_check_lptr_disk(cur, pp[i - 1], - level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memmove(&kp[ptr], &kp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*kp)); - memmove(&pp[ptr], &pp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*pp)); -#ifdef DEBUG - if ((error = xfs_btree_check_lptr(cur, *bnop, level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } -#endif - kp[ptr - 1] = key; - pp[ptr - 1] = cpu_to_be64(*bnop); - numrecs++; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_bmbt_log_keys(cur, bp, ptr, numrecs); - xfs_bmbt_log_ptrs(cur, bp, ptr, numrecs); - } else { - rp = XFS_BMAP_REC_IADDR(block, 1, cur); - memmove(&rp[ptr], &rp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*rp)); - rp[ptr - 1] = *recp; - numrecs++; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_bmbt_log_recs(cur, bp, ptr, numrecs); - } - xfs_bmbt_log_block(cur, bp, XFS_BB_NUMRECS); -#ifdef DEBUG - if (ptr < numrecs) { - if (level == 0) - xfs_btree_check_rec(XFS_BTNUM_BMAP, rp + ptr - 1, - rp + ptr); - else - xfs_btree_check_key(XFS_BTNUM_BMAP, kp + ptr - 1, - kp + ptr); - } -#endif - if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - *bnop = nbno; - if (nbno != NULLFSBLOCK) { - *recp = nrec; - *curp = ncur; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; -} - STATIC int xfs_bmbt_killroot( xfs_btree_cur_t *cur) @@ -1024,67 +832,6 @@ xfs_bmbt_disk_get_startoff( } /* - * Insert the current record at the point referenced by cur. - * - * A multi-level split of the tree on insert will invalidate the original - * cursor. All callers of this function should assume that the cursor is - * no longer valid and revalidate it. - */ -int /* error */ -xfs_bmbt_insert( - xfs_btree_cur_t *cur, - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; - int level; - xfs_fsblock_t nbno; - xfs_btree_cur_t *ncur; - xfs_bmbt_rec_t nrec; - xfs_btree_cur_t *pcur; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - level = 0; - nbno = NULLFSBLOCK; - xfs_bmbt_disk_set_all(&nrec, &cur->bc_rec.b); - ncur = NULL; - pcur = cur; - do { - if ((error = xfs_bmbt_insrec(pcur, level++, &nbno, &nrec, &ncur, - &i))) { - if (pcur != cur) - xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR); - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if (pcur != cur && (ncur || nbno == NULLFSBLOCK)) { - cur->bc_nlevels = pcur->bc_nlevels; - cur->bc_private.b.allocated += - pcur->bc_private.b.allocated; - pcur->bc_private.b.allocated = 0; - ASSERT((cur->bc_private.b.firstblock != NULLFSBLOCK) || - XFS_IS_REALTIME_INODE(cur->bc_private.b.ip)); - cur->bc_private.b.firstblock = - pcur->bc_private.b.firstblock; - ASSERT(cur->bc_private.b.flist == - pcur->bc_private.b.flist); - xfs_btree_del_cursor(pcur, XFS_BTREE_NOERROR); - } - if (ncur) { - pcur = ncur; - ncur = NULL; - } - } while (nbno != NULLFSBLOCK); - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = i; - return 0; -error0: - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; -} - -/* * Log fields from the btree block header. */ void @@ -1497,6 +1244,21 @@ xfs_bmbt_dup_cursor( return new; } +STATIC void +xfs_bmbt_update_cursor( + struct xfs_btree_cur *src, + struct xfs_btree_cur *dst) +{ + ASSERT((dst->bc_private.b.firstblock != NULLFSBLOCK) || + (dst->bc_private.b.ip->i_d.di_flags & XFS_DIFLAG_REALTIME)); + ASSERT(dst->bc_private.b.flist == src->bc_private.b.flist); + + dst->bc_private.b.allocated += src->bc_private.b.allocated; + dst->bc_private.b.firstblock = src->bc_private.b.firstblock; + + src->bc_private.b.allocated = 0; +} + STATIC int xfs_bmbt_alloc_block( struct xfs_btree_cur *cur, @@ -1593,6 +1355,31 @@ xfs_bmbt_get_root_from_inode( return (struct xfs_btree_block *)ifp->if_broot; } +STATIC int /* error */ +xfs_bmbt_new_root( + struct xfs_btree_cur *cur, /* btree cursor */ + int *stat) /* return status - 0 fail */ +{ + int logflags = 0; + int error; + + error = xfs_bmbt_newroot(cur, &logflags, stat); + if (error || *stat == 0) + return error; + + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, logflags); + return 0; +} + +STATIC void +xfs_bmbt_realloc_root( + struct xfs_btree_cur *cur, + int index) +{ + xfs_iroot_realloc(cur->bc_private.b.ip, index, + cur->bc_private.b.whichfork); +} + STATIC int xfs_bmbt_get_maxrecs( struct xfs_btree_cur *cur, @@ -1601,6 +1388,14 @@ xfs_bmbt_get_maxrecs( return XFS_BMAP_BLOCK_IMAXRECS(level, cur); } +STATIC int +xfs_bmbt_get_dmaxrecs( + struct xfs_btree_cur *cur, + int level) +{ + return XFS_BMAP_BLOCK_DMAXRECS(level, cur); +} + STATIC void xfs_bmbt_init_key_from_rec( struct xfs_btree_cur *cur, @@ -1619,6 +1414,25 @@ xfs_bmbt_init_ptr_from_cur( ptr->l = 0; } +STATIC void +xfs_bmbt_init_rec_from_key( + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + ASSERT(key->bmbt.br_startoff != 0); + + xfs_bmbt_disk_set_allf(&rec->bmbt, be64_to_cpu(key->bmbt.br_startoff), + 0, 0, XFS_EXT_NORM); +} + +STATIC void +xfs_bmbt_init_rec_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + xfs_bmbt_disk_set_all(&rec->bmbt, &cur->bc_rec.b); +} + STATIC union xfs_btree_ptr * xfs_bmbt_ptr_addr( struct xfs_btree_cur *cur, @@ -1885,11 +1699,17 @@ xfs_bmbt_trace_record( static const struct xfs_btree_ops xfs_bmbt_ops = { .dup_cursor = xfs_bmbt_dup_cursor, + .update_cursor = xfs_bmbt_update_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, + .new_root = xfs_bmbt_new_root, + .realloc_root = xfs_bmbt_realloc_root, .alloc_block = xfs_bmbt_alloc_block, .init_key_from_rec = xfs_bmbt_init_key_from_rec, .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, + .init_rec_from_key = xfs_bmbt_init_rec_from_key, + .init_rec_from_cur = xfs_bmbt_init_rec_from_cur, .get_maxrecs = xfs_bmbt_get_maxrecs, + .get_dmaxrecs = xfs_bmbt_get_dmaxrecs, .ptr_addr = xfs_bmbt_ptr_addr, .key_addr = xfs_bmbt_key_addr, .rec_addr = xfs_bmbt_rec_addr, Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 17:01:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 17:01:27.000000000 +0200 @@ -187,6 +187,8 @@ do { \ struct xfs_btree_ops { /* cursor operations */ struct xfs_btree_cur *(*dup_cursor)(struct xfs_btree_cur *); + void (*update_cursor)(struct xfs_btree_cur *src, + struct xfs_btree_cur *dst); /* get inode rooted btree root */ struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); @@ -194,6 +196,9 @@ struct xfs_btree_ops { /* btree root operations */ void (*set_root)(struct xfs_btree_cur *cur, union xfs_btree_ptr *nptr, int level_change); + int (*new_root)(struct xfs_btree_cur *cur, int *stat); + + void (*realloc_root)(struct xfs_btree_cur *cur, int index); /* block allocation / freeing */ int (*alloc_block)(struct xfs_btree_cur *cur, @@ -216,6 +221,7 @@ struct xfs_btree_ops { /* records in block/level */ int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); + int (*get_dmaxrecs)(struct xfs_btree_cur *cur, int level); /* init values of btree structures */ void (*init_key_from_rec)(struct xfs_btree_cur *cur, @@ -223,6 +229,10 @@ struct xfs_btree_ops { union xfs_btree_rec *rec); void (*init_ptr_from_cur)(struct xfs_btree_cur *cur, union xfs_btree_ptr *ptr); + void (*init_rec_from_key)(union xfs_btree_key *key, + union xfs_btree_rec *rec); + void (*init_rec_from_cur)(struct xfs_btree_cur *cur, + union xfs_btree_rec *rec); /* difference between key value and cursor value */ __int64_t (*key_diff)(struct xfs_btree_cur *cur, @@ -282,6 +292,7 @@ struct xfs_btree_ops { * Reasons for the update_lastrec method to be called. */ #define LASTREC_UPDATE 0 +#define LASTREC_INSREC 1 /* @@ -590,6 +601,7 @@ int xfs_btree_rshift(struct xfs_btree_cu int xfs_btree_split(struct xfs_btree_cur *, int, union xfs_btree_ptr *, union xfs_btree_key *, struct xfs_btree_cur **, int *); int xfs_btree_new_root(struct xfs_btree_cur *, int *); +int xfs_btree_insert(struct xfs_btree_cur *, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-29 17:01:15.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-29 17:01:27.000000000 +0200 @@ -515,228 +515,6 @@ error0: } /* - * Insert one record/level. Return information to the caller - * allowing the next level up to proceed if necessary. - */ -STATIC int /* error */ -xfs_inobt_insrec( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level to insert record at */ - xfs_agblock_t *bnop, /* i/o: block number inserted */ - xfs_inobt_rec_t *recp, /* i/o: record data inserted */ - xfs_btree_cur_t **curp, /* output: new cursor replacing cur */ - int *stat) /* success/failure */ -{ - xfs_inobt_block_t *block; /* btree block record/key lives in */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop index */ - xfs_inobt_key_t key; /* key value being inserted */ - xfs_inobt_key_t *kp=NULL; /* pointer to btree keys */ - xfs_agblock_t nbno; /* block number of allocated block */ - xfs_btree_cur_t *ncur; /* new cursor to be used at next lvl */ - xfs_inobt_key_t nkey; /* new key value, from split */ - xfs_inobt_rec_t nrec; /* new record value, for caller */ - int numrecs; - int optr; /* old ptr value */ - xfs_inobt_ptr_t *pp; /* pointer to btree addresses */ - int ptr; /* index in btree block for this rec */ - xfs_inobt_rec_t *rp=NULL; /* pointer to btree records */ - - /* - * GCC doesn't understand the (arguably complex) control flow in - * this function and complains about uninitialized structure fields - * without this. - */ - memset(&nrec, 0, sizeof(nrec)); - - /* - * If we made it to the root level, allocate a new root block - * and we're done. - */ - if (level >= cur->bc_nlevels) { - error = xfs_btree_new_root(cur, &i); - *bnop = NULLAGBLOCK; - *stat = i; - return error; - } - /* - * Make a key out of the record data to be inserted, and save it. - */ - key.ir_startino = recp->ir_startino; - optr = ptr = cur->bc_ptrs[level]; - /* - * If we're off the left edge, return failure. - */ - if (ptr == 0) { - *stat = 0; - return 0; - } - /* - * Get pointers to the btree buffer and block. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); - numrecs = be16_to_cpu(block->bb_numrecs); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; - /* - * Check that the new entry is being inserted in the right place. - */ - if (ptr <= numrecs) { - if (level == 0) { - rp = XFS_INOBT_REC_ADDR(block, ptr, cur); - xfs_btree_check_rec(cur->bc_btnum, recp, rp); - } else { - kp = XFS_INOBT_KEY_ADDR(block, ptr, cur); - xfs_btree_check_key(cur->bc_btnum, &key, kp); - } - } -#endif - nbno = NULLAGBLOCK; - ncur = NULL; - /* - * If the block is full, we can't insert the new entry until we - * make the block un-full. - */ - if (numrecs == XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - /* - * First, try shifting an entry to the right neighbor. - */ - if ((error = xfs_btree_rshift(cur, level, &i))) - return error; - if (i) { - /* nothing */ - } - /* - * Next, try shifting an entry to the left neighbor. - */ - else { - if ((error = xfs_btree_lshift(cur, level, &i))) - return error; - if (i) { - optr = ptr = cur->bc_ptrs[level]; - } else { - union xfs_btree_ptr bno = { .s = cpu_to_be32(nbno) }; - /* - * Next, try splitting the current block - * in half. If this works we have to - * re-set our variables because - * we could be in a different block now. - */ - if ((error = xfs_btree_split(cur, level, &bno, - (union xfs_btree_key *)&nkey, - &ncur, &i))) - return error; - nbno = be32_to_cpu(bno.s); - if (i) { - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, - block, level, bp))) - return error; -#endif - ptr = cur->bc_ptrs[level]; - nrec.ir_startino = nkey.ir_startino; - } else { - /* - * Otherwise the insert fails. - */ - *stat = 0; - return 0; - } - } - } - } - /* - * At this point we know there's room for our new entry in the block - * we're pointing at. - */ - numrecs = be16_to_cpu(block->bb_numrecs); - if (level > 0) { - /* - * It's a non-leaf entry. Make a hole for the new data - * in the key and ptr regions of the block. - */ - kp = XFS_INOBT_KEY_ADDR(block, 1, cur); - pp = XFS_INOBT_PTR_ADDR(block, 1, cur); -#ifdef DEBUG - for (i = numrecs; i >= ptr; i--) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(pp[i - 1]), level))) - return error; - } -#endif - memmove(&kp[ptr], &kp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*kp)); - memmove(&pp[ptr], &pp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*pp)); - /* - * Now stuff the new data in, bump numrecs and log the new data. - */ -#ifdef DEBUG - if ((error = xfs_btree_check_sptr(cur, *bnop, level))) - return error; -#endif - kp[ptr - 1] = key; - pp[ptr - 1] = cpu_to_be32(*bnop); - numrecs++; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_inobt_log_keys(cur, bp, ptr, numrecs); - xfs_inobt_log_ptrs(cur, bp, ptr, numrecs); - } else { - /* - * It's a leaf entry. Make a hole for the new record. - */ - rp = XFS_INOBT_REC_ADDR(block, 1, cur); - memmove(&rp[ptr], &rp[ptr - 1], - (numrecs - ptr + 1) * sizeof(*rp)); - /* - * Now stuff the new record in, bump numrecs - * and log the new data. - */ - rp[ptr - 1] = *recp; - numrecs++; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_inobt_log_recs(cur, bp, ptr, numrecs); - } - /* - * Log the new number of records in the btree header. - */ - xfs_inobt_log_block(cur->bc_tp, bp, XFS_BB_NUMRECS); -#ifdef DEBUG - /* - * Check that the key/record is in the right place, now. - */ - if (ptr < numrecs) { - if (level == 0) - xfs_btree_check_rec(cur->bc_btnum, rp + ptr - 1, - rp + ptr); - else - xfs_btree_check_key(cur->bc_btnum, kp + ptr - 1, - kp + ptr); - } -#endif - /* - * If we inserted at the start of a block, update the parents' keys. - */ - if (optr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)&key, level + 1))) - return error; - /* - * Return the new block number, if any. - * If there is one, give back a record value and a cursor too. - */ - *bnop = nbno; - if (nbno != NULLAGBLOCK) { - *recp = nrec; - *curp = ncur; - } - *stat = 1; - return 0; -} - -/* * Log header fields from a btree block. */ STATIC void @@ -868,66 +646,6 @@ xfs_inobt_get_rec( return 0; } -/* - * Insert the current record at the point referenced by cur. - * The cursor may be inconsistent on return if splits have been done. - */ -int /* error */ -xfs_inobt_insert( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* result value, 0 for failure */ - int level; /* current level number in btree */ - xfs_agblock_t nbno; /* new block number (split result) */ - xfs_btree_cur_t *ncur; /* new cursor (split result) */ - xfs_inobt_rec_t nrec; /* record being inserted this level */ - xfs_btree_cur_t *pcur; /* previous level's cursor */ - - level = 0; - nbno = NULLAGBLOCK; - nrec.ir_startino = cpu_to_be32(cur->bc_rec.i.ir_startino); - nrec.ir_freecount = cpu_to_be32(cur->bc_rec.i.ir_freecount); - nrec.ir_free = cpu_to_be64(cur->bc_rec.i.ir_free); - ncur = NULL; - pcur = cur; - /* - * Loop going up the tree, starting at the leaf level. - * Stop when we don't get a split block, that must mean that - * the insert is finished with this level. - */ - do { - /* - * Insert nrec/nbno into this level of the tree. - * Note if we fail, nbno will be null. - */ - if ((error = xfs_inobt_insrec(pcur, level++, &nbno, &nrec, &ncur, - &i))) { - if (pcur != cur) - xfs_btree_del_cursor(pcur, XFS_BTREE_ERROR); - return error; - } - /* - * See if the cursor we just used is trash. - * Can't trash the caller's cursor, but otherwise we should - * if ncur is a new cursor or we're about to be done. - */ - if (pcur != cur && (ncur || nbno == NULLAGBLOCK)) { - cur->bc_nlevels = pcur->bc_nlevels; - xfs_btree_del_cursor(pcur, XFS_BTREE_NOERROR); - } - /* - * If we got a new cursor, switch to it. - */ - if (ncur) { - pcur = ncur; - ncur = NULL; - } - } while (nbno != NULLAGBLOCK); - *stat = i; - return 0; -} STATIC struct xfs_btree_cur * xfs_inobt_dup_cursor( @@ -1025,6 +743,24 @@ xfs_inobt_init_ptr_from_cur( ptr->s = agi->agi_root; } +STATIC void +xfs_inobt_init_rec_from_key( + union xfs_btree_key *key, + union xfs_btree_rec *rec) +{ + rec->inobt.ir_startino = key->inobt.ir_startino; +} + +STATIC void +xfs_inobt_init_rec_from_cur( + struct xfs_btree_cur *cur, + union xfs_btree_rec *rec) +{ + rec->inobt.ir_startino = cpu_to_be32(cur->bc_rec.i.ir_startino); + rec->inobt.ir_freecount = cpu_to_be32(cur->bc_rec.i.ir_freecount); + rec->inobt.ir_free = cpu_to_be64(cur->bc_rec.i.ir_free); +} + STATIC union xfs_btree_ptr * xfs_inobt_ptr_addr( struct xfs_btree_cur *cur, @@ -1269,10 +1005,13 @@ xfs_inobt_trace_record( static const struct xfs_btree_ops xfs_inobt_ops = { .dup_cursor = xfs_inobt_dup_cursor, .set_root = xfs_inobt_set_root, + .new_root = xfs_btree_new_root, .alloc_block = xfs_inobt_alloc_block, .get_maxrecs = xfs_inobt_get_maxrecs, .init_key_from_rec = xfs_inobt_init_key_from_rec, .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, + .init_rec_from_key = xfs_inobt_init_rec_from_key, + .init_rec_from_cur = xfs_inobt_init_rec_from_cur, .ptr_addr = xfs_inobt_ptr_addr, .key_addr = xfs_inobt_key_addr, .rec_addr = xfs_inobt_rec_addr, Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-29 17:00:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-29 17:01:27.000000000 +0200 @@ -408,7 +408,7 @@ xfs_alloc_fixup_trees( if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno1, nflen1, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 0); - if ((error = xfs_alloc_insert(cnt_cur, &i))) + if ((error = xfs_btree_insert(cnt_cur, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); } @@ -416,7 +416,7 @@ xfs_alloc_fixup_trees( if ((error = xfs_alloc_lookup_eq(cnt_cur, nfbno2, nflen2, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 0); - if ((error = xfs_alloc_insert(cnt_cur, &i))) + if ((error = xfs_btree_insert(cnt_cur, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); } @@ -444,7 +444,7 @@ xfs_alloc_fixup_trees( if ((error = xfs_alloc_lookup_eq(bno_cur, nfbno2, nflen2, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 0); - if ((error = xfs_alloc_insert(bno_cur, &i))) + if ((error = xfs_btree_insert(bno_cur, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); } @@ -1756,7 +1756,7 @@ xfs_free_ag_extent( else { nbno = bno; nlen = len; - if ((error = xfs_alloc_insert(bno_cur, &i))) + if ((error = xfs_btree_insert(bno_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); } @@ -1768,7 +1768,7 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, nbno, nlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 0, error0); - if ((error = xfs_alloc_insert(cnt_cur, &i))) + if ((error = xfs_btree_insert(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-29 17:00:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-29 17:01:27.000000000 +0200 @@ -107,12 +107,6 @@ extern int xfs_alloc_delete(struct xfs_b extern int xfs_alloc_get_rec(struct xfs_btree_cur *cur, xfs_agblock_t *bno, xfs_extlen_t *len, int *stat); -/* - * Insert the current record at the point referenced by cur. - * The cursor may be inconsistent on return if splits have been done. - */ -extern int xfs_alloc_insert(struct xfs_btree_cur *cur, int *stat); - extern struct xfs_btree_cur *xfs_allocbt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-29 17:00:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-29 17:01:27.000000000 +0200 @@ -977,7 +977,7 @@ xfs_bmap_add_extent_delay_real( goto done; XFS_WANT_CORRUPTED_GOTO(i == 0, done); cur->bc_rec.b.br_state = XFS_EXT_NORM; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -1053,7 +1053,7 @@ xfs_bmap_add_extent_delay_real( goto done; XFS_WANT_CORRUPTED_GOTO(i == 0, done); cur->bc_rec.b.br_state = XFS_EXT_NORM; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -1143,7 +1143,7 @@ xfs_bmap_add_extent_delay_real( goto done; XFS_WANT_CORRUPTED_GOTO(i == 0, done); cur->bc_rec.b.br_state = XFS_EXT_NORM; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -1198,7 +1198,7 @@ xfs_bmap_add_extent_delay_real( goto done; XFS_WANT_CORRUPTED_GOTO(i == 0, done); cur->bc_rec.b.br_state = XFS_EXT_NORM; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -1651,7 +1651,7 @@ xfs_bmap_add_extent_unwritten_real( oldext))) goto done; cur->bc_rec.b = *new; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -1741,7 +1741,7 @@ xfs_bmap_add_extent_unwritten_real( goto done; XFS_WANT_CORRUPTED_GOTO(i == 0, done); cur->bc_rec.b.br_state = XFS_EXT_NORM; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -1789,7 +1789,7 @@ xfs_bmap_add_extent_unwritten_real( cur->bc_rec.b = PREV; cur->bc_rec.b.br_blockcount = new->br_startoff - PREV.br_startoff; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); /* @@ -1804,7 +1804,7 @@ xfs_bmap_add_extent_unwritten_real( XFS_WANT_CORRUPTED_GOTO(i == 0, done); /* new middle extent - newext */ cur->bc_rec.b.br_state = new->br_state; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -2264,7 +2264,7 @@ xfs_bmap_add_extent_hole_real( goto done; XFS_WANT_CORRUPTED_GOTO(i == 0, done); cur->bc_rec.b.br_state = new->br_state; - if ((error = xfs_bmbt_insert(cur, &i))) + if ((error = xfs_btree_insert(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); } @@ -3303,7 +3303,7 @@ xfs_bmap_del_extent( if ((error = xfs_btree_increment(cur, 0, &i))) goto done; cur->bc_rec.b = new; - error = xfs_bmbt_insert(cur, &i); + error = xfs_btree_insert(cur, &i); if (error && error != ENOSPC) goto done; /* Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-29 17:00:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-29 17:01:27.000000000 +0200 @@ -250,7 +250,6 @@ extern void xfs_bmbt_disk_get_all(xfs_bm extern xfs_filblks_t xfs_bmbt_disk_get_blockcount(xfs_bmbt_rec_t *r); extern xfs_fileoff_t xfs_bmbt_disk_get_startoff(xfs_bmbt_rec_t *r); -extern int xfs_bmbt_insert(struct xfs_btree_cur *, int *); extern void xfs_bmbt_log_block(struct xfs_btree_cur *, struct xfs_buf *, int); extern void xfs_bmbt_log_recs(struct xfs_btree_cur *, struct xfs_buf *, int, int); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-29 17:00:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-29 17:01:27.000000000 +0200 @@ -418,7 +418,7 @@ xfs_ialloc_ag_alloc( return error; } ASSERT(i == 0); - if ((error = xfs_inobt_insert(cur, &i))) { + if ((error = xfs_btree_insert(cur, &i))) { xfs_btree_del_cursor(cur, XFS_BTREE_ERROR); return error; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-29 17:00:17.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-29 17:01:27.000000000 +0200 @@ -129,12 +129,6 @@ extern int xfs_inobt_delete(struct xfs_b extern int xfs_inobt_get_rec(struct xfs_btree_cur *cur, xfs_agino_t *ino, __int32_t *fcnt, xfs_inofree_t *free, int *stat); -/* - * Insert the current record at the point referenced by cur. - * The cursor may be inconsistent on return if splits have been done. - */ -extern int xfs_inobt_insert(struct xfs_btree_cur *cur, int *stat); - extern struct xfs_btree_cur *xfs_inobt_init_cursor(struct xfs_mount *, struct xfs_trans *, struct xfs_buf *, xfs_agnumber_t); -- From owner-xfs@oss.sgi.com Tue Jul 29 12:30:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 12:31:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_63,J_CHICKENPOX_64,J_CHICKENPOX_65,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6TJUjad000656 for ; Tue, 29 Jul 2008 12:30:48 -0700 X-ASG-Debug-ID: 1217359913-0c32031b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from verein.lst.de (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 082C61947DCD for ; Tue, 29 Jul 2008 12:31:53 -0700 (PDT) Received: from verein.lst.de (verein.lst.de [213.95.11.210]) by cuda.sgi.com with ESMTP id ScS0J03hB4WF7bIa for ; Tue, 29 Jul 2008 12:31:53 -0700 (PDT) Received: from verein.lst.de (localhost [127.0.0.1]) by verein.lst.de (8.12.3/8.12.3/Debian-7.1) with ESMTP id m6TJVrIF019420 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Tue, 29 Jul 2008 21:31:53 +0200 Received: (from hch@localhost) by verein.lst.de (8.12.3/8.12.3/Debian-6.6) id m6TJVrKS019418 for xfs@oss.sgi.com; Tue, 29 Jul 2008 21:31:53 +0200 Date: Tue, 29 Jul 2008 21:31:53 +0200 From: Christoph Hellwig To: xfs@oss.sgi.com X-ASG-Orig-Subj: [PATCH 20/21] implement generic xfs_btree_delete/delrec Subject: [PATCH 20/21] implement generic xfs_btree_delete/delrec Message-ID: <20080729193153.GU19104@lst.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline; filename=xfs-common-btree-delete User-Agent: Mutt/1.3.28i X-Scanned-By: MIMEDefang 2.39 X-Barracuda-Connect: verein.lst.de[213.95.11.210] X-Barracuda-Start-Time: 1217359916 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.22 X-Barracuda-Spam-Status: No, SCORE=-1.22 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615, MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1222 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17262 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: hch@lst.de Precedence: bulk X-list: xfs Make the btree delete code generic. Based on a patch from David Chinner with lots of changes to follow the original btree implementations more closely. While this loses some of the generic helper routines for inserting/moving/removing records it also solves some of the one off bugs in the original code and makes it easier to verify. Signed-off-by: Christoph Hellwig Index: linux-2.6-xfs/fs/xfs/xfs_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-29 16:18:32.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-29 16:19:57.000000000 +0200 @@ -2742,3 +2742,586 @@ error0: XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return error; } + +STATIC int +xfs_btree_dec_cursor( + struct xfs_btree_cur *cur, + int level, + int *stat) +{ + int error; + int i; + + if (level > 0) { + error = xfs_btree_decrement(cur, level, &i); + if (error) + return error; + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; +} + +/* + * Single level of the btree record deletion routine. + * Delete record pointed to by cur/level. + * Remove the record from its block then rebalance the tree. + * Return 0 for error, 1 for done, 2 to go on to the next level. + */ +STATIC int /* error */ +xfs_btree_delrec( + struct xfs_btree_cur *cur, /* btree cursor */ + int level, /* level removing record from */ + int *stat) /* fail/done/go-on */ +{ + struct xfs_btree_block *block; /* bmap btree block */ + union xfs_btree_ptr cptr; /* current block ptr */ + struct xfs_buf *bp; /* buffer for block */ + int error; /* error return value */ + int i; /* loop counter */ + union xfs_btree_key key; /* bmap btree key */ + union xfs_btree_ptr lptr; /* left sibling block ptr */ + struct xfs_buf *lbp; /* left buffer pointer */ + struct xfs_btree_block *left; /* left btree block */ + int lrecs = 0; /* left record count */ + int ptr; /* key/record index */ + union xfs_btree_ptr rptr; /* right sibling block ptr */ + struct xfs_buf *rbp; /* right buffer pointer */ + struct xfs_btree_block *right; /* right btree block */ + struct xfs_btree_block *rrblock; /* right-right btree block */ + struct xfs_buf *rrbp; /* right-right buffer pointer */ + int rrecs = 0; /* right record count */ + struct xfs_btree_cur *tcur; /* temporary btree cursor */ + int numrecs; /* temporary numrec count */ + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_TRACE_ARGI(cur, level); + + tcur = NULL; + + /* Get the index of the entry being deleted, check for nothing there. */ + ptr = cur->bc_ptrs[level]; + if (ptr == 0) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + + /* Get the buffer & block containing the record or key/ptr. */ + block = xfs_btree_get_block(cur, level, &bp); + numrecs = xfs_btree_get_numrecs(block); + +#ifdef DEBUG + error = xfs_btree_check_block(cur, block, level, bp); + if (error) + goto error0; +#endif + + /* Fail if we're off the end of the block. */ + if (ptr > numrecs) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 0; + return 0; + } + + XFS_BTREE_STATS_INC(cur, delrec); + XFS_BTREE_STATS_ADD(cur, moves, numrecs - ptr); + + /* Excise the entries being deleted. */ + if (level > 0) { + /* It's a nonleaf. operate on keys and ptrs */ + union xfs_btree_key *lkp; /* pointer to bmap btree key */ + union xfs_btree_ptr *lpp; /* pointer to bmap block addr */ + + lkp = cur->bc_ops->key_addr(cur, 1, block); + lpp = cur->bc_ops->ptr_addr(cur, 1, block); + +#ifdef DEBUG + for (i = ptr; i < numrecs; i++) { + error = xfs_btree_check_ptr(cur, lpp, i, level); + if (error) + goto error0; + } +#endif + + if (ptr < numrecs) { + cur->bc_ops->move_keys(cur, lkp, ptr, ptr - 1, + numrecs - ptr); + xfs_btree_move_ptrs(cur, lpp, ptr, ptr - 1, + numrecs - ptr); + cur->bc_ops->log_keys(cur, bp, ptr, numrecs - 1); + xfs_btree_log_ptrs(cur, bp, ptr, numrecs - 1); + } + } else { + /* It's a leaf. operate on records */ + union xfs_btree_rec *lrp; /* pointer to bmap btree rec */ + + lrp = cur->bc_ops->rec_addr(cur, 1, block); + if (ptr < numrecs) { + cur->bc_ops->move_recs(cur, lrp, ptr, ptr - 1, + numrecs - ptr); + cur->bc_ops->log_recs(cur, bp, ptr, numrecs - 1); + } + + /* + * If it's the first record in the block, we'll need a key + * structure to pass up to the next level (updkey). + */ + if (ptr == 1) + cur->bc_ops->init_key_from_rec(cur, &key, lrp); + } + + /* + * Decrement and log the number of entries in the block. + */ + xfs_btree_set_numrecs(block, --numrecs); + xfs_btree_log_block(cur, bp, XFS_BB_NUMRECS); + + /* + * If we are tracking the last record in the tree and + * we are at the far right edge of the tree, update it. + */ + if (xfs_btree_is_lastrec(cur, block, level)) { + cur->bc_ops->update_lastrec(cur, block, NULL, + ptr, LASTREC_DELREC); + } + + /* + * We're at the root level. First, shrink the root block in-memory. + * Try to get rid of the next level down. If we can't then there's + * nothing left to do. + */ + if (level == cur->bc_nlevels - 1) { + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) { + cur->bc_ops->realloc_root(cur, -1); + + error = cur->bc_ops->kill_root(cur, -1, NULL); + if (error) + goto error0; + + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + *stat = 1; + return 0; + } + + /* + * If this is the root level, and there's only one entry left, + * and it's NOT the leaf level, then we can get rid of this + * level. + */ + if (numrecs == 1 && level > 0) { + union xfs_btree_ptr *pp; + /* + * pp is still set to the first pointer in the block. + * Make it the new root of the btree. + */ + pp = cur->bc_ops->ptr_addr(cur, 1, block); + error = cur->bc_ops->kill_root(cur, level, pp); + if (error) + goto error0; + } else if (level > 0) { + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + } + *stat = 1; + return 0; + } + + /* + * If we deleted the leftmost entry in the block, update the + * key values above us in the tree. + */ + if (ptr == 1) { + error = xfs_btree_updkey(cur, &key, level + 1); + if (error) + goto error0; + } + + /* + * If the number of records remaining in the block is at least + * the minimum, we're done. + */ + if (numrecs >= cur->bc_ops->get_minrecs(cur, level)) { + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + + /* + * Otherwise, we have to move some records around to keep the + * tree balanced. Look at the left and right sibling blocks to + * see if we can re-balance by moving only one record. + */ + xfs_btree_get_sibling(cur, block, &rptr, XFS_BB_RIGHTSIB); + xfs_btree_get_sibling(cur, block, &lptr, XFS_BB_LEFTSIB); + if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) { + /* + * One child of root, need to get a chance to copy its contents + * into the root and delete it. Can't go up to next level, + * there's nothing to delete there. + */ + if (xfs_btree_ptr_is_null(cur, &rptr) && + xfs_btree_ptr_is_null(cur, &lptr) && + level == cur->bc_nlevels - 2) { + error = cur->bc_ops->kill_root(cur, -1, NULL); + if (!error) + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + } + + ASSERT(!xfs_btree_ptr_is_null(cur, &rptr) || + !xfs_btree_ptr_is_null(cur, &lptr)); + + /* + * Duplicate the cursor so our btree manipulations here won't + * disrupt the next level up. + */ + error = xfs_btree_dup_cursor(cur, &tcur); + if (error) + goto error0; + + /* + * If there's a right sibling, see if it's ok to shift an entry + * out of it. + */ + if (!xfs_btree_ptr_is_null(cur, &rptr)) { + /* + * Move the temp cursor to the last entry in the next block. + * Actually any entry but the first would suffice. + */ + i = xfs_btree_lastrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_increment(tcur, level, &i); + if (error) + goto error0; + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + i = xfs_btree_lastrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + /* Grab a pointer to the block. */ + right = xfs_btree_get_block(tcur, level, &rbp); +#ifdef DEBUG + error = xfs_btree_check_block(tcur, right, level, rbp); + if (error) + goto error0; +#endif + /* Grab the current block number, for future use. */ + xfs_btree_get_sibling(tcur, right, &cptr, XFS_BB_LEFTSIB); + + /* + * If right block is full enough so that removing one entry + * won't make it too empty, and left-shifting an entry out + * of right to us works, we're done. + */ + if (xfs_btree_get_numrecs(right) - 1 >= + cur->bc_ops->get_minrecs(tcur, level)) { + error = xfs_btree_lshift(tcur, level, &i); + if (error) + goto error0; + if (i) { + ASSERT(xfs_btree_get_numrecs(block) >= + cur->bc_ops->get_minrecs(tcur, level)); + + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + tcur = NULL; + + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + } + + /* + * Otherwise, grab the number of records in right for + * future reference, and fix up the temp cursor to point + * to our block again (last record). + */ + rrecs = xfs_btree_get_numrecs(right); + if (!xfs_btree_ptr_is_null(cur, &lptr)) { + i = xfs_btree_firstrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_decrement(tcur, level, &i); + if (error) + goto error0; + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + } + } + + /* + * If there's a left sibling, see if it's ok to shift an entry + * out of it. + */ + if (!xfs_btree_ptr_is_null(cur, &lptr)) { + /* + * Move the temp cursor to the first entry in the + * previous block. + */ + i = xfs_btree_firstrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + error = xfs_btree_decrement(tcur, level, &i); + if (error) + goto error0; + i = xfs_btree_firstrec(tcur, level); + XFS_WANT_CORRUPTED_GOTO(i == 1, error0); + + /* Grab a pointer to the block. */ + left = xfs_btree_get_block(tcur, level, &lbp); +#ifdef DEBUG + error = xfs_btree_check_block(cur, left, level, lbp); + if (error) + goto error0; +#endif + /* Grab the current block number, for future use. */ + xfs_btree_get_sibling(tcur, left, &cptr, XFS_BB_RIGHTSIB); + + /* + * If left block is full enough so that removing one entry + * won't make it too empty, and right-shifting an entry out + * of left to us works, we're done. + */ + if (xfs_btree_get_numrecs(left) - 1 >= + cur->bc_ops->get_minrecs(tcur, level)) { + error = xfs_btree_rshift(tcur, level, &i); + if (error) + goto error0; + if (i) { + ASSERT(xfs_btree_get_numrecs(block) >= + cur->bc_ops->get_minrecs(tcur, level)); + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + tcur = NULL; + if (level == 0) + cur->bc_ptrs[0]++; + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = 1; + return 0; + } + } + + /* + * Otherwise, grab the number of records in right for + * future reference. + */ + lrecs = xfs_btree_get_numrecs(left); + } + + /* Delete the temp cursor, we're done with it. */ + xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); + tcur = NULL; + + /* If here, we need to do a join to keep the tree balanced. */ + ASSERT(!xfs_btree_ptr_is_null(cur, &cptr)); + + if (!xfs_btree_ptr_is_null(cur, &lptr) && + lrecs + xfs_btree_get_numrecs(block) <= + cur->bc_ops->get_maxrecs(cur, level)) { + /* + * Set "right" to be the starting block, + * "left" to be the left neighbor. + */ + rptr = cptr; + right = block; + rbp = bp; + error = xfs_btree_read_buf_block(cur, &lptr, level, + 0, &left, &lbp); + if (error) + goto error0; + + /* + * If that won't work, see if we can join with the right neighbor block. + */ + } else if (!xfs_btree_ptr_is_null(cur, &rptr) && + rrecs + xfs_btree_get_numrecs(block) <= + cur->bc_ops->get_maxrecs(cur, level)) { + /* + * Set "left" to be the starting block, + * "right" to be the right neighbor. + */ + lptr = cptr; + left = block; + lbp = bp; + error = xfs_btree_read_buf_block(cur, &rptr, level, + 0, &right, &rbp); + if (error) + goto error0; + + /* + * Otherwise, we can't fix the imbalance. + * Just return. This is probably a logic error, but it's not fatal. + */ + } else { + error = xfs_btree_dec_cursor(cur, level, stat); + if (error) + goto error0; + return 0; + } + + rrecs = xfs_btree_get_numrecs(right); + lrecs = xfs_btree_get_numrecs(left); + + /* + * We're now going to join "left" and "right" by moving all the stuff + * in "right" to "left" and deleting "right". + */ + XFS_BTREE_STATS_ADD(cur, moves, rrecs); + if (level > 0) { + /* It's a non-leaf. Move keys and pointers. */ + union xfs_btree_key *lkp; /* left btree key */ + union xfs_btree_ptr *lpp; /* left address pointer */ + union xfs_btree_key *rkp; /* right btree key */ + union xfs_btree_ptr *rpp; /* right address pointer */ + + lkp = cur->bc_ops->key_addr(cur, lrecs + 1, left); + lpp = cur->bc_ops->ptr_addr(cur, lrecs + 1, left); + rkp = cur->bc_ops->key_addr(cur, 1, right); + rpp = cur->bc_ops->ptr_addr(cur, 1, right); +#ifdef DEBUG + for (i = 1; i < rrecs; i++) { + error = xfs_btree_check_ptr(cur, rpp, i, level); + if (error) + goto error0; + } +#endif + cur->bc_ops->copy_keys(cur, rkp, lkp, rrecs); + xfs_btree_copy_ptrs(cur, rpp, lpp, rrecs); + + cur->bc_ops->log_keys(cur, lbp, lrecs + 1, lrecs + rrecs); + xfs_btree_log_ptrs(cur, lbp, lrecs + 1, lrecs + rrecs); + } else { + /* It's a leaf. Move records. */ + union xfs_btree_rec *lrp; /* left record pointer */ + union xfs_btree_rec *rrp; /* right record pointer */ + + lrp = cur->bc_ops->rec_addr(cur, lrecs + 1, left); + rrp = cur->bc_ops->rec_addr(cur, 1, right); + + cur->bc_ops->copy_recs(cur, rrp, lrp, rrecs); + cur->bc_ops->log_recs(cur, lbp, lrecs + 1, lrecs + rrecs); + } + + XFS_BTREE_STATS_INC(cur, join); + + /* + * Fix up the the number of records and right block pointer in the + * surviving block, and log it. + */ + xfs_btree_set_numrecs(left, lrecs + rrecs); + xfs_btree_get_sibling(cur, right, &cptr, XFS_BB_RIGHTSIB), + xfs_btree_set_sibling(cur, left, &cptr, XFS_BB_RIGHTSIB); + xfs_btree_log_block(cur, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); + + /* If there is a right sibling, point it to the remaining block. */ + xfs_btree_get_sibling(cur, left, &cptr, XFS_BB_RIGHTSIB); + if (!xfs_btree_ptr_is_null(cur, &cptr)) { + error = xfs_btree_read_buf_block(cur, &cptr, level, + 0, &rrblock, &rrbp); + if (error) + goto error0; + xfs_btree_set_sibling(cur, rrblock, &lptr, XFS_BB_LEFTSIB); + xfs_btree_log_block(cur, rrbp, XFS_BB_LEFTSIB); + } + /* Free the deleted block. */ + error = cur->bc_ops->free_block(cur, rbp, 1); + if (error) + goto error0; + XFS_BTREE_STATS_INC(cur, free); + + /* + * If we joined with the left neighbor, set the buffer in the + * cursor to the left block, and fix up the index. + */ + if (bp != lbp) { + cur->bc_bufs[level] = lbp; + cur->bc_ptrs[level] += lrecs; + cur->bc_ra[level] = 0; + } + /* + * If we joined with the right neighbor and there's a level above + * us, increment the cursor at that level. + */ + else if ((cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) || + (level + 1 < cur->bc_nlevels)) { + error = xfs_btree_increment(cur, level + 1, &i); + if (error) + goto error0; + } + + /* + * Readjust the ptr at this level if it's not a leaf, since it's + * still pointing at the deletion point, which makes the cursor + * inconsistent. If this makes the ptr 0, the caller fixes it up. + * We can't use decrement because it would change the next level up. + */ + if (level > 0) + cur->bc_ptrs[level]--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + /* Return value means the next level up has something to do. */ + *stat = 2; + return 0; + +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + if (tcur) + xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); + return error; +} + +/* + * Delete the record pointed to by cur. + * The cursor refers to the place where the record was (could be inserted) + * when the operation returns. + */ +int /* error */ +xfs_btree_delete( + struct xfs_btree_cur *cur, + int *stat) /* success/failure */ +{ + int error; /* error return value */ + int level; + int i; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + + /* + * Go up the tree, starting at leaf level. + * + * If 2 is returned then a join was done; go to the next level. + * Otherwise we are done. + */ + for (level = 0, i = 2; i == 2; level++) { + error = xfs_btree_delrec(cur, level, &i); + if (error) + goto error0; + } + + if (i == 0) { + for (level = 1; level < cur->bc_nlevels; level++) { + if (cur->bc_ptrs[level] == 0) { + error = xfs_btree_decrement(cur, level, &i); + if (error) + goto error0; + break; + } + } + } + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + *stat = i; + return 0; +error0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; +} Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c 2008-07-29 16:18:46.000000000 +0200 @@ -40,638 +40,6 @@ #include "xfs_alloc.h" #include "xfs_error.h" -/* - * Prototypes for internal functions. - */ - -STATIC void xfs_alloc_log_block(xfs_trans_t *, xfs_buf_t *, int); -STATIC void xfs_allocbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); -#define xfs_alloc_log_keys(c, b, i, j) \ - xfs_allocbt_log_keys(c, b, i, j) -STATIC void xfs_alloc_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_allocbt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -#define xfs_alloc_log_recs(c, b, i, j) \ - xfs_allocbt_log_recs(c, b, i, j) - -/* - * Internal functions. - */ - -/* - * Single level of the xfs_alloc_delete record deletion routine. - * Delete record pointed to by cur/level. - * Remove the record from its block then rebalance the tree. - * Return 0 for error, 1 for done, 2 to go on to the next level. - */ -STATIC int /* error */ -xfs_alloc_delrec( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level removing record from */ - int *stat) /* fail/done/go-on */ -{ - xfs_agf_t *agf; /* allocation group freelist header */ - xfs_alloc_block_t *block; /* btree block record/key lives in */ - xfs_agblock_t bno; /* btree block number */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop index */ - xfs_alloc_key_t key; /* kp points here if block is level 0 */ - xfs_agblock_t lbno; /* left block's block number */ - xfs_buf_t *lbp; /* left block's buffer pointer */ - xfs_alloc_block_t *left; /* left btree block */ - xfs_alloc_key_t *lkp=NULL; /* left block key pointer */ - xfs_alloc_ptr_t *lpp=NULL; /* left block address pointer */ - int lrecs=0; /* number of records in left block */ - xfs_alloc_rec_t *lrp; /* left block record pointer */ - xfs_mount_t *mp; /* mount structure */ - int ptr; /* index in btree block for this rec */ - xfs_agblock_t rbno; /* right block's block number */ - xfs_buf_t *rbp; /* right block's buffer pointer */ - xfs_alloc_block_t *right; /* right btree block */ - xfs_alloc_key_t *rkp; /* right block key pointer */ - xfs_alloc_ptr_t *rpp; /* right block address pointer */ - int rrecs=0; /* number of records in right block */ - int numrecs; - xfs_alloc_rec_t *rrp; /* right block record pointer */ - xfs_btree_cur_t *tcur; /* temporary btree cursor */ - - /* - * Get the index of the entry being deleted, check for nothing there. - */ - ptr = cur->bc_ptrs[level]; - if (ptr == 0) { - *stat = 0; - return 0; - } - /* - * Get the buffer & block containing the record or key/ptr. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_ALLOC_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Fail if we're off the end of the block. - */ - numrecs = be16_to_cpu(block->bb_numrecs); - if (ptr > numrecs) { - *stat = 0; - return 0; - } - XFS_STATS_INC(xs_abt_delrec); - /* - * It's a nonleaf. Excise the key and ptr being deleted, by - * sliding the entries past them down one. - * Log the changed areas of the block. - */ - if (level > 0) { - lkp = XFS_ALLOC_KEY_ADDR(block, 1, cur); - lpp = XFS_ALLOC_PTR_ADDR(block, 1, cur); -#ifdef DEBUG - for (i = ptr; i < numrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(lpp[i]), level))) - return error; - } -#endif - if (ptr < numrecs) { - memmove(&lkp[ptr - 1], &lkp[ptr], - (numrecs - ptr) * sizeof(*lkp)); - memmove(&lpp[ptr - 1], &lpp[ptr], - (numrecs - ptr) * sizeof(*lpp)); - xfs_alloc_log_ptrs(cur, bp, ptr, numrecs - 1); - xfs_alloc_log_keys(cur, bp, ptr, numrecs - 1); - } - } - /* - * It's a leaf. Excise the record being deleted, by sliding the - * entries past it down one. Log the changed areas of the block. - */ - else { - lrp = XFS_ALLOC_REC_ADDR(block, 1, cur); - if (ptr < numrecs) { - memmove(&lrp[ptr - 1], &lrp[ptr], - (numrecs - ptr) * sizeof(*lrp)); - xfs_alloc_log_recs(cur, bp, ptr, numrecs - 1); - } - /* - * If it's the first record in the block, we'll need a key - * structure to pass up to the next level (updkey). - */ - if (ptr == 1) { - key.ar_startblock = lrp->ar_startblock; - key.ar_blockcount = lrp->ar_blockcount; - lkp = &key; - } - } - /* - * Decrement and log the number of entries in the block. - */ - numrecs--; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_alloc_log_block(cur->bc_tp, bp, XFS_BB_NUMRECS); - /* - * See if the longest free extent in the allocation group was - * changed by this operation. True if it's the by-size btree, and - * this is the leaf level, and there is no right sibling block, - * and this was the last record. - */ - agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); - mp = cur->bc_mp; - - if (level == 0 && - cur->bc_btnum == XFS_BTNUM_CNT && - be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK && - ptr > numrecs) { - ASSERT(ptr == numrecs + 1); - /* - * There are still records in the block. Grab the size - * from the last one. - */ - if (numrecs) { - rrp = XFS_ALLOC_REC_ADDR(block, numrecs, cur); - agf->agf_longest = rrp->ar_blockcount; - } - /* - * No free extents left. - */ - else - agf->agf_longest = 0; - mp->m_perag[be32_to_cpu(agf->agf_seqno)].pagf_longest = - be32_to_cpu(agf->agf_longest); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_LONGEST); - } - /* - * Is this the root level? If so, we're almost done. - */ - if (level == cur->bc_nlevels - 1) { - /* - * If this is the root level, - * and there's only one entry left, - * and it's NOT the leaf level, - * then we can get rid of this level. - */ - if (numrecs == 1 && level > 0) { - /* - * lpp is still set to the first pointer in the block. - * Make it the new root of the btree. - */ - bno = be32_to_cpu(agf->agf_roots[cur->bc_btnum]); - agf->agf_roots[cur->bc_btnum] = *lpp; - be32_add(&agf->agf_levels[cur->bc_btnum], -1); - mp->m_perag[be32_to_cpu(agf->agf_seqno)].pagf_levels[cur->bc_btnum]--; - /* - * Put this buffer/block on the ag's freelist. - */ - error = xfs_alloc_put_freelist(cur->bc_tp, - cur->bc_private.a.agbp, NULL, bno, 1); - if (error) - return error; - /* - * Since blocks move to the free list without the - * coordination used in xfs_bmap_finish, we can't allow - * block to be available for reallocation and - * non-transaction writing (user data) until we know - * that the transaction that moved it to the free list - * is permanently on disk. We track the blocks by - * declaring these blocks as "busy"; the busy list is - * maintained on a per-ag basis and each transaction - * records which entries should be removed when the - * iclog commits to disk. If a busy block is - * allocated, the iclog is pushed up to the LSN - * that freed the block. - */ - xfs_alloc_mark_busy(cur->bc_tp, - be32_to_cpu(agf->agf_seqno), bno, 1); - - xfs_trans_agbtree_delta(cur->bc_tp, -1); - xfs_alloc_log_agf(cur->bc_tp, cur->bc_private.a.agbp, - XFS_AGF_ROOTS | XFS_AGF_LEVELS); - /* - * Update the cursor so there's one fewer level. - */ - xfs_btree_setbuf(cur, level, NULL); - cur->bc_nlevels--; - } else if (level > 0 && - (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * If we deleted the leftmost entry in the block, update the - * key values above us in the tree. - */ - if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)lkp, level + 1))) - return error; - /* - * If the number of records remaining in the block is at least - * the minimum, we're done. - */ - if (numrecs >= XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * Otherwise, we have to move some records around to keep the - * tree balanced. Look at the left and right sibling blocks to - * see if we can re-balance by moving only one record. - */ - rbno = be32_to_cpu(block->bb_rightsib); - lbno = be32_to_cpu(block->bb_leftsib); - bno = NULLAGBLOCK; - ASSERT(rbno != NULLAGBLOCK || lbno != NULLAGBLOCK); - /* - * Duplicate the cursor so our btree manipulations here won't - * disrupt the next level up. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - /* - * If there's a right sibling, see if it's ok to shift an entry - * out of it. - */ - if (rbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the last entry in the next block. - * Actually any entry but the first would suffice. - */ - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - /* - * Grab a pointer to the block. - */ - rbp = tcur->bc_bufs[level]; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(right->bb_leftsib); - /* - * If right block is full enough so that removing one entry - * won't make it too empty, and left-shifting an entry out - * of right to us works, we're done. - */ - if (be16_to_cpu(right->bb_numrecs) - 1 >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_lshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level > 0 && - (error = xfs_btree_decrement(cur, level, - &i))) - return error; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference, and fix up the temp cursor to point - * to our block again (last record). - */ - rrecs = be16_to_cpu(right->bb_numrecs); - if (lbno != NULLAGBLOCK) { - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - } - } - /* - * If there's a left sibling, see if it's ok to shift an entry - * out of it. - */ - if (lbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the first entry in the - * previous block. - */ - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - xfs_btree_firstrec(tcur, level); - /* - * Grab a pointer to the block. - */ - lbp = tcur->bc_bufs[level]; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(left->bb_rightsib); - /* - * If left block is full enough so that removing one entry - * won't make it too empty, and right-shifting an entry out - * of left to us works, we're done. - */ - if (be16_to_cpu(left->bb_numrecs) - 1 >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_rshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_ALLOC_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level == 0) - cur->bc_ptrs[0]++; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference. - */ - lrecs = be16_to_cpu(left->bb_numrecs); - } - /* - * Delete the temp cursor, we're done with it. - */ - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - /* - * If here, we need to do a join to keep the tree balanced. - */ - ASSERT(bno != NULLAGBLOCK); - /* - * See if we can join with the left neighbor block. - */ - if (lbno != NULLAGBLOCK && - lrecs + numrecs <= XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - /* - * Set "right" to be the starting block, - * "left" to be the left neighbor. - */ - rbno = bno; - right = block; - rrecs = be16_to_cpu(right->bb_numrecs); - rbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, lbno, 0, &lbp, - XFS_ALLOC_BTREE_REF))) - return error; - left = XFS_BUF_TO_ALLOC_BLOCK(lbp); - lrecs = be16_to_cpu(left->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - } - /* - * If that won't work, see if we can join with the right neighbor block. - */ - else if (rbno != NULLAGBLOCK && - rrecs + numrecs <= XFS_ALLOC_BLOCK_MAXRECS(level, cur)) { - /* - * Set "left" to be the starting block, - * "right" to be the right neighbor. - */ - lbno = bno; - left = block; - lrecs = be16_to_cpu(left->bb_numrecs); - lbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, rbno, 0, &rbp, - XFS_ALLOC_BTREE_REF))) - return error; - right = XFS_BUF_TO_ALLOC_BLOCK(rbp); - rrecs = be16_to_cpu(right->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - } - /* - * Otherwise, we can't fix the imbalance. - * Just return. This is probably a logic error, but it's not fatal. - */ - else { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * We're now going to join "left" and "right" by moving all the stuff - * in "right" to "left" and deleting "right". - */ - if (level > 0) { - /* - * It's a non-leaf. Move keys and pointers. - */ - lkp = XFS_ALLOC_KEY_ADDR(left, lrecs + 1, cur); - lpp = XFS_ALLOC_PTR_ADDR(left, lrecs + 1, cur); - rkp = XFS_ALLOC_KEY_ADDR(right, 1, cur); - rpp = XFS_ALLOC_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < rrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memcpy(lkp, rkp, rrecs * sizeof(*lkp)); - memcpy(lpp, rpp, rrecs * sizeof(*lpp)); - xfs_alloc_log_keys(cur, lbp, lrecs + 1, lrecs + rrecs); - xfs_alloc_log_ptrs(cur, lbp, lrecs + 1, lrecs + rrecs); - } else { - /* - * It's a leaf. Move records. - */ - lrp = XFS_ALLOC_REC_ADDR(left, lrecs + 1, cur); - rrp = XFS_ALLOC_REC_ADDR(right, 1, cur); - memcpy(lrp, rrp, rrecs * sizeof(*lrp)); - xfs_alloc_log_recs(cur, lbp, lrecs + 1, lrecs + rrecs); - } - /* - * If we joined with the left neighbor, set the buffer in the - * cursor to the left block, and fix up the index. - */ - if (bp != lbp) { - xfs_btree_setbuf(cur, level, lbp); - cur->bc_ptrs[level] += lrecs; - } - /* - * If we joined with the right neighbor and there's a level above - * us, increment the cursor at that level. - */ - else if (level + 1 < cur->bc_nlevels && - (error = xfs_btree_increment(cur, level + 1, &i))) - return error; - /* - * Fix up the number of records in the surviving block. - */ - lrecs += rrecs; - left->bb_numrecs = cpu_to_be16(lrecs); - /* - * Fix up the right block pointer in the surviving block, and log it. - */ - left->bb_rightsib = right->bb_rightsib; - xfs_alloc_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); - /* - * If there is a right sibling now, make it point to the - * remaining block. - */ - if (be32_to_cpu(left->bb_rightsib) != NULLAGBLOCK) { - xfs_alloc_block_t *rrblock; - xfs_buf_t *rrbp; - - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), 0, - &rrbp, XFS_ALLOC_BTREE_REF))) - return error; - rrblock = XFS_BUF_TO_ALLOC_BLOCK(rrbp); - if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))) - return error; - rrblock->bb_leftsib = cpu_to_be32(lbno); - xfs_alloc_log_block(cur->bc_tp, rrbp, XFS_BB_LEFTSIB); - } - /* - * Free the deleting block by putting it on the freelist. - */ - error = xfs_alloc_put_freelist(cur->bc_tp, - cur->bc_private.a.agbp, NULL, rbno, 1); - if (error) - return error; - /* - * Since blocks move to the free list without the coordination - * used in xfs_bmap_finish, we can't allow block to be available - * for reallocation and non-transaction writing (user data) - * until we know that the transaction that moved it to the free - * list is permanently on disk. We track the blocks by declaring - * these blocks as "busy"; the busy list is maintained on a - * per-ag basis and each transaction records which entries - * should be removed when the iclog commits to disk. If a - * busy block is allocated, the iclog is pushed up to the - * LSN that freed the block. - */ - xfs_alloc_mark_busy(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1); - xfs_trans_agbtree_delta(cur->bc_tp, -1); - - /* - * Adjust the current level's cursor so that we're left referring - * to the right node, after we're done. - * If this leaves the ptr value 0 our caller will fix it up. - */ - if (level > 0) - cur->bc_ptrs[level]--; - /* - * Return value means the next level up has something to do. - */ - *stat = 2; - return 0; - -error0: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* - * Log header fields from a btree block. - */ -STATIC void -xfs_alloc_log_block( - xfs_trans_t *tp, /* transaction pointer */ - xfs_buf_t *bp, /* buffer containing btree block */ - int fields) /* mask of fields: XFS_BB_... */ -{ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - static const short offsets[] = { /* table of offsets */ - offsetof(xfs_alloc_block_t, bb_magic), - offsetof(xfs_alloc_block_t, bb_level), - offsetof(xfs_alloc_block_t, bb_numrecs), - offsetof(xfs_alloc_block_t, bb_leftsib), - offsetof(xfs_alloc_block_t, bb_rightsib), - sizeof(xfs_alloc_block_t) - }; - - xfs_btree_offsets(fields, offsets, XFS_BB_NUM_BITS, &first, &last); - xfs_trans_log_buf(tp, bp, first, last); -} - -/* - * Log block pointer fields from a btree block (nonleaf). - */ -STATIC void -xfs_alloc_log_ptrs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int pfirst, /* index of first pointer to log */ - int plast) /* index of last pointer to log */ -{ - xfs_alloc_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_alloc_ptr_t *pp; /* block-pointer pointer in btree blk */ - - block = XFS_BUF_TO_ALLOC_BLOCK(bp); - pp = XFS_ALLOC_PTR_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&pp[pfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&pp[plast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - - -/* - * Externally visible routines. - */ - -/* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -int /* error */ -xfs_alloc_delete( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; /* result code */ - int level; /* btree level */ - - /* - * Go up the tree, starting at leaf level. - * If 2 is returned then a join was done; go to the next level. - * Otherwise we are done. - */ - for (level = 0, i = 2; i == 2; level++) { - if ((error = xfs_alloc_delrec(cur, level, &i))) - return error; - } - if (i == 0) { - for (level = 1; level < cur->bc_nlevels; level++) { - if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_btree_decrement(cur, level, &i))) - return error; - break; - } - } - } - *stat = i; - return 0; -} /* * Get the data from the pointed-to record. @@ -747,6 +115,55 @@ xfs_allocbt_set_root( } STATIC int +xfs_allocbt_kill_root( + struct xfs_btree_cur *cur, + int level, + union xfs_btree_ptr *newroot) +{ + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agf *agf = XFS_BUF_TO_AGF(agbp); + xfs_agblock_t bno; + int error; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, killroot); + + /* + * Set the root entry in the AGF structure, decreasing the level by 1 + * and then free the old root. + */ + bno = be32_to_cpu(agf->agf_roots[cur->bc_btnum]); + xfs_allocbt_set_root(cur, newroot, -1); + error = xfs_alloc_put_freelist(cur->bc_tp, agbp, NULL, bno, 1); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + XFS_BTREE_STATS_INC(cur, free); + + /* + * Since blocks move to the free list without the coordination used in + * xfs_bmap_finish, we can't allow block to be available for + * reallocation and non-transaction writing (user data) until we know + * that the transaction that moved it to the free list is permanently + * on disk. We track the blocks by declaring these blocks as "busy"; + * the busy list is maintained on a per-ag basis and each transaction + * records which entries should be removed when the iclog commits to + * disk. If a busy block is allocated, the iclog is pushed up to the + * LSN that freed the block. + */ + xfs_alloc_mark_busy(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1); + xfs_trans_agbtree_delta(cur->bc_tp, -1); + + /* Update the cursor so there's one fewer level. */ + xfs_btree_setbuf(cur, level, NULL); + cur->bc_nlevels--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} + +STATIC int xfs_allocbt_alloc_block( struct xfs_btree_cur *cur, union xfs_btree_ptr *start, @@ -781,6 +198,39 @@ xfs_allocbt_alloc_block( return 0; } +STATIC int +xfs_allocbt_free_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int size) +{ + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); + xfs_agblock_t bno; + int error; + + bno = XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(bp)); + + error = xfs_alloc_put_freelist(cur->bc_tp, cur->bc_private.a.agbp, + NULL, bno, size); + if (error) + return error; + + /* + * Since blocks move to the free list without the coordination used in + * xfs_bmap_finish, we can't allow block to be available for + * reallocation and non-transaction writing (user data) until we know + * that the transaction that moved it to the free list is permanently + * on disk. We track the blocks by declaring these blocks as "busy"; + * the busy list is maintained on a per-ag basis and each transaction + * records which entries should be removed when the iclog commits to + * disk. If a busy block is allocated, the iclog is pushed up to the + * LSN that freed the block. + */ + xfs_alloc_mark_busy(cur->bc_tp, be32_to_cpu(agf->agf_seqno), bno, 1); + xfs_trans_agbtree_delta(cur->bc_tp, -1); + return 0; +} + /* * Update the longest extent in the AGF */ @@ -795,6 +245,7 @@ xfs_allocbt_update_lastrec( struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); __be32 len; + int numrecs; ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); @@ -814,6 +265,22 @@ xfs_allocbt_update_lastrec( return; len = rec->alloc.ar_blockcount; break; + case LASTREC_DELREC: + numrecs = xfs_btree_get_numrecs(block); + if (ptr <= numrecs) + return; + ASSERT(ptr == numrecs + 1); + + if (numrecs) { + xfs_alloc_rec_t *rrp; + + rrp = XFS_ALLOC_REC_ADDR(block, numrecs, cur); + len = rrp->ar_blockcount; + } else { + len = 0; + } + + break; default: ASSERT(0); return; @@ -825,6 +292,14 @@ xfs_allocbt_update_lastrec( } STATIC int +xfs_allocbt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_alloc_mnr[level != 0]; +} + +STATIC int xfs_allocbt_get_maxrecs( struct xfs_btree_cur *cur, int level) @@ -1041,7 +516,7 @@ xfs_allocbt_log_keys( * Log records from a btree block (leaf). */ STATIC void -xfs_alloc_log_recs( +xfs_allocbt_log_recs( struct xfs_btree_cur *cur, /* btree cursor */ struct xfs_buf *bp, /* buffer containing btree block */ int rfirst, /* index of first record to log */ @@ -1147,8 +622,11 @@ static const struct xfs_btree_ops xfs_al .dup_cursor = xfs_allocbt_dup_cursor, .set_root = xfs_allocbt_set_root, .new_root = xfs_btree_new_root, + .kill_root = xfs_allocbt_kill_root, .alloc_block = xfs_allocbt_alloc_block, + .free_block = xfs_allocbt_free_block, .update_lastrec = xfs_allocbt_update_lastrec, + .get_minrecs = xfs_allocbt_get_minrecs, .get_maxrecs = xfs_allocbt_get_maxrecs, .init_key_from_rec = xfs_allocbt_init_key_from_rec, .init_ptr_from_cur = xfs_allocbt_init_ptr_from_cur, Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c 2008-07-29 16:20:22.000000000 +0200 @@ -49,7 +49,6 @@ */ -STATIC int xfs_bmbt_killroot(xfs_btree_cur_t *); STATIC void xfs_bmbt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); STATIC void xfs_bmbt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); @@ -86,467 +85,6 @@ STATIC void xfs_bmbt_log_ptrs(xfs_btree_ */ /* - * Delete record pointed to by cur/level. - */ -STATIC int /* error */ -xfs_bmbt_delrec( - xfs_btree_cur_t *cur, - int level, - int *stat) /* success/failure */ -{ - xfs_bmbt_block_t *block; /* bmap btree block */ - xfs_fsblock_t bno; /* fs-relative block number */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop counter */ - int j; /* temp state */ - xfs_bmbt_key_t key; /* bmap btree key */ - xfs_bmbt_key_t *kp=NULL; /* pointer to bmap btree key */ - xfs_fsblock_t lbno; /* left sibling block number */ - xfs_buf_t *lbp; /* left buffer pointer */ - xfs_bmbt_block_t *left; /* left btree block */ - xfs_bmbt_key_t *lkp; /* left btree key */ - xfs_bmbt_ptr_t *lpp; /* left address pointer */ - int lrecs=0; /* left record count */ - xfs_bmbt_rec_t *lrp; /* left record pointer */ - xfs_mount_t *mp; /* file system mount point */ - xfs_bmbt_ptr_t *pp; /* pointer to bmap block addr */ - int ptr; /* key/record index */ - xfs_fsblock_t rbno; /* right sibling block number */ - xfs_buf_t *rbp; /* right buffer pointer */ - xfs_bmbt_block_t *right; /* right btree block */ - xfs_bmbt_key_t *rkp; /* right btree key */ - xfs_bmbt_rec_t *rp; /* pointer to bmap btree rec */ - xfs_bmbt_ptr_t *rpp; /* right address pointer */ - xfs_bmbt_block_t *rrblock; /* right-right btree block */ - xfs_buf_t *rrbp; /* right-right buffer pointer */ - int rrecs=0; /* right record count */ - xfs_bmbt_rec_t *rrp; /* right record pointer */ - xfs_btree_cur_t *tcur; /* temporary btree cursor */ - int numrecs; /* temporary numrec count */ - int numlrecs, numrrecs; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - XFS_BMBT_TRACE_ARGI(cur, level); - ptr = cur->bc_ptrs[level]; - tcur = NULL; - if (ptr == 0) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - block = xfs_bmbt_get_block(cur, level, &bp); - numrecs = be16_to_cpu(block->bb_numrecs); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, block, level, bp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } -#endif - if (ptr > numrecs) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 0; - return 0; - } - XFS_STATS_INC(xs_bmbt_delrec); - if (level > 0) { - kp = XFS_BMAP_KEY_IADDR(block, 1, cur); - pp = XFS_BMAP_PTR_IADDR(block, 1, cur); -#ifdef DEBUG - for (i = ptr; i < numrecs; i++) { - if ((error = xfs_btree_check_lptr_disk(cur, pp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - } -#endif - if (ptr < numrecs) { - memmove(&kp[ptr - 1], &kp[ptr], - (numrecs - ptr) * sizeof(*kp)); - memmove(&pp[ptr - 1], &pp[ptr], - (numrecs - ptr) * sizeof(*pp)); - xfs_bmbt_log_ptrs(cur, bp, ptr, numrecs - 1); - xfs_bmbt_log_keys(cur, bp, ptr, numrecs - 1); - } - } else { - rp = XFS_BMAP_REC_IADDR(block, 1, cur); - if (ptr < numrecs) { - memmove(&rp[ptr - 1], &rp[ptr], - (numrecs - ptr) * sizeof(*rp)); - xfs_bmbt_log_recs(cur, bp, ptr, numrecs - 1); - } - if (ptr == 1) { - key.br_startoff = - cpu_to_be64(xfs_bmbt_disk_get_startoff(rp)); - kp = &key; - } - } - numrecs--; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_bmbt_log_block(cur, bp, XFS_BB_NUMRECS); - /* - * We're at the root level. - * First, shrink the root block in-memory. - * Try to get rid of the next level down. - * If we can't then there's nothing left to do. - */ - if (level == cur->bc_nlevels - 1) { - xfs_iroot_realloc(cur->bc_private.b.ip, -1, - cur->bc_private.b.whichfork); - if ((error = xfs_bmbt_killroot(cur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (numrecs >= XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &j))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - rbno = be64_to_cpu(block->bb_rightsib); - lbno = be64_to_cpu(block->bb_leftsib); - /* - * One child of root, need to get a chance to copy its contents - * into the root and delete it. Can't go up to next level, - * there's nothing to delete there. - */ - if (lbno == NULLFSBLOCK && rbno == NULLFSBLOCK && - level == cur->bc_nlevels - 2) { - if ((error = xfs_bmbt_killroot(cur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - ASSERT(rbno != NULLFSBLOCK || lbno != NULLFSBLOCK); - if ((error = xfs_btree_dup_cursor(cur, &tcur))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - bno = NULLFSBLOCK; - if (rbno != NULLFSBLOCK) { - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - rbp = tcur->bc_bufs[level]; - right = XFS_BUF_TO_BMBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } -#endif - bno = be64_to_cpu(right->bb_leftsib); - if (be16_to_cpu(right->bb_numrecs) - 1 >= - XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_btree_lshift(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_BMAP_BLOCK_IMINRECS(level, tcur)); - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - tcur = NULL; - if (level > 0) { - if ((error = xfs_btree_decrement(cur, - level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, - ERROR); - goto error0; - } - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - } - rrecs = be16_to_cpu(right->bb_numrecs); - if (lbno != NULLFSBLOCK) { - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_decrement(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - } - } - if (lbno != NULLFSBLOCK) { - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - /* - * decrement to last in block - */ - if ((error = xfs_btree_decrement(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - i = xfs_btree_firstrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - lbp = tcur->bc_bufs[level]; - left = XFS_BUF_TO_BMBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } -#endif - bno = be64_to_cpu(left->bb_rightsib); - if (be16_to_cpu(left->bb_numrecs) - 1 >= - XFS_BMAP_BLOCK_IMINRECS(level, cur)) { - if ((error = xfs_btree_rshift(tcur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_BMAP_BLOCK_IMINRECS(level, tcur)); - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - tcur = NULL; - if (level == 0) - cur->bc_ptrs[0]++; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - } - lrecs = be16_to_cpu(left->bb_numrecs); - } - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - tcur = NULL; - mp = cur->bc_mp; - ASSERT(bno != NULLFSBLOCK); - if (lbno != NULLFSBLOCK && - lrecs + be16_to_cpu(block->bb_numrecs) <= XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - rbno = bno; - right = block; - rbp = bp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, lbno, 0, &lbp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - left = XFS_BUF_TO_BMBT_BLOCK(lbp); - if ((error = xfs_btree_check_lblock(cur, left, level, lbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - } else if (rbno != NULLFSBLOCK && - rrecs + be16_to_cpu(block->bb_numrecs) <= - XFS_BMAP_BLOCK_IMAXRECS(level, cur)) { - lbno = bno; - left = block; - lbp = bp; - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, rbno, 0, &rbp, - XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - right = XFS_BUF_TO_BMBT_BLOCK(rbp); - if ((error = xfs_btree_check_lblock(cur, right, level, rbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - lrecs = be16_to_cpu(left->bb_numrecs); - } else { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 1; - return 0; - } - numlrecs = be16_to_cpu(left->bb_numrecs); - numrrecs = be16_to_cpu(right->bb_numrecs); - if (level > 0) { - lkp = XFS_BMAP_KEY_IADDR(left, numlrecs + 1, cur); - lpp = XFS_BMAP_PTR_IADDR(left, numlrecs + 1, cur); - rkp = XFS_BMAP_KEY_IADDR(right, 1, cur); - rpp = XFS_BMAP_PTR_IADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < numrrecs; i++) { - if ((error = xfs_btree_check_lptr_disk(cur, rpp[i], level))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - } -#endif - memcpy(lkp, rkp, numrrecs * sizeof(*lkp)); - memcpy(lpp, rpp, numrrecs * sizeof(*lpp)); - xfs_bmbt_log_keys(cur, lbp, numlrecs + 1, numlrecs + numrrecs); - xfs_bmbt_log_ptrs(cur, lbp, numlrecs + 1, numlrecs + numrrecs); - } else { - lrp = XFS_BMAP_REC_IADDR(left, numlrecs + 1, cur); - rrp = XFS_BMAP_REC_IADDR(right, 1, cur); - memcpy(lrp, rrp, numrrecs * sizeof(*lrp)); - xfs_bmbt_log_recs(cur, lbp, numlrecs + 1, numlrecs + numrrecs); - } - be16_add(&left->bb_numrecs, numrrecs); - left->bb_rightsib = right->bb_rightsib; - xfs_bmbt_log_block(cur, lbp, XFS_BB_RIGHTSIB | XFS_BB_NUMRECS); - if (be64_to_cpu(left->bb_rightsib) != NULLDFSBNO) { - if ((error = xfs_btree_read_bufl(mp, cur->bc_tp, - be64_to_cpu(left->bb_rightsib), - 0, &rrbp, XFS_BMAP_BTREE_REF))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - rrblock = XFS_BUF_TO_BMBT_BLOCK(rrbp); - if ((error = xfs_btree_check_lblock(cur, rrblock, level, rrbp))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - rrblock->bb_leftsib = cpu_to_be64(lbno); - xfs_bmbt_log_block(cur, rrbp, XFS_BB_LEFTSIB); - } - xfs_bmap_add_free(XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(rbp)), 1, - cur->bc_private.b.flist, mp); - cur->bc_private.b.ip->i_d.di_nblocks--; - xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, XFS_ILOG_CORE); - XFS_TRANS_MOD_DQUOT_BYINO(mp, cur->bc_tp, cur->bc_private.b.ip, - XFS_TRANS_DQ_BCOUNT, -1L); - xfs_trans_binval(cur->bc_tp, rbp); - if (bp != lbp) { - cur->bc_bufs[level] = lbp; - cur->bc_ptrs[level] += lrecs; - cur->bc_ra[level] = 0; - } else if ((error = xfs_btree_increment(cur, level + 1, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - goto error0; - } - if (level > 0) - cur->bc_ptrs[level]--; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = 2; - return 0; - -error0: - if (tcur) - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -STATIC int -xfs_bmbt_killroot( - xfs_btree_cur_t *cur) -{ - xfs_bmbt_block_t *block; - xfs_bmbt_block_t *cblock; - xfs_buf_t *cbp; - xfs_bmbt_key_t *ckp; - xfs_bmbt_ptr_t *cpp; -#ifdef DEBUG - int error; -#endif - int i; - xfs_bmbt_key_t *kp; - xfs_inode_t *ip; - xfs_ifork_t *ifp; - int level; - xfs_bmbt_ptr_t *pp; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - level = cur->bc_nlevels - 1; - ASSERT(level >= 1); - /* - * Don't deal with the root block needs to be a leaf case. - * We're just going to turn the thing back into extents anyway. - */ - if (level == 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; - } - block = xfs_bmbt_get_block(cur, level, &cbp); - /* - * Give up if the root has multiple children. - */ - if (be16_to_cpu(block->bb_numrecs) != 1) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; - } - /* - * Only do this if the next level will fit. - * Then the data must be copied up to the inode, - * instead of freeing the root you free the next level. - */ - cbp = cur->bc_bufs[level - 1]; - cblock = XFS_BUF_TO_BMBT_BLOCK(cbp); - if (be16_to_cpu(cblock->bb_numrecs) > XFS_BMAP_BLOCK_DMAXRECS(level, cur)) { - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; - } - ASSERT(be64_to_cpu(cblock->bb_leftsib) == NULLDFSBNO); - ASSERT(be64_to_cpu(cblock->bb_rightsib) == NULLDFSBNO); - ip = cur->bc_private.b.ip; - ifp = XFS_IFORK_PTR(ip, cur->bc_private.b.whichfork); - ASSERT(XFS_BMAP_BLOCK_IMAXRECS(level, cur) == - XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes)); - i = (int)(be16_to_cpu(cblock->bb_numrecs) - XFS_BMAP_BLOCK_IMAXRECS(level, cur)); - if (i) { - xfs_iroot_realloc(ip, i, cur->bc_private.b.whichfork); - block = ifp->if_broot; - } - be16_add(&block->bb_numrecs, i); - ASSERT(block->bb_numrecs == cblock->bb_numrecs); - kp = XFS_BMAP_KEY_IADDR(block, 1, cur); - ckp = XFS_BMAP_KEY_IADDR(cblock, 1, cur); - memcpy(kp, ckp, be16_to_cpu(block->bb_numrecs) * sizeof(*kp)); - pp = XFS_BMAP_PTR_IADDR(block, 1, cur); - cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); -#ifdef DEBUG - for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { - if ((error = xfs_btree_check_lptr_disk(cur, cpp[i], level - 1))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } -#endif - memcpy(pp, cpp, be16_to_cpu(block->bb_numrecs) * sizeof(*pp)); - xfs_bmap_add_free(XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(cbp)), 1, - cur->bc_private.b.flist, cur->bc_mp); - ip->i_d.di_nblocks--; - XFS_TRANS_MOD_DQUOT_BYINO(cur->bc_mp, cur->bc_tp, ip, - XFS_TRANS_DQ_BCOUNT, -1L); - xfs_trans_binval(cur->bc_tp, cbp); - cur->bc_bufs[level - 1] = NULL; - be16_add(&block->bb_level, -1); - xfs_trans_log_inode(cur->bc_tp, ip, - XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); - cur->bc_nlevels--; - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - return 0; -} - -/* * Log pointer values from the btree block. */ STATIC void @@ -631,42 +169,6 @@ xfs_bmdr_to_bmbt( } /* - * Delete the record pointed to by cur. - */ -int /* error */ -xfs_bmbt_delete( - xfs_btree_cur_t *cur, - int *stat) /* success/failure */ -{ - int error; /* error return value */ - int i; - int level; - - XFS_BMBT_TRACE_CURSOR(cur, ENTRY); - for (level = 0, i = 2; i == 2; level++) { - if ((error = xfs_bmbt_delrec(cur, level, &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - } - if (i == 0) { - for (level = 1; level < cur->bc_nlevels; level++) { - if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_btree_decrement(cur, level, - &i))) { - XFS_BMBT_TRACE_CURSOR(cur, ERROR); - return error; - } - break; - } - } - } - XFS_BMBT_TRACE_CURSOR(cur, EXIT); - *stat = i; - return 0; -} - -/* * Convert a compressed bmap extent record to an uncompressed form. * This code must be in sync with the routines xfs_bmbt_get_startoff, * xfs_bmbt_get_startblock, xfs_bmbt_get_blockcount and xfs_bmbt_get_state. @@ -1344,6 +846,24 @@ xfs_bmbt_alloc_block( return error; } +STATIC int +xfs_bmbt_free_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int size) +{ + struct xfs_mount *mp = cur->bc_mp; + struct xfs_inode *ip = cur->bc_private.b.ip; + + xfs_bmap_add_free(XFS_DADDR_TO_FSB(mp, XFS_BUF_ADDR(bp)), 1, + cur->bc_private.b.flist, mp); + ip->i_d.di_nblocks--; + xfs_trans_log_inode(cur->bc_tp, ip, XFS_ILOG_CORE); + XFS_TRANS_MOD_DQUOT_BYINO(mp, cur->bc_tp, ip, XFS_TRANS_DQ_BCOUNT, -1L); + xfs_trans_binval(cur->bc_tp, bp); + return 0; +} + STATIC struct xfs_btree_block * xfs_bmbt_get_root_from_inode( struct xfs_btree_cur *cur) @@ -1370,6 +890,98 @@ xfs_bmbt_new_root( return 0; } +STATIC int +xfs_bmbt_kill_root( + struct xfs_btree_cur *cur, + int level, + union xfs_btree_ptr *newroot) +{ + struct xfs_inode *ip; + struct xfs_ifork *ifp; + struct xfs_btree_lblock *block; + struct xfs_btree_lblock *cblock; + struct xfs_buf *cbp; + xfs_bmbt_key_t *ckp; + xfs_bmbt_ptr_t *cpp; + xfs_bmbt_key_t *kp; + xfs_bmbt_ptr_t *pp; + int i; + int lev; + + ASSERT(newroot == NULL); + ASSERT(level == -1); + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + lev = cur->bc_nlevels - 1; + ASSERT(lev >= 1); + /* + * Don't deal with the root block needs to be a leaf case. + * We're just going to turn the thing back into extents anyway. + */ + if (lev == 1) + goto out0; + + block = xfs_bmbt_get_block(cur, lev, &cbp); + + /* Give up if the root has multiple children. */ + if (be16_to_cpu(block->bb_numrecs) != 1) + goto out0; + /* + * Only do this if the next level will fit. + * Then the data must be copied up to the inode, + * instead of freeing the root you free the next level. + */ + cblock = xfs_bmbt_get_block(cur, lev - 1, &cbp); + if (be16_to_cpu(cblock->bb_numrecs) > XFS_BMAP_BLOCK_DMAXRECS(level, cur)) + goto out0; + XFS_BTREE_STATS_INC(cur, killroot); + + ASSERT(be64_to_cpu(cblock->bb_leftsib) == NULLDFSBNO); + ASSERT(be64_to_cpu(cblock->bb_rightsib) == NULLDFSBNO); + ip = cur->bc_private.b.ip; + ifp = XFS_IFORK_PTR(ip, cur->bc_private.b.whichfork); + ASSERT(XFS_BMAP_BLOCK_IMAXRECS(lev, cur) == + XFS_BMAP_BROOT_MAXRECS(ifp->if_broot_bytes)); + i = (int)(be16_to_cpu(cblock->bb_numrecs) - + XFS_BMAP_BLOCK_IMAXRECS(lev, cur)); + if (i) { + xfs_iroot_realloc(ip, i, cur->bc_private.b.whichfork); + block = (struct xfs_btree_lblock *)ifp->if_broot; + } + be16_add(&block->bb_numrecs, i); + ASSERT(block->bb_numrecs == cblock->bb_numrecs); + kp = XFS_BMAP_KEY_IADDR(block, 1, cur); + ckp = XFS_BMAP_KEY_IADDR(cblock, 1, cur); + memcpy(kp, ckp, be16_to_cpu(block->bb_numrecs) * sizeof(*kp)); + pp = XFS_BMAP_PTR_IADDR(block, 1, cur); + cpp = XFS_BMAP_PTR_IADDR(cblock, 1, cur); + +#ifdef DEBUG + for (i = 0; i < be16_to_cpu(cblock->bb_numrecs); i++) { + int error; + + error = xfs_btree_check_lptr_disk(cur, cpp[i], level - 1); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + } +#endif + + memcpy(pp, cpp, be16_to_cpu(block->bb_numrecs) * sizeof(*pp)); + + xfs_bmbt_free_block(cur, cbp, 1); + XFS_BTREE_STATS_INC(cur, free); + cur->bc_bufs[lev - 1] = NULL; + be16_add(&block->bb_level, -1); + xfs_trans_log_inode(cur->bc_tp, ip, + XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + cur->bc_nlevels--; +out0: + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} + STATIC void xfs_bmbt_realloc_root( struct xfs_btree_cur *cur, @@ -1380,6 +992,14 @@ xfs_bmbt_realloc_root( } STATIC int +xfs_bmbt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return XFS_BMAP_BLOCK_IMINRECS(level, cur); +} + +STATIC int xfs_bmbt_get_maxrecs( struct xfs_btree_cur *cur, int level) @@ -1703,12 +1323,15 @@ static const struct xfs_btree_ops xfs_bm .update_cursor = xfs_bmbt_update_cursor, .get_root_from_inode = xfs_bmbt_get_root_from_inode, .new_root = xfs_bmbt_new_root, + .kill_root = xfs_bmbt_kill_root, .realloc_root = xfs_bmbt_realloc_root, .alloc_block = xfs_bmbt_alloc_block, + .free_block = xfs_bmbt_free_block, .init_key_from_rec = xfs_bmbt_init_key_from_rec, .init_ptr_from_cur = xfs_bmbt_init_ptr_from_cur, .init_rec_from_key = xfs_bmbt_init_rec_from_key, .init_rec_from_cur = xfs_bmbt_init_rec_from_cur, + .get_minrecs = xfs_bmbt_get_minrecs, .get_maxrecs = xfs_bmbt_get_maxrecs, .get_dmaxrecs = xfs_bmbt_get_dmaxrecs, .ptr_addr = xfs_bmbt_ptr_addr, Index: linux-2.6-xfs/fs/xfs/xfs_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 16:18:46.000000000 +0200 @@ -197,6 +197,8 @@ struct xfs_btree_ops { void (*set_root)(struct xfs_btree_cur *cur, union xfs_btree_ptr *nptr, int level_change); int (*new_root)(struct xfs_btree_cur *cur, int *stat); + int (*kill_root)(struct xfs_btree_cur *cur, int level, + union xfs_btree_ptr *nptr); void (*realloc_root)(struct xfs_btree_cur *cur, int index); @@ -205,6 +207,8 @@ struct xfs_btree_ops { union xfs_btree_ptr *sbno, union xfs_btree_ptr *nbno, int length, int *stat); + int (*free_block)(struct xfs_btree_cur *cur, struct xfs_buf *bp, + int length); /* updated last record information */ void (*update_lastrec)(struct xfs_btree_cur *, @@ -220,6 +224,7 @@ struct xfs_btree_ops { struct xfs_btree_block *block); /* records in block/level */ + int (*get_minrecs)(struct xfs_btree_cur *cur, int level); int (*get_maxrecs)(struct xfs_btree_cur *cur, int level); int (*get_dmaxrecs)(struct xfs_btree_cur *cur, int level); @@ -293,6 +298,7 @@ struct xfs_btree_ops { */ #define LASTREC_UPDATE 0 #define LASTREC_INSREC 1 +#define LASTREC_DELREC 2 /* @@ -602,6 +608,7 @@ int xfs_btree_split(struct xfs_btree_cur union xfs_btree_key *, struct xfs_btree_cur **, int *); int xfs_btree_new_root(struct xfs_btree_cur *, int *); int xfs_btree_insert(struct xfs_btree_cur *, int *); +int xfs_btree_delete(struct xfs_btree_cur *, int *); /* Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c 2008-07-29 16:18:46.000000000 +0200 @@ -40,567 +40,6 @@ #include "xfs_alloc.h" #include "xfs_error.h" -STATIC void xfs_inobt_log_block(xfs_trans_t *, xfs_buf_t *, int); -STATIC void xfs_inobt_log_keys(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_inobt_log_ptrs(xfs_btree_cur_t *, xfs_buf_t *, int, int); -STATIC void xfs_inobt_log_recs(xfs_btree_cur_t *, xfs_buf_t *, int, int); - -/* - * Single level of the xfs_inobt_delete record deletion routine. - * Delete record pointed to by cur/level. - * Remove the record from its block then rebalance the tree. - * Return 0 for error, 1 for done, 2 to go on to the next level. - */ -STATIC int /* error */ -xfs_inobt_delrec( - xfs_btree_cur_t *cur, /* btree cursor */ - int level, /* level removing record from */ - int *stat) /* fail/done/go-on */ -{ - xfs_buf_t *agbp; /* buffer for a.g. inode header */ - xfs_mount_t *mp; /* mount structure */ - xfs_agi_t *agi; /* allocation group inode header */ - xfs_inobt_block_t *block; /* btree block record/key lives in */ - xfs_agblock_t bno; /* btree block number */ - xfs_buf_t *bp; /* buffer for block */ - int error; /* error return value */ - int i; /* loop index */ - xfs_inobt_key_t key; /* kp points here if block is level 0 */ - xfs_inobt_key_t *kp = NULL; /* pointer to btree keys */ - xfs_agblock_t lbno; /* left block's block number */ - xfs_buf_t *lbp; /* left block's buffer pointer */ - xfs_inobt_block_t *left; /* left btree block */ - xfs_inobt_key_t *lkp; /* left block key pointer */ - xfs_inobt_ptr_t *lpp; /* left block address pointer */ - int lrecs = 0; /* number of records in left block */ - xfs_inobt_rec_t *lrp; /* left block record pointer */ - xfs_inobt_ptr_t *pp = NULL; /* pointer to btree addresses */ - int ptr; /* index in btree block for this rec */ - xfs_agblock_t rbno; /* right block's block number */ - xfs_buf_t *rbp; /* right block's buffer pointer */ - xfs_inobt_block_t *right; /* right btree block */ - xfs_inobt_key_t *rkp; /* right block key pointer */ - xfs_inobt_rec_t *rp; /* pointer to btree records */ - xfs_inobt_ptr_t *rpp; /* right block address pointer */ - int rrecs = 0; /* number of records in right block */ - int numrecs; - xfs_inobt_rec_t *rrp; /* right block record pointer */ - xfs_btree_cur_t *tcur; /* temporary btree cursor */ - - mp = cur->bc_mp; - - /* - * Get the index of the entry being deleted, check for nothing there. - */ - ptr = cur->bc_ptrs[level]; - if (ptr == 0) { - *stat = 0; - return 0; - } - - /* - * Get the buffer & block containing the record or key/ptr. - */ - bp = cur->bc_bufs[level]; - block = XFS_BUF_TO_INOBT_BLOCK(bp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, block, level, bp))) - return error; -#endif - /* - * Fail if we're off the end of the block. - */ - - numrecs = be16_to_cpu(block->bb_numrecs); - if (ptr > numrecs) { - *stat = 0; - return 0; - } - /* - * It's a nonleaf. Excise the key and ptr being deleted, by - * sliding the entries past them down one. - * Log the changed areas of the block. - */ - if (level > 0) { - kp = XFS_INOBT_KEY_ADDR(block, 1, cur); - pp = XFS_INOBT_PTR_ADDR(block, 1, cur); -#ifdef DEBUG - for (i = ptr; i < numrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(pp[i]), level))) - return error; - } -#endif - if (ptr < numrecs) { - memmove(&kp[ptr - 1], &kp[ptr], - (numrecs - ptr) * sizeof(*kp)); - memmove(&pp[ptr - 1], &pp[ptr], - (numrecs - ptr) * sizeof(*kp)); - xfs_inobt_log_keys(cur, bp, ptr, numrecs - 1); - xfs_inobt_log_ptrs(cur, bp, ptr, numrecs - 1); - } - } - /* - * It's a leaf. Excise the record being deleted, by sliding the - * entries past it down one. Log the changed areas of the block. - */ - else { - rp = XFS_INOBT_REC_ADDR(block, 1, cur); - if (ptr < numrecs) { - memmove(&rp[ptr - 1], &rp[ptr], - (numrecs - ptr) * sizeof(*rp)); - xfs_inobt_log_recs(cur, bp, ptr, numrecs - 1); - } - /* - * If it's the first record in the block, we'll need a key - * structure to pass up to the next level (updkey). - */ - if (ptr == 1) { - key.ir_startino = rp->ir_startino; - kp = &key; - } - } - /* - * Decrement and log the number of entries in the block. - */ - numrecs--; - block->bb_numrecs = cpu_to_be16(numrecs); - xfs_inobt_log_block(cur->bc_tp, bp, XFS_BB_NUMRECS); - /* - * Is this the root level? If so, we're almost done. - */ - if (level == cur->bc_nlevels - 1) { - /* - * If this is the root level, - * and there's only one entry left, - * and it's NOT the leaf level, - * then we can get rid of this level. - */ - if (numrecs == 1 && level > 0) { - agbp = cur->bc_private.a.agbp; - agi = XFS_BUF_TO_AGI(agbp); - /* - * pp is still set to the first pointer in the block. - * Make it the new root of the btree. - */ - bno = be32_to_cpu(agi->agi_root); - agi->agi_root = *pp; - be32_add(&agi->agi_level, -1); - /* - * Free the block. - */ - if ((error = xfs_free_extent(cur->bc_tp, - XFS_AGB_TO_FSB(mp, cur->bc_private.a.agno, bno), 1))) - return error; - xfs_trans_binval(cur->bc_tp, bp); - xfs_ialloc_log_agi(cur->bc_tp, agbp, - XFS_AGI_ROOT | XFS_AGI_LEVEL); - /* - * Update the cursor so there's one fewer level. - */ - cur->bc_bufs[level] = NULL; - cur->bc_nlevels--; - } else if (level > 0 && - (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * If we deleted the leftmost entry in the block, update the - * key values above us in the tree. - */ - if (ptr == 1 && (error = xfs_btree_updkey(cur, (union xfs_btree_key *)kp, level + 1))) - return error; - /* - * If the number of records remaining in the block is at least - * the minimum, we're done. - */ - if (numrecs >= XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if (level > 0 && - (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * Otherwise, we have to move some records around to keep the - * tree balanced. Look at the left and right sibling blocks to - * see if we can re-balance by moving only one record. - */ - rbno = be32_to_cpu(block->bb_rightsib); - lbno = be32_to_cpu(block->bb_leftsib); - bno = NULLAGBLOCK; - ASSERT(rbno != NULLAGBLOCK || lbno != NULLAGBLOCK); - /* - * Duplicate the cursor so our btree manipulations here won't - * disrupt the next level up. - */ - if ((error = xfs_btree_dup_cursor(cur, &tcur))) - return error; - /* - * If there's a right sibling, see if it's ok to shift an entry - * out of it. - */ - if (rbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the last entry in the next block. - * Actually any entry but the first would suffice. - */ - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_btree_increment(tcur, level, &i))) - goto error0; - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - i = xfs_btree_lastrec(tcur, level); - XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - /* - * Grab a pointer to the block. - */ - rbp = tcur->bc_bufs[level]; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(right->bb_leftsib); - /* - * If right block is full enough so that removing one entry - * won't make it too empty, and left-shifting an entry out - * of right to us works, we're done. - */ - if (be16_to_cpu(right->bb_numrecs) - 1 >= - XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_lshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_INOBT_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level > 0 && - (error = xfs_btree_decrement(cur, level, - &i))) - return error; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference, and fix up the temp cursor to point - * to our block again (last record). - */ - rrecs = be16_to_cpu(right->bb_numrecs); - if (lbno != NULLAGBLOCK) { - xfs_btree_firstrec(tcur, level); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - } - } - /* - * If there's a left sibling, see if it's ok to shift an entry - * out of it. - */ - if (lbno != NULLAGBLOCK) { - /* - * Move the temp cursor to the first entry in the - * previous block. - */ - xfs_btree_firstrec(tcur, level); - if ((error = xfs_btree_decrement(tcur, level, &i))) - goto error0; - xfs_btree_firstrec(tcur, level); - /* - * Grab a pointer to the block. - */ - lbp = tcur->bc_bufs[level]; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); -#ifdef DEBUG - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - goto error0; -#endif - /* - * Grab the current block number, for future use. - */ - bno = be32_to_cpu(left->bb_rightsib); - /* - * If left block is full enough so that removing one entry - * won't make it too empty, and right-shifting an entry out - * of left to us works, we're done. - */ - if (be16_to_cpu(left->bb_numrecs) - 1 >= - XFS_INOBT_BLOCK_MINRECS(level, cur)) { - if ((error = xfs_btree_rshift(tcur, level, &i))) - goto error0; - if (i) { - ASSERT(be16_to_cpu(block->bb_numrecs) >= - XFS_INOBT_BLOCK_MINRECS(level, cur)); - xfs_btree_del_cursor(tcur, - XFS_BTREE_NOERROR); - if (level == 0) - cur->bc_ptrs[0]++; - *stat = 1; - return 0; - } - } - /* - * Otherwise, grab the number of records in right for - * future reference. - */ - lrecs = be16_to_cpu(left->bb_numrecs); - } - /* - * Delete the temp cursor, we're done with it. - */ - xfs_btree_del_cursor(tcur, XFS_BTREE_NOERROR); - /* - * If here, we need to do a join to keep the tree balanced. - */ - ASSERT(bno != NULLAGBLOCK); - /* - * See if we can join with the left neighbor block. - */ - if (lbno != NULLAGBLOCK && - lrecs + numrecs <= XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - /* - * Set "right" to be the starting block, - * "left" to be the left neighbor. - */ - rbno = bno; - right = block; - rrecs = be16_to_cpu(right->bb_numrecs); - rbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, lbno, 0, &lbp, - XFS_INO_BTREE_REF))) - return error; - left = XFS_BUF_TO_INOBT_BLOCK(lbp); - lrecs = be16_to_cpu(left->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, left, level, lbp))) - return error; - } - /* - * If that won't work, see if we can join with the right neighbor block. - */ - else if (rbno != NULLAGBLOCK && - rrecs + numrecs <= XFS_INOBT_BLOCK_MAXRECS(level, cur)) { - /* - * Set "left" to be the starting block, - * "right" to be the right neighbor. - */ - lbno = bno; - left = block; - lrecs = be16_to_cpu(left->bb_numrecs); - lbp = bp; - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, rbno, 0, &rbp, - XFS_INO_BTREE_REF))) - return error; - right = XFS_BUF_TO_INOBT_BLOCK(rbp); - rrecs = be16_to_cpu(right->bb_numrecs); - if ((error = xfs_btree_check_sblock(cur, right, level, rbp))) - return error; - } - /* - * Otherwise, we can't fix the imbalance. - * Just return. This is probably a logic error, but it's not fatal. - */ - else { - if (level > 0 && (error = xfs_btree_decrement(cur, level, &i))) - return error; - *stat = 1; - return 0; - } - /* - * We're now going to join "left" and "right" by moving all the stuff - * in "right" to "left" and deleting "right". - */ - if (level > 0) { - /* - * It's a non-leaf. Move keys and pointers. - */ - lkp = XFS_INOBT_KEY_ADDR(left, lrecs + 1, cur); - lpp = XFS_INOBT_PTR_ADDR(left, lrecs + 1, cur); - rkp = XFS_INOBT_KEY_ADDR(right, 1, cur); - rpp = XFS_INOBT_PTR_ADDR(right, 1, cur); -#ifdef DEBUG - for (i = 0; i < rrecs; i++) { - if ((error = xfs_btree_check_sptr(cur, be32_to_cpu(rpp[i]), level))) - return error; - } -#endif - memcpy(lkp, rkp, rrecs * sizeof(*lkp)); - memcpy(lpp, rpp, rrecs * sizeof(*lpp)); - xfs_inobt_log_keys(cur, lbp, lrecs + 1, lrecs + rrecs); - xfs_inobt_log_ptrs(cur, lbp, lrecs + 1, lrecs + rrecs); - } else { - /* - * It's a leaf. Move records. - */ - lrp = XFS_INOBT_REC_ADDR(left, lrecs + 1, cur); - rrp = XFS_INOBT_REC_ADDR(right, 1, cur); - memcpy(lrp, rrp, rrecs * sizeof(*lrp)); - xfs_inobt_log_recs(cur, lbp, lrecs + 1, lrecs + rrecs); - } - /* - * If we joined with the left neighbor, set the buffer in the - * cursor to the left block, and fix up the index. - */ - if (bp != lbp) { - xfs_btree_setbuf(cur, level, lbp); - cur->bc_ptrs[level] += lrecs; - } - /* - * If we joined with the right neighbor and there's a level above - * us, increment the cursor at that level. - */ - else if (level + 1 < cur->bc_nlevels && - (error = xfs_btree_increment(cur, level + 1, &i))) - return error; - /* - * Fix up the number of records in the surviving block. - */ - lrecs += rrecs; - left->bb_numrecs = cpu_to_be16(lrecs); - /* - * Fix up the right block pointer in the surviving block, and log it. - */ - left->bb_rightsib = right->bb_rightsib; - xfs_inobt_log_block(cur->bc_tp, lbp, XFS_BB_NUMRECS | XFS_BB_RIGHTSIB); - /* - * If there is a right sibling now, make it point to the - * remaining block. - */ - if (be32_to_cpu(left->bb_rightsib) != NULLAGBLOCK) { - xfs_inobt_block_t *rrblock; - xfs_buf_t *rrbp; - - if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, - cur->bc_private.a.agno, be32_to_cpu(left->bb_rightsib), 0, - &rrbp, XFS_INO_BTREE_REF))) - return error; - rrblock = XFS_BUF_TO_INOBT_BLOCK(rrbp); - if ((error = xfs_btree_check_sblock(cur, rrblock, level, rrbp))) - return error; - rrblock->bb_leftsib = cpu_to_be32(lbno); - xfs_inobt_log_block(cur->bc_tp, rrbp, XFS_BB_LEFTSIB); - } - /* - * Free the deleting block. - */ - if ((error = xfs_free_extent(cur->bc_tp, XFS_AGB_TO_FSB(mp, - cur->bc_private.a.agno, rbno), 1))) - return error; - xfs_trans_binval(cur->bc_tp, rbp); - /* - * Readjust the ptr at this level if it's not a leaf, since it's - * still pointing at the deletion point, which makes the cursor - * inconsistent. If this makes the ptr 0, the caller fixes it up. - * We can't use decrement because it would change the next level up. - */ - if (level > 0) - cur->bc_ptrs[level]--; - /* - * Return value means the next level up has something to do. - */ - *stat = 2; - return 0; - -error0: - xfs_btree_del_cursor(tcur, XFS_BTREE_ERROR); - return error; -} - -/* - * Log header fields from a btree block. - */ -STATIC void -xfs_inobt_log_block( - xfs_trans_t *tp, /* transaction pointer */ - xfs_buf_t *bp, /* buffer containing btree block */ - int fields) /* mask of fields: XFS_BB_... */ -{ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - static const short offsets[] = { /* table of offsets */ - offsetof(xfs_inobt_block_t, bb_magic), - offsetof(xfs_inobt_block_t, bb_level), - offsetof(xfs_inobt_block_t, bb_numrecs), - offsetof(xfs_inobt_block_t, bb_leftsib), - offsetof(xfs_inobt_block_t, bb_rightsib), - sizeof(xfs_inobt_block_t) - }; - - xfs_btree_offsets(fields, offsets, XFS_BB_NUM_BITS, &first, &last); - xfs_trans_log_buf(tp, bp, first, last); -} - -/* - * Log block pointer fields from a btree block (nonleaf). - */ -STATIC void -xfs_inobt_log_ptrs( - xfs_btree_cur_t *cur, /* btree cursor */ - xfs_buf_t *bp, /* buffer containing btree block */ - int pfirst, /* index of first pointer to log */ - int plast) /* index of last pointer to log */ -{ - xfs_inobt_block_t *block; /* btree block to log from */ - int first; /* first byte offset logged */ - int last; /* last byte offset logged */ - xfs_inobt_ptr_t *pp; /* block-pointer pointer in btree blk */ - - block = XFS_BUF_TO_INOBT_BLOCK(bp); - pp = XFS_INOBT_PTR_ADDR(block, 1, cur); - first = (int)((xfs_caddr_t)&pp[pfirst - 1] - (xfs_caddr_t)block); - last = (int)(((xfs_caddr_t)&pp[plast] - 1) - (xfs_caddr_t)block); - xfs_trans_log_buf(cur->bc_tp, bp, first, last); -} - - -/* - * Externally visible routines. - */ - -/* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -int /* error */ -xfs_inobt_delete( - xfs_btree_cur_t *cur, /* btree cursor */ - int *stat) /* success/failure */ -{ - int error; - int i; /* result code */ - int level; /* btree level */ - - /* - * Go up the tree, starting at leaf level. - * If 2 is returned then a join was done; go to the next level. - * Otherwise we are done. - */ - for (level = 0, i = 2; i == 2; level++) { - if ((error = xfs_inobt_delrec(cur, level, &i))) - return error; - } - if (i == 0) { - for (level = 1; level < cur->bc_nlevels; level++) { - if (cur->bc_ptrs[level] == 0) { - if ((error = xfs_btree_decrement(cur, level, &i))) - return error; - break; - } - } - } - *stat = i; - return 0; -} - /* * Get the data from the pointed-to record. @@ -670,6 +109,46 @@ xfs_inobt_set_root( } STATIC int +xfs_inobt_kill_root( + struct xfs_btree_cur *cur, + int level, + union xfs_btree_ptr *newroot) +{ + struct xfs_buf *agbp = cur->bc_private.a.agbp; + struct xfs_agi *agi = XFS_BUF_TO_AGI(agbp); + xfs_fsblock_t fsbno; + int error; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); + XFS_BTREE_STATS_INC(cur, killroot); + + /* + * Set the root entry in the AGI structure, decreasing the level by 1 + * and then free the old root.. + */ + xfs_inobt_set_root(cur, newroot, -1); + + fsbno = XFS_AGB_TO_FSB(cur->bc_mp, cur->bc_private.a.agno, + be32_to_cpu(agi->agi_root)); + + error = xfs_free_extent(cur->bc_tp, fsbno, 1); + if (error) { + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); + return error; + } + + XFS_BTREE_STATS_INC(cur, free); + + /* Update the cursor so there's one fewer level. */ + xfs_trans_binval(cur->bc_tp, cur->bc_bufs[level]); + cur->bc_bufs[level] = NULL; + cur->bc_nlevels--; + + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); + return 0; +} + +STATIC int xfs_inobt_alloc_block( struct xfs_btree_cur *cur, union xfs_btree_ptr *start, @@ -710,6 +189,30 @@ xfs_inobt_alloc_block( return 0; } +STATIC int +xfs_inobt_free_block( + struct xfs_btree_cur *cur, + struct xfs_buf *bp, + int size) +{ + int error; + + error = xfs_free_extent(cur->bc_tp, + XFS_DADDR_TO_FSB(cur->bc_mp, XFS_BUF_ADDR(bp)), 1); + if (error) + return error; + + xfs_trans_binval(cur->bc_tp, bp); + return 0; +} + +STATIC int +xfs_inobt_get_minrecs( + struct xfs_btree_cur *cur, + int level) +{ + return cur->bc_mp->m_inobt_mnr[level != 0]; +} STATIC int xfs_inobt_get_maxrecs( @@ -1006,7 +509,10 @@ static const struct xfs_btree_ops xfs_in .dup_cursor = xfs_inobt_dup_cursor, .set_root = xfs_inobt_set_root, .new_root = xfs_btree_new_root, + .kill_root = xfs_inobt_kill_root, .alloc_block = xfs_inobt_alloc_block, + .free_block = xfs_inobt_free_block, + .get_minrecs = xfs_inobt_get_minrecs, .get_maxrecs = xfs_inobt_get_maxrecs, .init_key_from_rec = xfs_inobt_init_key_from_rec, .init_ptr_from_cur = xfs_inobt_init_ptr_from_cur, Index: linux-2.6-xfs/fs/xfs/xfs_alloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-29 16:18:46.000000000 +0200 @@ -398,7 +398,7 @@ xfs_alloc_fixup_trees( /* * Delete the entry from the by-size btree. */ - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); /* @@ -427,7 +427,7 @@ xfs_alloc_fixup_trees( /* * No remaining freespace, just delete the by-block tree entry. */ - if ((error = xfs_alloc_delete(bno_cur, &i))) + if ((error = xfs_btree_delete(bno_cur, &i))) return error; XFS_WANT_CORRUPTED_RETURN(i == 1); } else { @@ -1651,7 +1651,7 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* @@ -1660,13 +1660,13 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* * Delete the old by-block entry for the right block. */ - if ((error = xfs_alloc_delete(bno_cur, &i))) + if ((error = xfs_btree_delete(bno_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* @@ -1711,7 +1711,7 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, ltbno, ltlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* @@ -1737,7 +1737,7 @@ xfs_free_ag_extent( if ((error = xfs_alloc_lookup_eq(cnt_cur, gtbno, gtlen, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); - if ((error = xfs_alloc_delete(cnt_cur, &i))) + if ((error = xfs_btree_delete(cnt_cur, &i))) goto error0; XFS_WANT_CORRUPTED_GOTO(i == 1, error0); /* Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.h 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.h 2008-07-29 16:18:46.000000000 +0200 @@ -95,13 +95,6 @@ typedef struct xfs_btree_sblock xfs_allo XFS_BTREE_PTR_ADDR(xfs_alloc, bb, i, XFS_ALLOC_BLOCK_MAXRECS(1, cur)) /* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -extern int xfs_alloc_delete(struct xfs_btree_cur *cur, int *stat); - -/* * Get the data from the pointed-to record. */ extern int xfs_alloc_get_rec(struct xfs_btree_cur *cur, xfs_agblock_t *bno, Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c 2008-07-29 16:18:46.000000000 +0200 @@ -864,7 +864,7 @@ xfs_bmap_add_extent_delay_real( RIGHT.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -1425,13 +1425,13 @@ xfs_bmap_add_extent_unwritten_real( RIGHT.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -1474,7 +1474,7 @@ xfs_bmap_add_extent_unwritten_real( &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -1517,7 +1517,7 @@ xfs_bmap_add_extent_unwritten_real( RIGHT.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -2152,7 +2152,7 @@ xfs_bmap_add_extent_hole_real( right.br_blockcount, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); if ((error = xfs_btree_decrement(cur, 0, &i))) @@ -3216,7 +3216,7 @@ xfs_bmap_del_extent( flags |= XFS_ILOG_FEXT(whichfork); break; } - if ((error = xfs_bmbt_delete(cur, &i))) + if ((error = xfs_btree_delete(cur, &i))) goto done; XFS_WANT_CORRUPTED_GOTO(i == 1, done); break; Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h 2008-07-29 16:18:46.000000000 +0200 @@ -237,7 +237,6 @@ typedef struct xfs_btree_lblock xfs_bmbt * Prototypes for xfs_bmap.c to call. */ extern void xfs_bmdr_to_bmbt(xfs_bmdr_block_t *, int, xfs_bmbt_block_t *, int); -extern int xfs_bmbt_delete(struct xfs_btree_cur *, int *); extern void xfs_bmbt_get_all(xfs_bmbt_rec_host_t *r, xfs_bmbt_irec_t *s); extern xfs_bmbt_block_t *xfs_bmbt_get_block(struct xfs_btree_cur *cur, int, struct xfs_buf **bpp); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c 2008-07-29 16:18:46.000000000 +0200 @@ -1168,8 +1168,8 @@ xfs_difree( xfs_trans_mod_sb(tp, XFS_TRANS_SB_ICOUNT, -ilen); xfs_trans_mod_sb(tp, XFS_TRANS_SB_IFREE, -(ilen - 1)); - if ((error = xfs_inobt_delete(cur, &i))) { - cmn_err(CE_WARN, "xfs_difree: xfs_inobt_delete returned an error %d on %s.\n", + if ((error = xfs_btree_delete(cur, &i))) { + cmn_err(CE_WARN, "xfs_difree: xfs_btree_delete returned an error %d on %s.\n", error, mp->m_fsname); goto error0; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h 2008-07-29 16:15:54.000000000 +0200 +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h 2008-07-29 16:18:46.000000000 +0200 @@ -117,13 +117,6 @@ typedef struct xfs_btree_sblock xfs_inob i, XFS_INOBT_BLOCK_MAXRECS(1, cur))) /* - * Delete the record pointed to by cur. - * The cursor refers to the place where the record was (could be inserted) - * when the operation returns. - */ -extern int xfs_inobt_delete(struct xfs_btree_cur *cur, int *stat); - -/* * Get the data from the pointed-to record. */ extern int xfs_inobt_get_rec(struct xfs_btree_cur *cur, xfs_agino_t *ino, -- From owner-xfs@oss.sgi.com Tue Jul 29 17:52:52 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 17:52:59 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U0qp0o005302 for ; Tue, 29 Jul 2008 17:52:51 -0700 X-ASG-Debug-ID: 1217379240-0eb302b40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 053401BBD985 for ; Tue, 29 Jul 2008 17:54:00 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id zbmLHadZW0PixDWX for ; Tue, 29 Jul 2008 17:54:00 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAClYj0h5LDlw/2dsb2JhbACLH6Yf X-IronPort-AV: E=Sophos;i="4.31,275,1215354600"; d="scan'208";a="160202354" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 10:23:40 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KNzwh-0004tF-1x; Wed, 30 Jul 2008 10:53:39 +1000 Date: Wed, 30 Jul 2008 10:53:39 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 00/21] btree cleanups and unification Subject: Re: [PATCH 00/21] btree cleanups and unification Message-ID: <20080730005338.GG13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193000.GA19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193000.GA19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217379244 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1243 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17263 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:30:00PM +0200, Christoph Hellwig wrote: > This is the full btree unficiation based on Dave's initial patches plus > various cleanups. This second versions post now contains the complete > btree refactoring, and passes XFSQA. Cool. Are the first few patches unchanged from the ones I reviewed earlier? > The real news is the missing btree operations, including all the hairy > ones. These have been reimplemented looking at the three original > btrees and Daves code, in doubt going with the former. That means the > small helpers to insert/remove/move records are gone now in favour of > following the original code more closely. This fixed the one off error > showing up in the intial refactoring. I'll have a close look at this ;) > There's a lot of new comments and empty lines, so by diffstat the new > code isn't all that much smaller: > > 36 files changed, 6041 insertions(+), 7128 deletions(-) 'bout the same as my original change series... > but the (debug) binary modules is almost 15kb smaller: > > text data bss dec hex filename > 631577 4227 3092 638896 9bfb0 fs/xfs/xfs.ko.old > 616929 4435 3124 624488 98768 fs/xfs/xfs.ko.btree And again, roughly the same. The difference will really be seen when we implement new btrees..... Cheers,, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 17:53:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 17:53:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U0riNT005476 for ; Tue, 29 Jul 2008 17:53:44 -0700 X-ASG-Debug-ID: 1217379295-19c901740000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 29196ECFFDE for ; Tue, 29 Jul 2008 17:54:56 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id afyojEOjL7zgg7Ok for ; Tue, 29 Jul 2008 17:54:56 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAClYj0h5LDlw/2dsb2JhbACLH6Yf X-IronPort-AV: E=Sophos;i="4.31,275,1215354600"; d="scan'208";a="160202993" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 10:24:25 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KNzxR-0004uH-5Q; Wed, 30 Jul 2008 10:54:25 +1000 Date: Wed, 30 Jul 2008 10:54:25 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com, Dave Chinner X-ASG-Orig-Subj: Re: [PATCH 07/21] add new btree statistics Subject: Re: [PATCH 07/21] add new btree statistics Message-ID: <20080730005425.GH13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com, Dave Chinner References: <20080729193039.GH19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193039.GH19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217379297 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1242 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17264 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:30:39PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > Introduce statistics coverage of all the btrees and cover > all the btree operations, not just some. > > Invaluable for determining test code coverage of all the btree > operations.... > > > Signed-off-by: Dave Chinner > Signed-off-by: Christoph Hellwig Still looks fine to me ;) Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 18:38:14 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 18:38:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_64 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U1cEwZ009861 for ; Tue, 29 Jul 2008 18:38:14 -0700 X-ASG-Debug-ID: 1217381966-19c8039c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6DB54ED090D for ; Tue, 29 Jul 2008 18:39:26 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 1h59Ma1tvQ7aaFYU for ; Tue, 29 Jul 2008 18:39:26 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEANdij0h5LDlw/2dsb2JhbACLH6VZ X-IronPort-AV: E=Sophos;i="4.31,275,1215354600"; d="scan'208";a="160238572" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 11:09:22 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO0eu-0005vt-P0; Wed, 30 Jul 2008 11:39:20 +1000 Date: Wed, 30 Jul 2008 11:39:20 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 08/21] make btree tracing generic Subject: Re: [PATCH 08/21] make btree tracing generic Message-ID: <20080730013920.GI13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193044.GI19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193044.GI19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217381967 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1246 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17265 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:30:44PM +0200, Christoph Hellwig wrote: > make the existing bmap btree tracing generic so that it applies to all > btree types. > > Some fragments lifted from a patch by Dave Chinner. > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.h > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-29 16:23:23.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-29 16:52:06.000000000 +0200 > @@ -190,6 +190,25 @@ struct xfs_btree_ops { > > /* get inode rooted btree root */ > struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); > + > + /* btree tracing */ > +#ifdef XFS_BTREE_TRACE > + void (*trace_enter)(struct xfs_btree_cur *, const char *, > + char *, int, int, __psunsigned_t, > + __psunsigned_t, __psunsigned_t, > + __psunsigned_t, __psunsigned_t, > + __psunsigned_t, __psunsigned_t, > + __psunsigned_t, __psunsigned_t, > + __psunsigned_t, __psunsigned_t); Would it be better to use a 'trace args' structure here rather than passing a heap of parameters? memset(args, 0,...) rather than passing a whole heap of zeros in most cases seems like a better approach to me, esp. as they all get cast to (void *) anyway.... > +static void > +xfsidb_btree_trace_record( shouldn't these all use "xfsidbg" prefixes? Otherwise looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 19:06:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 19:06:29 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U26MMl012415 for ; Tue, 29 Jul 2008 19:06:25 -0700 X-ASG-Debug-ID: 1217383652-37f203240000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id B7A5715ED317 for ; Tue, 29 Jul 2008 19:07:33 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id wiZ9w12wfbUNo2pz for ; Tue, 29 Jul 2008 19:07:33 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAN9pj0h5LDlw/2dsb2JhbACLH6VD X-IronPort-AV: E=Sophos;i="4.31,276,1215354600"; d="scan'208";a="160262097" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 11:36:57 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO15W-0006Xp-VB; Wed, 30 Jul 2008 12:06:50 +1000 Date: Wed, 30 Jul 2008 12:06:45 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 09/21] implement generic xfs_btree_increment Subject: Re: [PATCH 09/21] implement generic xfs_btree_increment Message-ID: <20080730020645.GJ13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193053.GJ19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193053.GJ19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217383654 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.02, rules version 3.0.82708 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17266 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:30:53PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > Because this is the first major generic btree routine this patch > includes some infrastrucure, fistly a few routines to deal with > a btree block that can be either in short or long form, and secondly > xfs_btree_read_buf_block, which is the new central routine to read > a btree block given a cursor. > > [hch: split out from bigger patch and minor adaptions] > > Signed-off-by: Christoph Hellwig ..... > @@ -502,6 +506,23 @@ xfs_btree_setbuf( > int lev, /* level in btree */ > struct xfs_buf *bp); /* new buffer to set */ > > +/* > + * Common btree core entry points. > + */ > + > +int xfs_btree_increment(struct xfs_btree_cur *, int, int *); I think for these interfaces it woul dbe better to include variable names in the prototypes. i.e.: int xfs_btree_increment(struct xfs_btree_cur *cur, int level, int *stat); > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 04:41:51.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 06:47:21.000000000 +0200 > @@ -35,6 +35,7 @@ > #include "xfs_dinode.h" > #include "xfs_inode.h" > #include "xfs_btree.h" > +#include "xfs_btree_trace.h" > #include "xfs_ialloc.h" > #include "xfs_error.h" > > @@ -829,3 +830,230 @@ xfs_btree_setbuf( > cur->bc_ra[lev] |= XFS_BTCUR_RIGHTRA; > } > } > + > +STATIC int > +xfs_btree_ptr_is_null( > + struct xfs_btree_cur *cur, > + union xfs_btree_ptr *ptr) > +{ > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) > + return be64_to_cpu(ptr->l) == NULLFSBLOCK; > + else > + return be32_to_cpu(ptr->s) == NULLAGBLOCK; Can kill the else there: if (cur->bc_flags & XFS_BTREE_LONG_PTRS) return be64_to_cpu(ptr->l) == NULLFSBLOCK; return be32_to_cpu(ptr->s) == NULLAGBLOCK; > +} > + > +/* > + * Get/set/init sibling pointers > + */ > +STATIC void > +xfs_btree_get_sibling( > + struct xfs_btree_cur *cur, > + struct xfs_btree_block *block, > + union xfs_btree_ptr *ptr, > + int lr) > +{ > + ASSERT(lr == XFS_BB_LEFTSIB || lr == XFS_BB_RIGHTSIB); > + > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { > + if (lr == XFS_BB_RIGHTSIB) > + ptr->l = block->bb_u.l.bb_rightsib; > + else > + ptr->l = block->bb_u.l.bb_leftsib; > + } else { > + if (lr == XFS_BB_RIGHTSIB) > + ptr->s = block->bb_u.s.bb_rightsib; > + else > + ptr->s = block->bb_u.s.bb_leftsib; > + } > +} Should we use trinary notation for this? i.e: { ASSERT(lr == XFS_BB_LEFTSIB || lr == XFS_BB_RIGHTSIB); if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { ptr->l = (lr == XFS_BB_RIGHTSIB) ? block->bb_u.l.bb_rightsib : block->bb_u.l.bb_leftsib; } else { ptr->s = (lr == XFS_BB_RIGHTSIB) ? block->bb_u.s.bb_rightsib : block->bb_u.s.bb_leftsib; } } > +STATIC xfs_daddr_t > +xfs_btree_ptr_to_daddr( > + struct xfs_btree_cur *cur, > + union xfs_btree_ptr *ptr) > +{ > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { > + ASSERT(be64_to_cpu(ptr->l) != NULLFSBLOCK); > + > + return XFS_FSB_TO_DADDR(cur->bc_mp, be64_to_cpu(ptr->l)); > + } else { > + ASSERT(cur->bc_private.a.agno != NULLAGNUMBER); > + ASSERT(be32_to_cpu(ptr->s) != NULLAGBLOCK); > + > + return XFS_AGB_TO_DADDR(cur->bc_mp, cur->bc_private.a.agno, > + be32_to_cpu(ptr->s)); > + } > +} Can kill the else here as well... > +/* > + * Read in the buffer at the given ptr and return the buffer and > + * the block pointer within the buffer. > + */ > +STATIC int > +xfs_btree_read_buf_block( > + struct xfs_btree_cur *cur, > + union xfs_btree_ptr *ptr, > + int level, > + int flags, > + struct xfs_btree_block **block, > + struct xfs_buf **bpp) > +{ > + struct xfs_mount *mp = cur->bc_mp; > + xfs_daddr_t d; > + int error; > + > + /* need to sort out how callers deal with failures first */ > + ASSERT(!(flags & XFS_BUF_TRYLOCK)); > + > + d = xfs_btree_ptr_to_daddr(cur, ptr); > + error = xfs_trans_read_buf(mp, cur->bc_tp, mp->m_ddev_targp, d, > + mp->m_bsize, flags, bpp); > + if (error) > + return error; > + > + ASSERT(*bpp != NULL); > + ASSERT(!XFS_BUF_GETERROR(*bpp)); > + > + xfs_btree_set_refs(cur, *bpp); > + *block = XFS_BUF_TO_BLOCK(*bpp); > + > + return xfs_btree_check_block(cur, *block, level, *bpp); > +} Hmmm - if xfs_btree_check_block() returns an error, we won't release the buffer in the error handling path. While this may not be a problem right now (as the only error is EFSCORRUPTED) we want to be able to recover from errors here in the future so we should really exit cleanly form this function.... > +/* > + * Increment cursor by one record at the level. > + * For nonzero levels the leaf-ward information is untouched. > + */ > +int /* error */ > +xfs_btree_increment( > + struct xfs_btree_cur *cur, > + int level, > + int *stat) /* success/failure */ > +{ ..... > + /* > + * If we went off the root then we are either seriously > + * confused or have the tree root in an inode. > + */ > + if (lev == cur->bc_nlevels) { > + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); > + goto out0; > + } Would it be better here to explicitly test this rather than assert? ie.: if (lev == cur->bc_nlevels) { if (cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) goto out0; ASSERT(0); error = EFSCORRUPTED; goto error0; } So that we get an explicit error reported in the production systems rather than carrying on and dying a horrible death somewhere else.... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 19:08:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 19:08:18 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U28FCt012816 for ; Tue, 29 Jul 2008 19:08:15 -0700 X-ASG-Debug-ID: 1217383767-69d2030e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 782F633FBC7 for ; Tue, 29 Jul 2008 19:09:27 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id r7ZQMu2GYb15QRCC for ; Tue, 29 Jul 2008 19:09:27 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAN9pj0h5LDlw/2dsb2JhbACLH6VD X-IronPort-AV: E=Sophos;i="4.31,276,1215354600"; d="scan'208";a="160264029" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 11:39:22 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO17v-0006b3-Gi; Wed, 30 Jul 2008 12:09:19 +1000 Date: Wed, 30 Jul 2008 12:09:19 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 10/21] implement generic xfs_btree_decrement Subject: Re: [PATCH 10/21] implement generic xfs_btree_decrement Message-ID: <20080730020919.GK13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193058.GK19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193058.GK19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217383768 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.02, rules version 3.0.82708 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17267 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:30:58PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > [hch: split out from bigger patch and minor adaptions] > > Signed-off-by: Christoph Hellwig .... > + /* > + * If we went off the root then we are seriously confused. > + * or the root of the tree is in an inode. > + */ > + if (lev == cur->bc_nlevels) { > + ASSERT(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE); > + goto out0; > + } Same question as for the increment case. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 21:58:30 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 21:58:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_65, RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U4wTaT031062 for ; Tue, 29 Jul 2008 21:58:29 -0700 X-ASG-Debug-ID: 1217393980-153801fc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 55A631950AC2 for ; Tue, 29 Jul 2008 21:59:41 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id QziVnpyF2DJJxDRp for ; Tue, 29 Jul 2008 21:59:41 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAJCQj0h5LDlw/2dsb2JhbACLH6Un X-IronPort-AV: E=Sophos;i="4.31,276,1215354600"; d="scan'208";a="160379209" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 14:29:39 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO3mj-0001t6-Ou; Wed, 30 Jul 2008 14:59:37 +1000 Date: Wed, 30 Jul 2008 14:59:37 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 11/21] implement generic xfs_btree_lookup Subject: Re: [PATCH 11/21] implement generic xfs_btree_lookup Message-ID: <20080730045937.GL13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193104.GL19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193104.GL19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217393982 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1259 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17268 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:04PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > [hch: split out from bigger patch and minor adaptions] > > > Signed-off-by: Christoph Hellwig ..... > + > +/* > + * Get current search key. For level 0 we don't actually have a key > + * structure so we make one up from the record. For all other levels > + * we just return the right key. > + */ > +STATIC union xfs_btree_key * > +xfs_lookup_get_search_key( > + struct xfs_btree_cur *cur, > + int level, > + int keyno, > + struct xfs_btree_block *block, > + union xfs_btree_key *kp) > +{ > + if (level == 0) { > + union xfs_btree_rec *krp; > + > + krp = cur->bc_ops->rec_addr(cur, keyno, block); > + cur->bc_ops->init_key_from_rec(cur, kp, krp); > + return kp; I think the record pointer variable "krp" is confusing with "kp", the key pointer. It's a record pointer; 'rp' it should be. > + /* > + * Iterate over each level in the btree, starting at the root. > + * For each level above the leaves, find the key we need, based > + * on the lookup record, then follow the corresponding block > + * pointer down to the next level. > + */ > + for (level = cur->bc_nlevels - 1, diff = 1; level >= 0; level--) { > + /* Get the block we need to do the lookup on. */ > + error = xfs_btree_lookup_get_block(cur, level, pp, &block); > + if (error) > + goto error0; > + > + /* > + * If we already had a key match at a higher level, we know > + * we need to use the first entry in this block. > + */ > + if (diff == 0) > + keyno = 1; > + > + /* Otherwise search this block. Do a binary search. */ > + else { Can you make the {} consistent here ant move the comment for the else? i.e. if (diff == 0) { keyno = 1; } else { /* Otherwise search this block. Do a binary search. */ > + int high; /* high entry number */ > + int low; /* low entry number */ > + > + /* Set low and high entry numbers, 1-based. */ > + low = 1; > + high = xfs_btree_get_numrecs(block); > + if (!high) { > + /* Block is empty, must be an empty leaf. */ > + ASSERT(level == 0 && cur->bc_nlevels == 1); > + cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; > + XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); > + *stat = 0; > + return 0; > + } > + /* Binary search the block. */ Can we add a couple of empty lines there to break up that code a bit? high = xfs_btree_get_numrecs(block); if (!high) { /* Block is empty, must be an empty leaf. */ ASSERT(level == 0 && cur->bc_nlevels == 1); cur->bc_ptrs[0] = dir != XFS_LOOKUP_LE; XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); *stat = 0; return 0; } /* Binary search the block. */ > + /* Return if we succeeded or not. */ > + if (keyno == 0 || keyno > xfs_btree_get_numrecs(block)) > + *stat = 0; > + else > + *stat = ((dir != XFS_LOOKUP_EQ) || (diff == 0)); Can probably kill all the extra () in that. > --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc.c 2008-07-15 17:46:52.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_alloc.c 2008-07-15 17:51:41.000000000 +0200 > @@ -90,6 +90,54 @@ STATIC int xfs_alloc_ag_vextent_small(xf > */ > > /* > + * Lookup the record equal to [bno, len] in the btree given by cur. > + */ > +STATIC int /* error */ > +xfs_alloc_lookup_eq( Should these be xfs_allocbt_lookup_*() to be consistent with all the other allocbt functions (and inobt_lookup/bmbt_lookup)? Otherwise look sane. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 22:08:39 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 22:08:41 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U58csv032119 for ; Tue, 29 Jul 2008 22:08:39 -0700 X-ASG-Debug-ID: 1217394589-0bce03600000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id D8B1019530B8 for ; Tue, 29 Jul 2008 22:09:49 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id GIsPsMn5QOBYpmOZ for ; Tue, 29 Jul 2008 22:09:49 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAA+Uj0h5LDlw/2dsb2JhbACLH6Ua X-IronPort-AV: E=Sophos;i="4.31,277,1215354600"; d="scan'208";a="160385730" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 14:39:41 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO3wO-00026z-Kz; Wed, 30 Jul 2008 15:09:36 +1000 Date: Wed, 30 Jul 2008 15:09:36 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 12/21] implement generic xfs_btree_updkey Subject: Re: [PATCH 12/21] implement generic xfs_btree_updkey Message-ID: <20080730050936.GM13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193110.GM19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193110.GM19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217394590 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1259 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17269 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:10PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > Note that there are many > 80 char lines introduced due to the > xfs_btree_key casts. But the places where this happens is throw-away > code once the whole btree code gets merged into a common implementation. > > The same is true for the temporary xfs_alloc_log_keys define to the new > name. All old users will be gone after a few patches. > > [hch: split out from bigger patch and minor adaptions] > > Signed-off-by: Christoph Hellwig ..... > +/* > + * Update keys at all levels from here to the root along the cursor's path. > + */ > +int > +xfs_btree_updkey( > + struct xfs_btree_cur *cur, > + union xfs_btree_key *keyp, > + int level) > +{ > + struct xfs_btree_block *block; > + struct xfs_buf *bp; > + union xfs_btree_key *kp; > + int ptr; > +#ifdef DEBUG > + int error; > +#endif This can be scoped inside the for loop. > + > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > + XFS_BTREE_TRACE_ARGIK(cur, level, keyp); > + > + ASSERT(!(cur->bc_flags & XFS_BTREE_ROOT_IN_INODE) || level >= 1); > + > + /* > + * Go up the tree from this level toward the root. > + * At each level, update the key value to the value input. > + * Stop when we reach a level where the cursor isn't pointing > + * at the first entry in the block. > + */ > + for (ptr = 1; ptr == 1 && level < cur->bc_nlevels; level++) { > + block = xfs_btree_get_block(cur, level, &bp); > +#ifdef DEBUG > + error = xfs_btree_check_block(cur, block, level, bp); > + if (error) { > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); > + return error; > + } > +#endif And even then I think we might not need an error variable - it can only return EFSCORRUPTED, so: #ifdef DEBUG if (xfs_btree_check_block(cur, block, level, bp)) { XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); return EFSCORRUPTED; } #endif Would remove the need for the error variable. Otherwise looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 22:29:25 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 22:29:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U5TPoZ001406 for ; Tue, 29 Jul 2008 22:29:25 -0700 X-ASG-Debug-ID: 1217395834-155602cc0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 75DD81953168 for ; Tue, 29 Jul 2008 22:30:35 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id HnvdSBYrpjZWFzOD for ; Tue, 29 Jul 2008 22:30:35 -0700 (PDT) Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 15:00:00 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO4G7-0002YJ-AQ; Wed, 30 Jul 2008 15:29:59 +1000 Date: Wed, 30 Jul 2008 15:29:59 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 13/21] implement generic xfs_btree_update Subject: Re: [PATCH 13/21] implement generic xfs_btree_update Message-ID: <20080730052959.GN13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193116.GN19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080729193116.GN19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217395836 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1261 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17270 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:16PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > The most complicated part here is the lastrec tracking for > the alloc btree. Most logic is in the update_lastrec method > which has to do some hopefully good enough dirty magic to > maintain it. > > [hch: split out from bigger patch and a rework of the lastrec > logic] > > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-21 05:10:43.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-21 05:24:20.000000000 +0200 > @@ -867,6 +867,30 @@ xfs_btree_get_sibling( > } > } > > +/* > + * Return true if ptr is the last record in the btree and > + * we need to track updateÑ• to this record. The decision > + * will be further refined in the update_lastrec method. > + */ > +STATIC int > +xfs_btree_is_lastrec( > + struct xfs_btree_cur *cur, > + struct xfs_btree_block *block, > + int level) > +{ > + union xfs_btree_ptr ptr; > + > + if (level > 0) > + return 0; > + if (!(cur->bc_flags & XFS_BTREE_LASTREC_UPDATE)) > + return 0; > + > + xfs_btree_get_sibling(cur, block, &ptr, XFS_BB_RIGHTSIB); > + if (!xfs_btree_ptr_is_null(cur, &ptr)) > + return 0; > + return 1; > +} That is not checking if it's the last record - it's checking if it is the rightmost block in the btree. i.e. if the block contains the last record. If the code is to remain this way, that needs renaming. > + > STATIC struct xfs_btree_block * > xfs_btree_buf_to_block( > struct xfs_btree_cur *cur, > @@ -1417,3 +1441,66 @@ xfs_btree_updkey( > XFS_BTREE_TRACE_CURSOR(cur, XBT_EXIT); > return 0; > } > + > +/* > + * Update the record referred to by cur to the value in the > + * given record. This either works (return 0) or gets an > + * EFSCORRUPTED error. > + */ > +int > +xfs_btree_update( > + struct xfs_btree_cur *cur, > + union xfs_btree_rec *rec) > +{ > + struct xfs_btree_block *block; > + struct xfs_buf *bp; > + int error; > + int ptr; > + union xfs_btree_rec *rp; > + > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > + XFS_BTREE_TRACE_ARGR(cur, rec); > + > + /* Pick up the current block. */ > + block = xfs_btree_get_block(cur, 0, &bp); > + > +#ifdef DEBUG > + error = xfs_btree_check_block(cur, block, 0, bp); > + if (error) > + goto error0; > +#endif > + /* Get the address of the rec to be updated. */ > + ptr = cur->bc_ptrs[0]; > + rp = cur->bc_ops->rec_addr(cur, ptr, block); > + > + /* Fill in the new contents and log them. */ > + cur->bc_ops->copy_recs(cur, rec, rp, 1); > + cur->bc_ops->log_recs(cur, bp, ptr, ptr); > + > + /* > + * If we are tracking the last record in the tree and > + * we are at the far right edge of the tree, update it. > + */ > + if (xfs_btree_is_lastrec(cur, block, 0)) { > + cur->bc_ops->update_lastrec(cur, block, rec, > + ptr, LASTREC_UPDATE); > + } So this will update the last record on any update to a record in the last block. Seeing as we will typically be allocating out of the last block (where the biggest extents are) this is somewhat additional overhead, right? This is the code that used to trigger the update: /* * If it's the by-size btree and it's the last leaf block and * it's the last record... then update the size of the longest * extent in the a.g., which we cache in the a.g. freelist header. */ if (cur->bc_btnum == XFS_BTNUM_CNT && be32_to_cpu(block->bb_rightsib) == NULLAGBLOCK && ptr == be16_to_cpu(block->bb_numrecs)) { So it's clear we aren't doing the same check here. My original code had the ptr check in it. Why did you drop it? > +STATIC void > +xfs_allocbt_update_lastrec( > + struct xfs_btree_cur *cur, > + struct xfs_btree_block *block, > + union xfs_btree_rec *rec, > + int ptr, > + int reason) > { ..... > + struct xfs_agf *agf = XFS_BUF_TO_AGF(cur->bc_private.a.agbp); > + xfs_agnumber_t seqno = be32_to_cpu(agf->agf_seqno); > + __be32 len; > ..... > + ASSERT(cur->bc_btnum == XFS_BTNUM_CNT); > ..... > + switch (reason) { > + case LASTREC_UPDATE: > /* ..... > + * If this is the last leaf block and it's the last record, > + * then update the size of the longest extent in the AG. > */ ..... > + if (ptr != xfs_btree_get_numrecs(block)) > + return; > + len = rec->alloc.ar_blockcount; > + break; > + default: > + ASSERT(0); > + return; > } Oh, it's be moved inside the update code itself. So, why always call the update function and then check the ptr? Why not the way it was originally done? > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.h 2008-07-21 05:11:01.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.h 2008-07-21 05:23:07.000000000 +0200 > @@ -191,6 +191,11 @@ struct xfs_btree_ops { > /* get inode rooted btree root */ > struct xfs_btree_block *(*get_root_from_inode)(struct xfs_btree_cur *); > > + /* updated last record information */ > + void (*update_lastrec)(struct xfs_btree_cur *, > + struct xfs_btree_block *, > + union xfs_btree_rec *, int, int); Can you add the variable names to the prototype parameters? Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 22:33:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 22:33:51 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U5Xnj1002002 for ; Tue, 29 Jul 2008 22:33:50 -0700 X-ASG-Debug-ID: 1217396100-189c02d20000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0957C19531BC for ; Tue, 29 Jul 2008 22:35:01 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id i6LbPVNRQmjVx0UG for ; Tue, 29 Jul 2008 22:35:01 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAJiXj0h5LDlw/2dsb2JhbACLH6UV X-IronPort-AV: E=Sophos;i="4.31,277,1215354600"; d="scan'208";a="160407085" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 15:04:56 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO4Kt-0002er-6a; Wed, 30 Jul 2008 15:34:55 +1000 Date: Wed, 30 Jul 2008 15:34:55 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 14/21] add get_maxrecs btree operation Subject: Re: [PATCH 14/21] add get_maxrecs btree operation Message-ID: <20080730053455.GO13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193121.GO19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193121.GO19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217396102 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1261 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17271 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:21PM +0200, Christoph Hellwig wrote: > Factor xfs_btree_maxrecs into a per-btree operation. > > > Signed-off-by: Christoph Hellwig ->get_maxrecs was extracted out of my original patchset, right? I didn't apply it to removing xfs_btree_maxrecs(), though. Good idea. Looks fine to me. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 23:07:06 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 23:07:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_64,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U675SS004297 for ; Tue, 29 Jul 2008 23:07:06 -0700 X-ASG-Debug-ID: 1217398097-064b00730000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AFD1619531CF for ; Tue, 29 Jul 2008 23:08:17 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id IB36CGeu8OEgOEvS for ; Tue, 29 Jul 2008 23:08:17 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAC+ij0h5LDlw/2dsb2JhbACLH6Rv X-IronPort-AV: E=Sophos;i="4.31,277,1215354600"; d="scan'208";a="160427618" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 15:38:10 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO4r2-0003NK-Fi; Wed, 30 Jul 2008 16:08:08 +1000 Date: Wed, 30 Jul 2008 16:08:08 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 15/21] implement generic xfs_btree_rshift Subject: Re: [PATCH 15/21] implement generic xfs_btree_rshift Message-ID: <20080730060808.GP13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193125.GP19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193125.GP19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217398098 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1263 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17272 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:25PM +0200, Christoph Hellwig wrote: > Make the btree right shift code generic. Based on a patch from David Chinner > with lots of changes to follow the original btree implementations more > closely. While this loses some of the generic helper routines for > inserting/moving/removing records it also solves some of the one off > bugs in the original code and makes it easier to verify. Looks good. A few comments below. > > Signed-off-by: Christoph Hellwig > > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-27 17:40:52.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-28 16:13:33.000000000 +0200 > @@ -34,6 +34,7 @@ > #include "xfs_attr_sf.h" > #include "xfs_dinode.h" > #include "xfs_inode.h" > +#include "xfs_inode_item.h" > #include "xfs_btree.h" > #include "xfs_btree_trace.h" > #include "xfs_ialloc.h" > @@ -952,6 +953,123 @@ xfs_btree_read_buf_block( > return xfs_btree_check_block(cur, *block, level, *bpp); > } > > +STATIC void > +xfs_btree_move_ptrs( > + struct xfs_btree_cur *cur, > + union xfs_btree_ptr *base, > + int from, > + int to, > + int numptrs) > +{ > + ASSERT(from >= 0 && from <= 1000); > + ASSERT(to >= 0 && to <= 1000); > + ASSERT(numptrs >= 0); Those numbers are not safe. I plucked them out of thin air to verify validity on 4k block size filesystem which had (IIRC) a max of about 500 ptrs to a block. It was throwaway debug code to find a problem. Larger block sizes can well exceed 1000. So realistically, the only valid assert there is this one: ASSERT(numptrs >= 0); > +/* > + * Log block pointer fields from a btree block (nonleaf). > + */ > +STATIC void > +xfs_btree_log_ptrs( > + struct xfs_btree_cur *cur, /* btree cursor */ > + struct xfs_buf *bp, /* buffer containing btree block */ > + int pfirst, /* index of first pointer to log */ > + int plast) /* index of last pointer to log */ I'd call these first/last (being indexes), and these: > +{ > + > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > + XFS_BTREE_TRACE_ARGBII(cur, bp, pfirst, plast); > + > + if (bp) { > + struct xfs_btree_block *block = XFS_BUF_TO_BLOCK(bp); > + union xfs_btree_ptr *pp; > + int first; /* first byte offset logged */ > + int last; /* last byte offset logged */ start/end because they are byte range identifiers. > + > + pp = cur->bc_ops->ptr_addr(cur, 1, block); > + > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { > + __be64 *lpp = &pp->l; > + > + first = (int)((xfs_caddr_t)&lpp[pfirst - 1] - > + (xfs_caddr_t)block); > + last = (int)(((xfs_caddr_t)&lpp[plast] - 1) - > + (xfs_caddr_t)block); > + } else { > + __be32 *spp = &pp->s; > + > + first = (int)((xfs_caddr_t)&spp[pfirst - 1] - > + (xfs_caddr_t)block); > + last = (int)(((xfs_caddr_t)&spp[plast] - 1) - > + (xfs_caddr_t)block); Hmmmm. That's not very nice with all those casts. It's clear that it's pointer arithmetic, but rather messy. > + } > + > + xfs_trans_log_buf(cur->bc_tp, bp, first, last); How about: union xfs_btree_ptr *pp; xfs_caddr_t *block = XFS_BUF_TO_BLOCK(bp); xfs_caddr_t start; /* first byte offset logged */ xfs_caddr_t end; /* last byte offset logged */ pp = cur->bc_ops->ptr_addr(cur, 1, XFS_BUF_TO_BLOCK(bp)); if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { __be64 *lpp = &pp->l; start = (xfs_caddr_t)&lpp[first - 1] - block; end = ((xfs_caddr_t)&lpp[last] - 1) - block; } else { __be32 *spp = &pp->s; start = (xfs_caddr_t)&spp[first - 1] - block; end = ((xfs_caddr_t)&spp[last] - 1) - block; } xfs_trans_log_buf(cur->bc_tp, bp, (int)start, (int)end); That makes it much easier to read (to me, anyway). > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ENTRY); > + XFS_BTREE_TRACE_ARGBI(cur, bp, fields); > + > + if (bp) { > + xfs_btree_offsets(fields, > + (cur->bc_flags & XFS_BTREE_LONG_PTRS) ? > + loffsets : soffsets, ^^ Some stray whitespace there. > + XFS_BB_NUM_BITS, &first, &last); > + xfs_trans_log_buf(cur->bc_tp, bp, first, last); > + } else { > + /* XXX(hch): maybe factor out into a method? */ > + xfs_trans_log_inode(cur->bc_tp, cur->bc_private.b.ip, > + XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); I don't think it is necessary at this point. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 23:23:15 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 23:23:17 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U6NEUb006080 for ; Tue, 29 Jul 2008 23:23:14 -0700 X-ASG-Debug-ID: 1217399066-3f3700840000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id C6C29ED4CE8 for ; Tue, 29 Jul 2008 23:24:27 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id XB5cF4o5TzwBE2mS for ; Tue, 29 Jul 2008 23:24:27 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAK2lj0h5LDlw/2dsb2JhbACLH6Rr X-IronPort-AV: E=Sophos;i="4.31,277,1215354600"; d="scan'208";a="160439695" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 15:54:24 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO56k-0003k5-VX; Wed, 30 Jul 2008 16:24:22 +1000 Date: Wed, 30 Jul 2008 16:24:22 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 16/21] implement generic xfs_btree_lshift Subject: Re: [PATCH 16/21] implement generic xfs_btree_lshift Message-ID: <20080730062422.GQ13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193132.GQ19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193132.GQ19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217399067 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1264 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17273 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:32PM +0200, Christoph Hellwig wrote: > Make the btree left shift code generic. Based on a patch from David Chinner > with lots of changes to follow the original btree implementations more > closely. While this loses some of the generic helper routines for > inserting/moving/removing records it also solves some of the one off > bugs in the original code and makes it easier to verify. > > Signed-off-by: Christoph Hellwig > > Index: linux-2.6-xfs/fs/xfs/xfs_btree.c > =================================================================== > --- linux-2.6-xfs.orig/fs/xfs/xfs_btree.c 2008-07-28 16:13:33.000000000 +0200 > +++ linux-2.6-xfs/fs/xfs/xfs_btree.c 2008-07-28 16:16:22.000000000 +0200 > @@ -976,6 +976,21 @@ xfs_btree_move_ptrs( > } > } > > +STATIC void > +xfs_btree_copy_ptrs( > + struct xfs_btree_cur *cur, > + union xfs_btree_ptr *src_ptr, > + union xfs_btree_ptr *dst_ptr, > + int numptrs) > +{ > + ASSERT(numptrs > 0); > + > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) > + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be64)); > + else > + memcpy(dst_ptr, src_ptr, numptrs * sizeof(__be32)); > +} These should really use memmove, not memcpy. There is no guarantee the source and destination do not overlap. At minimum, we need comments to say this must only be used to copy between blocks, and xfs_btree_move_ptrs() must be used to copy within a block. I note the original patchset of mine commented on this distinction when defining the ->move_* and ->copy_* operations. FWIW, that also helps explain why they have different interfaces... > + > /* > * Log block pointer fields from a btree block (nonleaf). > */ > @@ -1597,6 +1612,188 @@ error0: > } > > /* > + * Move 1 record left from cur/level if possible. > + * Update cur to reflect the new path. > + */ > +int /* error */ > +xfs_btree_lshift( > + struct xfs_btree_cur *cur, > + int level, > + int *stat) /* success/failure */ > +{ > + union xfs_btree_key key; /* btree key */ > + struct xfs_buf *lbp; /* left buffer pointer */ > + struct xfs_btree_block *left; /* left btree block */ > + int lrecs; /* left record count */ > + struct xfs_buf *rbp; /* right buffer pointer */ > + struct xfs_btree_block *right; /* right btree block */ > + int rrecs; /* right record count */ > + union xfs_btree_ptr lptr; /* left btree pointer */ > + union xfs_btree_key *rkp = NULL; /* right btree key */ > + union xfs_btree_ptr *rpp = NULL; /* right address pointer */ > + union xfs_btree_rec *rrp = NULL; /* right record pointer */ > + int error; /* error return value */ > +#ifdef DEBUG > + int i; /* loop index */ > +#endif This can be moved inside the branch it is used in. > + lrecs++; > + rrecs--; > + > + XFS_BTREE_STATS_INC(cur, lshift); > + > + /* > + * If non-leaf, copy a key and a ptr to the left block. > + * Log the changes to the left block. > + */ > + XFS_BTREE_STATS_ADD(cur, moves, 1); Move the XFS_BTREE_STATS_ADD() above the comment to match the rshift code. Otherwise looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 23:52:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 23:53:07 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U6qftb009224 for ; Tue, 29 Jul 2008 23:52:41 -0700 X-ASG-Debug-ID: 1217400832-2c8303980000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 6A940ED4BB0 for ; Tue, 29 Jul 2008 23:53:53 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id GXzKxgktPf75N8PH for ; Tue, 29 Jul 2008 23:53:53 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALCsj0h5LDlw/2dsb2JhbACLH6Ry X-IronPort-AV: E=Sophos;i="4.31,277,1215354600"; d="scan'208";a="160464851" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 16:23:51 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO5ZF-0004OL-Vj; Wed, 30 Jul 2008 16:53:49 +1000 Date: Wed, 30 Jul 2008 16:53:49 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 17/21] implement generic xfs_btree_split Subject: Re: [PATCH 17/21] implement generic xfs_btree_split Message-ID: <20080730065349.GR13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729192113.493074843@verein.lst.de> <20080729193137.GR19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20080729193137.GR19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217400834 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1265 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17274 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:37PM +0200, Christoph Hellwig wrote: > Make the btree split code generic. Based on a patch from David Chinner > with lots of changes to follow the original btree implementations more > closely. While this loses some of the generic helper routines for > inserting/moving/removing records it also solves some of the one off > bugs in the original code and makes it easier to verify. > > Signed-off-by: Christoph Hellwig ..... > +STATIC void > +xfs_btree_init_block( > + struct xfs_btree_cur *cur, > + int level, > + int numrecs, > + struct xfs_btree_block *new) /* new block */ > +{ > + new->bb_h.bb_magic = cpu_to_be32(xfs_magics[cur->bc_btnum]); > + new->bb_h.bb_level = cpu_to_be16(level); > + new->bb_h.bb_numrecs = cpu_to_be16(numrecs); > + > + if (cur->bc_flags & XFS_BTREE_LONG_PTRS) { > + new->bb_u.l.bb_leftsib = cpu_to_be64(NULLFSBLOCK); > + new->bb_u.l.bb_rightsib = cpu_to_be64(NULLFSBLOCK); > + } else { > + new->bb_u.s.bb_leftsib = cpu_to_be32(NULLAGBLOCK); > + new->bb_u.s.bb_rightsib = cpu_to_be32(NULLAGBLOCK); > + } > +} This is where I begin to question this approach (i.e. using helpers like this rather than specific ops like I did). It's taken me 4 År 5 patches to put my finger on it. The intent of this factorisation is to make implementing new btree structures easy, not making the current code better or more managable. The first thing we need is is btrees with different header blocks (self describing information, CRCs, etc). This above function will suddenly have four combinations to deal with - long and short, version 1 and version 2 header formats. The more we change, the more this complicates these helpers. That is why I pushed seemingly trivial stuff out to operations vectors - because of the future flexibility it allowed in implementation of new btrees..... I don't see this a problem for this patch series, but I can see that some of this work will end up being converted back to ops vectors as soon as we start modifying between structures.... > +STATIC int > +xfs_btree_get_buf_block( > + struct xfs_btree_cur *cur, > + union xfs_btree_ptr *ptr, > + int flags, > + struct xfs_btree_block **block, > + struct xfs_buf **bpp) > +{ > + struct xfs_mount *mp = cur->bc_mp; > + xfs_daddr_t d; > + > + /* need to sort out how callers deal with failures first */ > + ASSERT(!(flags & XFS_BUF_TRYLOCK)); > + > + d = xfs_btree_ptr_to_daddr(cur, ptr); > + *bpp = xfs_trans_get_buf(cur->bc_tp, mp->m_ddev_targp, d, > + mp->m_bsize, flags); > + > + ASSERT(*bpp); > + ASSERT(!XFS_BUF_GETERROR(*bpp)); xfs_trans_get_buf() can return NULL, right? > + /* block allocation / freeing */ > + int (*alloc_block)(struct xfs_btree_cur *cur, > + union xfs_btree_ptr *sbno, > + union xfs_btree_ptr *nbno, start_bno, new_bno. Otherwise looks good. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Tue Jul 29 23:56:17 2008 Received: with ECARTIS (v1.0.0; list xfs); Tue, 29 Jul 2008 23:56:20 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U6uH1g010026 for ; Tue, 29 Jul 2008 23:56:17 -0700 X-ASG-Debug-ID: 1217401047-3f32025d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9115BED4BCA for ; Tue, 29 Jul 2008 23:57:29 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id VjC3jCiBF3ZNYP1L for ; Tue, 29 Jul 2008 23:57:29 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALCsj0h5LDlw/2dsb2JhbACLH6Ry X-IronPort-AV: E=Sophos;i="4.31,277,1215354600"; d="scan'208";a="160467929" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 16:27:22 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO5cf-0004Tj-Sw; Wed, 30 Jul 2008 16:57:21 +1000 Date: Wed, 30 Jul 2008 16:57:21 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 18/21] implement semi-generic xfs_btree_new_root Subject: Re: [PATCH 18/21] implement semi-generic xfs_btree_new_root Message-ID: <20080730065721.GS13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193143.GS19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193143.GS19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217401050 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1265 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17275 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:43PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > Add a xfs_btree_new_root helper for the alloc and ialloc btrees. The bmap > btree needs it's own version and is not converted. > > [hch: split out from bigger patch and minor adaptions] > > > Signed-off-by: Christoph Hellwig Looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 30 00:11:10 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 00:11:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,MIME_8BIT_HEADER autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U7BAXT014757 for ; Wed, 30 Jul 2008 00:11:10 -0700 X-ASG-Debug-ID: 1217401942-5e9700c00000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 66A95ED4DD8 for ; Wed, 30 Jul 2008 00:12:22 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id nCOofvJNYLjDayZH for ; Wed, 30 Jul 2008 00:12:22 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAC+wj0h5LDlw/2dsb2JhbACLH6Rr X-IronPort-AV: E=Sophos;i="4.31,278,1215354600"; d="scan'208";a="160478195" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 16:42:21 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO5r9-0004np-Bm; Wed, 30 Jul 2008 17:12:19 +1000 Date: Wed, 30 Jul 2008 17:12:19 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 19/21] implement =?utf-8?Q?gene?= =?utf-8?Q?ric_xfs=5Fbtree=5Fin=D1=95ert=2Finsrec?= Subject: Re: [PATCH 19/21] implement =?utf-8?Q?gene?= =?utf-8?Q?ric_xfs=5Fbtree=5Fin=D1=95ert=2Finsrec?= Message-ID: <20080730071219.GT13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193148.GT19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193148.GT19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217401943 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1267 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17276 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:48PM +0200, Christoph Hellwig wrote: > Make the btree insert code generic. Based on a patch from David Chinner > with lots of changes to follow the original btree implementations more > closely. While this loses some of the generic helper routines for > inserting/moving/removing records it also solves some of the one off > bugs in the original code and makes it easier to verify. > > > Signed-off-by: Christoph Hellwig Looks fine (though my eyes are starting to glaze over). Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 30 00:25:34 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 00:25:37 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U7PXkS021993 for ; Wed, 30 Jul 2008 00:25:33 -0700 X-ASG-Debug-ID: 1217402805-5e95016c0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9C5D7ED4EFC for ; Wed, 30 Jul 2008 00:26:45 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id W9VgJu1PFTNTxHTa for ; Wed, 30 Jul 2008 00:26:45 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALmzj0h5LDlw/2dsb2JhbACLH6Rz X-IronPort-AV: E=Sophos;i="4.31,278,1215354600"; d="scan'208";a="160487645" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 16:56:44 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO64o-00057u-Ui; Wed, 30 Jul 2008 17:26:26 +1000 Date: Wed, 30 Jul 2008 17:26:26 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 20/21] implement generic xfs_btree_delete/delrec Subject: Re: [PATCH 20/21] implement generic xfs_btree_delete/delrec Message-ID: <20080730072626.GU13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193153.GU19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193153.GU19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217402806 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.42 X-Barracuda-Spam-Status: No, SCORE=-1.42 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=MARKETING_SUBJECT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1267 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.60 MARKETING_SUBJECT Subject contains popular marketing words X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17277 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:31:53PM +0200, Christoph Hellwig wrote: > Make the btree delete code generic. Based on a patch from David Chinner > with lots of changes to follow the original btree implementations more > closely. While this loses some of the generic helper routines for > inserting/moving/removing records it also solves some of the one off > bugs in the original code and makes it easier to verify. > > > Signed-off-by: Christoph Hellwig looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 30 00:31:36 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 00:31:38 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_62, J_CHICKENPOX_65 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda2.sgi.com [192.48.168.29]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U7VZqs023178 for ; Wed, 30 Jul 2008 00:31:36 -0700 X-ASG-Debug-ID: 1217403167-363b014a0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 0B95E33F17E for ; Wed, 30 Jul 2008 00:32:48 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id 3xwR0CbXktI7mFd9 for ; Wed, 30 Jul 2008 00:32:48 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALmzj0h5LDlw/2dsb2JhbACLH6Rz X-IronPort-AV: E=Sophos;i="4.31,278,1215354600"; d="scan'208";a="160492043" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 17:02:46 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO6Av-0005G6-BU; Wed, 30 Jul 2008 17:32:45 +1000 Date: Wed, 30 Jul 2008 17:32:45 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 21/21] clean up xfs_bmap_btree.c Subject: Re: [PATCH 21/21] clean up xfs_bmap_btree.c Message-ID: <20080730073245.GV13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080729193200.GV19104@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080729193200.GV19104@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217403169 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1267 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17278 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Tue, Jul 29, 2008 at 09:32:00PM +0200, Christoph Hellwig wrote: > From: Dave Chinner > > Reimplement xfs_bmbt_newroot and xfs_bmbt_kill_root using the new generic > btree helpers and clean out all cruft needed for the old implementations. > > This requires exporting some functionality from xfs_btree.c that's only > used locally otherwise. > > > Signed-off-by: Christoph Hellwig ..... > + nrecs += i; > + xfs_btree_set_numrecs(block, nrecs); > + > + ASSERT(nrecs == crecs); > + kp = xfs_bmbt_key_addr(cur, 1, block); > + ckp = xfs_bmbt_key_addr(cur, 1, cblock); > + memcpy(kp, ckp, nrecs * sizeof(xfs_bmbt_key_t)); Should really be xfs_bmbt_copy_keys(), right? > + pp = xfs_bmbt_ptr_addr(cur, 1, block); > + cpp = xfs_bmbt_ptr_addr(cur, 1, cblock); > + > +#ifdef DEBUG > + for (i = 0; i < crecs; i++) { > + int error; > + > + error = xfs_btree_check_ptr(cur, cpp, i, level - 1); > + if (error) { > + XFS_BTREE_TRACE_CURSOR(cur, XBT_ERROR); > + return error; > + } > + } > +#endif > + > + memcpy(pp, cpp, nrecs * sizeof(xfs_bmbt_key_t)); xfs_bmbt_copy_recs()? Otherwise looks ok. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 30 00:34:13 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 00:34:14 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6U7YCmp023866 for ; Wed, 30 Jul 2008 00:34:13 -0700 X-ASG-Debug-ID: 1217403323-4474020b0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 9AB6D1947ED9 for ; Wed, 30 Jul 2008 00:35:24 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id Ie2gVEk6EenhnzoI for ; Wed, 30 Jul 2008 00:35:24 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEALmzj0h5LDlw/2dsb2JhbACLH6Rz X-IronPort-AV: E=Sophos;i="4.31,278,1215354600"; d="scan'208";a="160493800" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 30 Jul 2008 17:05:23 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KO6DS-0005Jp-BG; Wed, 30 Jul 2008 17:35:22 +1000 Date: Wed, 30 Jul 2008 17:35:22 +1000 From: Dave Chinner To: Christoph Hellwig Cc: xfs@oss.sgi.com X-ASG-Orig-Subj: Re: [PATCH 07/15] refactor xfs_btree_readahead Subject: Re: [PATCH 07/15] refactor xfs_btree_readahead Message-ID: <20080730073522.GW13395@disturbed> Mail-Followup-To: Christoph Hellwig , xfs@oss.sgi.com References: <20080723200859.GH7401@lst.de> <20080724233655.GH15438@disturbed> <20080728153959.GA29132@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080728153959.GA29132@lst.de> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217403325 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1268 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17279 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Mon, Jul 28, 2008 at 05:39:59PM +0200, Christoph Hellwig wrote: > On Fri, Jul 25, 2008 at 09:36:55AM +1000, Dave Chinner wrote: > > I've been wondering if this is the best naming convention - > > appending a single s or l to indicate short or long btree ops. > > Perhaps this would be better as xfs_btree_readahead_short() and > > xfs_btree_readahead_long(), esp. as we dropped the 'core' from > > the caller to make it xfs_btree_readahead(). > > I've renamedthe helpers to xfs_btree_readahead_lblock / > xfs_btree_readahead_slblock to match the naming for the other short / > long block helpers. Ok, that sounds reasonable. Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 30 19:52:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 19:52:47 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6V2qI8w015047 for ; Wed, 30 Jul 2008 19:52:19 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA17817; Thu, 31 Jul 2008 12:53:28 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 6328358C4C3F; Thu, 31 Jul 2008 12:53:28 +1000 (EST) Date: Thu, 31 Jul 2008 12:53:28 +1000 To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: [GIT PULL] XFS update for 2.6.27 User-Agent: nail 11.25 7/29/05 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17280 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs The following changes since commit c9272c4f9fbe2087beb3392f526dc5b19efaa56b: Linus Torvalds (1): Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 are available in the git repository at: git://oss.sgi.com:8090/xfs/xfs-pull for-linus Barry Naujok (12): [XFS] Split xfs_dir2_leafn_lookup_int into its two pieces of functionality [XFS] Name operation vector for hash and compare [XFS] Add op_flags field and helpers to xfs_da_args dcache: Add case-insensitive support d_ci_add() routine [XFS] Return case-insensitive match for dentry cache [XFS] XFS: ASCII case-insensitive support [XFS] kmem_free and kmem_realloc to use const void * [XFS] Remove d_add call for an ENOENT lookup return code [XFS] Zero uninitialised xfs_da_args structure in xfs_dir2.c [XFS] Invalidate dentry in unlink/rmdir if in case-insensitive mode [XFS] Fix returning case-preserved name with CI node form directories [XFS] Fix CI lookup in leaf-form directories Christoph Hellwig (28): [XFS] Kill attr_capable checks as already done in xattr_permission. [XFS] kill xfs_uuid_unmount [XFS] merge xfs_mntupdate into xfs_fs_remount [XFS] kill xfs_igrow_start and xfs_igrow_finish [XFS] merge xfs_unmount into xfs_fs_put_super / xfs_fs_fill_super [XFS] merge xfs_mount into xfs_fs_fill_super [XFS] don't call xfs_freesb from xfs_mountfs failure case [XFS] sort out opening and closing of the block devices [XFS] add xfs_setup_devices helper [XFS] allow xfs_args_allocate to fail [XFS] kill xfs_mount_init [XFS] kill calls to xfs_binval in the mount error path [XFS] rename error2 goto label in xfs_fs_fill_super [XFS] add missing call to xfs_filestream_unmount on xfs_mountfs failure [XFS] Factor out code for whether inode has attributes or not. [XFS] Switches xfs_vn_listxattr to set it's put_listent callback directly [XFS] Merge xfs_rmdir into xfs_remove [XFS] Don't update i_size for directories and special files [XFS] Check for invalid flags in xfs_attrlist_by_handle. [XFS] attrmulti cleanup [XFS] Don't update mtime on rename source [XFS] streamline init/exit path [XFS] fix mount option parsing in remount [XFS] s/XFS_PURGE_INODE/IRELE/g s/VN_HOLD(XFS_ITOV())/IHOLD()/ [XFS] fix compilation without CONFIG_PROC_FS [XFS] xfs_setattr currently doesn't just handle the attributes set through [XFS] Now that xfs_setattr is only used for attributes set from ->setattr [XFS] Remove vn_revalidate calls in xfs. David Chinner (1): [XFS] Update valid fields in xfs_mount_log_sb() Denys Vlasenko (3): [XFS] Remove unused arg from kmem_free() [XFS] Remove unused Falgs parameter from xfs_qm_dqpurge() [XFS] Remove unused wbc parameter from xfs_start_page_writeback() Eric Sandeen (3): [XFS] [XFS] Pack some shortform dir2 structures for the ARM old ABI [XFS] Disable queue flag test in barrier check. Lachlan McIlroy (11): [XFS] Use the generic xattr methods. [XFS] make inode reclaim wait for log I/O to complete [XFS] fix extent corruption in xfs_iext_irec_compact_full() [XFS] Convert ASSERTs to XFS_WANT_CORRUPTED_GOTOs [XFS] Always reset btree cursor after an insert [XFS] Use the generic xattr methods. [XFS] use minleft when allocating in xfs_bmbt_split() [XFS] Restore the lowspace extent allocator algorithm [XFS] Allow xfs_bmbt_split() to fallback to the lowspace allocator [XFS] Don't assert if trying to mount with blocksize > pagesize [XFS] fix use after free with external logs or real-time devices Matthew Wilcox (1): [XFS] Convert l_flushsema to a sv_t Michael Nishimoto (1): [XFS] Ensure that 2 GiB xfs logs work properly. Tim Shimmin (4): [XFS] Fix up noattr2 so that it will properly update the versionnum and [XFS] Fix up warning for xfs_vn_listxatt's call of list_one_attr() with [XFS] Fix up problem when CONFIG_XFS_POSIX_ACL is not set and yet we still [XFS] A bug was found in xfs_bmap_add_extent_unwritten_real(). In a fs/dcache.c | 102 +++++ fs/xfs/Makefile | 3 +- fs/xfs/linux-2.6/kmem.c | 6 +- fs/xfs/linux-2.6/kmem.h | 4 +- fs/xfs/linux-2.6/xfs_aops.c | 5 +- fs/xfs/linux-2.6/xfs_buf.c | 14 +- fs/xfs/linux-2.6/xfs_buf.h | 2 +- fs/xfs/linux-2.6/xfs_export.c | 2 +- fs/xfs/linux-2.6/xfs_ioctl.c | 376 ++++++++++++++-- fs/xfs/linux-2.6/xfs_iops.c | 345 +++++---------- fs/xfs/linux-2.6/xfs_iops.h | 2 + fs/xfs/linux-2.6/xfs_linux.h | 8 + fs/xfs/linux-2.6/xfs_stats.c | 15 +- fs/xfs/linux-2.6/xfs_stats.h | 12 +- fs/xfs/linux-2.6/xfs_super.c | 938 ++++++++++++++++++++++++++++++++++++---- fs/xfs/linux-2.6/xfs_super.h | 4 +- fs/xfs/linux-2.6/xfs_sysctl.c | 8 +- fs/xfs/linux-2.6/xfs_sysctl.h | 4 +- fs/xfs/linux-2.6/xfs_vnode.c | 50 --- fs/xfs/linux-2.6/xfs_vnode.h | 89 ---- fs/xfs/linux-2.6/xfs_xattr.c | 330 ++++++++++++++ fs/xfs/quota/xfs_dquot.c | 3 +- fs/xfs/quota/xfs_dquot.h | 2 +- fs/xfs/quota/xfs_dquot_item.c | 4 +- fs/xfs/quota/xfs_qm.c | 24 +- fs/xfs/quota/xfs_qm_syscalls.c | 12 +- fs/xfs/quota/xfs_quota_priv.h | 3 - fs/xfs/support/ktrace.c | 4 +- fs/xfs/support/uuid.c | 8 +- fs/xfs/support/uuid.h | 1 - fs/xfs/xfs_acl.c | 21 +- fs/xfs/xfs_acl.h | 4 +- fs/xfs/xfs_attr.c | 608 ++++---------------------- fs/xfs/xfs_attr.h | 90 ++--- fs/xfs/xfs_attr_leaf.c | 99 ++--- fs/xfs/xfs_attr_leaf.h | 29 +-- fs/xfs/xfs_attr_sf.h | 10 +- fs/xfs/xfs_bmap.c | 118 +++--- fs/xfs/xfs_bmap.h | 13 +- fs/xfs/xfs_bmap_btree.c | 76 ++-- fs/xfs/xfs_buf_item.c | 8 +- fs/xfs/xfs_clnt.h | 1 + fs/xfs/xfs_da_btree.c | 48 ++- fs/xfs/xfs_da_btree.h | 36 ++- fs/xfs/xfs_dfrag.c | 4 +- fs/xfs/xfs_dir2.c | 125 +++++- fs/xfs/xfs_dir2.h | 6 +- fs/xfs/xfs_dir2_block.c | 56 ++- fs/xfs/xfs_dir2_data.c | 5 +- fs/xfs/xfs_dir2_leaf.c | 93 +++-- fs/xfs/xfs_dir2_node.c | 402 ++++++++++------- fs/xfs/xfs_dir2_sf.c | 83 ++-- fs/xfs/xfs_dir2_sf.h | 6 +- fs/xfs/xfs_dir2_trace.c | 20 +- fs/xfs/xfs_dmapi.h | 2 +- fs/xfs/xfs_error.c | 13 +- fs/xfs/xfs_error.h | 1 - fs/xfs/xfs_extfree_item.c | 6 +- fs/xfs/xfs_filestream.c | 4 +- fs/xfs/xfs_fs.h | 4 + fs/xfs/xfs_fsops.c | 4 +- fs/xfs/xfs_inode.c | 165 +++----- fs/xfs/xfs_inode.h | 3 - fs/xfs/xfs_inode_item.c | 7 +- fs/xfs/xfs_iomap.c | 10 + fs/xfs/xfs_itable.c | 6 +- fs/xfs/xfs_log.c | 49 +- fs/xfs/xfs_log_priv.h | 6 +- fs/xfs/xfs_log_recover.c | 21 +- fs/xfs/xfs_mount.c | 118 ++---- fs/xfs/xfs_mount.h | 17 +- fs/xfs/xfs_mru_cache.c | 21 +- fs/xfs/xfs_rename.c | 22 +- fs/xfs/xfs_rtalloc.c | 2 +- fs/xfs/xfs_sb.h | 17 +- fs/xfs/xfs_trans.c | 4 +- fs/xfs/xfs_trans_inode.c | 2 +- fs/xfs/xfs_trans_item.c | 8 +- fs/xfs/xfs_vfsops.c | 610 +-------------------------- fs/xfs/xfs_vfsops.h | 5 - fs/xfs/xfs_vnodeops.c | 722 +++++++++---------------------- fs/xfs/xfs_vnodeops.h | 12 +- include/linux/dcache.h | 1 + 83 files changed, 3105 insertions(+), 3098 deletions(-) create mode 100644 fs/xfs/linux-2.6/xfs_xattr.c From owner-xfs@oss.sgi.com Wed Jul 30 20:04:35 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 20:04:39 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_102, J_CHICKENPOX_32,J_CHICKENPOX_42,J_CHICKENPOX_44,J_CHICKENPOX_45, J_CHICKENPOX_61,J_CHICKENPOX_62,J_CHICKENPOX_63,J_CHICKENPOX_64, J_CHICKENPOX_65,J_CHICKENPOX_66,J_CHICKENPOX_74 autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6V34ZIw016108 for ; Wed, 30 Jul 2008 20:04:35 -0700 X-ASG-Debug-ID: 1217473544-1ee5008d0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 77958EE0CCD for ; Wed, 30 Jul 2008 20:05:45 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id kDNR1TEjgrCVTS1R for ; Wed, 30 Jul 2008 20:05:45 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id C1C29AC6275 for ; Wed, 30 Jul 2008 22:05:43 -0500 (CDT) Message-ID: <48912C07.7060705@sandeen.net> Date: Wed, 30 Jul 2008 22:05:43 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: [PATCH] kill the last of the shouting-indirection macros Subject: [PATCH] kill the last of the shouting-indirection macros Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1217473546 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -1.82 X-Barracuda-Spam-Status: No, SCORE=-1.82 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=BSF_SC0_MJ615 X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1337 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.20 BSF_SC0_MJ615 Custom Rule MJ615 X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17281 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs I think these are the last few macros-defined-to-static-inlines. Compile-tested only. Signed-off-by: Eric Sandeen --- quota/xfs_dquot.c | 2 xfs_ag.h | 8 +- xfs_alloc_btree.c | 6 - xfs_attr.c | 26 ++++---- xfs_bit.h | 7 -- xfs_bmap.c | 166 ++++++++++++++++++++++++++--------------------------- xfs_bmap.h | 2 xfs_bmap_btree.c | 104 ++++++++++++++++----------------- xfs_bmap_btree.h | 4 - xfs_da_btree.c | 8 +- xfs_ialloc.c | 4 - xfs_ialloc.h | 2 xfs_ialloc_btree.c | 6 - xfs_ialloc_btree.h | 1 xfs_inode.c | 6 - xfs_inode_item.h | 9 -- xfs_iomap.c | 10 +-- xfs_itable.c | 6 - xfs_mount.h | 6 - xfs_rename.c | 2 xfs_rtalloc.c | 2 xfs_rw.h | 1 xfs_sb.h | 2 xfs_vnodeops.c | 20 +++--- xfsidbg.c | 4 - 25 files changed, 196 insertions(+), 218 deletions(-) Index: linux-2.6-xfs/fs/xfs/xfs_bmap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.c +++ linux-2.6-xfs/fs/xfs/xfs_bmap.c @@ -549,9 +549,9 @@ xfs_bmap_add_extent( xfs_iext_insert(ifp, 0, 1, new); ASSERT(cur == NULL); ifp->if_lastex = 0; - if (!ISNULLSTARTBLOCK(new->br_startblock)) { + if (!isnullstartblock(new->br_startblock)) { XFS_IFORK_NEXT_SET(ip, whichfork, 1); - logflags = XFS_ILOG_CORE | XFS_ILOG_FEXT(whichfork); + logflags = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); } else logflags = 0; /* DELTA: single new extent */ @@ -567,7 +567,7 @@ xfs_bmap_add_extent( /* * Any kind of new delayed allocation goes here. */ - else if (ISNULLSTARTBLOCK(new->br_startblock)) { + else if (isnullstartblock(new->br_startblock)) { if (cur) ASSERT((cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL) == 0); @@ -598,11 +598,11 @@ xfs_bmap_add_extent( * in a delayed or unwritten allocation with a real one, or * converting real back to unwritten. */ - if (!ISNULLSTARTBLOCK(new->br_startblock) && + if (!isnullstartblock(new->br_startblock) && new->br_startoff + new->br_blockcount > prev.br_startoff) { if (prev.br_state != XFS_EXT_UNWRITTEN && - ISNULLSTARTBLOCK(prev.br_startblock)) { - da_old = STARTBLOCKVAL(prev.br_startblock); + isnullstartblock(prev.br_startblock)) { + da_old = startblockval(prev.br_startblock); if (cur) ASSERT(cur->bc_private.b.flags & XFS_BTCUR_BPRV_WASDEL); @@ -757,7 +757,7 @@ xfs_bmap_add_extent_delay_real( */ if (STATE_SET_TEST(LEFT_VALID, idx > 0)) { xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx - 1), &LEFT); - STATE_SET(LEFT_DELAY, ISNULLSTARTBLOCK(LEFT.br_startblock)); + STATE_SET(LEFT_DELAY, isnullstartblock(LEFT.br_startblock)); } STATE_SET(LEFT_CONTIG, STATE_TEST(LEFT_VALID) && !STATE_TEST(LEFT_DELAY) && @@ -774,7 +774,7 @@ xfs_bmap_add_extent_delay_real( idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t) - 1)) { xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx + 1), &RIGHT); - STATE_SET(RIGHT_DELAY, ISNULLSTARTBLOCK(RIGHT.br_startblock)); + STATE_SET(RIGHT_DELAY, isnullstartblock(RIGHT.br_startblock)); } STATE_SET(RIGHT_CONTIG, STATE_TEST(RIGHT_VALID) && !STATE_TEST(RIGHT_DELAY) && @@ -973,8 +973,8 @@ xfs_bmap_add_extent_delay_real( goto done; } temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), - STARTBLOCKVAL(PREV.br_startblock)); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + startblockval(PREV.br_startblock)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); XFS_BMAP_TRACE_POST_UPDATE("LF|LC", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: The boundary between two in-core extents moved. */ @@ -1021,10 +1021,10 @@ xfs_bmap_add_extent_delay_real( goto done; } temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), - STARTBLOCKVAL(PREV.br_startblock) - + startblockval(PREV.br_startblock) - (cur ? cur->bc_private.b.allocated : 0)); ep = xfs_iext_get_ext(ifp, idx + 1); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); XFS_BMAP_TRACE_POST_UPDATE("LF", ip, idx + 1, XFS_DATA_FORK); *dnew = temp; /* DELTA: One in-core extent is split in two. */ @@ -1064,8 +1064,8 @@ xfs_bmap_add_extent_delay_real( goto done; } temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), - STARTBLOCKVAL(PREV.br_startblock)); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + startblockval(PREV.br_startblock)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); XFS_BMAP_TRACE_POST_UPDATE("RF|RC", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: The boundary between two in-core extents moved. */ @@ -1111,10 +1111,10 @@ xfs_bmap_add_extent_delay_real( goto done; } temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), - STARTBLOCKVAL(PREV.br_startblock) - + startblockval(PREV.br_startblock) - (cur ? cur->bc_private.b.allocated : 0)); ep = xfs_iext_get_ext(ifp, idx); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); XFS_BMAP_TRACE_POST_UPDATE("RF", ip, idx, XFS_DATA_FORK); *dnew = temp; /* DELTA: One in-core extent is split in two. */ @@ -1167,7 +1167,7 @@ xfs_bmap_add_extent_delay_real( } temp = xfs_bmap_worst_indlen(ip, temp); temp2 = xfs_bmap_worst_indlen(ip, temp2); - diff = (int)(temp + temp2 - STARTBLOCKVAL(PREV.br_startblock) - + diff = (int)(temp + temp2 - startblockval(PREV.br_startblock) - (cur ? cur->bc_private.b.allocated : 0)); if (diff > 0 && xfs_mod_incore_sb(ip->i_mount, XFS_SBS_FDBLOCKS, -((int64_t)diff), rsvd)) { @@ -1195,11 +1195,11 @@ xfs_bmap_add_extent_delay_real( } } ep = xfs_iext_get_ext(ifp, idx); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx, XFS_DATA_FORK); XFS_BMAP_TRACE_PRE_UPDATE("0", ip, idx + 2, XFS_DATA_FORK); xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx + 2), - NULLSTARTBLOCK((int)temp2)); + nullstartblock((int)temp2)); XFS_BMAP_TRACE_POST_UPDATE("0", ip, idx + 2, XFS_DATA_FORK); *dnew = temp + temp2; /* DELTA: One in-core extent is split in three. */ @@ -1319,7 +1319,7 @@ xfs_bmap_add_extent_unwritten_real( */ if (STATE_SET_TEST(LEFT_VALID, idx > 0)) { xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx - 1), &LEFT); - STATE_SET(LEFT_DELAY, ISNULLSTARTBLOCK(LEFT.br_startblock)); + STATE_SET(LEFT_DELAY, isnullstartblock(LEFT.br_startblock)); } STATE_SET(LEFT_CONTIG, STATE_TEST(LEFT_VALID) && !STATE_TEST(LEFT_DELAY) && @@ -1336,7 +1336,7 @@ xfs_bmap_add_extent_unwritten_real( idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t) - 1)) { xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx + 1), &RIGHT); - STATE_SET(RIGHT_DELAY, ISNULLSTARTBLOCK(RIGHT.br_startblock)); + STATE_SET(RIGHT_DELAY, isnullstartblock(RIGHT.br_startblock)); } STATE_SET(RIGHT_CONTIG, STATE_TEST(RIGHT_VALID) && !STATE_TEST(RIGHT_DELAY) && @@ -1843,13 +1843,13 @@ xfs_bmap_add_extent_hole_delay( ifp = XFS_IFORK_PTR(ip, XFS_DATA_FORK); ep = xfs_iext_get_ext(ifp, idx); state = 0; - ASSERT(ISNULLSTARTBLOCK(new->br_startblock)); + ASSERT(isnullstartblock(new->br_startblock)); /* * Check and set flags if this segment has a left neighbor */ if (STATE_SET_TEST(LEFT_VALID, idx > 0)) { xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx - 1), &left); - STATE_SET(LEFT_DELAY, ISNULLSTARTBLOCK(left.br_startblock)); + STATE_SET(LEFT_DELAY, isnullstartblock(left.br_startblock)); } /* * Check and set flags if the current (right) segment exists. @@ -1859,7 +1859,7 @@ xfs_bmap_add_extent_hole_delay( idx < ip->i_df.if_bytes / (uint)sizeof(xfs_bmbt_rec_t))) { xfs_bmbt_get_all(ep, &right); - STATE_SET(RIGHT_DELAY, ISNULLSTARTBLOCK(right.br_startblock)); + STATE_SET(RIGHT_DELAY, isnullstartblock(right.br_startblock)); } /* * Set contiguity flags on the left and right neighbors. @@ -1892,12 +1892,12 @@ xfs_bmap_add_extent_hole_delay( XFS_BMAP_TRACE_PRE_UPDATE("LC|RC", ip, idx - 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); - oldlen = STARTBLOCKVAL(left.br_startblock) + - STARTBLOCKVAL(new->br_startblock) + - STARTBLOCKVAL(right.br_startblock); + oldlen = startblockval(left.br_startblock) + + startblockval(new->br_startblock) + + startblockval(right.br_startblock); newlen = xfs_bmap_worst_indlen(ip, temp); xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), - NULLSTARTBLOCK((int)newlen)); + nullstartblock((int)newlen)); XFS_BMAP_TRACE_POST_UPDATE("LC|RC", ip, idx - 1, XFS_DATA_FORK); XFS_BMAP_TRACE_DELETE("LC|RC", ip, idx, 1, XFS_DATA_FORK); @@ -1918,11 +1918,11 @@ xfs_bmap_add_extent_hole_delay( XFS_BMAP_TRACE_PRE_UPDATE("LC", ip, idx - 1, XFS_DATA_FORK); xfs_bmbt_set_blockcount(xfs_iext_get_ext(ifp, idx - 1), temp); - oldlen = STARTBLOCKVAL(left.br_startblock) + - STARTBLOCKVAL(new->br_startblock); + oldlen = startblockval(left.br_startblock) + + startblockval(new->br_startblock); newlen = xfs_bmap_worst_indlen(ip, temp); xfs_bmbt_set_startblock(xfs_iext_get_ext(ifp, idx - 1), - NULLSTARTBLOCK((int)newlen)); + nullstartblock((int)newlen)); XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, XFS_DATA_FORK); ip->i_df.if_lastex = idx - 1; @@ -1939,11 +1939,11 @@ xfs_bmap_add_extent_hole_delay( */ XFS_BMAP_TRACE_PRE_UPDATE("RC", ip, idx, XFS_DATA_FORK); temp = new->br_blockcount + right.br_blockcount; - oldlen = STARTBLOCKVAL(new->br_startblock) + - STARTBLOCKVAL(right.br_startblock); + oldlen = startblockval(new->br_startblock) + + startblockval(right.br_startblock); newlen = xfs_bmap_worst_indlen(ip, temp); xfs_bmbt_set_allf(ep, new->br_startoff, - NULLSTARTBLOCK((int)newlen), temp, right.br_state); + nullstartblock((int)newlen), temp, right.br_state); XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, XFS_DATA_FORK); ip->i_df.if_lastex = idx; /* DELTA: One in-core extent grew into a hole. */ @@ -2039,7 +2039,7 @@ xfs_bmap_add_extent_hole_real( */ if (STATE_SET_TEST(LEFT_VALID, idx > 0)) { xfs_bmbt_get_all(xfs_iext_get_ext(ifp, idx - 1), &left); - STATE_SET(LEFT_DELAY, ISNULLSTARTBLOCK(left.br_startblock)); + STATE_SET(LEFT_DELAY, isnullstartblock(left.br_startblock)); } /* * Check and set flags if this segment has a current value. @@ -2049,7 +2049,7 @@ xfs_bmap_add_extent_hole_real( idx < ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t))) { xfs_bmbt_get_all(ep, &right); - STATE_SET(RIGHT_DELAY, ISNULLSTARTBLOCK(right.br_startblock)); + STATE_SET(RIGHT_DELAY, isnullstartblock(right.br_startblock)); } /* * We're inserting a real allocation between "left" and "right". @@ -2097,7 +2097,7 @@ xfs_bmap_add_extent_hole_real( XFS_IFORK_NEXT_SET(ip, whichfork, XFS_IFORK_NEXTENTS(ip, whichfork) - 1); if (cur == NULL) { - rval = XFS_ILOG_CORE | XFS_ILOG_FEXT(whichfork); + rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); } else { rval = XFS_ILOG_CORE; if ((error = xfs_bmbt_lookup_eq(cur, @@ -2139,7 +2139,7 @@ xfs_bmap_add_extent_hole_real( XFS_BMAP_TRACE_POST_UPDATE("LC", ip, idx - 1, whichfork); ifp->if_lastex = idx - 1; if (cur == NULL) { - rval = XFS_ILOG_FEXT(whichfork); + rval = xfs_ilog_fext(whichfork); } else { rval = 0; if ((error = xfs_bmbt_lookup_eq(cur, @@ -2174,7 +2174,7 @@ xfs_bmap_add_extent_hole_real( XFS_BMAP_TRACE_POST_UPDATE("RC", ip, idx, whichfork); ifp->if_lastex = idx; if (cur == NULL) { - rval = XFS_ILOG_FEXT(whichfork); + rval = xfs_ilog_fext(whichfork); } else { rval = 0; if ((error = xfs_bmbt_lookup_eq(cur, @@ -2208,7 +2208,7 @@ xfs_bmap_add_extent_hole_real( XFS_IFORK_NEXT_SET(ip, whichfork, XFS_IFORK_NEXTENTS(ip, whichfork) + 1); if (cur == NULL) { - rval = XFS_ILOG_CORE | XFS_ILOG_FEXT(whichfork); + rval = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); } else { rval = XFS_ILOG_CORE; if ((error = xfs_bmbt_lookup_eq(cur, @@ -2436,7 +2436,7 @@ xfs_bmap_adjacent( * try to use it's last block as our starting point. */ if (ap->eof && ap->prevp->br_startoff != NULLFILEOFF && - !ISNULLSTARTBLOCK(ap->prevp->br_startblock) && + !isnullstartblock(ap->prevp->br_startblock) && ISVALID(ap->prevp->br_startblock + ap->prevp->br_blockcount, ap->prevp->br_startblock)) { ap->rval = ap->prevp->br_startblock + ap->prevp->br_blockcount; @@ -2465,7 +2465,7 @@ xfs_bmap_adjacent( * start block based on it. */ if (ap->prevp->br_startoff != NULLFILEOFF && - !ISNULLSTARTBLOCK(ap->prevp->br_startblock) && + !isnullstartblock(ap->prevp->br_startblock) && (prevbno = ap->prevp->br_startblock + ap->prevp->br_blockcount) && ISVALID(prevbno, ap->prevp->br_startblock)) { @@ -2506,7 +2506,7 @@ xfs_bmap_adjacent( * If there's a following (right) block, select a requested * start block based on it. */ - if (!ISNULLSTARTBLOCK(ap->gotp->br_startblock)) { + if (!isnullstartblock(ap->gotp->br_startblock)) { /* * Calculate gap to start of next block. */ @@ -3036,7 +3036,7 @@ xfs_bmap_btree_to_extents( ASSERT(ifp->if_broot == NULL); ASSERT((ifp->if_flags & XFS_IFBROOT) == 0); XFS_IFORK_FMT_SET(ip, whichfork, XFS_DINODE_FMT_EXTENTS); - *logflagsp = XFS_ILOG_CORE | XFS_ILOG_FEXT(whichfork); + *logflagsp = XFS_ILOG_CORE | xfs_ilog_fext(whichfork); return 0; } @@ -3090,8 +3090,8 @@ xfs_bmap_del_extent( del_endoff = del->br_startoff + del->br_blockcount; got_endoff = got.br_startoff + got.br_blockcount; ASSERT(got_endoff >= del_endoff); - delay = ISNULLSTARTBLOCK(got.br_startblock); - ASSERT(ISNULLSTARTBLOCK(del->br_startblock) == delay); + delay = isnullstartblock(got.br_startblock); + ASSERT(isnullstartblock(del->br_startblock) == delay); flags = 0; qfield = 0; error = 0; @@ -3143,7 +3143,7 @@ xfs_bmap_del_extent( } da_old = da_new = 0; } else { - da_old = STARTBLOCKVAL(got.br_startblock); + da_old = startblockval(got.br_startblock); da_new = 0; nblks = 0; do_fx = 0; @@ -3167,7 +3167,7 @@ xfs_bmap_del_extent( XFS_IFORK_NEXTENTS(ip, whichfork) - 1); flags |= XFS_ILOG_CORE; if (!cur) { - flags |= XFS_ILOG_FEXT(whichfork); + flags |= xfs_ilog_fext(whichfork); break; } if ((error = xfs_bmbt_delete(cur, &i))) @@ -3187,7 +3187,7 @@ xfs_bmap_del_extent( if (delay) { temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), da_old); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, whichfork); da_new = temp; @@ -3196,7 +3196,7 @@ xfs_bmap_del_extent( xfs_bmbt_set_startblock(ep, del_endblock); XFS_BMAP_TRACE_POST_UPDATE("2", ip, idx, whichfork); if (!cur) { - flags |= XFS_ILOG_FEXT(whichfork); + flags |= xfs_ilog_fext(whichfork); break; } if ((error = xfs_bmbt_update(cur, del_endoff, del_endblock, @@ -3216,7 +3216,7 @@ xfs_bmap_del_extent( if (delay) { temp = XFS_FILBLKS_MIN(xfs_bmap_worst_indlen(ip, temp), da_old); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, whichfork); da_new = temp; @@ -3224,7 +3224,7 @@ xfs_bmap_del_extent( } XFS_BMAP_TRACE_POST_UPDATE("1", ip, idx, whichfork); if (!cur) { - flags |= XFS_ILOG_FEXT(whichfork); + flags |= xfs_ilog_fext(whichfork); break; } if ((error = xfs_bmbt_update(cur, got.br_startoff, @@ -3299,22 +3299,22 @@ xfs_bmap_del_extent( } XFS_WANT_CORRUPTED_GOTO(i == 1, done); } else - flags |= XFS_ILOG_FEXT(whichfork); + flags |= xfs_ilog_fext(whichfork); XFS_IFORK_NEXT_SET(ip, whichfork, XFS_IFORK_NEXTENTS(ip, whichfork) + 1); } else { ASSERT(whichfork == XFS_DATA_FORK); temp = xfs_bmap_worst_indlen(ip, temp); - xfs_bmbt_set_startblock(ep, NULLSTARTBLOCK((int)temp)); + xfs_bmbt_set_startblock(ep, nullstartblock((int)temp)); temp2 = xfs_bmap_worst_indlen(ip, temp2); - new.br_startblock = NULLSTARTBLOCK((int)temp2); + new.br_startblock = nullstartblock((int)temp2); da_new = temp + temp2; while (da_new > da_old) { if (temp) { temp--; da_new--; xfs_bmbt_set_startblock(ep, - NULLSTARTBLOCK((int)temp)); + nullstartblock((int)temp)); } if (da_new == da_old) break; @@ -3322,7 +3322,7 @@ xfs_bmap_del_extent( temp2--; da_new--; new.br_startblock = - NULLSTARTBLOCK((int)temp2); + nullstartblock((int)temp2); } } } @@ -3498,7 +3498,7 @@ xfs_bmap_extents_to_btree( nextents = ifp->if_bytes / (uint)sizeof(xfs_bmbt_rec_t); for (cnt = i = 0; i < nextents; i++) { ep = xfs_iext_get_ext(ifp, i); - if (!ISNULLSTARTBLOCK(xfs_bmbt_get_startblock(ep))) { + if (!isnullstartblock(xfs_bmbt_get_startblock(ep))) { arp->l0 = cpu_to_be64(ep->l0); arp->l1 = cpu_to_be64(ep->l1); arp++; cnt++; @@ -3522,7 +3522,7 @@ xfs_bmap_extents_to_btree( xfs_bmbt_log_recs(cur, abp, 1, be16_to_cpu(ablock->bb_numrecs)); ASSERT(*curp == NULL); *curp = cur; - *logflagsp = XFS_ILOG_CORE | XFS_ILOG_FBROOT(whichfork); + *logflagsp = XFS_ILOG_CORE | xfs_ilog_fbroot(whichfork); return 0; } @@ -3626,7 +3626,7 @@ xfs_bmap_local_to_extents( ip->i_d.di_nblocks = 1; XFS_TRANS_MOD_DQUOT_BYINO(args.mp, tp, ip, XFS_TRANS_DQ_BCOUNT, 1L); - flags |= XFS_ILOG_FEXT(whichfork); + flags |= xfs_ilog_fext(whichfork); } else { ASSERT(XFS_IFORK_NEXTENTS(ip, whichfork) == 0); xfs_bmap_forkoff_reset(ip->i_mount, ip, whichfork); @@ -4032,7 +4032,7 @@ xfs_bmap_add_attrfork( XFS_IFORK_ASIZE(ip) / (uint)sizeof(xfs_bmbt_rec_t); ip->i_afp->if_flags = XFS_IFEXTENTS; logflags = 0; - XFS_BMAP_INIT(&flist, &firstblock); + xfs_bmap_init(&flist, &firstblock); switch (ip->i_d.di_format) { case XFS_DINODE_FMT_LOCAL: error = xfs_bmap_add_attrfork_local(tp, ip, &firstblock, &flist, @@ -4112,7 +4112,7 @@ xfs_bmap_add_free( ASSERT(bno != NULLFSBLOCK); ASSERT(len > 0); ASSERT(len <= MAXEXTLEN); - ASSERT(!ISNULLSTARTBLOCK(bno)); + ASSERT(!isnullstartblock(bno)); agno = XFS_FSB_TO_AGNO(mp, bno); agbno = XFS_FSB_TO_AGBNO(mp, bno); ASSERT(agno < mp->m_sb.sb_agcount); @@ -4837,7 +4837,7 @@ xfs_bmapi( got.br_startoff = end; inhole = eof || got.br_startoff > bno; wasdelay = wr && !inhole && !(flags & XFS_BMAPI_DELAY) && - ISNULLSTARTBLOCK(got.br_startblock); + isnullstartblock(got.br_startblock); /* * First, deal with the hole before the allocated space * that we found, if any. @@ -4956,7 +4956,7 @@ xfs_bmapi( } ip->i_delayed_blks += alen; - abno = NULLSTARTBLOCK(indlen); + abno = nullstartblock(indlen); } else { /* * If first time, allocate and fill in @@ -5073,8 +5073,8 @@ xfs_bmapi( aoff + alen); #ifdef DEBUG if (flags & XFS_BMAPI_DELAY) { - ASSERT(ISNULLSTARTBLOCK(got.br_startblock)); - ASSERT(STARTBLOCKVAL(got.br_startblock) > 0); + ASSERT(isnullstartblock(got.br_startblock)); + ASSERT(startblockval(got.br_startblock) > 0); } ASSERT(got.br_state == XFS_EXT_NORM || got.br_state == XFS_EXT_UNWRITTEN); @@ -5108,7 +5108,7 @@ xfs_bmapi( ASSERT((bno >= obno) || (n == 0)); ASSERT(bno < end); mval->br_startoff = bno; - if (ISNULLSTARTBLOCK(got.br_startblock)) { + if (isnullstartblock(got.br_startblock)) { ASSERT(!wr || (flags & XFS_BMAPI_DELAY)); mval->br_startblock = DELAYSTARTBLOCK; } else @@ -5130,7 +5130,7 @@ xfs_bmapi( ASSERT(mval->br_blockcount <= len); } else { *mval = got; - if (ISNULLSTARTBLOCK(mval->br_startblock)) { + if (isnullstartblock(mval->br_startblock)) { ASSERT(!wr || (flags & XFS_BMAPI_DELAY)); mval->br_startblock = DELAYSTARTBLOCK; } @@ -5259,12 +5259,12 @@ error0: * Log everything. Do this after conversion, there's no point in * logging the extent records if we've converted to btree format. */ - if ((logflags & XFS_ILOG_FEXT(whichfork)) && + if ((logflags & xfs_ilog_fext(whichfork)) && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) - logflags &= ~XFS_ILOG_FEXT(whichfork); - else if ((logflags & XFS_ILOG_FBROOT(whichfork)) && + logflags &= ~xfs_ilog_fext(whichfork); + else if ((logflags & xfs_ilog_fbroot(whichfork)) && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) - logflags &= ~XFS_ILOG_FBROOT(whichfork); + logflags &= ~xfs_ilog_fbroot(whichfork); /* * Log whatever the flags say, even if error. Otherwise we might miss * detecting a case where the data is changed, there's an error, @@ -5341,7 +5341,7 @@ xfs_bmapi_single( *fsb = NULLFSBLOCK; return 0; } - ASSERT(!ISNULLSTARTBLOCK(got.br_startblock)); + ASSERT(!isnullstartblock(got.br_startblock)); ASSERT(bno < got.br_startoff + got.br_blockcount); *fsb = got.br_startblock + (bno - got.br_startoff); ifp->if_lastex = lastx; @@ -5474,7 +5474,7 @@ xfs_bunmapi( */ ASSERT(ep != NULL); del = got; - wasdel = ISNULLSTARTBLOCK(del.br_startblock); + wasdel = isnullstartblock(del.br_startblock); if (got.br_startoff < start) { del.br_startoff = start; del.br_blockcount -= start - got.br_startoff; @@ -5569,7 +5569,7 @@ xfs_bunmapi( xfs_bmbt_get_all(xfs_iext_get_ext(ifp, lastx - 1), &prev); ASSERT(prev.br_state == XFS_EXT_NORM); - ASSERT(!ISNULLSTARTBLOCK(prev.br_startblock)); + ASSERT(!isnullstartblock(prev.br_startblock)); ASSERT(del.br_startblock == prev.br_startblock + prev.br_blockcount); if (prev.br_startoff < start) { @@ -5597,7 +5597,7 @@ xfs_bunmapi( } } if (wasdel) { - ASSERT(STARTBLOCKVAL(del.br_startblock) > 0); + ASSERT(startblockval(del.br_startblock) > 0); /* Update realtime/data freespace, unreserve quota */ if (isrt) { xfs_filblks_t rtexts; @@ -5713,12 +5713,12 @@ error0: * Log everything. Do this after conversion, there's no point in * logging the extent records if we've converted to btree format. */ - if ((logflags & XFS_ILOG_FEXT(whichfork)) && + if ((logflags & xfs_ilog_fext(whichfork)) && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_EXTENTS) - logflags &= ~XFS_ILOG_FEXT(whichfork); - else if ((logflags & XFS_ILOG_FBROOT(whichfork)) && + logflags &= ~xfs_ilog_fext(whichfork); + else if ((logflags & xfs_ilog_fbroot(whichfork)) && XFS_IFORK_FORMAT(ip, whichfork) != XFS_DINODE_FMT_BTREE) - logflags &= ~XFS_ILOG_FBROOT(whichfork); + logflags &= ~xfs_ilog_fbroot(whichfork); /* * Log inode even in the error case, if the transaction * is dirty we'll need to shut down the filesystem. @@ -5763,7 +5763,7 @@ xfs_getbmapx_fix_eof_hole( out->bmv_length = fixlen; } } else { - out->bmv_block = XFS_FSB_TO_DB(ip, startblock); + out->bmv_block = xfs_fsb_to_db(ip, startblock); } return 1; @@ -5895,7 +5895,7 @@ xfs_getbmap( if (nex > XFS_IFORK_NEXTENTS(ip, whichfork) * 2 + 1) nex = XFS_IFORK_NEXTENTS(ip, whichfork) * 2 + 1; - bmapi_flags = XFS_BMAPI_AFLAG(whichfork) | + bmapi_flags = xfs_bmapi_aflag(whichfork) | ((sh_unwritten) ? 0 : XFS_BMAPI_IGSTATE); /* @@ -6023,7 +6023,7 @@ xfs_bmap_isaeof( */ *aeof = (off >= s.br_startoff && off < s.br_startoff + s.br_blockcount && - ISNULLSTARTBLOCK(s.br_startblock)) || + isnullstartblock(s.br_startblock)) || off >= s.br_startoff + s.br_blockcount; return 0; } Index: linux-2.6-xfs/fs/xfs/xfsidbg.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfsidbg.c +++ linux-2.6-xfs/fs/xfs/xfsidbg.c @@ -3264,8 +3264,8 @@ xfs_fmtfsblock(xfs_fsblock_t bno, xfs_mo if (bno == NULLFSBLOCK) sprintf(rval, "NULLFSBLOCK"); - else if (ISNULLSTARTBLOCK(bno)) - sprintf(rval, "NULLSTARTBLOCK(%Ld)", STARTBLOCKVAL(bno)); + else if (isnullstartblock(bno)) + sprintf(rval, "nullstartblock(%Ld)", startblockval(bno)); else if (mp) sprintf(rval, "%Ld[%x:%x]", (xfs_dfsbno_t)bno, XFS_FSB_TO_AGNO(mp, bno), XFS_FSB_TO_AGBNO(mp, bno)); Index: linux-2.6-xfs/fs/xfs/xfs_ag.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ag.h +++ linux-2.6-xfs/fs/xfs/xfs_ag.h @@ -220,7 +220,7 @@ typedef struct xfs_perag #define XFS_FSB_TO_AGNO(mp,fsbno) \ ((xfs_agnumber_t)((fsbno) >> (mp)->m_sb.sb_agblklog)) #define XFS_FSB_TO_AGBNO(mp,fsbno) \ - ((xfs_agblock_t)((fsbno) & XFS_MASK32LO((mp)->m_sb.sb_agblklog))) + ((xfs_agblock_t)((fsbno) & xfs_mask32lo((mp)->m_sb.sb_agblklog))) #define XFS_AGB_TO_DADDR(mp,agno,agbno) \ ((xfs_daddr_t)XFS_FSB_TO_BB(mp, \ (xfs_fsblock_t)(agno) * (mp)->m_sb.sb_agblocks + (agbno))) @@ -233,8 +233,8 @@ typedef struct xfs_perag #define XFS_AG_CHECK_DADDR(mp,d,len) \ ((len) == 1 ? \ ASSERT((d) == XFS_SB_DADDR || \ - XFS_DADDR_TO_AGBNO(mp, d) != XFS_SB_DADDR) : \ - ASSERT(XFS_DADDR_TO_AGNO(mp, d) == \ - XFS_DADDR_TO_AGNO(mp, (d) + (len) - 1))) + xfs_daddr_to_agbno(mp, d) != XFS_SB_DADDR) : \ + ASSERT(xfs_daddr_to_agno(mp, d) == \ + xfs_daddr_to_agno(mp, (d) + (len) - 1))) #endif /* __XFS_AG_H__ */ Index: linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_alloc_btree.c +++ linux-2.6-xfs/fs/xfs/xfs_alloc_btree.c @@ -1368,7 +1368,7 @@ xfs_alloc_newroot( /* * Our block is left, pick up the right block. */ - lbno = XFS_DADDR_TO_AGBNO(mp, XFS_BUF_ADDR(lbp)); + lbno = xfs_daddr_to_agbno(mp, XFS_BUF_ADDR(lbp)); rbno = be32_to_cpu(left->bb_rightsib); if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, cur->bc_private.a.agno, rbno, 0, &rbp, @@ -1385,7 +1385,7 @@ xfs_alloc_newroot( */ rbp = lbp; right = left; - rbno = XFS_DADDR_TO_AGBNO(mp, XFS_BUF_ADDR(rbp)); + rbno = xfs_daddr_to_agbno(mp, XFS_BUF_ADDR(rbp)); lbno = be32_to_cpu(right->bb_leftsib); if ((error = xfs_btree_read_bufs(mp, cur->bc_tp, cur->bc_private.a.agno, lbno, 0, &lbp, @@ -1688,7 +1688,7 @@ xfs_alloc_split( * Find the left block number by looking in the buffer. * Adjust numrecs, sibling pointers. */ - lbno = XFS_DADDR_TO_AGBNO(cur->bc_mp, XFS_BUF_ADDR(lbp)); + lbno = xfs_daddr_to_agbno(cur->bc_mp, XFS_BUF_ADDR(lbp)); be16_add(&left->bb_numrecs, -(be16_to_cpu(right->bb_numrecs))); right->bb_rightsib = left->bb_rightsib; left->bb_rightsib = cpu_to_be32(rbno); Index: linux-2.6-xfs/fs/xfs/xfs_attr.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_attr.c +++ linux-2.6-xfs/fs/xfs/xfs_attr.c @@ -374,7 +374,7 @@ xfs_attr_set_int(xfs_inode_t *dp, struct * It won't fit in the shortform, transform to a leaf block. * GROT: another possible req'mt for a double-split btree op. */ - XFS_BMAP_INIT(args.flist, args.firstblock); + xfs_bmap_init(args.flist, args.firstblock); error = xfs_attr_shortform_to_leaf(&args); if (!error) { error = xfs_bmap_finish(&args.trans, args.flist, @@ -956,7 +956,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *arg * Commit that transaction so that the node_addname() call * can manage its own transactions. */ - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr_leaf_to_node(args); if (!error) { error = xfs_bmap_finish(&args->trans, args->flist, @@ -1057,7 +1057,7 @@ xfs_attr_leaf_addname(xfs_da_args_t *arg * If the result is small enough, shrink it all into the inode. */ if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) { - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ if (!error) { @@ -1135,7 +1135,7 @@ xfs_attr_leaf_removename(xfs_da_args_t * * If the result is small enough, shrink it all into the inode. */ if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) { - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ if (!error) { @@ -1290,7 +1290,7 @@ restart: * have been a b-tree. */ xfs_da_state_free(state); - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr_leaf_to_node(args); if (!error) { error = xfs_bmap_finish(&args->trans, @@ -1331,7 +1331,7 @@ restart: * in the index/blkno/rmtblkno/rmtblkcnt fields and * in the index2/blkno2/rmtblkno2/rmtblkcnt2 fields. */ - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_da_split(state); if (!error) { error = xfs_bmap_finish(&args->trans, args->flist, @@ -1443,7 +1443,7 @@ restart: * Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active > 1)) { - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_da_join(state); if (!error) { error = xfs_bmap_finish(&args->trans, @@ -1579,7 +1579,7 @@ xfs_attr_node_removename(xfs_da_args_t * * Check to see if the tree needs to be collapsed. */ if (retval && (state->path.active > 1)) { - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_da_join(state); if (!error) { error = xfs_bmap_finish(&args->trans, args->flist, @@ -1630,7 +1630,7 @@ xfs_attr_node_removename(xfs_da_args_t * == XFS_ATTR_LEAF_MAGIC); if ((forkoff = xfs_attr_shortform_allfit(bp, dp))) { - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_attr_leaf_to_shortform(bp, args, forkoff); /* bp is gone due to xfs_da_shrink_inode */ if (!error) { @@ -2069,7 +2069,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) /* * Allocate a single extent, up to the size of the value. */ - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); nmap = 1; error = xfs_bmapi(args->trans, dp, (xfs_fileoff_t)lblkno, blkcnt, @@ -2123,7 +2123,7 @@ xfs_attr_rmtval_set(xfs_da_args_t *args) /* * Try to remember where we decided to put the value. */ - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); nmap = 1; error = xfs_bmapi(NULL, dp, (xfs_fileoff_t)lblkno, args->rmtblkcnt, @@ -2188,7 +2188,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *ar /* * Try to remember where we decided to put the value. */ - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); nmap = 1; error = xfs_bmapi(NULL, args->dp, (xfs_fileoff_t)lblkno, args->rmtblkcnt, @@ -2229,7 +2229,7 @@ xfs_attr_rmtval_remove(xfs_da_args_t *ar blkcnt = args->rmtblkcnt; done = 0; while (!done) { - XFS_BMAP_INIT(args->flist, args->firstblock); + xfs_bmap_init(args->flist, args->firstblock); error = xfs_bunmapi(args->trans, args->dp, lblkno, blkcnt, XFS_BMAPI_ATTRFORK | XFS_BMAPI_METADATA, 1, args->firstblock, args->flist, Index: linux-2.6-xfs/fs/xfs/xfs_bit.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bit.h +++ linux-2.6-xfs/fs/xfs/xfs_bit.h @@ -25,22 +25,21 @@ /* * masks with n high/low bits set, 32-bit values & 64-bit values */ -#define XFS_MASK32HI(n) xfs_mask32hi(n) static inline __uint32_t xfs_mask32hi(int n) { return (__uint32_t)-1 << (32 - (n)); } -#define XFS_MASK64HI(n) xfs_mask64hi(n) + static inline __uint64_t xfs_mask64hi(int n) { return (__uint64_t)-1 << (64 - (n)); } -#define XFS_MASK32LO(n) xfs_mask32lo(n) + static inline __uint32_t xfs_mask32lo(int n) { return ((__uint32_t)1 << (n)) - 1; } -#define XFS_MASK64LO(n) xfs_mask64lo(n) + static inline __uint64_t xfs_mask64lo(int n) { return ((__uint64_t)1 << (n)) - 1; Index: linux-2.6-xfs/fs/xfs/xfs_bmap.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap.h +++ linux-2.6-xfs/fs/xfs/xfs_bmap.h @@ -95,7 +95,6 @@ typedef struct xfs_bmap_free /* need write cache flushing and no */ /* additional allocation alignments */ -#define XFS_BMAPI_AFLAG(w) xfs_bmapi_aflag(w) static inline int xfs_bmapi_aflag(int w) { return (w == XFS_ATTR_FORK ? XFS_BMAPI_ATTRFORK : 0); @@ -107,7 +106,6 @@ static inline int xfs_bmapi_aflag(int w) #define DELAYSTARTBLOCK ((xfs_fsblock_t)-1LL) #define HOLESTARTBLOCK ((xfs_fsblock_t)-2LL) -#define XFS_BMAP_INIT(flp,fbp) xfs_bmap_init(flp,fbp) static inline void xfs_bmap_init(xfs_bmap_free_t *flp, xfs_fsblock_t *fbp) { ((flp)->xbf_first = NULL, (flp)->xbf_count = 0, \ Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.c +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.c @@ -949,7 +949,7 @@ xfs_bmbt_killroot( cur->bc_bufs[level - 1] = NULL; be16_add(&block->bb_level, -1); xfs_trans_log_inode(cur->bc_tp, ip, - XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_private.b.whichfork)); cur->bc_nlevels--; XFS_BMBT_TRACE_CURSOR(cur, EXIT); return 0; @@ -986,7 +986,7 @@ xfs_bmbt_log_keys( ip = cur->bc_private.b.ip; xfs_trans_log_inode(tp, ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + xfs_ilog_fbroot(cur->bc_private.b.whichfork)); } XFS_BMBT_TRACE_CURSOR(cur, EXIT); } @@ -1022,7 +1022,7 @@ xfs_bmbt_log_ptrs( ip = cur->bc_private.b.ip; xfs_trans_log_inode(tp, ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + xfs_ilog_fbroot(cur->bc_private.b.whichfork)); } XFS_BMBT_TRACE_CURSOR(cur, EXIT); } @@ -1827,25 +1827,25 @@ __xfs_bmbt_get_all( ext_flag = (int)(l0 >> (64 - BMBT_EXNTFLAG_BITLEN)); s->br_startoff = ((xfs_fileoff_t)l0 & - XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; + xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; #if XFS_BIG_BLKNOS - s->br_startblock = (((xfs_fsblock_t)l0 & XFS_MASK64LO(9)) << 43) | + s->br_startblock = (((xfs_fsblock_t)l0 & xfs_mask64lo(9)) << 43) | (((xfs_fsblock_t)l1) >> 21); #else #ifdef DEBUG { xfs_dfsbno_t b; - b = (((xfs_dfsbno_t)l0 & XFS_MASK64LO(9)) << 43) | + b = (((xfs_dfsbno_t)l0 & xfs_mask64lo(9)) << 43) | (((xfs_dfsbno_t)l1) >> 21); - ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); + ASSERT((b >> 32) == 0 || isnulldstartblock(b)); s->br_startblock = (xfs_fsblock_t)b; } #else /* !DEBUG */ s->br_startblock = (xfs_fsblock_t)(((xfs_dfsbno_t)l1) >> 21); #endif /* DEBUG */ #endif /* XFS_BIG_BLKNOS */ - s->br_blockcount = (xfs_filblks_t)(l1 & XFS_MASK64LO(21)); + s->br_blockcount = (xfs_filblks_t)(l1 & xfs_mask64lo(21)); /* This is xfs_extent_state() in-line */ if (ext_flag) { ASSERT(s->br_blockcount != 0); /* saved for DMIG */ @@ -1895,7 +1895,7 @@ xfs_filblks_t xfs_bmbt_get_blockcount( xfs_bmbt_rec_host_t *r) { - return (xfs_filblks_t)(r->l1 & XFS_MASK64LO(21)); + return (xfs_filblks_t)(r->l1 & xfs_mask64lo(21)); } /* @@ -1906,15 +1906,15 @@ xfs_bmbt_get_startblock( xfs_bmbt_rec_host_t *r) { #if XFS_BIG_BLKNOS - return (((xfs_fsblock_t)r->l0 & XFS_MASK64LO(9)) << 43) | + return (((xfs_fsblock_t)r->l0 & xfs_mask64lo(9)) << 43) | (((xfs_fsblock_t)r->l1) >> 21); #else #ifdef DEBUG xfs_dfsbno_t b; - b = (((xfs_dfsbno_t)r->l0 & XFS_MASK64LO(9)) << 43) | + b = (((xfs_dfsbno_t)r->l0 & xfs_mask64lo(9)) << 43) | (((xfs_dfsbno_t)r->l1) >> 21); - ASSERT((b >> 32) == 0 || ISNULLDSTARTBLOCK(b)); + ASSERT((b >> 32) == 0 || isnulldstartblock(b)); return (xfs_fsblock_t)b; #else /* !DEBUG */ return (xfs_fsblock_t)(((xfs_dfsbno_t)r->l1) >> 21); @@ -1930,7 +1930,7 @@ xfs_bmbt_get_startoff( xfs_bmbt_rec_host_t *r) { return ((xfs_fileoff_t)r->l0 & - XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; + xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; } xfs_exntst_t @@ -1960,7 +1960,7 @@ xfs_filblks_t xfs_bmbt_disk_get_blockcount( xfs_bmbt_rec_t *r) { - return (xfs_filblks_t)(be64_to_cpu(r->l1) & XFS_MASK64LO(21)); + return (xfs_filblks_t)(be64_to_cpu(r->l1) & xfs_mask64lo(21)); } /* @@ -1971,7 +1971,7 @@ xfs_bmbt_disk_get_startoff( xfs_bmbt_rec_t *r) { return ((xfs_fileoff_t)be64_to_cpu(r->l0) & - XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; + xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN)) >> 9; } /* @@ -2146,7 +2146,7 @@ xfs_bmbt_log_block( xfs_trans_log_buf(tp, bp, first, last); } else xfs_trans_log_inode(tp, cur->bc_private.b.ip, - XFS_ILOG_FBROOT(cur->bc_private.b.whichfork)); + xfs_ilog_fbroot(cur->bc_private.b.whichfork)); XFS_BMBT_TRACE_CURSOR(cur, EXIT); } @@ -2312,7 +2312,7 @@ xfs_bmbt_newroot( xfs_bmbt_log_ptrs(cur, bp, 1, be16_to_cpu(cblock->bb_numrecs)); XFS_BMBT_TRACE_CURSOR(cur, EXIT); *logflags |= - XFS_ILOG_CORE | XFS_ILOG_FBROOT(cur->bc_private.b.whichfork); + XFS_ILOG_CORE | xfs_ilog_fbroot(cur->bc_private.b.whichfork); *stat = 1; return 0; } @@ -2331,33 +2331,33 @@ xfs_bmbt_set_allf( int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); - ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0); - ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); + ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); + ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); #if XFS_BIG_BLKNOS - ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0); + ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | ((xfs_bmbt_rec_base_t)startoff << 9) | ((xfs_bmbt_rec_base_t)startblock >> 43); r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | ((xfs_bmbt_rec_base_t)blockcount & - (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); + (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); #else /* !XFS_BIG_BLKNOS */ - if (ISNULLSTARTBLOCK(startblock)) { + if (isnullstartblock(startblock)) { r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | ((xfs_bmbt_rec_base_t)startoff << 9) | - (xfs_bmbt_rec_base_t)XFS_MASK64LO(9); - r->l1 = XFS_MASK64HI(11) | + (xfs_bmbt_rec_base_t)xfs_mask64lo(9); + r->l1 = xfs_mask64hi(11) | ((xfs_bmbt_rec_base_t)startblock << 21) | ((xfs_bmbt_rec_base_t)blockcount & - (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); + (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); } else { r->l0 = ((xfs_bmbt_rec_base_t)extent_flag << 63) | ((xfs_bmbt_rec_base_t)startoff << 9); r->l1 = ((xfs_bmbt_rec_base_t)startblock << 21) | ((xfs_bmbt_rec_base_t)blockcount & - (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); + (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); } #endif /* XFS_BIG_BLKNOS */ } @@ -2389,11 +2389,11 @@ xfs_bmbt_disk_set_allf( int extent_flag = (state == XFS_EXT_NORM) ? 0 : 1; ASSERT(state == XFS_EXT_NORM || state == XFS_EXT_UNWRITTEN); - ASSERT((startoff & XFS_MASK64HI(64-BMBT_STARTOFF_BITLEN)) == 0); - ASSERT((blockcount & XFS_MASK64HI(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); + ASSERT((startoff & xfs_mask64hi(64-BMBT_STARTOFF_BITLEN)) == 0); + ASSERT((blockcount & xfs_mask64hi(64-BMBT_BLOCKCOUNT_BITLEN)) == 0); #if XFS_BIG_BLKNOS - ASSERT((startblock & XFS_MASK64HI(64-BMBT_STARTBLOCK_BITLEN)) == 0); + ASSERT((startblock & xfs_mask64hi(64-BMBT_STARTBLOCK_BITLEN)) == 0); r->l0 = cpu_to_be64( ((xfs_bmbt_rec_base_t)extent_flag << 63) | @@ -2402,17 +2402,17 @@ xfs_bmbt_disk_set_allf( r->l1 = cpu_to_be64( ((xfs_bmbt_rec_base_t)startblock << 21) | ((xfs_bmbt_rec_base_t)blockcount & - (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); + (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); #else /* !XFS_BIG_BLKNOS */ - if (ISNULLSTARTBLOCK(startblock)) { + if (isnullstartblock(startblock)) { r->l0 = cpu_to_be64( ((xfs_bmbt_rec_base_t)extent_flag << 63) | ((xfs_bmbt_rec_base_t)startoff << 9) | - (xfs_bmbt_rec_base_t)XFS_MASK64LO(9)); - r->l1 = cpu_to_be64(XFS_MASK64HI(11) | + (xfs_bmbt_rec_base_t)xfs_mask64lo(9)); + r->l1 = cpu_to_be64(xfs_mask64hi(11) | ((xfs_bmbt_rec_base_t)startblock << 21) | ((xfs_bmbt_rec_base_t)blockcount & - (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); + (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); } else { r->l0 = cpu_to_be64( ((xfs_bmbt_rec_base_t)extent_flag << 63) | @@ -2420,7 +2420,7 @@ xfs_bmbt_disk_set_allf( r->l1 = cpu_to_be64( ((xfs_bmbt_rec_base_t)startblock << 21) | ((xfs_bmbt_rec_base_t)blockcount & - (xfs_bmbt_rec_base_t)XFS_MASK64LO(21))); + (xfs_bmbt_rec_base_t)xfs_mask64lo(21))); } #endif /* XFS_BIG_BLKNOS */ } @@ -2445,9 +2445,9 @@ xfs_bmbt_set_blockcount( xfs_bmbt_rec_host_t *r, xfs_filblks_t v) { - ASSERT((v & XFS_MASK64HI(43)) == 0); - r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(43)) | - (xfs_bmbt_rec_base_t)(v & XFS_MASK64LO(21)); + ASSERT((v & xfs_mask64hi(43)) == 0); + r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64hi(43)) | + (xfs_bmbt_rec_base_t)(v & xfs_mask64lo(21)); } /* @@ -2459,21 +2459,21 @@ xfs_bmbt_set_startblock( xfs_fsblock_t v) { #if XFS_BIG_BLKNOS - ASSERT((v & XFS_MASK64HI(12)) == 0); - r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64HI(55)) | + ASSERT((v & xfs_mask64hi(12)) == 0); + r->l0 = (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64hi(55)) | (xfs_bmbt_rec_base_t)(v >> 43); - r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)) | + r->l1 = (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)) | (xfs_bmbt_rec_base_t)(v << 21); #else /* !XFS_BIG_BLKNOS */ - if (ISNULLSTARTBLOCK(v)) { - r->l0 |= (xfs_bmbt_rec_base_t)XFS_MASK64LO(9); - r->l1 = (xfs_bmbt_rec_base_t)XFS_MASK64HI(11) | + if (isnullstartblock(v)) { + r->l0 |= (xfs_bmbt_rec_base_t)xfs_mask64lo(9); + r->l1 = (xfs_bmbt_rec_base_t)xfs_mask64hi(11) | ((xfs_bmbt_rec_base_t)v << 21) | - (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); + (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); } else { - r->l0 &= ~(xfs_bmbt_rec_base_t)XFS_MASK64LO(9); + r->l0 &= ~(xfs_bmbt_rec_base_t)xfs_mask64lo(9); r->l1 = ((xfs_bmbt_rec_base_t)v << 21) | - (r->l1 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(21)); + (r->l1 & (xfs_bmbt_rec_base_t)xfs_mask64lo(21)); } #endif /* XFS_BIG_BLKNOS */ } @@ -2486,10 +2486,10 @@ xfs_bmbt_set_startoff( xfs_bmbt_rec_host_t *r, xfs_fileoff_t v) { - ASSERT((v & XFS_MASK64HI(9)) == 0); - r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) XFS_MASK64HI(1)) | + ASSERT((v & xfs_mask64hi(9)) == 0); + r->l0 = (r->l0 & (xfs_bmbt_rec_base_t) xfs_mask64hi(1)) | ((xfs_bmbt_rec_base_t)v << 9) | - (r->l0 & (xfs_bmbt_rec_base_t)XFS_MASK64LO(9)); + (r->l0 & (xfs_bmbt_rec_base_t)xfs_mask64lo(9)); } /* @@ -2502,9 +2502,9 @@ xfs_bmbt_set_state( { ASSERT(v == XFS_EXT_NORM || v == XFS_EXT_UNWRITTEN); if (v == XFS_EXT_NORM) - r->l0 &= XFS_MASK64LO(64 - BMBT_EXNTFLAG_BITLEN); + r->l0 &= xfs_mask64lo(64 - BMBT_EXNTFLAG_BITLEN); else - r->l0 |= XFS_MASK64HI(BMBT_EXNTFLAG_BITLEN); + r->l0 |= xfs_mask64hi(BMBT_EXNTFLAG_BITLEN); } /* Index: linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_bmap_btree.h +++ linux-2.6-xfs/fs/xfs/xfs_bmap_btree.h @@ -75,26 +75,22 @@ typedef struct xfs_bmbt_rec_host { #define DSTARTBLOCKMASK \ (((((xfs_dfsbno_t)1) << DSTARTBLOCKMASKBITS) - 1) << STARTBLOCKVALBITS) -#define ISNULLSTARTBLOCK(x) isnullstartblock(x) static inline int isnullstartblock(xfs_fsblock_t x) { return ((x) & STARTBLOCKMASK) == STARTBLOCKMASK; } -#define ISNULLDSTARTBLOCK(x) isnulldstartblock(x) static inline int isnulldstartblock(xfs_dfsbno_t x) { return ((x) & DSTARTBLOCKMASK) == DSTARTBLOCKMASK; } -#define NULLSTARTBLOCK(k) nullstartblock(k) static inline xfs_fsblock_t nullstartblock(int k) { ASSERT(k < (1 << STARTBLOCKVALBITS)); return STARTBLOCKMASK | (k); } -#define STARTBLOCKVAL(x) startblockval(x) static inline xfs_filblks_t startblockval(xfs_fsblock_t x) { return (xfs_filblks_t)((x) & ~STARTBLOCKMASK); Index: linux-2.6-xfs/fs/xfs/xfs_da_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_da_btree.c +++ linux-2.6-xfs/fs/xfs/xfs_da_btree.c @@ -1594,7 +1594,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, x nmap = 1; ASSERT(args->firstblock != NULL); if ((error = xfs_bmapi(tp, dp, bno, count, - XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA| + xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE|XFS_BMAPI_METADATA| XFS_BMAPI_CONTIG, args->firstblock, args->total, &map, &nmap, args->flist, NULL))) { @@ -1615,7 +1615,7 @@ xfs_da_grow_inode(xfs_da_args_t *args, x nmap = MIN(XFS_BMAP_MAX_NMAP, count); c = (int)(bno + count - b); if ((error = xfs_bmapi(tp, dp, b, c, - XFS_BMAPI_AFLAG(w)|XFS_BMAPI_WRITE| + xfs_bmapi_aflag(w)|XFS_BMAPI_WRITE| XFS_BMAPI_METADATA, args->firstblock, args->total, &mapp[mapi], &nmap, args->flist, @@ -1877,7 +1877,7 @@ xfs_da_shrink_inode(xfs_da_args_t *args, * the last block to the place we want to kill. */ if ((error = xfs_bunmapi(tp, dp, dead_blkno, count, - XFS_BMAPI_AFLAG(w)|XFS_BMAPI_METADATA, + xfs_bmapi_aflag(w)|XFS_BMAPI_METADATA, 0, args->firstblock, args->flist, NULL, &done)) == ENOSPC) { if (w != XFS_DATA_FORK) @@ -1982,7 +1982,7 @@ xfs_da_do_buf( if ((error = xfs_bmapi(trans, dp, (xfs_fileoff_t)bno, nfsb, XFS_BMAPI_METADATA | - XFS_BMAPI_AFLAG(whichfork), + xfs_bmapi_aflag(whichfork), NULL, 0, mapp, &nmap, NULL, NULL))) goto exit0; } Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.c +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.c @@ -315,7 +315,7 @@ xfs_ialloc_ag_alloc( */ xfs_biozero(fbuf, 0, ninodes << args.mp->m_sb.sb_inodelog); for (i = 0; i < ninodes; i++) { - free = XFS_MAKE_IPTR(args.mp, fbuf, i); + free = xfs_make_iptr(args.mp, fbuf, i); free->di_core.di_magic = cpu_to_be16(XFS_DINODE_MAGIC); free->di_core.di_version = version; free->di_core.di_gen = cpu_to_be32(gen); @@ -898,7 +898,7 @@ nextag: } } } - offset = XFS_IALLOC_FIND_FREE(&rec.ir_free); + offset = xfs_ialloc_find_free(&rec.ir_free); ASSERT(offset >= 0); ASSERT(offset < XFS_INODES_PER_CHUNK); ASSERT((XFS_AGINO_TO_OFFSET(mp, rec.ir_startino) % Index: linux-2.6-xfs/fs/xfs/xfs_ialloc.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc.h +++ linux-2.6-xfs/fs/xfs/xfs_ialloc.h @@ -38,7 +38,6 @@ struct xfs_trans; /* * Make an inode pointer out of the buffer/offset. */ -#define XFS_MAKE_IPTR(mp,b,o) xfs_make_iptr(mp,b,o) static inline struct xfs_dinode * xfs_make_iptr(struct xfs_mount *mp, struct xfs_buf *b, int o) { @@ -49,7 +48,6 @@ xfs_make_iptr(struct xfs_mount *mp, stru /* * Find a free (set) bit in the inode bitmask. */ -#define XFS_IALLOC_FIND_FREE(fp) xfs_ialloc_find_free(fp) static inline int xfs_ialloc_find_free(xfs_inofree_t *fp) { return xfs_lowbit64(*fp); Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.c +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.c @@ -1252,7 +1252,7 @@ xfs_inobt_newroot( * Our block is left, pick up the right block. */ lbp = bp; - lbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(lbp)); + lbno = xfs_daddr_to_agbno(args.mp, XFS_BUF_ADDR(lbp)); left = block; rbno = be32_to_cpu(left->bb_rightsib); if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno, @@ -1269,7 +1269,7 @@ xfs_inobt_newroot( * Our block is right, pick up the left block. */ rbp = bp; - rbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(rbp)); + rbno = xfs_daddr_to_agbno(args.mp, XFS_BUF_ADDR(rbp)); right = block; lbno = be32_to_cpu(right->bb_leftsib); if ((error = xfs_btree_read_bufs(args.mp, args.tp, args.agno, @@ -1487,7 +1487,7 @@ xfs_inobt_split( lbp = cur->bc_bufs[level]; args.tp = cur->bc_tp; args.mp = cur->bc_mp; - lbno = XFS_DADDR_TO_AGBNO(args.mp, XFS_BUF_ADDR(lbp)); + lbno = xfs_daddr_to_agbno(args.mp, XFS_BUF_ADDR(lbp)); /* * Allocate the new block. * If we can't do it, we're toast. Give up. Index: linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_ialloc_btree.h +++ linux-2.6-xfs/fs/xfs/xfs_ialloc_btree.h @@ -37,7 +37,6 @@ typedef __uint64_t xfs_inofree_t; #define XFS_INODES_PER_CHUNK_LOG (XFS_NBBYLOG + 3) #define XFS_INOBT_ALL_FREE ((xfs_inofree_t)-1) -#define XFS_INOBT_MASKN(i,n) xfs_inobt_maskn(i,n) static inline xfs_inofree_t xfs_inobt_maskn(int i, int n) { return (((n) >= XFS_INODES_PER_CHUNK ? \ Index: linux-2.6-xfs/fs/xfs/xfs_inode.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode.c +++ linux-2.6-xfs/fs/xfs/xfs_inode.c @@ -1655,10 +1655,10 @@ xfs_itruncate_finish( * in this file with garbage in them once recovery * runs. */ - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); error = xfs_bunmapi(ntp, ip, first_unmap_block, unmap_len, - XFS_BMAPI_AFLAG(fork) | + xfs_bmapi_aflag(fork) | (sync ? 0 : XFS_BMAPI_ASYNC), XFS_ITRUNC_MAX_EXTENTS, &first_block, &free_list, @@ -2778,7 +2778,7 @@ xfs_iextents_copy( for (i = 0; i < nrecs; i++) { xfs_bmbt_rec_host_t *ep = xfs_iext_get_ext(ifp, i); start_block = xfs_bmbt_get_startblock(ep); - if (ISNULLSTARTBLOCK(start_block)) { + if (isnullstartblock(start_block)) { /* * It's a delayed allocation extent, so skip it. */ Index: linux-2.6-xfs/fs/xfs/xfs_inode_item.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_inode_item.h +++ linux-2.6-xfs/fs/xfs/xfs_inode_item.h @@ -147,22 +147,13 @@ typedef struct xfs_inode_log_item { xfs_inode_log_format_t ili_format; /* logged structure */ } xfs_inode_log_item_t; - -#define XFS_ILOG_FDATA(w) xfs_ilog_fdata(w) -static inline int xfs_ilog_fdata(int w) -{ - return (w == XFS_DATA_FORK ? XFS_ILOG_DDATA : XFS_ILOG_ADATA); -} - #endif /* __KERNEL__ */ -#define XFS_ILOG_FBROOT(w) xfs_ilog_fbroot(w) static inline int xfs_ilog_fbroot(int w) { return (w == XFS_DATA_FORK ? XFS_ILOG_DBROOT : XFS_ILOG_ABROOT); } -#define XFS_ILOG_FEXT(w) xfs_ilog_fext(w) static inline int xfs_ilog_fext(int w) { return (w == XFS_DATA_FORK ? XFS_ILOG_DEXT : XFS_ILOG_AEXT); Index: linux-2.6-xfs/fs/xfs/xfs_iomap.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_iomap.c +++ linux-2.6-xfs/fs/xfs/xfs_iomap.c @@ -155,7 +155,7 @@ xfs_imap_to_bmap( iomapp->iomap_bn = IOMAP_DADDR_NULL; iomapp->iomap_flags |= IOMAP_DELAY; } else { - iomapp->iomap_bn = XFS_FSB_TO_DB(ip, start_block); + iomapp->iomap_bn = xfs_fsb_to_db(ip, start_block); if (ISUNWRITTEN(imap)) iomapp->iomap_flags |= IOMAP_UNWRITTEN; } @@ -261,7 +261,7 @@ xfs_iomap( xfs_iunlock(ip, lockmode); lockmode = 0; - if (nimaps && !ISNULLSTARTBLOCK(imap.br_startblock)) { + if (nimaps && !isnullstartblock(imap.br_startblock)) { xfs_iomap_map_trace(XFS_IOMAP_WRITE_MAP, ip, offset, count, iomapp, &imap, flags); break; @@ -498,7 +498,7 @@ xfs_iomap_write_direct( /* * Issue the xfs_bmapi() call to allocate the blocks */ - XFS_BMAP_INIT(&free_list, &firstfsb); + xfs_bmap_init(&free_list, &firstfsb); nimaps = 1; error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, bmapi_flag, &firstfsb, 0, &imap, &nimaps, &free_list, NULL); @@ -765,7 +765,7 @@ xfs_iomap_write_allocate( xfs_trans_ijoin(tp, ip, XFS_ILOCK_EXCL); xfs_trans_ihold(tp, ip); - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); /* * it is possible that the extents have changed since @@ -925,7 +925,7 @@ xfs_iomap_write_unwritten( /* * Modify the unwritten extent state of the buffer. */ - XFS_BMAP_INIT(&free_list, &firstfsb); + xfs_bmap_init(&free_list, &firstfsb); nimaps = 1; error = xfs_bmapi(tp, ip, offset_fsb, count_fsb, XFS_BMAPI_WRITE|XFS_BMAPI_CONVERT, &firstfsb, Index: linux-2.6-xfs/fs/xfs/xfs_itable.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_itable.c +++ linux-2.6-xfs/fs/xfs/xfs_itable.c @@ -442,7 +442,7 @@ xfs_bulkstat( (chunkidx = agino - gino + 1) < XFS_INODES_PER_CHUNK && /* there are some left allocated */ - XFS_INOBT_MASKN(chunkidx, + xfs_inobt_maskn(chunkidx, XFS_INODES_PER_CHUNK - chunkidx) & ~gfree) { /* * Grab the chunk record. Mark all the @@ -453,7 +453,7 @@ xfs_bulkstat( if (XFS_INOBT_MASK(i) & ~gfree) gcnt++; } - gfree |= XFS_INOBT_MASKN(0, chunkidx); + gfree |= xfs_inobt_maskn(0, chunkidx); irbp->ir_startino = gino; irbp->ir_freecount = gcnt; irbp->ir_free = gfree; @@ -524,7 +524,7 @@ xfs_bulkstat( chunkidx < XFS_INODES_PER_CHUNK; chunkidx += nicluster, agbno += nbcluster) { - if (XFS_INOBT_MASKN(chunkidx, + if (xfs_inobt_maskn(chunkidx, nicluster) & ~gfree) xfs_btree_reada_bufs(mp, agno, agbno, nbcluster); Index: linux-2.6-xfs/fs/xfs/xfs_mount.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_mount.h +++ linux-2.6-xfs/fs/xfs/xfs_mount.h @@ -47,9 +47,9 @@ typedef struct xfs_trans_reservations { /* * Moved here from xfs_ag.h to avoid reordering header files */ -#define XFS_DADDR_TO_AGNO(mp,d) \ +#define xfs_daddr_to_agno(mp,d) \ ((xfs_agnumber_t)(XFS_BB_TO_FSBT(mp, d) / (mp)->m_sb.sb_agblocks)) -#define XFS_DADDR_TO_AGBNO(mp,d) \ +#define xfs_daddr_to_agbno(mp,d) \ ((xfs_agblock_t)(XFS_BB_TO_FSBT(mp, d) % (mp)->m_sb.sb_agblocks)) #else struct cred; @@ -452,7 +452,6 @@ void xfs_do_force_shutdown(struct xfs_mo /* XFS_MFSI_CONVERT_SUNIT */ #define XFS_MFSI_QUIET 0x40 /* Be silent if mount errors found */ -#define XFS_DADDR_TO_AGNO(mp,d) xfs_daddr_to_agno(mp,d) static inline xfs_agnumber_t xfs_daddr_to_agno(struct xfs_mount *mp, xfs_daddr_t d) { @@ -461,7 +460,6 @@ xfs_daddr_to_agno(struct xfs_mount *mp, return (xfs_agnumber_t) ld; } -#define XFS_DADDR_TO_AGBNO(mp,d) xfs_daddr_to_agbno(mp,d) static inline xfs_agblock_t xfs_daddr_to_agbno(struct xfs_mount *mp, xfs_daddr_t d) { Index: linux-2.6-xfs/fs/xfs/xfs_rename.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rename.c +++ linux-2.6-xfs/fs/xfs/xfs_rename.c @@ -172,7 +172,7 @@ xfs_rename( xfs_sort_for_rename(src_dp, target_dp, src_ip, target_ip, inodes, &num_inodes); - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); tp = xfs_trans_alloc(mp, XFS_TRANS_RENAME); cancel_flags = XFS_TRANS_RELEASE_LOG_RES; spaceres = XFS_RENAME_SPACE_RES(mp, target_name->len); Index: linux-2.6-xfs/fs/xfs/xfs_rtalloc.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rtalloc.c +++ linux-2.6-xfs/fs/xfs/xfs_rtalloc.c @@ -120,7 +120,7 @@ xfs_growfs_rt_alloc( if ((error = xfs_trans_iget(mp, tp, ino, 0, XFS_ILOCK_EXCL, &ip))) goto error_cancel; - XFS_BMAP_INIT(&flist, &firstblock); + xfs_bmap_init(&flist, &firstblock); /* * Allocate blocks to the bitmap file. */ Index: linux-2.6-xfs/fs/xfs/xfs_rw.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_rw.h +++ linux-2.6-xfs/fs/xfs/xfs_rw.h @@ -28,7 +28,6 @@ struct xfs_mount; * file is a real time file or not, because the bmap code * does. */ -#define XFS_FSB_TO_DB(ip,fsb) xfs_fsb_to_db(ip,fsb) static inline xfs_daddr_t xfs_fsb_to_db(struct xfs_inode *ip, xfs_fsblock_t fsb) { Index: linux-2.6-xfs/fs/xfs/xfs_sb.h =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_sb.h +++ linux-2.6-xfs/fs/xfs/xfs_sb.h @@ -498,7 +498,7 @@ static inline void xfs_sb_version_remove #define XFS_HDR_BLOCK(mp,d) ((xfs_agblock_t)XFS_BB_TO_FSBT(mp,d)) #define XFS_DADDR_TO_FSB(mp,d) XFS_AGB_TO_FSB(mp, \ - XFS_DADDR_TO_AGNO(mp,d), XFS_DADDR_TO_AGBNO(mp,d)) + xfs_daddr_to_agno(mp,d), xfs_daddr_to_agbno(mp,d)) #define XFS_FSB_TO_DADDR(mp,fsbno) XFS_AGB_TO_DADDR(mp, \ XFS_FSB_TO_AGNO(mp,fsbno), XFS_FSB_TO_AGBNO(mp,fsbno)) Index: linux-2.6-xfs/fs/xfs/xfs_vnodeops.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/xfs_vnodeops.c +++ linux-2.6-xfs/fs/xfs/xfs_vnodeops.c @@ -972,7 +972,7 @@ xfs_inactive_symlink_rmt( * Find the block(s) so we can inval and unmap them. */ done = 0; - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); nmaps = ARRAY_SIZE(mval); if ((error = xfs_bmapi(tp, ip, 0, XFS_B_TO_FSB(mp, size), XFS_BMAPI_METADATA, &first_block, 0, mval, &nmaps, @@ -1392,7 +1392,7 @@ xfs_inactive( /* * Free the inode. */ - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); error = xfs_ifree(tp, ip, &free_list); if (error) { /* @@ -1565,7 +1565,7 @@ xfs_create( xfs_ilock(dp, XFS_ILOCK_EXCL | XFS_ILOCK_PARENT); unlock_dp_on_error = B_TRUE; - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); ASSERT(ip == NULL); @@ -1977,7 +1977,7 @@ xfs_remove( } } - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); error = xfs_dir_removename(tp, dp, name, ip->i_ino, &first_block, &free_list, resblks); if (error) { @@ -2164,7 +2164,7 @@ xfs_link( if (error) goto error_return; - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); error = xfs_dir_createname(tp, tdp, target_name, sip->i_ino, &first_block, &free_list, resblks); @@ -2337,7 +2337,7 @@ xfs_mkdir( xfs_trans_ijoin(tp, dp, XFS_ILOCK_EXCL); unlock_dp_on_error = B_FALSE; - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); error = xfs_dir_createname(tp, dp, dir_name, cdp->i_ino, &first_block, &free_list, resblks ? @@ -2552,7 +2552,7 @@ xfs_symlink( * Initialize the bmap freelist prior to calling either * bmapi or the directory create code. */ - XFS_BMAP_INIT(&free_list, &first_block); + xfs_bmap_init(&free_list, &first_block); /* * Allocate an inode for the symlink. @@ -3093,7 +3093,7 @@ retry: /* * Issue the xfs_bmapi() call to allocate the blocks */ - XFS_BMAP_INIT(&free_list, &firstfsb); + xfs_bmap_init(&free_list, &firstfsb); error = xfs_bmapi(tp, ip, startoffset_fsb, allocatesize_fsb, bmapi_flag, &firstfsb, 0, imapp, &nimaps, @@ -3193,7 +3193,7 @@ xfs_zero_remaining_bytes( XFS_BUF_UNDONE(bp); XFS_BUF_UNWRITE(bp); XFS_BUF_READ(bp); - XFS_BUF_SET_ADDR(bp, XFS_FSB_TO_DB(ip, imap.br_startblock)); + XFS_BUF_SET_ADDR(bp, xfs_fsb_to_db(ip, imap.br_startblock)); xfsbdstrat(mp, bp); error = xfs_iowait(bp); if (error) { @@ -3398,7 +3398,7 @@ xfs_free_file_space( /* * issue the bunmapi() call to free the blocks */ - XFS_BMAP_INIT(&free_list, &firstfsb); + xfs_bmap_init(&free_list, &firstfsb); error = xfs_bunmapi(tp, ip, startoffset_fsb, endoffset_fsb - startoffset_fsb, 0, 2, &firstfsb, &free_list, NULL, &done); Index: linux-2.6-xfs/fs/xfs/quota/xfs_dquot.c =================================================================== --- linux-2.6-xfs.orig/fs/xfs/quota/xfs_dquot.c +++ linux-2.6-xfs/fs/xfs/quota/xfs_dquot.c @@ -415,7 +415,7 @@ xfs_qm_dqalloc( /* * Initialize the bmap freelist prior to calling bmapi code. */ - XFS_BMAP_INIT(&flist, &firstblock); + xfs_bmap_init(&flist, &firstblock); xfs_ilock(quotip, XFS_ILOCK_EXCL); /* * Return if this type of quotas is turned off while we didn't From owner-xfs@oss.sgi.com Wed Jul 30 20:48:44 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 20:48:53 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6V3miEX025148 for ; Wed, 30 Jul 2008 20:48:44 -0700 X-ASG-Debug-ID: 1217476196-3b00012e0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ipmail01.adl6.internode.on.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 46D23EE11E6 for ; Wed, 30 Jul 2008 20:49:56 -0700 (PDT) Received: from ipmail01.adl6.internode.on.net (ipmail01.adl6.internode.on.net [203.16.214.146]) by cuda.sgi.com with ESMTP id VdJBt1hL3nUbZ4aG for ; Wed, 30 Jul 2008 20:49:56 -0700 (PDT) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApsEAHfQkEh5LDlw/2dsb2JhbACLHqVm X-IronPort-AV: E=Sophos;i="4.31,283,1215354600"; d="scan'208";a="161163191" Received: from ppp121-44-57-112.lns10.syd7.internode.on.net (HELO disturbed) ([121.44.57.112]) by ipmail01.adl6.internode.on.net with ESMTP; 31 Jul 2008 13:19:54 +0930 Received: from dave by disturbed with local (Exim 4.69) (envelope-from ) id 1KOPAm-0006mA-Vm; Thu, 31 Jul 2008 13:49:52 +1000 Date: Thu, 31 Jul 2008 13:49:52 +1000 From: Dave Chinner To: Lachlan McIlroy Cc: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27 Subject: Re: [GIT PULL] XFS update for 2.6.27 Message-ID: <20080731034952.GC13395@disturbed> Mail-Followup-To: Lachlan McIlroy , torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org References: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Barracuda-Connect: ipmail01.adl6.internode.on.net[203.16.214.146] X-Barracuda-Start-Time: 1217476197 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -0.52 X-Barracuda-Spam-Status: No, SCORE=-0.52 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests=WEIRD_PORT X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1339 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 1.50 WEIRD_PORT URI: Uses non-standard port number for HTTP X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17282 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: david@fromorbit.com Precedence: bulk X-list: xfs On Thu, Jul 31, 2008 at 12:53:28PM +1000, Lachlan McIlroy wrote: > The following changes since commit c9272c4f9fbe2087beb3392f526dc5b19efaa56b: > Linus Torvalds (1): > Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 > > are available in the git repository at: > > git://oss.sgi.com:8090/xfs/xfs-pull for-linus ..... > > Lachlan McIlroy (11): > [XFS] Use the generic xattr methods. ..... > [XFS] Use the generic xattr methods. BTW, that's a patch from Christoph, so there's a mistake in the author of that patch. I don't know why there's duplicates of it in the tree - the only thing I can see is that the committer's email address is not stable. There is a growing number of duplicate commits like this in the XFS tree..... Cheers, Dave. -- Dave Chinner david@fromorbit.com From owner-xfs@oss.sgi.com Wed Jul 30 21:08:21 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 21:08:24 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m6V48LHh026833 for ; Wed, 30 Jul 2008 21:08:21 -0700 X-ASG-Debug-ID: 1217477373-227103de0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from sandeen.net (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id AE0C9EE134D for ; Wed, 30 Jul 2008 21:09:34 -0700 (PDT) Received: from sandeen.net (sandeen.net [209.173.210.139]) by cuda.sgi.com with ESMTP id GjJzW7P3sjeLI6Ev for ; Wed, 30 Jul 2008 21:09:34 -0700 (PDT) Received: from liberator.sandeen.net (liberator.sandeen.net [10.0.0.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by sandeen.net (Postfix) with ESMTP id 97A56AC6275; Wed, 30 Jul 2008 23:09:33 -0500 (CDT) Message-ID: <48913AFD.9050407@sandeen.net> Date: Wed, 30 Jul 2008 23:09:33 -0500 From: Eric Sandeen User-Agent: Thunderbird 2.0.0.16 (Macintosh/20080707) MIME-Version: 1.0 To: Lachlan McIlroy CC: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org X-ASG-Orig-Subj: Re: [GIT PULL] XFS update for 2.6.27 Subject: Re: [GIT PULL] XFS update for 2.6.27 References: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> In-Reply-To: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Barracuda-Connect: sandeen.net[209.173.210.139] X-Barracuda-Start-Time: 1217477374 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1341 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17283 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: sandeen@sandeen.net Precedence: bulk X-list: xfs Lachlan McIlroy wrote: ... > Eric Sandeen (3): > [XFS] > [XFS] Pack some shortform dir2 structures for the ARM old ABI > [XFS] Disable queue flag test in barrier check. Lachlan, you might want to fix up that blank summary as well? Thanks, -Eric From owner-xfs@oss.sgi.com Wed Jul 30 21:52:41 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 21:52:48 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6V4qc2s030296 for ; Wed, 30 Jul 2008 21:52:40 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id OAA20747; Thu, 31 Jul 2008 14:53:49 +1000 Message-ID: <489146BE.6020308@sgi.com> Date: Thu, 31 Jul 2008 14:59:42 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Lachlan McIlroy , torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: Re: [GIT PULL] XFS update for 2.6.27 References: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> <20080731034952.GC13395@disturbed> In-Reply-To: <20080731034952.GC13395@disturbed> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17284 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Dave Chinner wrote: > On Thu, Jul 31, 2008 at 12:53:28PM +1000, Lachlan McIlroy wrote: >> The following changes since commit c9272c4f9fbe2087beb3392f526dc5b19efaa56b: >> Linus Torvalds (1): >> Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 >> >> are available in the git repository at: >> >> git://oss.sgi.com:8090/xfs/xfs-pull for-linus > ..... >> Lachlan McIlroy (11): >> [XFS] Use the generic xattr methods. > ..... >> [XFS] Use the generic xattr methods. > > BTW, that's a patch from Christoph, so there's a mistake in the > author of that patch. I don't know why there's duplicates of it > in the tree - the only thing I can see is that the committer's > email address is not stable. There is a growing number of > duplicate commits like this in the XFS tree..... > Yeah I know there are problems with the merge scripts. Christoph had already pointed this one out and I thought it had been corrected. I just don't have the time to fix every commit that comes through. From owner-xfs@oss.sgi.com Wed Jul 30 22:04:07 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 22:04:10 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6V545Jk031541 for ; Wed, 30 Jul 2008 22:04:06 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA20996; Thu, 31 Jul 2008 15:05:15 +1000 Message-ID: <4891496D.8040102@sgi.com> Date: Thu, 31 Jul 2008 15:11:09 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: Eric Sandeen CC: torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: Re: [GIT PULL] XFS update for 2.6.27 References: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> <48913AFD.9050407@sandeen.net> In-Reply-To: <48913AFD.9050407@sandeen.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17285 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs Eric Sandeen wrote: > Lachlan McIlroy wrote: > > ... > >> Eric Sandeen (3): >> [XFS] >> [XFS] Pack some shortform dir2 structures for the ARM old ABI >> [XFS] Disable queue flag test in barrier check. > > Lachlan, you might want to fix up that blank summary as well? Sorry about that Eric. The summary is in the commit log - the committer started the log with a blank line. de-duplicate calls to xfs_attr_trace_enter Every call to xfs_attr_trace_enter() shares the exact same 16 args in the middle... just send in the context pointer and let the next level down split it into the ktrace. > > Thanks, > -Eric > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ > From owner-xfs@oss.sgi.com Wed Jul 30 22:29:31 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 22:29:34 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6V5TSNE001324 for ; Wed, 30 Jul 2008 22:29:29 -0700 Received: from [134.14.55.78] (redback.melbourne.sgi.com [134.14.55.78]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA21693; Thu, 31 Jul 2008 15:30:36 +1000 Message-ID: <48914F5D.7060004@sgi.com> Date: Thu, 31 Jul 2008 15:36:29 +1000 From: Lachlan McIlroy Reply-To: lachlan@sgi.com User-Agent: Thunderbird 2.0.0.16 (X11/20080707) MIME-Version: 1.0 To: torvalds@linux-foundation.org CC: linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: Re: [GIT PULL] XFS update for 2.6.27 References: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> In-Reply-To: <20080731025328.6328358C4C3F@chook.melbourne.sgi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17286 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs We're having dns issues on our mail servers and none of our mails are going to lkml (or linus). I'll try to resend the pull request. Lachlan McIlroy wrote: > The following changes since commit c9272c4f9fbe2087beb3392f526dc5b19efaa56b: > Linus Torvalds (1): > Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 > > are available in the git repository at: > > git://oss.sgi.com:8090/xfs/xfs-pull for-linus > > Barry Naujok (12): > [XFS] Split xfs_dir2_leafn_lookup_int into its two pieces of functionality > [XFS] Name operation vector for hash and compare > [XFS] Add op_flags field and helpers to xfs_da_args > dcache: Add case-insensitive support d_ci_add() routine > [XFS] Return case-insensitive match for dentry cache > [XFS] XFS: ASCII case-insensitive support > [XFS] kmem_free and kmem_realloc to use const void * > [XFS] Remove d_add call for an ENOENT lookup return code > [XFS] Zero uninitialised xfs_da_args structure in xfs_dir2.c > [XFS] Invalidate dentry in unlink/rmdir if in case-insensitive mode > [XFS] Fix returning case-preserved name with CI node form directories > [XFS] Fix CI lookup in leaf-form directories > > Christoph Hellwig (28): > [XFS] Kill attr_capable checks as already done in xattr_permission. > [XFS] kill xfs_uuid_unmount > [XFS] merge xfs_mntupdate into xfs_fs_remount > [XFS] kill xfs_igrow_start and xfs_igrow_finish > [XFS] merge xfs_unmount into xfs_fs_put_super / xfs_fs_fill_super > [XFS] merge xfs_mount into xfs_fs_fill_super > [XFS] don't call xfs_freesb from xfs_mountfs failure case > [XFS] sort out opening and closing of the block devices > [XFS] add xfs_setup_devices helper > [XFS] allow xfs_args_allocate to fail > [XFS] kill xfs_mount_init > [XFS] kill calls to xfs_binval in the mount error path > [XFS] rename error2 goto label in xfs_fs_fill_super > [XFS] add missing call to xfs_filestream_unmount on xfs_mountfs failure > [XFS] Factor out code for whether inode has attributes or not. > [XFS] Switches xfs_vn_listxattr to set it's put_listent callback directly > [XFS] Merge xfs_rmdir into xfs_remove > [XFS] Don't update i_size for directories and special files > [XFS] Check for invalid flags in xfs_attrlist_by_handle. > [XFS] attrmulti cleanup > [XFS] Don't update mtime on rename source > [XFS] streamline init/exit path > [XFS] fix mount option parsing in remount > [XFS] s/XFS_PURGE_INODE/IRELE/g s/VN_HOLD(XFS_ITOV())/IHOLD()/ > [XFS] fix compilation without CONFIG_PROC_FS > [XFS] xfs_setattr currently doesn't just handle the attributes set through > [XFS] Now that xfs_setattr is only used for attributes set from ->setattr > [XFS] Remove vn_revalidate calls in xfs. > > David Chinner (1): > [XFS] Update valid fields in xfs_mount_log_sb() > > Denys Vlasenko (3): > [XFS] Remove unused arg from kmem_free() > [XFS] Remove unused Falgs parameter from xfs_qm_dqpurge() > [XFS] Remove unused wbc parameter from xfs_start_page_writeback() > > Eric Sandeen (3): > [XFS] > [XFS] Pack some shortform dir2 structures for the ARM old ABI > [XFS] Disable queue flag test in barrier check. > > Lachlan McIlroy (11): > [XFS] Use the generic xattr methods. > [XFS] make inode reclaim wait for log I/O to complete > [XFS] fix extent corruption in xfs_iext_irec_compact_full() > [XFS] Convert ASSERTs to XFS_WANT_CORRUPTED_GOTOs > [XFS] Always reset btree cursor after an insert > [XFS] Use the generic xattr methods. > [XFS] use minleft when allocating in xfs_bmbt_split() > [XFS] Restore the lowspace extent allocator algorithm > [XFS] Allow xfs_bmbt_split() to fallback to the lowspace allocator > [XFS] Don't assert if trying to mount with blocksize > pagesize > [XFS] fix use after free with external logs or real-time devices > > Matthew Wilcox (1): > [XFS] Convert l_flushsema to a sv_t > > Michael Nishimoto (1): > [XFS] Ensure that 2 GiB xfs logs work properly. > > Tim Shimmin (4): > [XFS] Fix up noattr2 so that it will properly update the versionnum and > [XFS] Fix up warning for xfs_vn_listxatt's call of list_one_attr() with > [XFS] Fix up problem when CONFIG_XFS_POSIX_ACL is not set and yet we still > [XFS] A bug was found in xfs_bmap_add_extent_unwritten_real(). In a > > fs/dcache.c | 102 +++++ > fs/xfs/Makefile | 3 +- > fs/xfs/linux-2.6/kmem.c | 6 +- > fs/xfs/linux-2.6/kmem.h | 4 +- > fs/xfs/linux-2.6/xfs_aops.c | 5 +- > fs/xfs/linux-2.6/xfs_buf.c | 14 +- > fs/xfs/linux-2.6/xfs_buf.h | 2 +- > fs/xfs/linux-2.6/xfs_export.c | 2 +- > fs/xfs/linux-2.6/xfs_ioctl.c | 376 ++++++++++++++-- > fs/xfs/linux-2.6/xfs_iops.c | 345 +++++---------- > fs/xfs/linux-2.6/xfs_iops.h | 2 + > fs/xfs/linux-2.6/xfs_linux.h | 8 + > fs/xfs/linux-2.6/xfs_stats.c | 15 +- > fs/xfs/linux-2.6/xfs_stats.h | 12 +- > fs/xfs/linux-2.6/xfs_super.c | 938 ++++++++++++++++++++++++++++++++++++---- > fs/xfs/linux-2.6/xfs_super.h | 4 +- > fs/xfs/linux-2.6/xfs_sysctl.c | 8 +- > fs/xfs/linux-2.6/xfs_sysctl.h | 4 +- > fs/xfs/linux-2.6/xfs_vnode.c | 50 --- > fs/xfs/linux-2.6/xfs_vnode.h | 89 ---- > fs/xfs/linux-2.6/xfs_xattr.c | 330 ++++++++++++++ > fs/xfs/quota/xfs_dquot.c | 3 +- > fs/xfs/quota/xfs_dquot.h | 2 +- > fs/xfs/quota/xfs_dquot_item.c | 4 +- > fs/xfs/quota/xfs_qm.c | 24 +- > fs/xfs/quota/xfs_qm_syscalls.c | 12 +- > fs/xfs/quota/xfs_quota_priv.h | 3 - > fs/xfs/support/ktrace.c | 4 +- > fs/xfs/support/uuid.c | 8 +- > fs/xfs/support/uuid.h | 1 - > fs/xfs/xfs_acl.c | 21 +- > fs/xfs/xfs_acl.h | 4 +- > fs/xfs/xfs_attr.c | 608 ++++---------------------- > fs/xfs/xfs_attr.h | 90 ++--- > fs/xfs/xfs_attr_leaf.c | 99 ++--- > fs/xfs/xfs_attr_leaf.h | 29 +-- > fs/xfs/xfs_attr_sf.h | 10 +- > fs/xfs/xfs_bmap.c | 118 +++--- > fs/xfs/xfs_bmap.h | 13 +- > fs/xfs/xfs_bmap_btree.c | 76 ++-- > fs/xfs/xfs_buf_item.c | 8 +- > fs/xfs/xfs_clnt.h | 1 + > fs/xfs/xfs_da_btree.c | 48 ++- > fs/xfs/xfs_da_btree.h | 36 ++- > fs/xfs/xfs_dfrag.c | 4 +- > fs/xfs/xfs_dir2.c | 125 +++++- > fs/xfs/xfs_dir2.h | 6 +- > fs/xfs/xfs_dir2_block.c | 56 ++- > fs/xfs/xfs_dir2_data.c | 5 +- > fs/xfs/xfs_dir2_leaf.c | 93 +++-- > fs/xfs/xfs_dir2_node.c | 402 ++++++++++------- > fs/xfs/xfs_dir2_sf.c | 83 ++-- > fs/xfs/xfs_dir2_sf.h | 6 +- > fs/xfs/xfs_dir2_trace.c | 20 +- > fs/xfs/xfs_dmapi.h | 2 +- > fs/xfs/xfs_error.c | 13 +- > fs/xfs/xfs_error.h | 1 - > fs/xfs/xfs_extfree_item.c | 6 +- > fs/xfs/xfs_filestream.c | 4 +- > fs/xfs/xfs_fs.h | 4 + > fs/xfs/xfs_fsops.c | 4 +- > fs/xfs/xfs_inode.c | 165 +++----- > fs/xfs/xfs_inode.h | 3 - > fs/xfs/xfs_inode_item.c | 7 +- > fs/xfs/xfs_iomap.c | 10 + > fs/xfs/xfs_itable.c | 6 +- > fs/xfs/xfs_log.c | 49 +- > fs/xfs/xfs_log_priv.h | 6 +- > fs/xfs/xfs_log_recover.c | 21 +- > fs/xfs/xfs_mount.c | 118 ++---- > fs/xfs/xfs_mount.h | 17 +- > fs/xfs/xfs_mru_cache.c | 21 +- > fs/xfs/xfs_rename.c | 22 +- > fs/xfs/xfs_rtalloc.c | 2 +- > fs/xfs/xfs_sb.h | 17 +- > fs/xfs/xfs_trans.c | 4 +- > fs/xfs/xfs_trans_inode.c | 2 +- > fs/xfs/xfs_trans_item.c | 8 +- > fs/xfs/xfs_vfsops.c | 610 +-------------------------- > fs/xfs/xfs_vfsops.h | 5 - > fs/xfs/xfs_vnodeops.c | 722 +++++++++---------------------- > fs/xfs/xfs_vnodeops.h | 12 +- > include/linux/dcache.h | 1 + > 83 files changed, 3105 insertions(+), 3098 deletions(-) > create mode 100644 fs/xfs/linux-2.6/xfs_xattr.c > > > From owner-xfs@oss.sgi.com Wed Jul 30 22:32:53 2008 Received: with ECARTIS (v1.0.0; list xfs); Wed, 30 Jul 2008 22:32:55 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=AWL,BAYES_00,WEIRD_PORT autolearn=no version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m6V5Wpr2001949 for ; Wed, 30 Jul 2008 22:32:52 -0700 Received: from chook.melbourne.sgi.com (chook.melbourne.sgi.com [134.14.54.237]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id PAA21750; Thu, 31 Jul 2008 15:34:00 +1000 Received: by chook.melbourne.sgi.com (Postfix, from userid 44625) id 0891D58C4C3F; Thu, 31 Jul 2008 15:33:59 +1000 (EST) Date: Thu, 31 Jul 2008 15:33:59 +1000 To: torvalds@linux-foundation.org Cc: linux-kernel@vger.kernel.org, xfs@oss.sgi.com, akpm@linux-foundation.org Subject: [GIT PULL] XFS update for 2.6.27 (Resend) User-Agent: nail 11.25 7/29/05 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20080731053400.0891D58C4C3F@chook.melbourne.sgi.com> From: lachlan@sgi.com (Lachlan McIlroy) X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17287 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: lachlan@sgi.com Precedence: bulk X-list: xfs I'm resending this pull request because the last one bounced with dns failures. Hope this one gets through... The following changes since commit c9272c4f9fbe2087beb3392f526dc5b19efaa56b: Linus Torvalds (1): Merge branch 'hotfixes' of git://git.linux-nfs.org/projects/trondmy/nfs-2.6 are available in the git repository at: git://oss.sgi.com:8090/xfs/xfs-pull for-linus Barry Naujok (12): [XFS] Split xfs_dir2_leafn_lookup_int into its two pieces of functionality [XFS] Name operation vector for hash and compare [XFS] Add op_flags field and helpers to xfs_da_args dcache: Add case-insensitive support d_ci_add() routine [XFS] Return case-insensitive match for dentry cache [XFS] XFS: ASCII case-insensitive support [XFS] kmem_free and kmem_realloc to use const void * [XFS] Remove d_add call for an ENOENT lookup return code [XFS] Zero uninitialised xfs_da_args structure in xfs_dir2.c [XFS] Invalidate dentry in unlink/rmdir if in case-insensitive mode [XFS] Fix returning case-preserved name with CI node form directories [XFS] Fix CI lookup in leaf-form directories Christoph Hellwig (28): [XFS] Kill attr_capable checks as already done in xattr_permission. [XFS] kill xfs_uuid_unmount [XFS] merge xfs_mntupdate into xfs_fs_remount [XFS] kill xfs_igrow_start and xfs_igrow_finish [XFS] merge xfs_unmount into xfs_fs_put_super / xfs_fs_fill_super [XFS] merge xfs_mount into xfs_fs_fill_super [XFS] don't call xfs_freesb from xfs_mountfs failure case [XFS] sort out opening and closing of the block devices [XFS] add xfs_setup_devices helper [XFS] allow xfs_args_allocate to fail [XFS] kill xfs_mount_init [XFS] kill calls to xfs_binval in the mount error path [XFS] rename error2 goto label in xfs_fs_fill_super [XFS] add missing call to xfs_filestream_unmount on xfs_mountfs failure [XFS] Factor out code for whether inode has attributes or not. [XFS] Switches xfs_vn_listxattr to set it's put_listent callback directly [XFS] Merge xfs_rmdir into xfs_remove [XFS] Don't update i_size for directories and special files [XFS] Check for invalid flags in xfs_attrlist_by_handle. [XFS] attrmulti cleanup [XFS] Don't update mtime on rename source [XFS] streamline init/exit path [XFS] fix mount option parsing in remount [XFS] s/XFS_PURGE_INODE/IRELE/g s/VN_HOLD(XFS_ITOV())/IHOLD()/ [XFS] fix compilation without CONFIG_PROC_FS [XFS] xfs_setattr currently doesn't just handle the attributes set through [XFS] Now that xfs_setattr is only used for attributes set from ->setattr [XFS] Remove vn_revalidate calls in xfs. David Chinner (1): [XFS] Update valid fields in xfs_mount_log_sb() Denys Vlasenko (3): [XFS] Remove unused arg from kmem_free() [XFS] Remove unused Falgs parameter from xfs_qm_dqpurge() [XFS] Remove unused wbc parameter from xfs_start_page_writeback() Eric Sandeen (3): [XFS] [XFS] Pack some shortform dir2 structures for the ARM old ABI [XFS] Disable queue flag test in barrier check. Lachlan McIlroy (11): [XFS] Use the generic xattr methods. [XFS] make inode reclaim wait for log I/O to complete [XFS] fix extent corruption in xfs_iext_irec_compact_full() [XFS] Convert ASSERTs to XFS_WANT_CORRUPTED_GOTOs [XFS] Always reset btree cursor after an insert [XFS] Use the generic xattr methods. [XFS] use minleft when allocating in xfs_bmbt_split() [XFS] Restore the lowspace extent allocator algorithm [XFS] Allow xfs_bmbt_split() to fallback to the lowspace allocator [XFS] Don't assert if trying to mount with blocksize > pagesize [XFS] fix use after free with external logs or real-time devices Matthew Wilcox (1): [XFS] Convert l_flushsema to a sv_t Michael Nishimoto (1): [XFS] Ensure that 2 GiB xfs logs work properly. Tim Shimmin (4): [XFS] Fix up noattr2 so that it will properly update the versionnum and [XFS] Fix up warning for xfs_vn_listxatt's call of list_one_attr() with [XFS] Fix up problem when CONFIG_XFS_POSIX_ACL is not set and yet we still [XFS] A bug was found in xfs_bmap_add_extent_unwritten_real(). In a fs/dcache.c | 102 +++++ fs/xfs/Makefile | 3 +- fs/xfs/linux-2.6/kmem.c | 6 +- fs/xfs/linux-2.6/kmem.h | 4 +- fs/xfs/linux-2.6/xfs_aops.c | 5 +- fs/xfs/linux-2.6/xfs_buf.c | 14 +- fs/xfs/linux-2.6/xfs_buf.h | 2 +- fs/xfs/linux-2.6/xfs_export.c | 2 +- fs/xfs/linux-2.6/xfs_ioctl.c | 376 ++++++++++++++-- fs/xfs/linux-2.6/xfs_iops.c | 345 +++++---------- fs/xfs/linux-2.6/xfs_iops.h | 2 + fs/xfs/linux-2.6/xfs_linux.h | 8 + fs/xfs/linux-2.6/xfs_stats.c | 15 +- fs/xfs/linux-2.6/xfs_stats.h | 12 +- fs/xfs/linux-2.6/xfs_super.c | 938 ++++++++++++++++++++++++++++++++++++---- fs/xfs/linux-2.6/xfs_super.h | 4 +- fs/xfs/linux-2.6/xfs_sysctl.c | 8 +- fs/xfs/linux-2.6/xfs_sysctl.h | 4 +- fs/xfs/linux-2.6/xfs_vnode.c | 50 --- fs/xfs/linux-2.6/xfs_vnode.h | 89 ---- fs/xfs/linux-2.6/xfs_xattr.c | 330 ++++++++++++++ fs/xfs/quota/xfs_dquot.c | 3 +- fs/xfs/quota/xfs_dquot.h | 2 +- fs/xfs/quota/xfs_dquot_item.c | 4 +- fs/xfs/quota/xfs_qm.c | 24 +- fs/xfs/quota/xfs_qm_syscalls.c | 12 +- fs/xfs/quota/xfs_quota_priv.h | 3 - fs/xfs/support/ktrace.c | 4 +- fs/xfs/support/uuid.c | 8 +- fs/xfs/support/uuid.h | 1 - fs/xfs/xfs_acl.c | 21 +- fs/xfs/xfs_acl.h | 4 +- fs/xfs/xfs_attr.c | 608 ++++---------------------- fs/xfs/xfs_attr.h | 90 ++--- fs/xfs/xfs_attr_leaf.c | 99 ++--- fs/xfs/xfs_attr_leaf.h | 29 +-- fs/xfs/xfs_attr_sf.h | 10 +- fs/xfs/xfs_bmap.c | 118 +++--- fs/xfs/xfs_bmap.h | 13 +- fs/xfs/xfs_bmap_btree.c | 76 ++-- fs/xfs/xfs_buf_item.c | 8 +- fs/xfs/xfs_clnt.h | 1 + fs/xfs/xfs_da_btree.c | 48 ++- fs/xfs/xfs_da_btree.h | 36 ++- fs/xfs/xfs_dfrag.c | 4 +- fs/xfs/xfs_dir2.c | 125 +++++- fs/xfs/xfs_dir2.h | 6 +- fs/xfs/xfs_dir2_block.c | 56 ++- fs/xfs/xfs_dir2_data.c | 5 +- fs/xfs/xfs_dir2_leaf.c | 93 +++-- fs/xfs/xfs_dir2_node.c | 402 ++++++++++------- fs/xfs/xfs_dir2_sf.c | 83 ++-- fs/xfs/xfs_dir2_sf.h | 6 +- fs/xfs/xfs_dir2_trace.c | 20 +- fs/xfs/xfs_dmapi.h | 2 +- fs/xfs/xfs_error.c | 13 +- fs/xfs/xfs_error.h | 1 - fs/xfs/xfs_extfree_item.c | 6 +- fs/xfs/xfs_filestream.c | 4 +- fs/xfs/xfs_fs.h | 4 + fs/xfs/xfs_fsops.c | 4 +- fs/xfs/xfs_inode.c | 165 +++----- fs/xfs/xfs_inode.h | 3 - fs/xfs/xfs_inode_item.c | 7 +- fs/xfs/xfs_iomap.c | 10 + fs/xfs/xfs_itable.c | 6 +- fs/xfs/xfs_log.c | 49 +- fs/xfs/xfs_log_priv.h | 6 +- fs/xfs/xfs_log_recover.c | 21 +- fs/xfs/xfs_mount.c | 118 ++---- fs/xfs/xfs_mount.h | 17 +- fs/xfs/xfs_mru_cache.c | 21 +- fs/xfs/xfs_rename.c | 22 +- fs/xfs/xfs_rtalloc.c | 2 +- fs/xfs/xfs_sb.h | 17 +- fs/xfs/xfs_trans.c | 4 +- fs/xfs/xfs_trans_inode.c | 2 +- fs/xfs/xfs_trans_item.c | 8 +- fs/xfs/xfs_vfsops.c | 610 +-------------------------- fs/xfs/xfs_vfsops.h | 5 - fs/xfs/xfs_vnodeops.c | 722 +++++++++---------------------- fs/xfs/xfs_vnodeops.h | 12 +- include/linux/dcache.h | 1 + 83 files changed, 3105 insertions(+), 3098 deletions(-) create mode 100644 fs/xfs/linux-2.6/xfs_xattr.c From owner-xfs@oss.sgi.com Thu Jul 31 17:09:50 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 31 Jul 2008 17:10:16 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from cuda.sgi.com (cuda1.sgi.com [192.48.168.28]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m7109nSr029850 for ; Thu, 31 Jul 2008 17:09:50 -0700 X-ASG-Debug-ID: 1217549462-387002eb0000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from ishtar.tlinx.org (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 18CB3EE9AA9 for ; Thu, 31 Jul 2008 17:11:02 -0700 (PDT) Received: from ishtar.tlinx.org (ishtar.tlinx.org [64.81.245.74]) by cuda.sgi.com with ESMTP id DRJ4rY1j2ZckIm0J for ; Thu, 31 Jul 2008 17:11:02 -0700 (PDT) Received: from [192.168.3.11] (Athena [192.168.3.11]) by ishtar.tlinx.org (8.14.1/8.12.10/SuSE Linux 0.7) with ESMTP id m710B1gq030954 for ; Thu, 31 Jul 2008 17:11:01 -0700 Message-ID: <48925495.7040804@tlinx.org> Date: Thu, 31 Jul 2008 17:11:01 -0700 From: "Linda A. Walsh" User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: xfs-oss X-ASG-Orig-Subj: Question about extended attributes... Subject: Question about extended attributes... Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Barracuda-Connect: ishtar.tlinx.org[64.81.245.74] X-Barracuda-Start-Time: 1217549463 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1397 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17288 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: xfs@tlinx.org Precedence: bulk X-list: xfs my man page says extended xfs attributes can have 256-byte names with up to 64K of data. Is there a limit on the number of extended attributes max data size or name size? I.e. could I have 1000 attributes with 64K of data each? Is there a strong reason why the file and data sizes were limited to 256/64K? Would they be hard to 'generalize' to max-path-segment-len/max-filelen? Only reason I wonder is wondering what file systems besides apple's "HPFS"(?) and MS's NTFS, that allow alternate data-streams of arbitrary length. I'm not sure about the maximums on HPFS and NTFS, but I haven't _read_ of any notable limits (I'm sure there are some, but it _seems_ you can store alternate file versions in different data-streams on NTFS, for example... I.e. could use it as a revision system, theoretically -- to save older versions of the file with the right software -- but with XFS, it wouldn't be so general case with a 64K data limit -- wouldn't be a show-stopper if one could 'link' multiple data-segments, but am just curious about the limitations (not that I'm planning on implementing a version control system using data-forks...it was just an example! :-)). linda From owner-xfs@oss.sgi.com Thu Jul 31 20:40:40 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 31 Jul 2008 20:40:43 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,RDNS_NONE autolearn=no version=3.3.0-r574664 Received: from cuda.sgi.com ([192.48.176.15]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with ESMTP id m713eehY021042 for ; Thu, 31 Jul 2008 20:40:40 -0700 X-ASG-Debug-ID: 1217562112-676f03b40000-NocioJ X-Barracuda-URL: http://cuda.sgi.com:80/cgi-bin/mark.cgi Received: from yw-out-1718.google.com (localhost [127.0.0.1]) by cuda.sgi.com (Spam Firewall) with ESMTP id 810B419666B6 for ; Thu, 31 Jul 2008 20:41:52 -0700 (PDT) Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.152]) by cuda.sgi.com with ESMTP id r5kzdGuea4uzCD98 for ; Thu, 31 Jul 2008 20:41:52 -0700 (PDT) Received: by yw-out-1718.google.com with SMTP id 5so417263ywm.32 for ; Thu, 31 Jul 2008 20:41:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to:user-agent; bh=klZHh9cLBidCS6kHjZ5v7Y29LY5hpvxgC07w6q/9t90=; b=lckb6mR68LDl2PhrwoBG3sWFwb4AGeQUNqwhDkfzrTuDfORzjUn04wNGVBWTAXwwgz LPKZiHURSUSHTVuuMrdEvX3F2GUveWYRYNsUALbJEHW+AAlVdgKFTbvgfdYtM0Ss5qy+ WknTNeim2ddc+Rs/wAuFnM53vcpLI8SeHVE7s= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; b=xvsBSAOrvE/P87gTdd7We0bkrs9DxkQg6CrbOkyPQGEIYf7NYOLQc2v1UZlsOZ7Mxo hXmU9WUJpHtnHE8jBmCOq+oEffRvpEG0C0Ss39ftWuMmOp0fv9AqSIBJ7ALCVp0mXmrV h6Ndzzn708giI/QIJD3o7JitIoGIj69Gonrm0= Received: by 10.150.79.22 with SMTP id c22mr2394732ybb.160.1217562112577; Thu, 31 Jul 2008 20:41:52 -0700 (PDT) Received: from sewage.raw-sewage.fake ( [71.194.2.212]) by mx.google.com with ESMTPS id 8sm1015322ywg.6.2008.07.31.20.41.51 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 31 Jul 2008 20:41:51 -0700 (PDT) Received: by sewage.raw-sewage.fake (Postfix, from userid 1000) id 4B92DD51DA; Thu, 31 Jul 2008 22:41:50 -0500 (CDT) Date: Thu, 31 Jul 2008 22:41:50 -0500 From: Matt Garman To: Justin Piszcz Cc: David Greaves , linux-kernel@vger.kernel.org, linux-raid@vger.kernel.org, xfs@oss.sgi.com X-ASG-Orig-Subj: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Subject: Re: 12 Veliciraptors again w/x4 card (~1gbyte/sec aggregate read)! Message-ID: <20080801034150.GA32026@sewage.raw-sewage.fake> References: <4872A2F4.2010604@dgreaves.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.16 (2007-06-09) X-Barracuda-Connect: yw-out-1718.google.com[74.125.46.152] X-Barracuda-Start-Time: 1217562113 X-Barracuda-Bayes: INNOCENT GLOBAL 0.0000 1.0000 -2.0210 X-Barracuda-Virus-Scanned: by cuda.sgi.com at sgi.com X-Barracuda-Spam-Score: -2.02 X-Barracuda-Spam-Status: No, SCORE=-2.02 using per-user scores of TAG_LEVEL=2.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=2.1 tests= X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.1.1410 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17289 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: matthew.garman@gmail.com Precedence: bulk X-list: xfs On Tue, Jul 08, 2008 at 04:39:34AM -0400, Justin Piszcz wrote: > On Tue, 8 Jul 2008, Justin Piszcz wrote: >> On Tue, 8 Jul 2008, David Greaves wrote: >>> Justin Piszcz wrote: >>>> Each PCI-e x1 card has 1 veliciraptor on it now. >>>> Got an x4 card wit 4 sata ports: >>> Useful - which card? >> >> StarTech 4 Port PCI Express x4 SATA II Card Model PEXSATA24E >> >> > Chipset: Marvell 88SX7042 > SATA Connectivity: Use four internal ports at the same time or two internal > and two external ports > > Which is fully supported in the latest kernels (didn't try an old kernel): > > linux-2.6.25.10/drivers/ata/sata_mv.c > > /* Marvell 7042 support */ > { PCI_VDEVICE(MARVELL, 0x7042), chip_7042 }, How have that card and the array attached to it been doing since you originally posted this? Doesn't that HighPoint 23xx card also use the Marvell 88SX7042 chip? I remember seeing the threads about the HighPoint card silently corrupting data by silently writing over parts of the disk(s) with its own info. I'm guessing that's not a "feature" of the Marvell chip, but still... admittedly irrational fear here :) It would be nice if that Supermicro 8-port SATA card (AOC-SAT2-MV8) was available in PCIe... I wonder if it's possible to just graft multiple SiI 3132 controllers (2 SATA each) on a single PCIe card? From owner-xfs@oss.sgi.com Thu Jul 31 23:54:22 2008 Received: with ECARTIS (v1.0.0; list xfs); Thu, 31 Jul 2008 23:54:26 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.0-r574664 (2007-09-11) on oss.sgi.com X-Spam-Level: X-Spam-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.0-r574664 Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.11.20060308/8.12.11/SuSE Linux 0.7) with SMTP id m716sKbg005086 for ; Thu, 31 Jul 2008 23:54:21 -0700 Received: from boing.melbourne.sgi.com (boing.melbourne.sgi.com [134.14.55.141]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id QAA27987; Fri, 1 Aug 2008 16:55:29 +1000 Message-ID: <4892B361.9030900@sgi.com> Date: Fri, 01 Aug 2008 16:55:29 +1000 From: Timothy Shimmin User-Agent: Thunderbird 2.0.0.14 (Macintosh/20080421) MIME-Version: 1.0 To: "Linda A. Walsh" CC: xfs-oss Subject: Re: Question about extended attributes... References: <48925495.7040804@tlinx.org> In-Reply-To: <48925495.7040804@tlinx.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.91.2/6021/Wed Feb 27 15:55:48 2008 on oss.sgi.com X-Virus-Status: Clean X-archive-position: 17290 X-ecartis-version: Ecartis v1.0.0 Sender: xfs-bounce@oss.sgi.com Errors-to: xfs-bounce@oss.sgi.com X-original-sender: tes@sgi.com Precedence: bulk X-list: xfs Hi Linda, Linda A. Walsh wrote: > my man page says extended xfs attributes can have 256-byte names > with up to 64K of data. > > Is there a limit on the number of extended attributes max data size or > name size? > > I.e. could I have 1000 attributes with 64K of data each? > Yep. > Is there a strong reason why the file and data sizes were limited to > 256/64K? I presume by file you mean name. In the various forms of an EA - shortform and leaf form, the namelen is stored as 1 byte and so we can really only store 255 bytes for a name AFAICT. For the value part, I can see 3 forms in which it is short form or in leaf-form with value local or value remote. struct xfs_attr_sf_entry { __uint8_t namelen; /* actual length of name (no NULL) */ __uint8_t valuelen; /* actual length of value (no NULL) */ typedef struct xfs_attr_leaf_name_local { __be16 valuelen; /* number of bytes in value */ __u8 namelen; /* length of name bytes */ typedef struct xfs_attr_leaf_name_remote { __be32 valueblk; /* block number of value bytes */ __be32 valuelen; /* number of bytes in value */ __u8 namelen; /* length of name bytes */ So from a valuelen pt-of-view we have 2^32-1. Not sure about other limitations there. I'm not sure why 64K was chosen for a value size limit. In fact, on a quick look in the xfs code I can't see (other than in dmapi and an assert in list) where we limit this. We do limit it in the attr(1) userspace cmd by only reading up to ATTR_MAX_VALUELEN. 1 xfs/xfs_attr.h 56 #define ATTR_MAX_VALUELEN (64*1024) 2 dmapi/xfs_dm.c xfs_dm_bulkall_one 685 if (value_len > ATTR_MAX_VALUELEN) 3 dmapi/xfs_dm.c xfs_dm_bulkall_one 686 value_len = ATTR_MAX_VALUELEN; 4 dmapi/xfs_dm.c xfs_dm_get_config 1584 retval = ATTR_MAX_VALUELEN; 5 dmapi/xfs_dm.c xfs_dm_get_dmattr 1957 if (alloc_size > ATTR_MAX_VALUELEN) 6 dmapi/xfs_dm.c xfs_dm_get_dmattr 1958 alloc_size = ATTR_MAX_VALUELEN; 7 dmapi/xfs_dm.c xfs_dm_set_dmattr 2623 if (buflen > ATTR_MAX_VALUELEN) 8 xfs/xfs_attr.c xfs_attr_put_listent 682 ASSERT(context->count < (ATTR_MAX_VALUELEN/8)); And on IRIX we limited the value size in the vfs and not in the xfs code. I wonder what would happen going straight to the setxattr syscall on an xfs file. Okay, we are limited by: #define XATTR_SIZE_MAX 65536 /* size of an extended attribute value (64k) */ And we have one for the name: #define XATTR_NAME_MAX 255 /* # chars in an extended attribute name */ static long setxattr(struct dentry *d, char __user *name, void __user *value, size_t size, int flags) { ... if (size) { if (size > XATTR_SIZE_MAX) return -E2BIG; So the Linux interface will limit us here too by the looks of it. > Would they be hard to 'generalize' to max-path-segment-len/max-filelen? > > Only reason I wonder is wondering what file systems besides apple's > "HPFS"(?) and > MS's NTFS, that allow alternate data-streams of arbitrary length. I'm > not sure about > the maximums on HPFS and NTFS, but I haven't _read_ of any notable > limits (I'm sure > there are some, but it _seems_ you can store alternate file versions in > different data-streams > on NTFS, for example... I.e. could use it as a revision system, > theoretically -- to save > older versions of the file with the right software -- but with XFS, it > wouldn't be so > general case with a 64K data limit -- wouldn't be a show-stopper if one > could 'link' > multiple data-segments, but am just curious about the limitations (not > that I'm planning > on implementing a version control system using data-forks...it was just > an example! :-)). > > linda > --Tim