Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 317387 Details for
Bug 454872
[NetApp 4.8 bug] online resize of filesystem does not work
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
adjust block device size after an online resize of a disk
2-adjust-block-device-size-after-an-online-resize-of-a-disk.patch (text/plain), 2.57 KB, created by
Jeff Moyer
on 2008-09-22 17:37:00 UTC
(
hide
)
Description:
adjust block device size after an online resize of a disk
Filename:
MIME Type:
Creator:
Jeff Moyer
Created:
2008-09-22 17:37:00 UTC
Size:
2.57 KB
patch
obsolete
>Adjust block device size after an online resize of a disk. > >The revalidate_disk routine now checks if a disk has been resized by >comparing the gendisk capacity to the bdev inode size. If they are >different (usually because the disk has been resized underneath the kernel) >the bdev inode size is adjusted to match the capacity. > >diff -up linux-2.6.9/fs/block_dev.c.orig linux-2.6.9/fs/block_dev.c >--- linux-2.6.9/fs/block_dev.c.orig 2008-09-22 11:23:34.515735843 -0400 >+++ linux-2.6.9/fs/block_dev.c 2008-09-22 11:26:04.649068219 -0400 >@@ -512,6 +512,34 @@ struct block_device *open_by_devnum(dev_ > EXPORT_SYMBOL(open_by_devnum); > > /** >+ * check_disk_size_change - checks for disk size change and adjusts >+ * bdev size. >+ * >+ * @disk: struct gendisk to check >+ * @bdev: struct bdev to adjust. >+ * >+ * This routine checks to see if the bdev size does not match the disk size >+ * and adjusts it if it differs. >+ */ >+void check_disk_size_change(struct gendisk *disk, struct block_device *bdev) >+{ >+ loff_t disk_size, bdev_size; >+ >+ disk_size = (loff_t)get_capacity(disk) << 9; >+ bdev_size = i_size_read(bdev->bd_inode); >+ if (disk_size != bdev_size) { >+ char name[BDEVNAME_SIZE]; >+ >+ disk_name(disk, 0, name); >+ printk(KERN_INFO >+ "%s: detected capacity change from %lld to %lld\n", >+ name, bdev_size, disk_size); >+ i_size_write(bdev->bd_inode, disk_size); >+ } >+} >+EXPORT_SYMBOL(check_disk_size_change); >+ >+/** > * revalidate_disk - wrapper for lower-level driver's revalidate_disk > * call-back > * >@@ -523,11 +551,22 @@ EXPORT_SYMBOL(open_by_devnum); > */ > int revalidate_disk(struct gendisk *disk) > { >+ struct block_device *bdev; > int ret = 0; > > if (disk->fops->revalidate_disk) > ret = disk->fops->revalidate_disk(disk); >+ else >+ return ret; > >+ bdev = bdget_disk(disk, 0); >+ if (!bdev) >+ return ret; >+ >+ mutex_lock(&bdev->bd_mutex); >+ check_disk_size_change(disk, bdev); >+ mutex_unlock(&bdev->bd_mutex); >+ bdput(bdev); > return ret; > } > EXPORT_SYMBOL(revalidate_disk); >diff -up linux-2.6.9/include/linux/fs.h.orig linux-2.6.9/include/linux/fs.h >--- linux-2.6.9/include/linux/fs.h.orig 2008-09-22 11:23:34.536730084 -0400 >+++ linux-2.6.9/include/linux/fs.h 2008-09-22 11:26:04.651731382 -0400 >@@ -1373,6 +1373,8 @@ extern int fs_may_remount_ro(struct supe > */ > #define bio_data_dir(bio) ((bio)->bi_rw & 1) > >+extern void check_disk_size_change(struct gendisk *disk, >+ struct block_device *bdev); > extern int revalidate_disk(struct gendisk *); > extern int check_disk_change(struct block_device *); > extern int invalidate_inodes(struct super_block *);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 454872
:
317386
| 317387 |
317388
|
317389
|
317390
|
317391