diff options
author | Soumya Koduri <skoduri@redhat.com> | 2015-07-10 12:40:24 +0530 |
---|---|---|
committer | Kaleb KEITHLEY <kkeithle@redhat.com> | 2016-02-28 12:14:14 -0800 |
commit | 7e65e1b5a9a7bdaa7ca28bc5c1773bc5472f19af (patch) | |
tree | f0653863755ff895636f87a89a13b43fcf71e075 /tests/basic/gfapi/bug-1241104.sh | |
parent | 6f12a5767f6912f6913cd9dfa4c6a5484a766000 (diff) |
locks: Handle negative values for flock->l_len
As per 'man 3 fcntl',
"If l_len is positive, the area affected shall start at
l_start and end at l_start+l_len−1. If l_len is negative,
the area affected shall start at l_start+l_len and end at
l_start−1. Locks may start and extend beyond the current
end of a file, but shall not extend before the beginning
of the file."
Currently we return EINVAL if l_len is found to be negative.
Fixed the same as mentioned in the man page.
This is backport of the below patch
- http://review.gluster.org/11613
Change-Id: I493ce202c543185fc4ae7266d1aaf9d7e2a66991
BUG: 1312200
Signed-off-by: Soumya Koduri <skoduri@redhat.com>
Reviewed-on: http://review.gluster.org/11613
Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Reviewed-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Reviewed-on: http://review.gluster.org/13526
Smoke: Gluster Build System <jenkins@build.gluster.com>
NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org>
CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'tests/basic/gfapi/bug-1241104.sh')
-rwxr-xr-x | tests/basic/gfapi/bug-1241104.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/basic/gfapi/bug-1241104.sh b/tests/basic/gfapi/bug-1241104.sh new file mode 100755 index 00000000000..e071835758d --- /dev/null +++ b/tests/basic/gfapi/bug-1241104.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +. $(dirname $0)/../../include.rc +. $(dirname $0)/../../volume.rc + +cleanup; + +TEST glusterd + +TEST $CLI volume create $V0 localhost:$B0/brick1; +EXPECT 'Created' volinfo_field $V0 'Status'; + +TEST $CLI volume start $V0; +EXPECT 'Started' volinfo_field $V0 'Status'; + +logdir=`gluster --print-logdir` + +## Enable Upcall cache-invalidation feature +TEST $CLI volume set $V0 features.cache-invalidation on; + +build_tester $(dirname $0)/bug-1241104.c -lgfapi -o $(dirname $0)/bug-1241104 + +TEST ./$(dirname $0)/bug-1241104 $V0 $logdir/bug-1241104.log + +cleanup_tester $(dirname $0)/bug1241104 + +TEST $CLI volume stop $V0 +TEST $CLI volume delete $V0 + +cleanup; |