From 185814ccaac3bddbca605fdddb8873e87230dc08 Mon Sep 17 00:00:00 2001 From: adilger Date: Mon, 1 Mar 2004 21:28:31 +0000 Subject: [PATCH] Make sure i_blksize is set, and limit it to 4MB (LL_MAX_BLKSIZE) for broken user-space apps. b=2844 --- lustre/llite/llite_internal.h | 4 +++- lustre/llite/llite_lib.c | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lustre/llite/llite_internal.h b/lustre/llite/llite_internal.h index c0ca902..84c910f 100644 --- a/lustre/llite/llite_internal.h +++ b/lustre/llite/llite_internal.h @@ -110,7 +110,7 @@ struct ll_async_page { struct page *llap_page; struct list_head llap_pending_write; /* only trust these if the page lock is providing exclusion */ - int llap_write_queued:1, + int llap_write_queued:1, llap_defer_uptodate:1; struct list_head llap_proc_item; }; @@ -249,6 +249,8 @@ int ll_close_thread_start(struct ll_close_queue **lcq_ret); #define LL_SBI_NOLCK 0x1 #define LL_SBI_READAHEAD 0x2 +#define LL_MAX_BLKSIZE (4UL * 1024 * 1024) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)) #define ll_s2sbi(sb) ((struct ll_sb_info *)((sb)->s_fs_info)) void __d_rehash(struct dentry * entry, int lock); diff --git a/lustre/llite/llite_lib.c b/lustre/llite/llite_lib.c index ceaa4e0..926e83d 100644 --- a/lustre/llite/llite_lib.c +++ b/lustre/llite/llite_lib.c @@ -1053,6 +1053,9 @@ void ll_update_inode(struct inode *inode, struct mds_body *body, LBUG(); } } + /* bug 2844 - limit i_blksize for broken user-space apps */ + LASSERTF(lsm->lsm_xfersize != 0, "%lu\n", lsm->lsm_xfersize); + inode->i_blksize = min(lsm->lsm_xfersize, LL_MAX_BLKSIZE); if (lli->lli_smd != lsm) obd_free_memmd(ll_i2obdexp(inode), &lsm); } -- 1.8.3.1