Re: [PATCH] xfsdump: fix race condition between lseek() and read()/write()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/12/2017 01:46 PM, Eric Sandeen wrote:
> 
> 

Sorry, I was wrong ...


>> diff --git a/inventory/inv_idx.c b/inventory/inv_idx.c
>> index 95529e8..cd9b9cb 100644
>> --- a/inventory/inv_idx.c
>> +++ b/inventory/inv_idx.c
>> @@ -341,8 +341,8 @@ idx_put_sesstime( inv_sestoken_t tok, bool_t whichtime)
> 
>         rval = GET_REC_NOLOCK( fd, &ent, sizeof( invt_entry_t ),
>                                 tok->sd_invtok->d_invindex_off);
> 
> This sets the offset to d_invindex_off

... and reads sizeof(invt_entry_t), advancing by that much.

>>  			      ent.ie_timeperiod.tp_start,
>>  			      ent.ie_timeperiod.tp_end );
>>  #endif
>> -	rval = PUT_REC_NOLOCK_SEEKCUR( fd, &ent, sizeof( invt_entry_t ),
>> -				      -(off64_t)(sizeof( invt_entry_t )));
> 
> This backed up one entry from the current offset...
which goes back to...

> 
>> +	rval = PUT_REC_NOLOCK(fd, &ent, sizeof(invt_entry_t),
>> +			      tok->sd_invtok->d_invindex_off);

...d_invindex_off.  Sorry for the false alarm.

-eric

> 
> but this keeps it at the current offset, no?  Isn't this a different behavior?
> 
>
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux