X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2FextN%2FMakefile.am;h=d1de59be078c505d19cbb3e119264d30ac825b7a;hb=0bcac33c5aec463e9f471fba6f7d0adc26e6df9f;hp=10ceb7f559e362304c62248f93cc23d0b9a11edb;hpb=77d67d6a17e0099ff82fd9350825a22cfca0457c;p=fs%2Flustre-release.git diff --git a/lustre/extN/Makefile.am b/lustre/extN/Makefile.am index 10ceb7f..d1de59b 100644 --- a/lustre/extN/Makefile.am +++ b/lustre/extN/Makefile.am @@ -8,60 +8,130 @@ MODULE = extN modulefs_DATA = extN.o EXTRA_PROGRAMS = extN -EXTNP = htree-ext3-2.4.18.diff linux-2.4.18ea-0.8.26.diff -EXTNP+= ext3-2.4.18-ino_sb_macro.diff extN-misc-fixup.diff +# NOTE: If you are not using a RedHat 12.5 or later kernel, then you need to +# apply the "fixes" patch first, as it fixes a number of bugs in ext3. +# It will be applied automatically by the extN build process, or you +# can apply it to the source kernel tree and fix ext3 also. For chaos22 +# (or other RH < 12.5 kernels) use the "chaos22" patch instead. +EXTN_FIXES = patch-2.4.18-chaos22 +#EXTN_FIXES = ext3-2.4.18-fixes.diff +EXTNP = htree-ext3-2.4.18.diff linux-2.4.18ea-0.8.26.diff ext3-2.4-ino_t.diff +EXTNP+= ext3-2.4.18-ino_sb_macro.diff extN-misc-fixup.diff extN-noread.diff +EXTNP+= extN-wantedi.diff extN-san.diff extN-2.4.18-ino_sb_fixup.diff +#EXTNP+= extN-iget-debug.diff EXTNC = balloc.c bitmap.c dir.c file.c fsync.c ialloc.c inode.c ioctl.c EXTNC+= namei.c super.c symlink.c -EXTNI = extN_fs.h extN_fs_i.h extN_fs_sb.h extN_jbd.h -EXTN_EXTRA = include/linux/xattr.h include/linux/extN_xattr.h fs/extN/xattr.c fs/extN/hash.c include/linux/extN_fs.h +EXTNI = extN_fs.h extN_fs_i.h extN_fs_sb.h extN_jbd.h quotaops.h +EXTN_EXTRA = include/linux/xattr.h include/linux/extN_xattr.h fs/extN/xattr.c +EXTN_EXTRA += include/linux/quotaops.h extN_SOURCES = $(EXTNC) xattr.c # punch.c extN_DEPENDENCIES = patch-stamp -EXTRA_DIST = $(EXTNP) extN-2.4.18-ino_sb_fixup.diff extN-2.4.18-exports.diff -DISTCLEANFILES = $(extN_SOURCES) patch-stamp *.orig *.rej -SUB=-e "s/ext3/extN/g" -e "s/EXT3/EXTN/g" +EXTRA_DIST = $(EXTNP) $(EXTN_FIXES) \ + ext3-largefile.diff extN-2.4.18-exports.diff \ + ext3-use-after-free.diff ext3-unmount_sync.diff $(wildcard extN.patch-*) +DISTCLEANFILES = -r $(extN_SOURCES) sed-stamp patch-stamp *.orig *.rej +SUB=-e "s/ext3/extN/g" -e "s/EXT3/EXTN/g" -e "s/extern __inline__/static inline/" + +distclean: + cd .. && rm -f $(EXTN_EXTRA) include $(top_srcdir)/Rules -# Create a fresh ext2 patch. +# Following 2 vars are for buildind outside the source tree. +extN_orig = $(top_builddir)/$(subdir)/extN.orig +extN_include_orig = $(top_builddir)/$(subdir)/extN-include.orig + +# Create a fresh extN patch. +# This is for when the patch-stamp target fails for your kernel. +# Just edit the files until you like them, then do `make diff', and +# it will create a specialized patch for your particular kernel. +# Check it in, and the build should work for you without disrupting +# the other developers. +# Of course, the ideal is to merge changes so that the default patch +# set works for nearly everybody. This is mainly for damage control. + diff: $(RM) extN.patchT - for f in $(EXTNC); do diff -u $(top_srcdir)/fs/extN/$$f $$f >> extN.patchT ; done - mv -f ext2.patchT $(srcdir)/ext2.patch-$(RELEASE) + l='$(EXTNC)'; for f in $$l; do \ + echo "$$f"; \ + (diff -u $(extN_orig)/$$f extN/$$f) >> extN.patchT; \ + test $$? -le 1 || exit 1; \ + done + l='$(EXTNI)'; for f in $$l; do \ + echo "$$f"; \ + (diff -u $(extN_include_orig)/$$f $(top_srcdir)/include/linux/$$f)>>extN.patchT;\ + test $$? -le 1 || exit 1; \ + done + l='$(EXTN_EXTRA)'; for f in $$l; do \ + f=`echo "$$f" | sed 's%^fs/%%'`; \ + echo "$$f"; \ + (cd $(top_srcdir) && \ + diff -u /dev/null $$f) >> extN.patchT; \ + test $$? -le 1 || exit 1; \ + done + mv -f extN.patchT $(top_builddir)/$(subdir)/extN.patch-$(RELEASE) + echo "Don't forget to add $(srcdir)/extN.patch-$(RELEASE) to CVS!" + .PHONY: diff -# Patch the kernel files with our ext3 patches. We need to go through some -# extra hoops because the include files are in a different tree and because -# patch likes to make local copies of files with (sym)links when it is patching -# them. To avoid this, we copy/patch in the source dir instead of the build -# dir (if they are different). -patch-stamp: $(EXTNP) +# Just do the SUB transformation on all our source files. +sed-stamp: $(RM) $@ - test -e $(top_srcdir)/fs || ln -sf . $(top_srcdir)/fs - set -vx;\ - list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(top_srcdir)/$$f; done - set -vx;\ + rm -rf $(extN_orig) $(extN_include_orig) + mkdir $(extN_orig) $(extN_include_orig) list='$(EXTNC)'; for f in $$list; do \ - sed $(SUB) $(LINUX)/fs/ext3/$$f > $(top_srcdir)/fs/extN/$$f; \ + echo "creating $(extN_orig)/$$f"; \ + sed $(SUB) $(LINUX)/fs/ext3/$$f > $(extN_orig)/$$f; \ done - set -vx;\ list='$(EXTNI)'; for i in $$list; do \ - s=`echo $$i | sed "s/extN/ext3/"`; \ - sed $(SUB) $(LINUX)/include/linux/$$s > \ - $(top_srcdir)/include/linux/$$i; \ + s=`echo $$i | sed "s/extN/ext3/"`; \ + echo "creating $(extN_include_orig)/$$i"; \ + sed $(SUB) $(LINUX)/include/linux/$$s > $(extN_include_orig)/$$i; \ done - set -vx;\ - if [ -f $(srcdir)/extN.patch-$(RELEASE) ]; then \ - patch -p0 < $(srcdir)/extN.patch-$(RELEASE); \ - else \ - list='$(EXTNP)'; for p in $$list; do \ - sed $(SUB) $(srcdir)/$$p|(cd $(top_srcdir);patch -p1)||exit -1;\ - done; \ - echo "It is OK if the following patch fails"; \ - (cd $(top_srcdir); patch -N -p1) < $(srcdir)/extN-2.4.18-exports.diff; \ - (cd $(top_srcdir); patch -p1) < $(srcdir)/extN-2.4.18-ino_sb_fixup.diff; \ + echo timestamp > $@ + + +# Patch the kernel files with our ext3 patches. We need to go through some +# extra hoops because the include files are in a different tree and because +# patch likes to make local copies of files with (sym)links when it is patching +# them. To avoid this, we copy/patch in the source dir instead of the build +# dir (if they are different). +# We also want to preserve the pristine transformed files for the diff target. + + + +patch-stamp: sed-stamp $(EXTNP) + test -e $(top_builddir)/include/linux || mkdir -p $(top_builddir)/include/linux + cp -a $(extN_orig)/* $(top_builddir)/$(subdir) + cp -a $(extN_include_orig)/* $(top_builddir)/include/linux + test -e $(top_builddir)/fs || ln -s . $(top_builddir)/fs + list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(top_builddir)/$$f; done + if [ -f $(srcdir)/extN.patch-$(RELEASE) ]; then \ + echo "applying patch $(srcdir)/extN.patch-$(RELEASE)"; \ + (cd $(top_builddir) && patch -p0) < $(srcdir)/extN.patch-$(RELEASE);\ + else \ + list='$(EXTNP)'; \ + grep -q "err = extN_mark_inode_dirty" $(extN_orig)/namei.c || \ + list="ext3-use-after-free.diff $$list"; \ + sed '/i_version/q' $(extN_orig)/namei.c | tail -2 | \ + grep -q extN_mark_inode_dirty && list="$(EXTN_FIXES) $$list"; \ + grep -q "if (do_sync_supers)" $(extN_orig)/super.c && \ + list="ext3-unmount_sync.diff $$list"; \ + grep -q "ext3_journal_start(inode, 2)" $(extN_orig)/inode.c || \ + list="ext3-largefile.diff $$list"; \ + grep -q "EXPORT_SYMBOL(extN_bread)" $(extN_orig)/super.c || \ + list="$$list extN-2.4.18-exports.diff"; \ + for p in $$list; do \ + echo "applying patch $$p"; \ + sed $(SUB) $(srcdir)/$$p | \ + (cd $(top_builddir) && patch -p1) || exit $$?; \ + done; \ fi echo timestamp > $@ + + + $(extN_SOURCES) $(EXTNI) $(EXTN_EXTRA): patch-stamp # Don't distribute any patched files. @@ -69,6 +139,6 @@ dist-hook: $(RM) $(top_srcdir)/fs list='$(EXTNC)'; for f in $$list; do $(RM) $(distdir)/$$f; done list='$(EXTNI)'; for i in $$list; do \ - $(RM) $(distdir)/../include/linux/$$i; \ + $(RM) $(distdir)/../include/linux/$$i; \ done list='$(EXTN_EXTRA)'; for f in $$list; do $(RM) $(distdir)/../$$f; done