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:
% make
Make sure there's no error in make.
Note: For Lab2 and beyond, you'll need to use a computer that has the FUSE module, library, and headers installed. You should be able to install these on your own machine by following the instructions at FUSE: Filesystem in Userspace (see Lab Information)

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
% export RPC_LOSSY=0
% ./lock_server 3772
Then, in another terminal:
% ./lock_tester 3772
% export RPC_LOSSY=5
% ./lock_server 3772
Then, in another terminal:
% export RPC_LOSSY=5
% ./lock_tester 3772
Again, you must restart the lock_server for each run of lock_tester.
% ./start.sh 5 # sets RPC_LOSSY to 5
% export RPC_COUNT=25
% ./lock_server 3772
RPC STATS: 7001:23 7002:2
...
% ./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
We will test your lock server with cache following the evaluation criteria above. You part3 score is proportional to the RPC reduction factor(a factor of 10 will be the full score).
% make handin
% mv lab2.tgz lab2_[your student id].tgz