Description
When swapping layouts between two files f0 and f1, if f1 has no striping then the layout gen of f0 is not incremented. This can be used to create layout gen collisions and cache inconsistencies:
# cd ~/lustre-release # git describe 2.3.64-30-g5b91c09 # MOUNT_2=y llmount.sh ... # cd /mnt/lustre # touch f0 # multiop f1 m # lfs swap_layouts /mnt/lustre2/f0 /mnt/lustre2/f1 # echo HI > /mnt/lustre2/f0 # cat f0 # cat /mnt/lustre2/f0 HI
# MOUNT_2=y llmount.sh ... # cd /mnt/lustre # echo OLD > f0 # echo NEW > f1 # multiop f2 m ## mknod # lfs getstripe f0 f0 lmm_stripe_count: 1 lmm_stripe_size: 1048576 lmm_layout_gen: 0 lmm_stripe_offset: 1 obdidx objid objid group 1 2 0x2 0 # lfs swap_layouts /mnt/lustre2/f0 /mnt/lustre2/f2 # lfs swap_layouts /mnt/lustre2/f0 /mnt/lustre2/f1 # lfs getstripe f0 f0 lmm_stripe_count: 1 lmm_stripe_size: 1048576 lmm_layout_gen: 0 lmm_stripe_offset: 0 obdidx objid objid group 0 2 0x2 0 # cat f0 OLD # cat /mnt/lustre2/f0 NEW # cat f0 OLD # cat /mnt/lustre2/f0 NEW
# MOUNT_2=y llmount.sh ... # cd /mnt/lustre # touch f0 # multiop f1 m # lfs swap_layouts /mnt/lustre2/f0 /mnt/lustre2/f1 # echo > /mnt/lustre2/f0 # # stat f0 File: `f0' Size: 0 Blocks: 0 IO Block: 4194304 regular empty file Device: 2c54f966h/743766374d Inode: 144115205255725134 Links: 1 Access: (0644/-rw-r--r--) Uid: ( 0/ root) Gid: ( 0/ root) Access: 2013-04-23 12:04:26.000000000 -0500 Modify: 2013-04-23 12:04:26.000000000 -0500 Change: 2013-04-23 12:04:26.000000000 -0500 # stat f1 stat: cannot stat `f1': Input/output error