Skip to content

Commit 3714033

Browse files
committed
Merge branch 'main' into kerberos
2 parents 2c7b221 + 0418191 commit 3714033

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

78 files changed

+3137
-790
lines changed

.github/scripts/prepare_db.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ prepare_db() {
118118
install_gluster
119119
install_webdav
120120
docker run -d --name sftp -p 2222:22 juicedata/ci-sftp
121+
docker run -d --name samba -p 4445:445 -e "USER=samba" -e "PASS=secret" dockurr/samba
121122
install_etcd
122123
.github/scripts/setup-hdfs.sh
123124
;;

.github/scripts/sync/sync_fsrand.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,14 @@ test_files_from(){
119119
./juicefs mount $META_URL /tmp/jfs -d
120120
sync_option1="--dirs --perms --check-all --links --list-threads 10 --list-depth 5"
121121
sync_option2="--dirs --perms --check-all --links --list-threads 10 --list-depth 5 --files-from files"
122-
ls -A $SOURCE_DIR1 > files
122+
ls -A "$SOURCE_DIR1" | while read file; do
123+
full_path="$SOURCE_DIR1/$file"
124+
if [ -L "$full_path" ] && [ ! -e "$full_path" ]; then
125+
rm "$full_path"
126+
else
127+
echo "$file"
128+
fi
129+
done > files
123130
sudo -u $USER GOCOVERDIR=$GOCOVERDIR ./juicefs sync -v $SOURCE_DIR1 $DEST_DIR1 $sync_option1 2>&1| tee sync1.log || true
124131
SOURCE_PERM=$(sudo stat -c "%a" "$DEST_DIR1")
125132
SOURCE_OWNER=$(sudo stat -c "%U" "$DEST_DIR1")
@@ -190,4 +197,4 @@ check_diff(){
190197
}
191198

192199

193-
source .github/scripts/common/run_test.sh && run_test $@
200+
source .github/scripts/common/run_test.sh && run_test $@

.github/workflows/unittests.yml

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,9 @@ jobs:
5555
SFTP_HOST: localhost:2222:/home/testUser1/upload/
5656
SFTP_USER: testUser1
5757
SFTP_PASS: password
58+
CIFS_ADDR: localhost:4445/Data
59+
CIFS_USER: samba
60+
CIFS_PASSWORD: secret
5861
WEBDAV_TEST_BUCKET: 127.0.0.1:9007
5962
TIKV_ADDR: 127.0.0.1
6063
REDIS_ADDR: redis://127.0.0.1:6379/13
@@ -99,12 +102,12 @@ jobs:
99102
name: Install redis-cluster
100103
uses: vishnudxb/[email protected]
101104
with:
102-
master1-port: 7000
103-
master2-port: 7001
104-
master3-port: 7002
105-
slave1-port: 7003
106-
slave2-port: 7004
107-
slave3-port: 7005
105+
master1-port: 7000
106+
master2-port: 7001
107+
master3-port: 7002
108+
slave1-port: 7003
109+
slave2-port: 7004
110+
slave3-port: 7005
108111

109112
- name: Prepare Database
110113
run: |

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ juicefs.cover: Makefile cmd/*.go pkg/*/*.go go.*
2828
go build -ldflags="$(LDFLAGS)" -cover -o juicefs .
2929

3030
juicefs.lite: Makefile cmd/*.go pkg/*/*.go
31-
go build -tags nogateway,nowebdav,nocos,nobos,nohdfs,noibmcos,noobs,nooss,noqingstor,nosftp,noswift,noazure,nogs,noufile,nob2,nonfs,nodragonfly,nosqlite,nomysql,nopg,notikv,nobadger,noetcd \
31+
go build -tags nogateway,nowebdav,nocos,nobos,nohdfs,noibmcos,noobs,nooss,noqingstor,nosftp,noswift,noazure,nogs,noufile,nob2,nonfs,nodragonfly,nosqlite,nomysql,nopg,notikv,nobadger,noetcd,nocifs \
3232
-ldflags="$(LDFLAGS)" -o juicefs.lite .
3333

3434
juicefs.ceph: Makefile cmd/*.go pkg/*/*.go

cmd/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,10 @@ func configManagementFlags() []cli.Flag {
8989
Name: "dir-stats",
9090
Usage: "enable dir stats, which is necessary for fast summary and dir quota",
9191
},
92+
&cli.BoolFlag{
93+
Name: "user-group-quota",
94+
Usage: "enable user and group quota management",
95+
},
9296
})
9397
}
9498

cmd/debug.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ func copyFileOnWindows(srcPath, destPath string) error {
111111

112112
func copyFile(srcPath, destPath string, requireRootPrivileges bool) error {
113113
if runtime.GOOS == "windows" {
114-
return utils.WithTimeout(func(context.Context) error {
114+
return utils.WithTimeout(context.TODO(), func(context.Context) error {
115115
return copyFileOnWindows(srcPath, destPath)
116116
}, 3*time.Second)
117117
}
@@ -148,7 +148,7 @@ func closeFile(file *os.File) {
148148

149149
func getPprofPort(pid, amp string, requireRootPrivileges bool) (int, error) {
150150
cfg := vfs.Config{}
151-
_ = utils.WithTimeout(func(context.Context) error {
151+
_ = utils.WithTimeout(context.TODO(), func(context.Context) error {
152152
content, err := readConfig(amp)
153153
if err != nil {
154154
logger.Warnf("failed to read config file: %v", err)
@@ -467,7 +467,7 @@ func collectSysInfo(ctx *cli.Context, currDir string) error {
467467
func collectSpecialFile(ctx *cli.Context, amp string, currDir string, requireRootPrivileges bool, wg *sync.WaitGroup) error {
468468
prefixed := true
469469
configName := ".jfs.config"
470-
_ = utils.WithTimeout(func(context.Context) error {
470+
_ = utils.WithTimeout(context.TODO(), func(context.Context) error {
471471
if !utils.Exists(filepath.Join(amp, configName)) {
472472
configName = ".config"
473473
prefixed = false
@@ -506,7 +506,7 @@ func debug(ctx *cli.Context) error {
506506
setup(ctx, 1)
507507
mp := ctx.Args().First()
508508
var inode uint64
509-
if err := utils.WithTimeout(func(context.Context) error {
509+
if err := utils.WithTimeout(context.TODO(), func(context.Context) error {
510510
var err error
511511
if inode, err = utils.GetFileInode(mp); err != nil {
512512
return fmt.Errorf("failed to lookup inode for %s: %s", mp, err)

cmd/debug_unix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ import (
3434

3535
func getCmdMount(mp string) (uid, pid, cmd string, err error) {
3636
var tmpPid string
37-
_ = utils.WithTimeout(func(context.Context) error {
37+
_ = utils.WithTimeout(context.TODO(), func(context.Context) error {
3838
content, err := readConfig(mp)
3939
if err != nil {
4040
logger.Warnf("failed to read config file: %v", err)

cmd/debug_windows.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ func getProcessUserSid(pid int) (string, error) {
148148

149149
func getCmdMount(mp string) (uid, pid, cmd string, err error) {
150150
var tmpPid string
151-
_ = utils.WithTimeout(func(context.Context) error {
151+
_ = utils.WithTimeout(context.TODO(), func(context.Context) error {
152152
content, err := readConfig(mp)
153153
if err != nil {
154154
logger.Warnf("failed to read config file: %v", err)

cmd/destroy.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import (
2424
"sync"
2525

2626
"github.com/juicedata/juicefs/pkg/meta"
27-
osync "github.com/juicedata/juicefs/pkg/sync"
27+
"github.com/juicedata/juicefs/pkg/object"
2828
"github.com/juicedata/juicefs/pkg/utils"
2929
"github.com/urfave/cli/v2"
3030
)
@@ -158,7 +158,7 @@ func destroy(ctx *cli.Context) error {
158158
}
159159
}
160160

161-
objs, err := osync.ListAll(blob, "", "", "", true)
161+
objs, err := object.ListAll(ctx.Context, blob, "", "", true, false)
162162
if err != nil {
163163
logger.Fatalf("list all objects: %s", err)
164164
}

cmd/flags.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,11 @@ func dataCacheFlags() []cli.Flag {
196196
Name: "writeback",
197197
Usage: "upload blocks in background",
198198
},
199+
&cli.StringFlag{
200+
Name: "writeback-threshold-size",
201+
Value: "0",
202+
Usage: "blocks smaller than this size will be staged, 0 means all staged.",
203+
},
199204
&cli.StringFlag{
200205
Name: "upload-delay",
201206
Value: "0s",
@@ -313,6 +318,10 @@ func metaFlags() []cli.Flag {
313318
Value: false,
314319
Usage: "Use local counters for statfs instead of querying metadata service",
315320
},
321+
&cli.StringFlag{
322+
Name: "network-interfaces",
323+
Usage: "comma-separated list of network interfaces to use for IP discovery (e.g. eth0,en0), empty means all",
324+
},
316325
})
317326
}
318327

0 commit comments

Comments
 (0)