Re: [PATCH] Make fileio open files in exclusive mode

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

 



On 07/10/2012 10:55 AM, Christoph Hellwig wrote:
> On Tue, Jul 10, 2012 at 10:50:00AM -0700, Andy Grover wrote:
>> On 07/09/2012 11:02 PM, Christoph Hellwig wrote:
>>> On Mon, Jul 09, 2012 at 05:58:10PM -0700, Andy Grover wrote:
>>>> Other backstores open backing devices in exclusive mode, fileio should as
>>>> well.
>>>
>>> O_EXCL doesn't really provide an exclusion once the file is opened, it
>>> just means the caller has to create the file and it can't exist
>>> beforehand.
>>>
>>> I don't think that's the semantics fileio needs.
>>
>> OK, should userspace just check no other fileio storageobjects exist
>> with that same backing file? Not quite as clean since there still are
>> ways to get around that, but it would at least prevent user errors for
>> those using rtslib.
> 
> You could try doing file locking - that would have to be from userspace
> through as there are no good APIs for it from kernelspace.

Unfortunately file locks are dropped on process exit, and so will not
work since targetcli does not stay resident. The storageobject check
mentioned above should work to prevent typical sysadmin typos, I guess
that'll have to be good enough.

-- Andy

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux