diff options
author | Pranith Kumar K <pranithk@gluster.com> | 2012-06-15 15:13:31 +0530 |
---|---|---|
committer | Anand Avati <avati@redhat.com> | 2012-06-19 23:50:30 -0700 |
commit | 79aa6092a277975cb618d89da645080e51958543 (patch) | |
tree | 1c24f103ab1c48d3884aeafe59cfc4410c8287f7 /libglusterfs/src/options.c | |
parent | d51d9b4154d6a70efcde30514620cc0442252436 (diff) | |
download | glusterfs-79aa6092a277975cb618d89da645080e51958543.tar.gz glusterfs-79aa6092a277975cb618d89da645080e51958543.tar.xz glusterfs-79aa6092a277975cb618d89da645080e51958543.zip |
protocol/client: Re-open should not have O_CREAT|O_TRUNC|O_EXCL
RCA
The bug is observed in 3.2.x because posix xlator changes
the uid/gid of file as per frame->root-uid/gid if O_CREAT flag
is set in open fop. Posix does not do this in 3.3.x so that
bug does not appear anymore but this issue exposed the actual
bug in client xlator re-open. Re-open of a file on re-connection
should not perform re-open with the same flags at the time of
open/create/opendir. Imagine a case where a file is opened with
O_TRUNC|O_RDWR and some data is written to it, now if the brick
goes down and comes back the file will be truncated.
When I tested this case, the file is not truncated because locks
xlator resets O_TRUNC unconditionally.
Client xlator re-open bug and locks xlator bug cancel each other.
Fix
Reset O_CREAT|O_TRUNC|O_EXCL flags in re-open.
Locks xlator should not reset O_TRUNC.
Additional changes
Removed wbflags as it is not assigned at all.
Testcases
Automated go program is at:
://bugzilla.redhat.com/show_bug.cgi?id=807976#c2
Change-Id: I0080344fdda2e62e7c976c35a5bf5f1fa8838891
BUG: 807976
Signed-off-by: Pranith Kumar K <pranithk@gluster.com>
Reviewed-on: http://review.gluster.com/3582
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'libglusterfs/src/options.c')
0 files changed, 0 insertions, 0 deletions