Displaying 20 results from an estimated 128 matches for "new_siz".
Did you mean:
new_size
2009 Feb 05
1
[PATCH 1/3] jbd2: Fix possible NULL pointer dereference in jbd2_journal_begin_ordered_truncate()
...ion to orphan list
+ * happens in the same transaction as write - we don't have to write any data
+ * in such case).
*/
-int jbd2_journal_begin_ordered_truncate(struct jbd2_inode *inode,
+int jbd2_journal_begin_ordered_truncate(journal_t *journal,
+ struct jbd2_inode *jinode,
loff_t new_size)
{
- journal_t *journal;
- transaction_t *commit_trans;
+ transaction_t *inode_trans, *commit_trans;
int ret = 0;
- if (!inode->i_transaction && !inode->i_next_transaction)
+ /* This is a quick check to avoid locking if not necessary */
+ if (!jinode->i_transaction)
goto o...
2009 Feb 24
1
[STABLE, 2.6.27.y] jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate()
.../jbd2.h | 3 ++-
4 files changed, 50 insertions(+), 14 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index 6e7f085..7b063d4 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -46,8 +46,10 @@
static inline int ext4_begin_ordered_truncate(struct inode *inode,
loff_t new_size)
{
- return jbd2_journal_begin_ordered_truncate(&EXT4_I(inode)->jinode,
- new_size);
+ return jbd2_journal_begin_ordered_truncate(
+ EXT4_SB(inode->i_sb)->s_journal,
+ &EXT4_I(inode)->jinode,
+ new_size);
}
static void ext4_invalidatepage(struct page *p...
2018 Jan 26
2
[PATCH nbdkit] filters: cache, cow: Handle bitmap overflow on 32 bit architectures.
...0644
--- a/filters/cache/cache.c
+++ b/filters/cache/cache.c
@@ -72,7 +72,7 @@ static int fd = -1;
static uint8_t *bitmap;
/* Size of the bitmap in bytes. */
-static uint64_t bm_size;
+static size_t bm_size;
enum bm_entry {
BLOCK_NOT_CACHED = 0,
@@ -167,7 +167,14 @@ blk_set_size (uint64_t new_size)
{
uint8_t *new_bm;
const size_t old_bm_size = bm_size;
- size_t new_bm_size = DIV_ROUND_UP (new_size, BLKSIZE*8/2);
+ uint64_t new_bm_size_u64 = DIV_ROUND_UP (new_size, BLKSIZE*8/2);
+ size_t new_bm_size;
+
+ if (new_bm_size_u64 > SIZE_MAX) {
+ nbdkit_error ("bitmap too larg...
2009 Feb 24
0
[STABLE, 2.6.28.y] jbd2: Avoid possible NULL dereference in jbd2_journal_begin_ordered_truncate()
.../jbd2.h | 3 ++-
4 files changed, 41 insertions(+), 16 deletions(-)
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index ccb6947..7353def 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -46,8 +46,10 @@
static inline int ext4_begin_ordered_truncate(struct inode *inode,
loff_t new_size)
{
- return jbd2_journal_begin_ordered_truncate(&EXT4_I(inode)->jinode,
- new_size);
+ return jbd2_journal_begin_ordered_truncate(
+ EXT4_SB(inode->i_sb)->s_journal,
+ &EXT4_I(inode)->jinode,
+ new_size);
}
static void ext4_invalidatepage(struct page *p...
2009 Mar 20
1
[stable] Linux 2.6.28.8 (ocfs2 build failure)
...++++++++++++++-----------
fs/ocfs2/journal.h | 6 ++++--
include/linux/jbd2.h | 3 ++-
4 files changed, 41 insertions(+), 16 deletions(-)
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -46,8 +46,10 @@
static inline int ext4_begin_ordered_truncate(struct inode *inode,
loff_t new_size)
{
- return jbd2_journal_begin_ordered_truncate(&EXT4_I(inode)->jinode,
- new_size);
+ return jbd2_journal_begin_ordered_truncate(
+ EXT4_SB(inode->i_sb)->s_journal,
+ &EXT4_I(inode)->jinode,
+ new_size);
}
static void ext4_invalidatepage(struct page *p...
2004 Dec 20
1
panic with search
...bffff884 "`????q\n\b?\f\b\210w\f\b??\017e\n\b\210w\f\b?\f\b") at failures.c:115
#3 0x080a786a in i_panic (format=0x80c3300 "pool_data_stack_realloc(): stack frame changed") at failures.c:173
#4 0x080afd33 in pool_data_stack_realloc (pool=0x80c7788, mem=0x80c77d0, old_size=256, new_size=8192) at mempool-datastack.c:110
#5 0x080a650f in buffer_alloc (buf=0x80c77b0, size=8192) at buffer.c:32
#6 0x080a6c74 in buffer_check_limits (buf=0x80c77b0, pos=1, data_size=4096) at buffer.c:57
#7 0x080a6a49 in buffer_copy (_dest=0x80c77b0, dest_pos=1, _src=0x80c7950, src_pos=0, copy_size=409...
2018 Dec 01
2
[PATCH nbdkit] common: Move shared bitmap code to a common library.
I have some patches I'm working on to fix the cache filter.
However this is a prelude. It should be simply pure refactoring.
All tests pass still.
Rich.
2009 Jul 21
1
[PATCH 1/1] ocfs2: adds mlogs to aops.c -V2
...d_inline_data(inode, page, wc->w_di_bh);
if (ret) {
+ mlog_errno(ret);
ocfs2_commit_trans(osb, handle);
-
goto out;
}
}
wc->w_handle = handle;
out:
+ mlog_exit(ret);
return ret;
}
@@ -1542,8 +1659,14 @@ int ocfs2_size_fits_inline_data(struct buffer_head *di_bh, u64 new_size)
{
struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh->b_data;
- if (new_size <= le16_to_cpu(di->id2.i_data.id_count))
+ mlog_entry("(%llu, %llu)\n",
+ di_bh->b_blocknr, (unsigned long long)new_size);
+
+ if (new_size <= le16_to_cpu(di->id2.i_data.id_count)...
2019 Jan 01
0
[PATCH nbdkit v2 3/4] cache: Implement LRU structure.
...OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef NBDKIT_LRU_H
+#define NBDKIT_LRU_H
+
+#include <stdbool.h>
+
+/* Initialize LRU. */
+extern void lru_init (void);
+
+/* Free the LRU. */
+extern void lru_free (void);
+
+/* Notify LRU that the virtual size has changed. */
+extern int lru_set_size (uint64_t new_size);
+
+/* Mark a block as recently accessed in the LRU structure. */
+extern void lru_set_recently_accessed (uint64_t blknum);
+
+/* Check if a block has been recently accessed. */
+extern bool lru_has_been_recently_accessed (uint64_t blknum);
+
+#endif /* NBDKIT_LRU_H */
diff --git a/filters/cache/...
2019 Jan 03
0
[PATCH nbdkit v4 1/2] cache: Implement LRU structure.
...OF
+ * SUCH DAMAGE.
+ */
+
+#ifndef NBDKIT_LRU_H
+#define NBDKIT_LRU_H
+
+#include <stdbool.h>
+
+/* Initialize LRU. */
+extern void lru_init (void);
+
+/* Free the LRU. */
+extern void lru_free (void);
+
+/* Notify LRU that the virtual size has changed. */
+extern int lru_set_size (uint64_t new_size);
+
+/* Mark a block as recently accessed in the LRU structure. */
+extern void lru_set_recently_accessed (uint64_t blknum);
+
+/* Check if a block has been recently accessed. */
+extern bool lru_has_been_recently_accessed (uint64_t blknum);
+
+#endif /* NBDKIT_LRU_H */
diff --git a/filters/cache/...
2018 Dec 02
2
[PATCH nbdkit v2] common: Move shared bitmap code to a common library.
This is exactly the same as v1:
https://www.redhat.com/archives/libguestfs/2018-December/msg00004.html
except that it now frees the bitmap on unload (which the old code did
not - there was always a memory leak).
Rich.
2018 Dec 01
0
[PATCH nbdkit] common: Move shared bitmap code to a common library.
...GE.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+
+#include <nbdkit-plugin.h>
+
+#include "bitmap.h"
+#include "rounding.h"
+
+int
+bitmap_resize (struct bitmap *bm, uint64_t new_size)
+{
+ uint8_t *new_bitmap;
+ const size_t old_bm_size = bm->size;
+ uint64_t new_bm_size_u64;
+ size_t new_bm_size;
+
+ new_bm_size_u64 = DIV_ROUND_UP (new_size, bm->blksize * 8 / bm->bpb);
+ if (new_bm_size_u64 > SIZE_MAX) {
+ nbdkit_error ("bitmap too large for this arc...
2018 Dec 02
0
[PATCH nbdkit v2] common: Move shared bitmap code to a common library.
...GE.
+ */
+
+#include <config.h>
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdint.h>
+
+#include <nbdkit-plugin.h>
+
+#include "bitmap.h"
+#include "rounding.h"
+
+int
+bitmap_resize (struct bitmap *bm, uint64_t new_size)
+{
+ uint8_t *new_bitmap;
+ const size_t old_bm_size = bm->size;
+ uint64_t new_bm_size_u64;
+ size_t new_bm_size;
+
+ new_bm_size_u64 = DIV_ROUND_UP (new_size, bm->blksize * 8 / bm->bpb);
+ if (new_bm_size_u64 > SIZE_MAX) {
+ nbdkit_error ("bitmap too large for this arc...
2018 Dec 03
0
[PATCH nbdkit v3] common: Move shared bitmap code to a common library.
...bitmap is statically allocated.
+ */
+static inline void
+bitmap_free (struct bitmap *bm)
+{
+ if (bm)
+ free (bm->bitmap);
+}
+
+/* Resize the bitmap to the virtual disk size in bytes.
+ * Returns -1 on error, setting nbdkit_error.
+ */
+extern int bitmap_resize (struct bitmap *bm, uint64_t new_size);
+
+/* This macro calculates the byte offset in the bitmap and which
+ * bit/mask we are addressing within that byte.
+ *
+ * bpb blk_offset blk_bit mask
+ * 1 blk >> 3 0,1,2,...,7 any single bit
+ * 2 blk >> 2 0, 2, 4 or 6...
2012 Jan 05
4
[RFC][PATCH 3/3] Btrfs: improve truncation of btrfs
...utex);
} else {
nr_unlink++;
@@ -2993,7 +2993,7 @@ static int btrfs_release_and_test_inline_data_extent(
return 0;
/*
- * Truncate inline items is special, we have done it by
+ * Truncate inline items is special, we will do it by
* btrfs_truncate_page();
*/
if (offset < new_size)
@@ -3121,9 +3121,9 @@ static int btrfs_release_and_test_data_extent(struct btrfs_trans_handle *trans,
* will kill all the items on this inode, including the INODE_ITEM_KEY.
*/
int btrfs_truncate_inode_items(struct btrfs_trans_handle *trans,
- struct btrfs_root *root,
- st...
2009 Jun 05
1
[PATCHv3 05/13] qemu: MSI-X support functions
...config space.
+ * Original bar size must be a power of 2 or 0.
+ * New bar size is returned. */
+static int msix_add_config(struct PCIDevice *pdev, unsigned short nentries,
+ unsigned bar_nr, unsigned bar_size)
+{
+ int config_offset;
+ uint8_t *config;
+ uint32_t new_size;
+
+ if (nentries < 1 || nentries > PCI_MSIX_FLAGS_QSIZE + 1)
+ return -EINVAL;
+ if (bar_size > 0x80000000)
+ return -ENOSPC;
+
+ /* Add space for MSI-X structures */
+ if (!bar_size)
+ new_size = MSIX_PAGE_SIZE;
+ else if (bar_size < MSIX_PAGE_SIZE...
2009 Jun 05
1
[PATCHv3 05/13] qemu: MSI-X support functions
...config space.
+ * Original bar size must be a power of 2 or 0.
+ * New bar size is returned. */
+static int msix_add_config(struct PCIDevice *pdev, unsigned short nentries,
+ unsigned bar_nr, unsigned bar_size)
+{
+ int config_offset;
+ uint8_t *config;
+ uint32_t new_size;
+
+ if (nentries < 1 || nentries > PCI_MSIX_FLAGS_QSIZE + 1)
+ return -EINVAL;
+ if (bar_size > 0x80000000)
+ return -ENOSPC;
+
+ /* Add space for MSI-X structures */
+ if (!bar_size)
+ new_size = MSIX_PAGE_SIZE;
+ else if (bar_size < MSIX_PAGE_SIZE...
2009 Aug 20
3
[PATCH ovirt-node-image] fixes for edit-livecd
Patch set fixes issues with image size increase when using edit-livecd
Also address issue with ext4 root fs
2018 Dec 03
3
[PATCH nbdkit v3] common: Move shared bitmap code to a common library.
v2:
https://www.redhat.com/archives/libguestfs/2018-December/msg00039.html
v2 -> v3:
- Fix all the issues raised in Eric's review.
- Precompute some numbers to make the calculations easier.
- Calculations now use bitshifts and masks in preference to division
and modulo.
- Clear existing bits before setting (which fixes a bug in the cache
filter).
Rich.
2003 Oct 15
1
ext3 + raid, is resize2fs neccessary?
Consider this section:
http://www.tldp.org/HOWTO/Software-RAID-HOWTO-4.html#ss4.14
I have not done this before and I'm leary about Step 11 which is resizing
the filesystem after doing a mkraid command. This howto lacks any ext3
documentation. Some questions I have are:
1. Should I convert back to ext2 on all my filesystems before I do a mkraid?
2. If I leave the system at ext3, will the