Linux-BTRFS Archive on lore.kernel.org
 help / color / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Chris Mason <chris.mason@oracle.com>,
	linux-kernel@vger.kernel.org, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH 1/1] FS: btrfs, use helpers for rlimits
Date: Fri, 03 Sep 2010 10:23:23 +0200
Message-ID: <4C80B07B.7050102@suse.cz> (raw)
In-Reply-To: <20100210200134.GK18175@think>

On 02/10/2010 09:01 PM, Chris Mason wrote:
> Thanks, I have this queued up for .34

Hi, this is still not merged. Was it lost?

> On Wed, Feb 10, 2010 at 09:00:09PM +0100, Jiri Slaby wrote:
>> Make sure compiler won't do weird things with limits. E.g. fetching
>> them twice may return 2 different values after writable limits are
>> implemented.
>>
>> I.e. either use rlimit helpers added in
>> 3e10e716abf3c71bdb5d86b8f507f9e72236c9cd
>> or ACCESS_ONCE if not applicable.
>>
>> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
>> Cc: Chris Mason <chris.mason@oracle.com>
>> Cc: linux-btrfs@vger.kernel.org
>> ---
>>  fs/btrfs/inode.c |    3 +--
>>  1 files changed, 1 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
>> index c41db6d..5aa0cef 100644
>> --- a/fs/btrfs/inode.c
>> +++ b/fs/btrfs/inode.c
>> @@ -3256,8 +3256,7 @@ static int btrfs_setattr_size(struct inode *inode, struct iattr *attr)
>>  		return 0;
>>  
>>  	if (attr->ia_size > inode->i_size) {
>> -		unsigned long limit;
>> -		limit = current->signal->rlim[RLIMIT_FSIZE].rlim_cur;
>> +		unsigned long limit = rlimit(RLIMIT_FSIZE);
>>  		if (attr->ia_size > inode->i_sb->s_maxbytes)
>>  			return -EFBIG;
>>  		if (limit != RLIM_INFINITY && attr->ia_size > limit) {
>> -- 
>> 1.6.6.1
>>


-- 
js
suse labs

  reply index

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-10 20:00 Jiri Slaby
2010-02-10 20:01 ` Chris Mason
2010-09-03  8:23   ` Jiri Slaby [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-06-15 13:48 Jiri Slaby
2010-01-28 21:44 Jiri Slaby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C80B07B.7050102@suse.cz \
    --to=jslaby@suse.cz \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Linux-BTRFS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-btrfs/0 linux-btrfs/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-btrfs linux-btrfs/ https://lore.kernel.org/linux-btrfs \
		linux-btrfs@vger.kernel.org
	public-inbox-index linux-btrfs

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-btrfs


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git