Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit ea9e1e00 authored by Michael Bestas's avatar Michael Bestas
Browse files

Merge branch 'master' of https://github.com/namjaejeon/linux-exfat-oot into android13-4.19-kona

* 'master' of https://github.com/namjaejeon/linux-exfat-oot:
  exfat: add necessary header for vmalloc
  exfat: release s_lock before calling dir_emit()
  exfat: check if filename entries exceeds max filename length
  exfat: github action: make space for running xfstests
  exfat: use kvmalloc_array/kvfree instead of kmalloc_array/kfree
  exfat: splice: Use filemap_splice_read() instead of generic_file_splice_read()
  exfat: fs: build the legacy direct I/O code conditionally
  exfat: fs: port ->rename() to pass mnt_idmap
  exfat: fs: port ->mkdir() to pass mnt_idmap
  exfat: fs: port ->create() to pass mnt_idmap
  exfat: fs: port ->getattr() to pass mnt_idmap
  exfat: fs: port ->setattr() to pass mnt_idmap
  exfat: fix the newly allocated clusters are not freed in error handling
  exfat: don't print error log in normal case
  exfat: remove unneeded code from exfat_alloc_cluster()
  exfat: remove ->writepage
  exfat: handle unreconized benign secondary entries
  exfat: fix inode->i_blocks for non-512 byte sector size device
  exfat: redefine DIR_DELETED as the bad cluster number
  exfat: fix reporting fs error when reading dir beyond EOF
  exfat: fix unexpected EOF while reading dir
  exfat: reuse exfat_find_location() to simplify exfat_get_dentry_set()
  exfat: fix overflow in sector and cluster conversion
  exfat: remove i_size_write() from __exfat_truncate()
  exfat: remove argument 'size' from exfat_truncate()
  exfat: remove unnecessary arguments from exfat_find_dir_entry()
  exfat: remove unneeded codes from __exfat_rename()
  exfat: remove call ilog2() from exfat_readdir()
  exfat: remove generic/286
  exfat: fix python package installation failure
  exfat: github actions: add apt-get update command
  exfat: treewide: use get_random_u32() when possible
  exfat: replace magic numbers with Macros
  exfat: rename exfat_free_dentry_set() to exfat_put_dentry_set()
  exfat: move exfat_entry_set_cache from heap to stack
  exfat: support dynamic allocate bh for exfat_entry_set_cache
  exfat: reduce the size of exfat_entry_set_cache
  exfat: add SECTOR_SIZE macro
  exfat: hint the empty entry which at the end of cluster chain
  exfat: simplify empty entry hint
  exfat: add auto-test using github action
  exfat: remove travis-CI test

Change-Id: Ie304b450ae4cd4f8021c909b83142cd69bfef926
parents 49a49fb8 2a0023bc
Loading
Loading
Loading
Loading
+196 −0
Original line number Diff line number Diff line
name: linux-exfat-oot CI

on:
  push:
    branches: [ "master" ]
  pull_request:
    branches: [ "master" ]

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - name: Download the kernel
      run: |
        sudo apt-get update
        sudo apt-get install libelf-dev wget tar gzip python2.7
        wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.1.36.tar.gz
        tar xf linux-4.1.36.tar.gz
        mv linux-4.1.36 linux-stable
    - name: Prerequisite for xfstests testing
      run: |
        sudo apt-get install linux-headers-$(uname -r)
        sudo apt-get install autoconf libtool pkg-config libnl-3-dev libnl-genl-3-dev
        sudo apt-get install xfslibs-dev uuid-dev libtool-bin xfsprogs libgdbm-dev gawk fio attr libattr1-dev libacl1-dev libaio-dev
        git clone --branch=exfat-next https://github.com/exfat-utils/exfat-utils
        git clone https://github.com/namjaejeon/exfat-testsuites
        export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
        export PATH=/usr/local/lib:$PATH
        sudo useradd fsgqa
        sudo useradd 123456-fsgqa
    - name: Copy exfat source to kernel
      run: |
        mv linux-stable ../
        mkdir ../linux-stable/fs/exfat
        cp -ar * ../linux-stable/fs/exfat/
    - name: Compile with 4.1 kernel
      run: |
        cd ../linux-stable
        yes "" | make oldconfig > /dev/null
        echo 'obj-$(CONFIG_EXFAT_FS) += exfat/' >> fs/Makefile
        echo 'source "fs/exfat/Kconfig"' >> fs/Kconfig
        echo 'CONFIG_EXFAT_FS=m' >> .config
        echo 'CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"' >> .config
        make -j$((`nproc`+1)) fs/exfat/exfat.ko
    - name: Run xfstests testsuite
      run: |
        cd ../linux-exfat-oot
        make > /dev/null
        sudo make install > /dev/null
        sudo insmod exfat.ko
        cd exfat-utils
        ./autogen.sh > /dev/null
        ./configure > /dev/null
        make -j$((`nproc`+1)) > /dev/null
        sudo make install > /dev/null
        cd ..
        sudo mkdir -p /mnt/scratch
        sudo mkdir -p /mnt/test
        sudo mkdir -p full_test
    - name: create file/director test
      run: |
        truncate -s 10G full_test.img
        sudo losetup /dev/loop22 full_test.img
        sudo mkfs.exfat /dev/loop22
        sudo mount -t exfat /dev/loop22 ./full_test/
        cd full_test/
        i=1;while [ $i -le 10000 ];do sudo touch file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
        sync
        sudo fsck.exfat /dev/loop22
        sudo rm -rf *
        i=1;while [ $i -le 10000 ];do sudo mkdir file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
        sync
        sudo rm -rf *
        sudo fsck.exfat /dev/loop22
        cd ..
        sudo umount ./full_test/
        sudo fsck.exfat /dev/loop22
        sudo losetup -d /dev/loop22
        rm full_test.img
    - name: xfstest tests
      run: |
        cd exfat-testsuites/
        tar xzvf xfstests-exfat.tgz > /dev/null
        cd xfstests-exfat
        make -j$((`nproc`+1)) > /dev/null
        truncate -s 100G test.img
        truncate -s 100G scratch.img
        sudo losetup /dev/loop20 test.img
        sudo losetup /dev/loop21 scratch.img
        sudo mkfs.exfat /dev/loop20
        sudo mkfs.exfat /dev/loop21
        sudo ./check generic/001
        sudo ./check generic/006
        sudo ./check generic/007
        sudo ./check generic/011
        sudo ./check generic/013
        sudo ./check generic/014
        sudo ./check generic/028
        sudo ./check generic/029
        sudo ./check generic/030
        sudo ./check generic/034
        sudo ./check generic/035
        sudo ./check generic/036
        sudo ./check generic/069
        sudo ./check generic/073
        sudo ./check generic/074
        sudo ./check generic/075
        sudo ./check generic/076
        sudo ./check generic/080
        sudo ./check generic/084
        sudo ./check generic/091
        sudo ./check generic/095
        sudo ./check generic/098
        sudo ./check generic/100
        sudo ./check generic/112
        sudo ./check generic/113
        sudo ./check generic/114
        sudo ./check generic/120
        sudo ./check generic/123
        sudo ./check generic/124
        sudo ./check generic/127
        sudo ./check generic/129
        sudo ./check generic/130
        sudo ./check generic/131
        sudo ./check generic/132
        sudo ./check generic/133
        sudo ./check generic/135
        sudo ./check generic/141
        sudo ./check generic/169
        sudo ./check generic/198
        sudo ./check generic/207
        sudo ./check generic/208
        sudo ./check generic/209
        sudo ./check generic/210
        sudo ./check generic/211
        sudo ./check generic/212
        sudo ./check generic/215
        sudo losetup -d /dev/loop20
        sudo losetup -d /dev/loop21
        rm test.img
        rm scratch.img
        truncate -s 100G test.img
        truncate -s 100G scratch.img
        sudo losetup /dev/loop20 test.img
        sudo losetup /dev/loop21 scratch.img
        sudo mkfs.exfat /dev/loop20
        sudo mkfs.exfat /dev/loop21
        sudo ./check generic/221
        sudo ./check generic/239
        sudo ./check generic/240
        sudo ./check generic/241
        sudo ./check generic/245
        sudo ./check generic/246
        sudo ./check generic/247
        sudo ./check generic/248
        sudo ./check generic/249
        sudo ./check generic/257
        sudo ./check generic/260
        sudo ./check generic/263
        sudo ./check generic/285
        sudo ./check generic/288
        sudo ./check generic/308
        sudo ./check generic/309
        sudo ./check generic/310
        sudo ./check generic/313
        sudo ./check generic/323
        sudo ./check generic/325
        sudo ./check generic/338
        sudo ./check generic/339
        sudo ./check generic/340
        sudo ./check generic/344
        sudo ./check generic/345
        sudo ./check generic/346
        sudo ./check generic/354
        sudo ./check generic/376
        sudo ./check generic/393
        sudo ./check generic/394
        sudo ./check generic/405
        sudo ./check generic/406
        sudo ./check generic/409
        sudo ./check generic/410
        sudo ./check generic/411
        sudo ./check generic/412
        sudo ./check generic/418
        sudo ./check generic/428
        sudo ./check generic/437
        sudo ./check generic/438
        sudo ./check generic/441
        sudo ./check generic/443
        sudo ./check generic/448
        sudo ./check generic/450
        sudo ./check generic/451
        sudo ./check generic/452

fs/exfat/.travis.yml

deleted100644 → 0
+0 −96
Original line number Diff line number Diff line
dist: bionic

language: c

notifications:
 - email: true

before_script:
 # Download the kernel
 - sudo apt-get install libelf-dev wget tar gzip python
 - wget https://mirrors.edge.kernel.org/pub/linux/kernel/v4.x/linux-4.1.36.tar.gz
 - tar xf linux-4.1.36.tar.gz
 - mv linux-4.1.36 linux-stable
 - ./.travis_get_mainline_kernel
 - cp ./.travis_cmd_wrapper.pl ~/travis_cmd_wrapper.pl
 # Prerequisite for xfstests testing
 - sudo apt-get install linux-headers-$(uname -r)
 - sudo apt-get install autoconf libtool pkg-config libnl-3-dev libnl-genl-3-dev
 - sudo apt-get install xfslibs-dev uuid-dev libtool-bin xfsprogs libgdbm-dev gawk fio attr libattr1-dev libacl1-dev libaio-dev
 - git clone --branch=exfat-next https://github.com/exfat-utils/exfat-utils
 - git clone https://github.com/namjaejeon/exfat-testsuites
 - export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
 - export PATH=/usr/local/lib:$PATH
 - sudo useradd fsgqa
 - sudo useradd 123456-fsgqa

script:
 # Copy ksmbd source to kernel
 - mv linux-stable ../
 - mv linux ../
 - mkdir ../linux-stable/fs/exfat
 - cp -ar * ../linux-stable/fs/exfat/
 - cp -ar * ../linux/fs/exfat/

 # Compile with 4.1 kernel
 - cd ../linux-stable
 - yes "" | make oldconfig > /dev/null
 - echo 'obj-$(CONFIG_EXFAT_FS) += exfat/' >> fs/Makefile
 - echo 'source "fs/exfat/Kconfig"' >> fs/Kconfig
 - echo 'CONFIG_EXFAT_FS=m' >> .config
 - echo 'CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"' >> .config
 - make -j$((`nproc`+1)) fs/exfat/exfat.ko

 # Compile with latest Torvalds' kernel
# - cd ../linux
# - yes "" | make oldconfig > /dev/null
# - echo 'obj-$(CONFIG_EXFAT) += exfat/' >> fs/Makefile
# - echo 'source "fs/exfat/Kconfig"' >> fs/Kconfig
# - echo 'CONFIG_EXFAT_FS=m' >> .config
# - echo 'CONFIG_EXFAT_DEFAULT_IOCHARSET="utf8"' >> .config
# - make -j$((`nproc`+1)) fs/exfat/exfat.ko

 # Run xfstests testsuite
 - cd ../linux-exfat-oot
 - make > /dev/null
 - sudo make install > /dev/null
 - sudo modprobe exfat
 - cd exfat-utils
 - ./autogen.sh > /dev/null
 - ./configure > /dev/null
 - make -j$((`nproc`+1)) > /dev/null
 - sudo make install > /dev/null
 - sudo mkdir -p /mnt/scratch
 - sudo mkdir -p /mnt/test
 - sudo mkdir -p /mnt/full_test
 # create file/director test
 - truncate -s 10G full_test.img
 - sudo losetup /dev/loop22 full_test.img
 - sudo mkfs.exfat /dev/loop22
 - sudo mount -t exfat /dev/loop22 /mnt/full_test/
 - cd /mnt/full_test/
 - i=1;while [ $i -le 10000 ];do sudo touch file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
 - sync
 - sudo fsck.exfat /dev/loop22
 - sudo rm -rf *
 - i=1;while [ $i -le 10000 ];do sudo mkdir file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
 - sync
 - sudo rm -rf *
 - sudo fsck.exfat /dev/loop22
 - cd -
 - sudo umount /mnt/full_test/
 - sudo fsck.exfat /dev/loop22
 # run xfstests test
 - truncate -s 100G test.img
 - truncate -s 100G scratch.img
 - sudo losetup /dev/loop20 test.img
 - sudo losetup /dev/loop21 scratch.img
 - sudo mkfs.exfat /dev/loop20
 - sudo mkfs.exfat /dev/loop21
 - cd ..
 - cd exfat-testsuites/
 - tar xzvf xfstests-exfat.tgz > /dev/null
 - cd xfstests-exfat
 - make -j$((`nproc`+1)) > /dev/null
 - sudo ./check generic/001
 - sudo ./check generic/006

fs/exfat/.travis_cmd_wrapper.pl

deleted100755 → 0
+0 −65
Original line number Diff line number Diff line
#!/usr/bin/perl

#
# SPDX-License-Identifier: GPL-2.0-or-later
#
# Copyright (C) 2019 Samsung Electronics Co., Ltd.
#

use strict;

sub tweak_sysctl()
{
	`sudo sysctl kernel.hardlockup_panic=0`;
	`sudo sysctl kernel.hung_task_panic=0`;
	`sudo sysctl kernel.panic=128`;
	`sudo sysctl kernel.panic_on_io_nmi=0`;
	`sudo sysctl kernel.panic_on_oops=0`;
	`sudo sysctl kernel.panic_on_rcu_stall=0`;
	`sudo sysctl kernel.panic_on_unrecovered_nmi=0`;
	`sudo sysctl kernel.panic_on_warn=0`;
	`sudo sysctl kernel.softlockup_panic=0`;
	`sudo sysctl kernel.unknown_nmi_panic=0`;
}

sub execute($$)
{
	my $cmd = shift;
	my $timeout = shift;
	my $output = "Timeout";
	my $status = 1;

	$timeout = 8 * 60 if (!defined $timeout);

	tweak_sysctl();

	eval {
		local $SIG{ALRM} = sub {
			print "TIMEOUT:\n";
			system("top -n 1"), print "top\n";
			system("free"), print "free\n";
			system("dmesg"), print "dmesg\n";
			die "Timeout\n";
		};

		print "Executing $cmd with timeout $timeout\n";

		alarm $timeout;
		$output = `$cmd`;
		$status = $?;
		alarm 0;
		print $output."\n";
		print "Finished: status $status\n";
	};

	if ($@) {
		die unless $@ eq "Timeout\n";
	}
}

if (! defined $ARGV[0]) {
	print "Usage:\n\t./.travis_cmd_wrapper.pl command [timeout seconds]\n";
	exit 1;
}

execute($ARGV[0], $ARGV[1]);
+0 −37
Original line number Diff line number Diff line
#!/bin/sh

#
# A simple script we are using to get the latest mainline kernel
# tar ball
#

wget https://www.kernel.org/releases.json
if [ $? -ne 0 ]; then
	echo "Could not download kernel.org/releases.json"
	exit 1
fi

VER=$(cat releases.json | python2.7 -c "import sys, json; print json.load(sys.stdin)['latest_stable']['version']")
if [ $? -ne 0 ]; then
	echo "Could not parse release.json"
	exit 1
fi

if [ "z$VER" = "z" ]; then
	echo "Could not determine latest release version"
	exit 1
fi

wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-"$VER".tar.gz
if [ $? -ne 0 ]; then
	echo "Could not download $VER kernel version"
	exit 1
fi

tar xf linux-"$VER".tar.gz
if [ $? -ne 0 ]; then
	echo "Could not untar kernel tar ball"
	exit 1
fi

mv linux-"$VER" linux
+1 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
config EXFAT_FS
	tristate "exFAT filesystem support"
	select NLS
	select LEGACY_DIRECT_IO
	help
	  This allows you to mount devices formatted with the exFAT file system.
	  exFAT is typically used on SD-Cards or USB sticks.
Loading