Project

General

Profile

Actions

Bug #44021

closed

client: bad error handling in Client::_lseek

Added by Jeff Layton over 4 years ago. Updated about 4 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
% Done:

0%

Source:
Development
Tags:
Backport:
nautilus,mimic
Regression:
No
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Component(FS):
Client
Labels (FS):
Pull request ID:
Crash signature (v1):
Crash signature (v2):

Description

The SEEK_HOLE and SEEK_DATA error handling looks broken in the userland client:

  case SEEK_DATA:                                                               
    if (offset < 0 || static_cast<uint64_t>(offset) >= in->size) {              
      r = -ENXIO;                                                               
      return offset;                                                            
    }                                                                           
    pos = offset;                                                               
    break;                                                                      

  case SEEK_HOLE:                                                               
    if (offset < 0 || static_cast<uint64_t>(offset) >= in->size) {              
      r = -ENXIO;                                                               
      pos = offset;                                                             
    } else {                                                                    
      pos = in->size;                                                           
    }                                                                           
    break;                                                                      

Both of the cases where we have "r = -ENXIO" should probably be just "return -ENXIO".


Related issues 2 (0 open2 closed)

Copied to CephFS - Backport #44328: nautilus: client: bad error handling in Client::_lseekResolvedWei-Chung ChengActions
Copied to CephFS - Backport #44329: mimic: client: bad error handling in Client::_lseekRejectedActions
Actions

Also available in: Atom PDF