[Top] [All Lists]

Re: [PATCH] Check for immutable flag in fallocate path

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH] Check for immutable flag in fallocate path
From: Marco Stornelli <marco.stornelli@xxxxxxxxx>
Date: Mon, 21 Feb 2011 17:50:21 +0100
Cc: Linux Kernel <linux-kernel@xxxxxxxxxxxxxxx>, cluster-devel@xxxxxxxxxx, Linux FS Devel <linux-fsdevel@xxxxxxxxxxxxxxx>, linux-ext4@xxxxxxxxxxxxxxx, linux-btrfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=yKgN2XFcqESMaRkcoQarYIr/+uBB2m4Mm1Qnsj/SzKY=; b=nE87E/nlV6wYRSSvZa/S+EtlZaffMqwYaqyxkxDNnr4oR4apWxUlhbFAeMZZCT44a+ OHk/7VqKqXymXRtuQUxvb5RWLSsib5gUqJZgU8/vF1a3UFdI/+sLOw5RX4f1KMtTu54C SKBamLGixoLT0YJv4G0rq5H12QBUqDf+6+JHE=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=NDzgn/2+NGxrOuhkJ3NZO2XPdcEvBL7/QcJZGqlzx8iOAmk06+ek8qfYY5ud6MtfSw VqzYaqmDl3NIvL1ITOTDunMn9VM12WEplm+JxWmieh2dzQG9ARbeLoQK4rn8/Ipmc9rS d9rdnpZ8HTb5OUTtylCoJ3Kl+9vfWBsytKxjs=
In-reply-to: <20110221124635.GA5525@xxxxxxxxxxxxx>
References: <4D6221B8.9040303@xxxxxxxxx> <20110221124635.GA5525@xxxxxxxxxxxxx>
2011/2/21 Christoph Hellwig <hch@xxxxxxxxxxxxx>:
> On Mon, Feb 21, 2011 at 09:26:32AM +0100, Marco Stornelli wrote:
>> From: Marco Stornelli <marco.stornelli@xxxxxxxxx>
>> All fs must check for the immutable flag in their fallocate callback.
>> It's possible to have a race condition in this scenario: an application
>> open a file in read/write and it does something, meanwhile root set the
>> immutable flag on the file, the application at that point can call
>> fallocate with success. Only Ocfs2 check for the immutable flag at the
>> moment.
> Please add the check in fs/open.c:do_fallocate() so that it covers all
> filesystems.

The check should be done after the fs got the inode mutex lock.


<Prev in Thread] Current Thread [Next in Thread>