Re: Is btrfs filesystem resize synchronous?

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

 



On Wed, Mar 18, 2015 at 04:36:17PM +0100, Zoltán Halassy wrote:
> Is it safe to use do something like this:
> 
> # btrfs filesystem resize 100m /mnt/something && lvreduce -f -L100M
> /dev/somevg/somelv
> 
> as in, when the first command exits with 0 status, is the filesystem
> already resized? I mean, it's 100% sure the FS driver will not touch
> any blocks beyond the requested size after the resize successfully
> returned?

Yes.

> I guess the utility just signals some ioctl to the mounted
> filesystem, but I wonder if the ioctl only returns successfully when
> it finished the task.

Yes, the ioctl starts a transaction and waits until it's committed, so
the new filesystem size is permanent at the time the ioctl returns.

> Sorry if this is a noise, I didn't find anything about this in the
> user documentation, and it is not obvious for me. I read somewhere,
> the FS driver does not check for missing blocks at the end of the
> device during mount (eg, when the device is smaller than the reported
> size in the superblock), and will simply throw io errors when tries to
> access those blocks. This made me ask the question above.

That's a bit different question.  If the block device is smaller than
the filesystem expects, then the out of bounds read attempts happen,
though this could/should be checked at the mount time.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux