summaryrefslogtreecommitdiffstats
path: root/xlators/features/locks/src/posix.c
diff options
context:
space:
mode:
authorPavan Sondur <pavan@gluster.com>2010-07-01 12:49:35 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-02 00:01:07 -0700
commite5d4a9bac5b3eabe60667ca3aef893a537eb082f (patch)
tree5e43b8c8cff87aad94d985a15cc5d0b8ea618c9c /xlators/features/locks/src/posix.c
parent248248d44c8f5f337549af9d450c3d45be6c43a5 (diff)
features/locks: Check flock structure before proceeding with the lk call.v3.0.5rc8
Signed-off-by: Pavan Vilas Sondur <pavan@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1042 (Use correct flock structures in lk fops) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1042
Diffstat (limited to 'xlators/features/locks/src/posix.c')
-rw-r--r--xlators/features/locks/src/posix.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/features/locks/src/posix.c b/xlators/features/locks/src/posix.c
index 06f4de17dff..5b3f7d5303a 100644
--- a/xlators/features/locks/src/posix.c
+++ b/xlators/features/locks/src/posix.c
@@ -761,6 +761,12 @@ pl_lk (call_frame_t *frame, xlator_t *this,
owner = frame->root->lk_owner;
priv = this->private;
+ if ((flock->l_start < 0) || (flock->l_len < 0)) {
+ op_ret = -1;
+ op_errno = EINVAL;
+ goto unwind;
+ }
+
pl_inode = pl_inode_get (this, fd->inode);
if (!pl_inode) {
gf_log (this->name, GF_LOG_ERROR,