>From 大水牛 <xu...@qiniu.com>:
大水牛 has uploaded this change for review. ( https://review.gerrithub.io/372229
Change subject: [bugfix]When ganesha.nfsd over ceph-rgw(>=10.2.8), EIO may
happen because rgw reject the partial-write or
out-of-order-write(ceph/ceph#10284) Two reasons: -1- mount without the sync
option. OS's buffer IO may flush the block out-of-order; -2- mount with t
......................................................................
[bugfix]When ganesha.nfsd over ceph-rgw(>=10.2.8), EIO may happen because rgw
reject the partial-write or out-of-order-write(ceph/ceph#10284)
Two reasons:
-1- mount without the sync option. OS's buffer IO may flush the block
out-of-order;
-2- mount with the sync option. Try 'dd if=/dev/zero of=./f0 bs=100
count=1024', found that nfs.client send the data by (begin_offset, end_offset]
in (0,100] (0,200] (0,300]...(0,4096]. When the rgw_file has wrote the (0,100],
it would update the offset to 100, but the (0,200] make the rgw return EIO.
This bugfix add a rgw_write_offset in struct fsal_obj_handle for current file
write offset, and skip the data that has wrote before. For example, after write
the (0,100] to rgw, rgw_write_offset=100; then (0,200], skip the (0,100], send
(100,200], rgw_write_offset=200;
more log as below:
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-31]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:0 req_off:0
size:200 goto correct[0]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-30]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:200
req_off:0 size:300 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-34]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:300
req_off:0 size:400 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-33]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:400
req_off:0 size:500 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-36]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:500
req_off:0 size:600 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-35]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:600
req_off:0 size:700 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-37]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:700
req_off:0 size:800 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-38]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:800
req_off:0 size:900 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-39]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:900
req_off:0 size:1000 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-40]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1000
req_off:0 size:1100 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-41]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1100
req_off:0 size:1200 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-42]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1200
req_off:0 size:1300 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-43]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1300
req_off:0 size:1400 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-44]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1400
req_off:0 size:1500 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-46]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1500
req_off:0 size:1600 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-45]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1600
req_off:0 size:1700 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-49]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1700
req_off:0 size:1800 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-47]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1800
req_off:0 size:1900 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-48]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:1900
req_off:0 size:2000 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-50]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2000
req_off:0 size:2100 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-52]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2100
req_off:0 size:2200 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-53]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2200
req_off:0 size:2300 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-51]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2300
req_off:0 size:2400 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-54]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2400
req_off:0 size:2500 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-55]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2500
req_off:0 size:2600 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-56]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2600
req_off:0 size:2700 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-58]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2700
req_off:0 size:2800 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-57]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2800
req_off:0 size:2900 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-59]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:2900
req_off:0 size:3000 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-61]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3000
req_off:0 size:3100 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-62]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3100
req_off:0 size:3200 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-64]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3200
req_off:0 size:3300 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-60]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3300
req_off:0 size:3400 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-63]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3400
req_off:0 size:3500 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-67]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3500
req_off:0 size:3600 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-69]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3600
req_off:0 size:3700 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-66]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3700
req_off:0 size:3800 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-65]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3800
req_off:0 size:3900 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-68]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:3900
req_off:0 size:4000 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-71]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:4000
req_off:0 size:4096 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-70]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:4096
req_off:4096 size:104 goto correct[0]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-73]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:4200
req_off:4096 size:204 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-74]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:4300
req_off:4096 size:304 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-72]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:4400
req_off:4096 size:404 goto correct[1]
01/08/2017 23:05:05 : epoch 598097a5 : ceph0 : nfs-ganesha-2025990[work-75]
rgw_fsal_write2 :FSAL :F_DBG :FSAL WRITE operation prepare. now_off:4500
req_off:4096 size:504 goto correct[1]
Change-Id: I8de3d68f24d9c836662bc7f0022a4d2cf8f93554
Signed-off-by: scenbuffalo <xu...@qiniu.com>
---
M src/FSAL/FSAL_RGW/handle.c
M src/FSAL/FSAL_RGW/internal.c
M src/include/fsal_api.h
3 files changed, 43 insertions(+), 4 deletions(-)
git pull ssh://review.gerrithub.io:29418/ffilz/nfs-ganesha
refs/changes/29/372229/1
--
To view, visit https://review.gerrithub.io/372229
To unsubscribe, visit https://review.gerrithub.io/settings
Gerrit-Project: ffilz/nfs-ganesha
Gerrit-Branch: next
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8de3d68f24d9c836662bc7f0022a4d2cf8f93554
Gerrit-Change-Number: 372229
Gerrit-PatchSet: 1
Gerrit-Owner: 大水牛 <xu...@qiniu.com>
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Nfs-ganesha-devel mailing list
Nfs-ganesha-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nfs-ganesha-devel