All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tadeusz Struk <tadeusz.struk@linaro.org>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Andreas Dilger <adilger.kernel@dilger.ca>,
	Ritesh Harjani <riteshh@linux.ibm.com>,
	linux-ext4@vger.kernel.org, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	syzbot+7a806094edd5d07ba029@syzkaller.appspotmail.com
Subject: Re: [PATCH] ext4: check if offset+length is within a valid range in fallocate
Date: Tue, 15 Mar 2022 13:39:41 -0700	[thread overview]
Message-ID: <ca6b85d7-3b58-dd6b-adf2-3dc3362bf54a@linaro.org> (raw)
In-Reply-To: <20220315191545.187366-1-tadeusz.struk@linaro.org>

On 3/15/22 12:15, Tadeusz Struk wrote:
> @@ -3967,6 +3968,16 @@ int ext4_punch_hole(struct inode *inode, loff_t offset, loff_t length)
>   		   offset;
>   	}
>   
> +	/*
> +	 * For punch hole the length + offset needs to be at least within
> +	 * one block before last
> +	 */
> +	max_length = sbi->s_bitmap_maxbytes - sbi->s_blocksize;

that supposed to be:
max_length = sbi->s_bitmap_maxbytes - inode->i_sb->s_blocksize;

Please ignore this one. I will send a new version soon.
Sorry for the noise.

> +	if (offset + length >= max_length) {
> +		ret = -ENOSPC;
> +		goto out_mutex;
> +	}
> +


-- 
Thanks,
Tadeusz

  reply	other threads:[~2022-03-15 20:39 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25  1:12 BUG in ext4_ind_remove_space Tadeusz Struk
2022-02-25 17:10 ` Ritesh Harjani
2022-02-25 19:19   ` Tadeusz Struk
2022-03-02 23:14     ` Tadeusz Struk
2022-03-03 14:56       ` Ritesh Harjani
2022-03-03 15:37         ` Tadeusz Struk
2022-03-03 20:08           ` Ritesh Harjani
2022-03-07  5:45             ` Ritesh Harjani
2022-03-08 17:58               ` Tadeusz Struk
2022-03-14 21:27               ` Tadeusz Struk
2022-03-15 17:50               ` Tadeusz Struk
2022-03-15 19:15                 ` [PATCH] ext4: check if offset+length is within a valid range in fallocate Tadeusz Struk
2022-03-15 20:39                   ` Tadeusz Struk [this message]
2022-03-16  1:22                   ` kernel test robot
2022-03-16  1:22                   ` kernel test robot
2022-03-16  2:14                     ` Tadeusz Struk
2022-03-16  2:14                       ` Tadeusz Struk

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=ca6b85d7-3b58-dd6b-adf2-3dc3362bf54a@linaro.org \
    --to=tadeusz.struk@linaro.org \
    --cc=adilger.kernel@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riteshh@linux.ibm.com \
    --cc=stable@vger.kernel.org \
    --cc=syzbot+7a806094edd5d07ba029@syzkaller.appspotmail.com \
    --cc=tytso@mit.edu \
    /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
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.