Please backup your solution to lab1 before starting the steps below
At first, please remember to save your lab1 solution:
% cd lab-cse/lab1 % git commit -a -m “solution for lab1”
Then, pull from the repository:
% git pull remote: Counting objects: 43, done. … [new branch] lab2 -> origin/lab2 Already up-to-date
Then, change to lab2 branch:
% git checkout lab2
Merge with lab1, and solve the conflict by yourself (mainly in fuse.cc and yfs_client.cc):
% git merge lab1 Auto-merging fuse.cc CONFLICT (content): Merge conflict in yfs_client.cc Auto-merging yfs_client.cc CONFLICT (content): Merge conflict in ifs_client.cc Automatic merge failed; fix conflicts and then commit the result ......
After merge all of the conflicts, you should be able to compile successfully:
# suppose the absoulte path of lab-cse is /home/xx/lab-cse % sudo docker run -it --privileged --cap-add=ALL -v /home/xx/lab-cse:/home/stu/devlop ddnirvana/cselab_env:latest /bin/bash % cd /home/stu/devlop % make
Make sure there's no error in make.

main() function in demo_server.cc).make rpcdemo to build the RPC demograde.sh is provided. Here's a successful grading.
% ./grade.sh
Passed A
Passed B
Passed C
Passed D
Passed E
Passed G (consistency)
Lab2 part 1 passed
......
% make
% ./lock_server 3772
% ./lock_demo 3772
stat request from clt 1386312245
stat returned 0
%
% ./lock_tester 3772
simple lock client
acquire a release a acquire a release a
acquire a acquire b release b release a
test2: client 0 acquire a release a
test2: client 2 acquire a release a
. . .
./lock_tester: passed all tests successfully
% ./start.sh
% ./test-lab2-part2-a ./yfs1 ./yfs2
Create then read: OK
Unlink: OK
Append: OK
Readdir: OK
Many sequential creates: OK
Write 20000 bytes: OK
Concurrent creates: OK
Concurrent creates of the same file: OK
Concurrent create/delete: OK
Concurrent creates, same file, same server: OK
test-lab2-part2-b: Passed all tests.
% ./stop.sh
% ./start.sh
% ./test-lab2-part2-b ./yfs1 ./yfs2
Create/delete in separate directories: tests completed OK
% ./stop.sh
% ./grade.sh
Passed part1 A
Passed part1 B
Passed part1 C
Passed part1 D
Passed part1 E
Passed part1 G (consistency)
Lab2 part 1 passed
Concurrent creates: OK
Concurrent creates of the same file: OK
Concurrent create/delete: OK
Concurrent creates, same file, same server: OK
Concurrent writes to different parts of same file: OK
Passed part2 A
Create/delete in separate directories: tests completed OK
Passed part2 B
Score: 120/120
% make handin
% mv lab2.tgz lab2_[your student id].tgz