It probably won''t help, but there''s a patch for 2.6.13 (and maybe 2.6.14) for Lustre 1.4.5 at https://bugzilla.lustre.org/show_bug.cgi?id=9421 I didn''t find one for 2.6.16 and I didn''t find one for Lustre 1.4.6.1. Lustre_nfs.tgz (a snapshot of a development branch which demos Lustre with kernel NFS on 2.6 kernels, found at https://bugzilla.lustre.org/show_bug.cgi?id=6062) has 2.6.14 patches, but they don''t seem to work, and neither do the 2.6.12 patches for it... I''m working with Lustre and DRBD, too, by the way (we should form a club or something). You shouldn''t need the newest DRBD, I believe, although I haven''t tested it much (I''m trying to get my setup to do LVS NFS or at least failover NFS, but I keep hitting dead-ends, and this is sucking up all my time). I haven''t tried Linux Vserver. Thanks, Brent Nelson Director of Computing Dept. of Physics University of Florida On Mon, 10 Apr 2006, EKC wrote:> Hello, > > Has anyone successfully modified the Lustre patches to work with a > 2.6.16 mainline vanilla kernel? I''ve tried applying the 2.6.12 lustre > patches to a 2.6.16 kernel without success. > > I''m trying to patch a 2.6.16 kernel to support Lustre, DRBD > (http://www.drbd.org) for OSS failover, and Linux Vserver > (http://linux-vserver.org). However, the latest DRBD and Vserver > relases are tailored to work only with the 2.6.16 kernel, which Lustre > does not yet support. Any advice on porting the 2.6.12 lustre patches > to 2.6.16? > > Thanks! > _______________________________________________ > Lustre-discuss mailing list > Lustre-discuss@clusterfs.com > https://mail.clusterfs.com/mailman/listinfo/lustre-discuss >
Hello! On Tue, Apr 11, 2006 at 11:54:47AM +0200, Goswin von Brederlow wrote:> The vfs code changed a semaphore into a mutex requiring all occurances > and uses of the semaphore to be changed to the respective mutex > calls. Unfortunately one of the calls has no direct equivalent (the > kernel source says the sematics of the mutex call follows spinlocks > sematic and not semaphores) so the result might just not work.If you mean mutex_trylock vs semaphore trylock, semantic is reversed. I.e. where semaphore trylock would return 1, mutex_trylock would return 0 and the other way around. We have a set of compat macroses for this now (not yet released). Bye, Oleg
I''ve decided to use the 2.6.12 Lustre patches with an old version of Linux Vserver that also supports 2.6.12. However, I''m running into conflicts between the Lustre kernel patches and the Vserver kernel patches. What is the minimum set of patches that I need to apply to the plain vanilla kernel to build a Luster Client Node? I''m assuming that a Lustre client needs only to run the native Lustre client filesystem driver to communicate with the servers. Do I really need to apply all of the kernel patches to build Lustre support into a client, or is there a select subset that I can use? Alternatively, is it possible to do a patchless client compile for a generic kernel? Thanks
I would be thrilled to be a guinea pig for your 2.6.16 patchless code. I understand that it is unsupported experimental code with no waranties of any sort. I''m stepping through dozens of kernel patch conflicts between Lustre and Linux Vserver at the moment, and I would much rather spend my time testing a prerelease version of Lustre. Thanks! On 4/11/06, Oleg Drokin <green@clusterfs.com> wrote:> Hello! > > On Tue, Apr 11, 2006 at 04:36:32AM -0700, EKC wrote: > > > What is the minimum set of patches that I need to apply to the plain > > vanilla kernel to build a Luster Client Node? > > Most of the lustre patches are for lustre client benefits. > > > I''m assuming that a Lustre client needs only to run the native Lustre > > client filesystem driver to communicate with the servers. Do I really > > need to apply all of the kernel patches to build Lustre support into a > > client, or is there a select subset that I can use? > > Most of them yes, > > > Alternatively, is it possible to do a patchless client compile for a > > generic kernel? > > We are working on a patchless client right now. > I have a code that seems to be working on 2.6.15 (with one extra patch to > fix kernel bug), 2.6.16, and RHEL4 default kernel (with one extra patch to > fix kernel bug and with another kernel patch to fix kernel bug if you > plan to export over NFS). Probably other kernels would work too, but I have not > tried anything but this. > If there are people who would like to test this out (there would be no > warranties of any sort, unsupported prerelease code, but I would be still > interested in bugreports of course), I can make it available. > > Bye, > Oleg > >
Peter Kjellström
2006-May-19 07:36 UTC
[Lustre-discuss] Lustre with a 2.6.16 vanilla kernel
On Monday 10 April 2006 20:39, EKC wrote:> Hello, > > Has anyone successfully modified the Lustre patches to work with a > 2.6.16 mainline vanilla kernel? I''ve tried applying the 2.6.12 lustre > patches to a 2.6.16 kernel without success. > > I''m trying to patch a 2.6.16 kernel to support Lustre, DRBD > (http://www.drbd.org) for OSS failover, and Linux Vserver > (http://linux-vserver.org). However, the latest DRBD and Vserver > relases are tailored to work only with the 2.6.16 kernel, which Lustre > does not yet support. Any advice on porting the 2.6.12 lustre patches > to 2.6.16?Goswin von Brederlow did some work on this (2.6.15 actually) a while back (search the archives, thread was called "Lustre with a 2.6.16 vanilla kernel") and posted this link as ref: http://mrvn.homeip.net/lustre/ Maybe he''ll wake up and give you his first hand view on it. /Peter> > Thanks!-- ------------------------------------------------------------ Peter Kjellstr?m | National Supercomputer Centre | Sweden | http://www.nsc.liu.se -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 191 bytes Desc: not available Url : http://mail.clusterfs.com/pipermail/lustre-discuss/attachments/20060411/45ecd40f/attachment.bin
Goswin von Brederlow
2006-May-19 07:36 UTC
[Lustre-discuss] Lustre with a 2.6.16 vanilla kernel
Peter Kjellstr?m <cap@nsc.liu.se> writes:> On Monday 10 April 2006 20:39, EKC wrote: >> Hello, >> >> Has anyone successfully modified the Lustre patches to work with a >> 2.6.16 mainline vanilla kernel? I''ve tried applying the 2.6.12 lustre >> patches to a 2.6.16 kernel without success. >> >> I''m trying to patch a 2.6.16 kernel to support Lustre, DRBD >> (http://www.drbd.org) for OSS failover, and Linux Vserver >> (http://linux-vserver.org). However, the latest DRBD and Vserver >> relases are tailored to work only with the 2.6.16 kernel, which Lustre >> does not yet support. Any advice on porting the 2.6.12 lustre patches >> to 2.6.16? > > Goswin von Brederlow did some work on this (2.6.15 actually) a while back > (search the archives, thread was called "Lustre with a 2.6.16 vanilla > kernel") and posted this link as ref: > http://mrvn.homeip.net/lustre/ > > Maybe he''ll wake up and give you his first hand view on it. > > /PeterI also made a patch for 2.6.16, which needed quite some patching. The vfs code changed a semaphore into a mutex requiring all occurances and uses of the semaphore to be changed to the respective mutex calls. Unfortunately one of the calls has no direct equivalent (the kernel source says the sematics of the mutex call follows spinlocks sematic and not semaphores) so the result might just not work. So far the patch applies and builds fine but I haven''t even had time to boot the result. If I had to guess I would say it will crash and burn. Apply http://mrvn.homeip.net/lustre/lustre-1.4.6_2.6.16.patch.bz2 to lustre-1.4.6 (not 1.4.6.1), build your kernel and then run ./configure --with-linux=/usr/src/linux-2.6.16 --disable-tests make LDISKFS_SERIES=2.6.16-vanilla.series DESTDIR=$PWD/../install/2.6.16 install MfG Goswin
Goswin von Brederlow
2006-May-19 07:36 UTC
[Lustre-discuss] Lustre with a 2.6.16 vanilla kernel
Oleg Drokin <green@clusterfs.com> writes:> Hello! > > On Tue, Apr 11, 2006 at 11:54:47AM +0200, Goswin von Brederlow wrote: >> The vfs code changed a semaphore into a mutex requiring all occurances >> and uses of the semaphore to be changed to the respective mutex >> calls. Unfortunately one of the calls has no direct equivalent (the >> kernel source says the sematics of the mutex call follows spinlocks >> sematic and not semaphores) so the result might just not work. > > If you mean mutex_trylock vs semaphore trylock, semantic is reversed. > I.e. where semaphore trylock would return 1, mutex_trylock would return > 0 and the other way around. > We have a set of compat macroses for this now (not yet released). > > Bye, > OlegDo you have an ETA for a release time? Or could you post that patch seperately? We currently use 2.6.15 but 2.6.16 has some driver updates for hardware we use that we might need to fix some bugs. MfG Goswin
Hello! On Tue, Apr 11, 2006 at 03:12:49PM +0200, Goswin von Brederlow wrote:> >> The vfs code changed a semaphore into a mutex requiring all occurances > >> and uses of the semaphore to be changed to the respective mutex > >> calls. Unfortunately one of the calls has no direct equivalent (the > >> kernel source says the sematics of the mutex call follows spinlocks > >> sematic and not semaphores) so the result might just not work. > > > > If you mean mutex_trylock vs semaphore trylock, semantic is reversed. > > I.e. where semaphore trylock would return 1, mutex_trylock would return > > 0 and the other way around. > > We have a set of compat macroses for this now (not yet released). > Do you have an ETA for a release time? Or could you post that patchNo.> seperately? We currently use 2.6.15 but 2.6.16 has some driver updates > for hardware we use that we might need to fix some bugs.I am attaching commit mail from my commit (it is against latest release tree but you will get the idea.). Patch names are stripped, so unfortunatelly you cannot just apply it as a patch without some editing. Sorry, but this is best what I have at hand right now. Bye, Oleg -------------- next part -------------- green 06/03/20 19:55:00 Modified: include/linux lustre_compat25.h lvfs.h ldiskfs quotafmt_test.c llite dir.c file.c llite_lib.c rw.c lvfs fsfilt_ext3.c mds handler.c mds_fs.c mds_join.c mds_open.c mds_reint.c mds_unlink_open.c mds_xattr.c obdclass llog_lvfs.c obdfilter filter.c filter_io_26.c filter_log.c quota quota_master.c Log: Branch: b1_4 r=adilger Adapt for 2.6.16+, where i_sem was replaced by i_mutex. Also update_atime is gone, replaced by touch_atime. Revision Changes Path 1.13.2.13.2.27 +20 -1 lustre-core/include/linux/lustre_compat25.h Index: lustre_compat25.h ==================================================================RCS file: /cvsroot/cfs/lustre-core/include/linux/lustre_compat25.h,v retrieving revision 1.13.2.13.2.26 retrieving revision 1.13.2.13.2.27 diff -b -B -p -u -r1.13.2.13.2.26 -r1.13.2.13.2.27 --- lustre_compat25.h 24 Feb 2006 00:37:24 -0000 1.13.2.13.2.26 +++ lustre_compat25.h 20 Mar 2006 19:54:57 -0000 1.13.2.13.2.27 @@ -31,6 +31,18 @@ #include <libcfs/linux/portals_compat25.h> +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,16) +#define UNLOCK_INODE_MUTEX(inode) do {mutex_unlock(&(inode)->i_mutex); } while(0) +#define LOCK_INODE_MUTEX(inode) do {mutex_lock(&(inode)->i_mutex); } while(0) +#define TRYLOCK_INODE_MUTEX(inode) mutex_trylock(&(inode)->i_mutex) +#define d_child d_u.d_child +#define d_rcu d_u.d_rcu +#else +#define UNLOCK_INODE_MUTEX(inode) do {up(&(inode)->i_sem); } while(0) +#define LOCK_INODE_MUTEX(inode) do {down(&(inode)->i_sem); } while(0) +#define TRYLOCK_INODE_MUTEX(inode) (!down_trylock(&(inode)->i_sem)) +#endif + #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,4) #define NGROUPS_SMALL NGROUPS #define NGROUPS_PER_BLOCK ((int)(EXEC_PAGESIZE / sizeof(gid_t))) @@ -314,13 +326,20 @@ static inline int page_mapped(struct pag } #endif /* !HAVE_PAGE_MAPPED */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)) +static inline void touch_atime(struct vfsmount *mnt, struct dentry *dentry) +{ + update_atime(dentry->d_inode); +} +#endif + static inline void file_accessed(struct file *file) { #ifdef O_NOATIME if (file->f_flags & O_NOATIME) return; #endif - update_atime(file->f_dentry->d_inode); + touch_atime(file->f_vfsmnt, file->f_dentry); } #endif /* end of 2.4 compat macros */ 1.6.8.3.14.6 +2 -2 lustre-core/include/linux/lvfs.h Index: lvfs.h ==================================================================RCS file: /cvsroot/cfs/lustre-core/include/linux/lvfs.h,v retrieving revision 1.6.8.3.14.5 retrieving revision 1.6.8.3.14.6 diff -b -B -p -u -r1.6.8.3.14.5 -r1.6.8.3.14.6 --- lvfs.h 10 Aug 2005 19:35:12 -0000 1.6.8.3.14.5 +++ lvfs.h 20 Mar 2006 19:54:57 -0000 1.6.8.3.14.6 @@ -118,9 +118,9 @@ static inline struct dentry *ll_lookup_o { struct dentry *dchild; - down(&dparent->d_inode->i_sem); + LOCK_INODE_MUTEX(dparent->d_inode); dchild = lookup_one_len(fid_name, dparent, fid_namelen); - up(&dparent->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dparent->d_inode); if (IS_ERR(dchild) || dchild->d_inode == NULL) return dchild; 1.1.8.10 +4 -4 lustre-core/ldiskfs/Attic/quotafmt_test.c Index: quotafmt_test.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/ldiskfs/Attic/quotafmt_test.c,v retrieving revision 1.1.8.9 retrieving revision 1.1.8.10 diff -b -B -p -u -r1.1.8.9 -r1.1.8.10 --- quotafmt_test.c 24 Feb 2006 00:37:46 -0000 1.1.8.9 +++ quotafmt_test.c 20 Mar 2006 19:54:57 -0000 1.1.8.10 @@ -45,13 +45,13 @@ static int quotfmt_initialize(struct lus int namelen = strlen(name); /* remove the stale test quotafile */ - down(&parent_inode->i_sem); + LOCK_INODE_MUTEX(parent_inode); de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen); if (!IS_ERR(de) && de->d_inode) vfs_unlink(parent_inode, de); if (!IS_ERR(de)) dput(de); - up(&parent_inode->i_sem); + UNLOCK_INODE_MUTEX(parent_inode); /* create quota file */ fp = filp_open(name, O_CREAT | O_EXCL, 0644); @@ -99,7 +99,7 @@ static int quotfmt_finalize(struct lustr filp_close(lqi->qi_files[i], 0); /* unlink quota file */ - down(&parent_inode->i_sem); + LOCK_INODE_MUTEX(parent_inode); de = lookup_one_len(name, tgt->obd_lvfs_ctxt.pwd, namelen); if (IS_ERR(de) || de->d_inode == NULL) { @@ -116,7 +116,7 @@ static int quotfmt_finalize(struct lustr dput: if (!IS_ERR(de)) dput(de); - up(&parent_inode->i_sem); + UNLOCK_INODE_MUTEX(parent_inode); } pop_ctxt(saved, &tgt->obd_lvfs_ctxt, NULL); 1.54.2.7.10.15 +2 -1 lustre-core/llite/dir.c Index: dir.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/llite/dir.c,v retrieving revision 1.54.2.7.10.14 retrieving revision 1.54.2.7.10.15 diff -b -B -p -u -r1.54.2.7.10.14 -r1.54.2.7.10.15 --- dir.c 3 Mar 2006 19:24:30 -0000 1.54.2.7.10.14 +++ dir.c 20 Mar 2006 19:54:57 -0000 1.54.2.7.10.15 @@ -362,7 +362,8 @@ int ll_readdir(struct file * filp, void done: filp->f_pos = (n << PAGE_CACHE_SHIFT) | offset; filp->f_version = inode->i_version; - update_atime(inode); + touch_atime(filp->f_vfsmnt, filp->f_dentry); + RETURN(rc); } 1.127.2.32.2.36 +4 -4 lustre-core/llite/file.c Index: file.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/llite/file.c,v retrieving revision 1.127.2.32.2.35 retrieving revision 1.127.2.32.2.36 diff -b -B -p -u -r1.127.2.32.2.35 -r1.127.2.32.2.36 --- file.c 20 Mar 2006 16:10:05 -0000 1.127.2.32.2.35 +++ file.c 20 Mar 2006 19:54:57 -0000 1.127.2.32.2.36 @@ -596,14 +596,14 @@ int ll_async_completion_ast(struct ldlm_ lsm->lsm_oinfo[stripe].loi_rss = lvb->lvb_size; l_lock(&lock->l_resource->lr_namespace->ns_lock); - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); kms = MAX(lsm->lsm_oinfo[stripe].loi_kms, lvb->lvb_size); kms = ldlm_extent_shift_kms(NULL, kms); if (lsm->lsm_oinfo[stripe].loi_kms != kms) LDLM_DEBUG(lock, "updating kms from "LPU64" to "LPU64, lsm->lsm_oinfo[stripe].loi_kms, kms); lsm->lsm_oinfo[stripe].loi_kms = kms; - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); l_unlock(&lock->l_resource->lr_namespace->ns_lock); } @@ -963,7 +963,7 @@ static ssize_t ll_file_write(struct file if (rc != 0) RETURN(rc); - /* this is ok, g_f_w will overwrite this under i_sem if it races + /* this is ok, g_f_w will overwrite this under i_mutex if it races * with a local truncate, it just makes our maxbyte checking easier */ if (file->f_flags & O_APPEND) *ppos = inode->i_size; @@ -980,7 +980,7 @@ static ssize_t ll_file_write(struct file CDEBUG(D_INFO, "Writing inode %lu, "LPSZ" bytes, offset %Lu\n", inode->i_ino, count, *ppos); - /* generic_file_write handles O_APPEND after getting i_sem */ + /* generic_file_write handles O_APPEND after getting i_mutex */ retval = generic_file_write(file, buf, count, ppos); out: 1.20.2.15.2.58 +3 -3 lustre-core/llite/llite_lib.c Index: llite_lib.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/llite/llite_lib.c,v retrieving revision 1.20.2.15.2.57 retrieving revision 1.20.2.15.2.58 diff -b -B -p -u -r1.20.2.15.2.57 -r1.20.2.15.2.58 --- llite_lib.c 28 Feb 2006 21:03:16 -0000 1.20.2.15.2.57 +++ llite_lib.c 20 Mar 2006 19:54:57 -0000 1.20.2.15.2.58 @@ -1197,15 +1197,15 @@ int ll_setattr_raw(struct inode *inode, if (attr->ia_size == 0) ast_flags = LDLM_AST_DISCARD_DATA; - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); UP_WRITE_I_ALLOC_SEM(inode); rc = ll_extent_lock(NULL, inode, lsm, LCK_PW, &policy, &lockh, ast_flags); #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0)) DOWN_WRITE_I_ALLOC_SEM(inode); - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); #else - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); DOWN_WRITE_I_ALLOC_SEM(inode); #endif if (rc != 0) 1.105.2.16.2.38 +1 -1 lustre-core/llite/rw.c Index: rw.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/llite/rw.c,v retrieving revision 1.105.2.16.2.37 retrieving revision 1.105.2.16.2.38 diff -b -B -p -u -r1.105.2.16.2.37 -r1.105.2.16.2.38 --- rw.c 18 Mar 2006 10:55:51 -0000 1.105.2.16.2.37 +++ rw.c 20 Mar 2006 19:54:57 -0000 1.105.2.16.2.38 @@ -103,7 +103,7 @@ static int ll_brw(int cmd, struct inode /* this isn''t where truncate starts. roughly: * sys_truncate->ll_setattr_raw->vmtruncate->ll_truncate. setattr_raw grabs - * DLM lock on [size, EOF], i_sem, ->lli_size_sem, and WRITE_I_ALLOC_SEM to + * DLM lock on [size, EOF], i_mutex, ->lli_size_sem, and WRITE_I_ALLOC_SEM to * avoid races. * * must be called under ->lli_size_sem */ 1.12.6.10.2.24 +3 -3 lustre-core/lvfs/fsfilt_ext3.c Index: fsfilt_ext3.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/lvfs/fsfilt_ext3.c,v retrieving revision 1.12.6.10.2.23 retrieving revision 1.12.6.10.2.24 diff -b -B -p -u -r1.12.6.10.2.23 -r1.12.6.10.2.24 --- fsfilt_ext3.c 24 Feb 2006 00:38:07 -0000 1.12.6.10.2.23 +++ fsfilt_ext3.c 20 Mar 2006 19:54:58 -0000 1.12.6.10.2.24 @@ -489,7 +489,7 @@ static int fsfilt_ext3_set_md(struct ino { int rc; - LASSERT_SEM_LOCKED(&inode->i_sem); + LASSERT(TRYLOCK_INODE_MUTEX(inode) == 0); if (EXT3_I(inode)->i_file_acl /* || large inode EA flag */) CWARN("setting EA on %lu/%u again... interesting\n", @@ -507,13 +507,13 @@ static int fsfilt_ext3_set_md(struct ino return rc; } -/* Must be called with i_sem held */ +/* Must be called with i_mutex held */ static int fsfilt_ext3_get_md(struct inode *inode, void *lmm, int lmm_size, const char *name) { int rc; - LASSERT_SEM_LOCKED(&inode->i_sem); + LASSERT(TRYLOCK_INODE_MUTEX(inode) == 0); lock_24kernel(); rc = ext3_xattr_get(inode, EXT3_XATTR_INDEX_TRUSTED, 1.244.2.17.2.59 +6 -6 lustre-core/mds/handler.c Index: handler.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/mds/handler.c,v retrieving revision 1.244.2.17.2.58 retrieving revision 1.244.2.17.2.59 diff -b -B -p -u -r1.244.2.17.2.58 -r1.244.2.17.2.59 --- handler.c 15 Mar 2006 22:03:43 -0000 1.244.2.17.2.58 +++ handler.c 20 Mar 2006 19:54:58 -0000 1.244.2.17.2.59 @@ -499,7 +499,7 @@ int mds_get_md(struct obd_device *obd, s int lmm_size; if (lock) - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); rc = fsfilt_get_md(obd, inode, md, *size, "lov"); if (rc < 0) { @@ -519,14 +519,14 @@ int mds_get_md(struct obd_device *obd, s *size = 0; } if (lock) - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); RETURN (rc); } -/* Call with lock=1 if you want mds_pack_md to take the i_sem. - * Call with lock=0 if the caller has already taken the i_sem. */ +/* Call with lock=1 if you want mds_pack_md to take the i_mutex. + * Call with lock=0 if the caller has already taken the i_mutex. */ int mds_pack_md(struct obd_device *obd, struct lustre_msg *msg, int offset, struct mds_body *body, struct inode *inode, int lock) { @@ -714,10 +714,10 @@ static int mds_getattr_pack_msg(struct p if ((S_ISREG(inode->i_mode) && (body->valid & OBD_MD_FLEASIZE)) || (S_ISDIR(inode->i_mode) && (body->valid & OBD_MD_FLDIREA))) { - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); rc = fsfilt_get_md(req->rq_export->exp_obd, inode, NULL, 0, "lov"); - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); CDEBUG(D_INODE, "got %d bytes MD data for inode %lu\n", rc, inode->i_ino); if (rc < 0) { 1.33.38.13.2.21 +4 -4 lustre-core/mds/mds_fs.c Index: mds_fs.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/mds/mds_fs.c,v retrieving revision 1.33.38.13.2.20 retrieving revision 1.33.38.13.2.21 diff -b -B -p -u -r1.33.38.13.2.20 -r1.33.38.13.2.21 --- mds_fs.c 3 Mar 2006 19:24:34 -0000 1.33.38.13.2.20 +++ mds_fs.c 20 Mar 2006 19:54:58 -0000 1.33.38.13.2.21 @@ -648,7 +648,7 @@ int mds_obd_create(struct obd_export *ex oa->o_generation = filp->f_dentry->d_inode->i_generation; namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation); - down(&parent_inode->i_sem); + LOCK_INODE_MUTEX(parent_inode); new_child = lookup_one_len(fidname, mds->mds_objects_dir, namelen); if (IS_ERR(new_child)) { @@ -683,7 +683,7 @@ int mds_obd_create(struct obd_export *ex out_dput: dput(new_child); out_close: - up(&parent_inode->i_sem); + UNLOCK_INODE_MUTEX(parent_inode); err = filp_close(filp, 0); if (err) { CERROR("closing tmpfile %u: rc %d\n", tmpname, rc); @@ -715,7 +715,7 @@ int mds_obd_destroy(struct obd_export *e namelen = ll_fid2str(fidname, oa->o_id, oa->o_generation); - down(&parent_inode->i_sem); + LOCK_INODE_MUTEX(parent_inode); de = lookup_one_len(fidname, mds->mds_objects_dir, namelen); if (IS_ERR(de)) { rc = IS_ERR(de); @@ -749,7 +749,7 @@ int mds_obd_destroy(struct obd_export *e out_dput: if (de != NULL) l_dput(de); - up(&parent_inode->i_sem); + UNLOCK_INODE_MUTEX(parent_inode); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, &ucred); RETURN(rc); 1.1.18.3 +2 -2 lustre-core/mds/Attic/mds_join.c Index: mds_join.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/mds/Attic/mds_join.c,v retrieving revision 1.1.18.2 retrieving revision 1.1.18.3 diff -b -B -p -u -r1.1.18.2 -r1.1.18.3 --- mds_join.c 2 Mar 2006 03:20:51 -0000 1.1.18.2 +++ mds_join.c 20 Mar 2006 19:54:58 -0000 1.1.18.3 @@ -380,7 +380,7 @@ int mds_join_file(struct mds_update_reco GOTO(cleanup, rc); } - down(&head_inode->i_sem); + LOCK_INODE_MUTEX(head_inode); cleanup_phase = 1; rc = mds_get_md(obd, head_inode, head_lmm, &size, 0); if (rc < 0) @@ -486,7 +486,7 @@ cleanup: pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); case 1: - up(&head_inode->i_sem); + UNLOCK_INODE_MUTEX(head_inode); case 0: if (tail_lmm != NULL) OBD_FREE(tail_lmm, lmm_size); 1.24.2.15.2.26 +12 -12 lustre-core/mds/mds_open.c Index: mds_open.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/mds/mds_open.c,v retrieving revision 1.24.2.15.2.25 retrieving revision 1.24.2.15.2.26 diff -b -B -p -u -r1.24.2.15.2.25 -r1.24.2.15.2.26 --- mds_open.c 1 Mar 2006 05:57:35 -0000 1.24.2.15.2.25 +++ mds_open.c 20 Mar 2006 19:54:58 -0000 1.24.2.15.2.26 @@ -303,7 +303,7 @@ cleanup_dentry: return ERR_PTR(error); } -/* Must be called with i_sem held */ +/* Must be called with i_mutex held */ static int mds_create_objects(struct ptlrpc_request *req, int offset, struct mds_update_record *rec, struct mds_obd *mds, struct obd_device *obd, @@ -679,29 +679,29 @@ static int mds_finish_open(struct ptlrpc ENTRY; /* atomically create objects if necessary */ - down(&dchild->d_inode->i_sem); + LOCK_INODE_MUTEX(dchild->d_inode); if (S_ISREG(dchild->d_inode->i_mode) && !(body->valid & OBD_MD_FLEASIZE)) { rc = mds_pack_md(obd, req->rq_repmsg, 2, body, dchild->d_inode, 0); if (rc) { - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); RETURN(rc); } } if (rec != NULL) { if ((body->valid & OBD_MD_FLEASIZE) && (rec->ur_flags & MDS_OPEN_HAS_EA)) { - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); RETURN(-EEXIST); } if (rec->ur_flags & MDS_OPEN_JOIN_FILE) { - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); rc = mds_join_file(rec, req, dchild, lockh); if (rc) RETURN(rc); - down(&dchild->d_inode->i_sem); + LOCK_INODE_MUTEX(dchild->d_inode); } if (!(body->valid & OBD_MD_FLEASIZE) && !(body->valid & OBD_MD_FLMODEASIZE)) { @@ -710,7 +710,7 @@ static int mds_finish_open(struct ptlrpc dchild, handle, &ids); if (rc) { CERROR("mds_create_objects: rc = %d\n", rc); - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); RETURN(rc); } } @@ -721,7 +721,7 @@ static int mds_finish_open(struct ptlrpc body->valid |= (OBD_MD_FLSIZE | OBD_MD_FLBLOCKS | OBD_MD_FLATIME | OBD_MD_FLMTIME); } - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); if (!(rec->ur_flags & MDS_OPEN_JOIN_FILE)) lustre_shrink_reply(req, 2, body->eadatasize, 0); @@ -1147,7 +1147,7 @@ found_child: } /* Close a "file descriptor" and possibly unlink an orphan from the - * PENDING directory. Caller must hold child->i_sem, this drops it. + * PENDING directory. Caller must hold child->i_mutex, this drops it. * * If we are being called from mds_disconnect() because the client has * disappeared, then req == NULL and we do not update last_rcvd because @@ -1210,8 +1210,8 @@ int mds_mfd_close(struct ptlrpc_request /* Sadly, there is no easy way to save pending_child from * mds_reint_unlink() into mfd, so we need to re-lookup, * but normally it will still be in the dcache. */ - down(&pending_dir->i_sem); - cleanup_phase = 1; /* up(&pending_dir->i_sem) when finished */ + LOCK_INODE_MUTEX(pending_dir); + cleanup_phase = 1; /* UNLOCK_INODE_MUTEX(pending_dir) when finished */ pending_child = lookup_one_len(fidname, mds->mds_pending_dir, fidlen); if (IS_ERR(pending_child)) @@ -1331,7 +1331,7 @@ out: case 2: dput(pending_child); case 1: - up(&pending_dir->i_sem); + UNLOCK_INODE_MUTEX(pending_dir); } RETURN(rc); } 1.132.2.13.2.30 +14 -14 lustre-core/mds/mds_reint.c Index: mds_reint.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/mds/mds_reint.c,v retrieving revision 1.132.2.13.2.29 retrieving revision 1.132.2.13.2.30 diff -b -B -p -u -r1.132.2.13.2.29 -r1.132.2.13.2.30 --- mds_reint.c 24 Feb 2006 00:38:21 -0000 1.132.2.13.2.29 +++ mds_reint.c 20 Mar 2006 19:54:58 -0000 1.132.2.13.2.30 @@ -511,7 +511,7 @@ static int mds_reint_setattr(struct mds_ if ((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) && rec->ur_eadata != NULL) { - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); need_lock = 0; } @@ -652,7 +652,7 @@ static int mds_reint_setattr(struct mds_ case 1: if ((S_ISREG(inode->i_mode) || S_ISDIR(inode->i_mode)) && rec->ur_eadata != NULL) - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); l_dput(de); if (locked) { if (rc) { @@ -870,10 +870,10 @@ static int mds_reint_create(struct mds_u int lmm_size = sizeof(lmm); rc = mds_get_md(obd, dir, &lmm, &lmm_size, 1); if (rc > 0) { - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); rc = fsfilt_set_md(obd, inode, handle, &lmm, lmm_size, "lov"); - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); } if (rc) CERROR("error on copy stripe info: rc = %d\n", @@ -1342,8 +1342,8 @@ void mds_reconstruct_generic(struct ptlr * part thereof, because we don''t have the inode to check for link * count/open status until after it is locked. * - * For lock ordering, caller must get child->i_sem first, then pending->i_sem - * before starting journal transaction. + * For lock ordering, caller must get child->i_mutex first, then + * pending->i_mutex before starting journal transaction. * * returns 1 on success * returns 0 if we lost a race and didn''t make a new link @@ -1363,9 +1363,9 @@ static int mds_orphan_add_link(struct md LASSERT(inode != NULL); LASSERT(!mds_inode_is_orphan(inode)); #ifndef HAVE_I_ALLOC_SEM - LASSERT(down_trylock(&inode->i_sem) != 0); + LASSERT(TRYLOCK_INODE_MUTEX(inode) == 0); #endif - LASSERT(down_trylock(&pending_dir->i_sem) != 0); + LASSERT(TRYLOCK_INODE_MUTEX(pending_dir) == 0); fidlen = ll_fid2str(fidname, inode->i_ino, inode->i_generation); @@ -1541,8 +1541,8 @@ static int mds_reint_unlink(struct mds_u child_inode->i_nlink == 1) { if (mds_orphan_open_count(child_inode) > 0) { /* need to lock pending_dir before transaction */ - down(&mds->mds_pending_dir->d_inode->i_sem); - cleanup_phase = 5; /* up(&pending_dir->i_sem) */ + LOCK_INODE_MUTEX(mds->mds_pending_dir->d_inode); + cleanup_phase = 5; /* UNLOCK_INODE_MUTEX(mds->mds_pending_dir->d_inode); */ } else if (S_ISREG(child_inode->i_mode)) { mds_pack_inode2fid(&body->fid1, child_inode); mds_pack_inode2body(body, child_inode); @@ -1637,7 +1637,7 @@ cleanup: "unlinked", 0, NULL); switch(cleanup_phase) { case 5: /* pending_dir semaphore */ - up(&mds->mds_pending_dir->d_inode->i_sem); + UNLOCK_INODE_MUTEX(mds->mds_pending_dir->d_inode); case 4: /* child inode semaphore */ MDS_UP_READ_ORPHAN_SEM(child_inode); case 3: /* child ino-reuse lock */ @@ -2104,8 +2104,8 @@ static int mds_reint_rename(struct mds_u new_inode->i_nlink == 1) { if (mds_orphan_open_count(new_inode) > 0) { /* need to lock pending_dir before transaction */ - down(&mds->mds_pending_dir->d_inode->i_sem); - cleanup_phase = 4; /* up(&pending_dir->i_sem) */ + LOCK_INODE_MUTEX(mds->mds_pending_dir->d_inode); + cleanup_phase = 4; /* UNLOCK_INODE_MUTEX(mds->mds_pending_dir->d_inode); */ } else if (S_ISREG(new_inode->i_mode)) { mds_pack_inode2fid(&body->fid1, new_inode); mds_pack_inode2body(body, new_inode); @@ -2168,7 +2168,7 @@ cleanup: switch (cleanup_phase) { case 4: - up(&mds->mds_pending_dir->d_inode->i_sem); + UNLOCK_INODE_MUTEX(mds->mds_pending_dir->d_inode); case 3: MDS_UP_READ_ORPHAN_SEM(new_inode); case 2: 1.10.6.5.10.10 +3 -3 lustre-core/mds/mds_unlink_open.c Index: mds_unlink_open.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/mds/mds_unlink_open.c,v retrieving revision 1.10.6.5.10.9 retrieving revision 1.10.6.5.10.10 diff -b -B -p -u -r1.10.6.5.10.9 -r1.10.6.5.10.10 --- mds_unlink_open.c 24 Feb 2006 00:38:22 -0000 1.10.6.5.10.9 +++ mds_unlink_open.c 20 Mar 2006 19:54:58 -0000 1.10.6.5.10.10 @@ -221,10 +221,10 @@ int mds_cleanup_pending(struct obd_devic ((namlen == 2) && !strcmp(d_name, "..")) || inum == 0) continue; - down(&pending_dir->i_sem); + LOCK_INODE_MUTEX(pending_dir); dchild = lookup_one_len(d_name, mds->mds_pending_dir, namlen); if (IS_ERR(dchild)) { - up(&pending_dir->i_sem); + UNLOCK_INODE_MUTEX(pending_dir); GOTO(err_out, rc = PTR_ERR(dchild)); } if (!dchild->d_inode) { @@ -263,7 +263,7 @@ int mds_cleanup_pending(struct obd_devic } next: l_dput(dchild); - up(&pending_dir->i_sem); + UNLOCK_INODE_MUTEX(pending_dir); } rc = 0; err_out: 1.1.4.3 +4 -4 lustre-core/mds/Attic/mds_xattr.c Index: mds_xattr.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/mds/Attic/mds_xattr.c,v retrieving revision 1.1.4.2 retrieving revision 1.1.4.3 diff -b -B -p -u -r1.1.4.2 -r1.1.4.3 --- mds_xattr.c 24 Feb 2006 00:38:23 -0000 1.1.4.2 +++ mds_xattr.c 20 Mar 2006 19:54:59 -0000 1.1.4.3 @@ -272,20 +272,20 @@ int mds_setxattr_internal(struct ptlrpc_ xattr = lustre_msg_buf(req->rq_reqmsg, 2, xattrlen); - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); lock_24kernel(); rc = inode->i_op->setxattr(de, xattr_name, xattr, xattrlen, body->flags); unlock_24kernel(); - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); } } else if (body->valid & OBD_MD_FLXATTRRM) { if (inode->i_op && inode->i_op->removexattr) { - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); lock_24kernel(); rc = inode->i_op->removexattr(de, xattr_name); unlock_24kernel(); - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); } } else { CERROR("valid bits: "LPX64"\n", body->valid); 1.7.6.9.10.8 +2 -2 lustre-core/obdclass/Attic/llog_lvfs.c Index: llog_lvfs.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/obdclass/Attic/llog_lvfs.c,v retrieving revision 1.7.6.9.10.7 retrieving revision 1.7.6.9.10.8 diff -b -B -p -u -r1.7.6.9.10.7 -r1.7.6.9.10.8 --- llog_lvfs.c 24 Feb 2006 00:38:30 -0000 1.7.6.9.10.7 +++ llog_lvfs.c 20 Mar 2006 19:54:59 -0000 1.7.6.9.10.8 @@ -655,9 +655,9 @@ static int llog_lvfs_destroy(struct llog rc = llog_lvfs_close(handle); if (rc == 0) { - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); rc = vfs_unlink(inode, fdentry); - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); } dput(fdentry); 1.143.2.21.2.62 +26 -24 lustre-core/obdfilter/filter.c Index: filter.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/obdfilter/filter.c,v retrieving revision 1.143.2.21.2.61 retrieving revision 1.143.2.21.2.62 diff -b -B -p -u -r1.143.2.21.2.61 -r1.143.2.21.2.62 --- filter.c 17 Mar 2006 22:05:55 -0000 1.143.2.21.2.61 +++ filter.c 20 Mar 2006 19:55:00 -0000 1.143.2.21.2.62 @@ -24,12 +24,12 @@ */ /* - * Invariant: Get O/R i_sem for lookup, if needed, before any journal ops + * Invariant: Get O/R i_mutex for lookup, if needed, before any journal ops * (which need to get journal_lock, may block if journal full). * * Invariant: Call filter_start_transno() before any journal ops to avoid the * same deadlock problem. We can (and want) to get rid of the - * transno sem in favour of the dir/inode i_sem to avoid single + * transno sem in favour of the dir/inode i_mutex to avoid single * threaded operation on the OST. */ @@ -650,10 +650,10 @@ static int filter_prep_groups(struct obd GOTO(cleanup_O0, rc = -EEXIST); } - down(&O_dentry->d_inode->i_sem); + LOCK_INODE_MUTEX(O_dentry->d_inode); rc = vfs_rename(O_dentry->d_inode, dentry, O_dentry->d_inode, O0_dentry); - up(&O_dentry->d_inode->i_sem); + UNLOCK_INODE_MUTEX(O_dentry->d_inode); if (rc) { CERROR("error renaming O/R to O/0: rc %d\n", rc); @@ -915,7 +915,7 @@ __u64 filter_last_id(struct filter_obd * static int filter_lock_dentry(struct obd_device *obd, struct dentry *dparent) { - down(&dparent->d_inode->i_sem); + LOCK_INODE_MUTEX(dparent->d_inode); return 0; } @@ -950,7 +950,7 @@ struct dentry *filter_parent_lock(struct /* We never dget the object parent, so DON''T dput it either */ static void filter_parent_unlock(struct dentry *dparent) { - up(&dparent->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dparent->d_inode); } /* How to get files, dentries, inodes from object id''s. @@ -1047,9 +1047,10 @@ int filter_vfs_unlink(struct inode *dir, ENTRY; /* don''t need dir->i_zombie for 2.4, it is for rename/unlink of dir - * itself we already hold dir->i_sem for child create/unlink ops */ - LASSERT_SEM_LOCKED(&dir->i_sem); - LASSERT_SEM_LOCKED(&dentry->d_inode->i_sem); + * itself we already hold dir->i_mutex for child create/unlink ops */ + LASSERT(TRYLOCK_INODE_MUTEX(dir) == 0); + LASSERT(TRYLOCK_INODE_MUTEX(dentry->d_inode) == 0); + /* may_delete() */ if (!dentry->d_inode || dentry->d_parent->d_inode != dir) @@ -1067,7 +1068,7 @@ int filter_vfs_unlink(struct inode *dir, IS_APPEND(dentry->d_inode) || IS_IMMUTABLE(dentry->d_inode)) GOTO(out, rc = -EPERM); - /* NOTE: This might need to go outside i_sem, though it isn''t clear if + /* NOTE: This might need to go outside i_mutex, though it isn''t clear if * that was done because of journal_start (which is already done * here) or some other ordering issue. */ DQUOT_INIT(dir); @@ -1080,8 +1081,8 @@ int filter_vfs_unlink(struct inode *dir, rc = dir->i_op->unlink(dir, dentry); out: - /* need to drop i_sem before we lose inode reference */ - up(&dentry->d_inode->i_sem); + /* need to drop i_mutex before we lose inode reference */ + UNLOCK_INODE_MUTEX(dentry->d_inode); if (rc == 0) d_delete(dentry); @@ -1089,7 +1090,7 @@ out: } /* Caller must hold LCK_PW on parent and push us into kernel context. - * Caller must hold child i_sem, we drop it always. + * Caller must hold child i_mutex, we drop it always. * Caller is also required to ensure that dchild->d_inode exists. */ static int filter_destroy_internal(struct obd_device *obd, obd_id objid, struct dentry *dparent, @@ -2139,7 +2140,7 @@ int filter_setattr_internal(struct obd_e } if (ia_valid & ATTR_SIZE || ia_valid & (ATTR_UID | ATTR_GID)) { - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); locked = 1; } @@ -2200,7 +2201,7 @@ int filter_setattr_internal(struct obd_e } if (locked) { - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); locked = 0; } @@ -2215,7 +2216,7 @@ int filter_setattr_internal(struct obd_e EXIT; out_unlock: if (locked) - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); /* trigger quota release */ if (ia_valid & (ATTR_SIZE | ATTR_UID | ATTR_GID)) { @@ -2736,11 +2737,11 @@ int filter_destroy(struct obd_export *ex * restart transaction * (see BUG 4180) -bzzz */ - down(&dchild->d_inode->i_sem); + LOCK_INODE_MUTEX(dchild->d_inode); handle = fsfilt_start_log(obd, dchild->d_inode, FSFILT_OP_SETATTR, NULL, 1); if (IS_ERR(handle)) { - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); GOTO(cleanup, rc = PTR_ERR(handle)); } @@ -2748,7 +2749,7 @@ int filter_destroy(struct obd_export *ex iattr.ia_size = 0; rc = fsfilt_setattr(obd, dchild, handle, &iattr, 1); rc2 = fsfilt_commit(obd, dchild->d_inode, handle, 0); - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); if (rc) GOTO(cleanup, rc); if (rc2) @@ -2763,10 +2764,10 @@ int filter_destroy(struct obd_export *ex GOTO(cleanup, rc = PTR_ERR(dparent)); cleanup_phase = 3; /* filter_parent_unlock */ - down(&dchild->d_inode->i_sem); + LOCK_INODE_MUTEX(dchild->d_inode); handle = fsfilt_start_log(obd, dparent->d_inode,FSFILT_OP_UNLINK,oti,1); if (IS_ERR(handle)) { - up(&dchild->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dchild->d_inode); GOTO(cleanup, rc = PTR_ERR(handle)); } cleanup_phase = 4; /* fsfilt_commit */ @@ -2774,7 +2775,7 @@ int filter_destroy(struct obd_export *ex /* Quota release need uid/gid of inode */ obdo_from_inode(oa, dchild->d_inode, OBD_MD_FLUID|OBD_MD_FLGID); - /* this drops dchild->d_inode->i_sem unconditionally */ + /* this drops dchild->d_inode->i_mutex unconditionally */ rc = filter_destroy_internal(obd, oa->o_id, dparent, dchild); EXIT; @@ -2864,7 +2865,8 @@ static int filter_sync(struct obd_export push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL); - down(&dentry->d_inode->i_sem); + LOCK_INODE_MUTEX(dentry->d_inode); + rc = filemap_fdatawrite(dentry->d_inode->i_mapping); if (rc == 0) { /* just any file to grab fsync method - "file" arg unused */ @@ -2877,7 +2879,7 @@ static int filter_sync(struct obd_export if (!rc) rc = rc2; } - up(&dentry->d_inode->i_sem); + UNLOCK_INODE_MUTEX(dentry->d_inode); oa->o_valid = OBD_MD_FLID; obdo_from_inode(oa, dentry->d_inode, FILTER_VALID_FLAGS); 1.6.2.6.2.23 +6 -6 lustre-core/obdfilter/filter_io_26.c Index: filter_io_26.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/obdfilter/filter_io_26.c,v retrieving revision 1.6.2.6.2.22 retrieving revision 1.6.2.6.2.23 diff -b -B -p -u -r1.6.2.6.2.22 -r1.6.2.6.2.23 --- filter_io_26.c 24 Feb 2006 00:38:35 -0000 1.6.2.6.2.22 +++ filter_io_26.c 20 Mar 2006 19:55:00 -0000 1.6.2.6.2.23 @@ -419,7 +419,7 @@ static int filter_clear_page_cache(struc return 0; } -/* Must be called with i_sem taken for writes; this will drop it */ +/* Must be called with i_mutex taken for writes; this will drop it */ int filter_direct_io(int rw, struct dentry *dchild, struct filter_iobuf *iobuf, struct obd_export *exp, struct iattr *attr, struct obd_trans_info *oti, void **wait_handle) @@ -479,7 +479,7 @@ remap: oti->oti_handle, attr, 0); } - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); rc2 = filter_finish_transno(exp, oti, 0); if (rc2 != 0) { @@ -593,12 +593,12 @@ int filter_commitrw_write(struct obd_exp push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); cleanup_phase = 2; - down(&inode->i_sem); - fsfilt_check_slow(now, obd_timeout, "i_sem"); + LOCK_INODE_MUTEX(inode); + fsfilt_check_slow(now, obd_timeout, "i_mutex"); oti->oti_handle = fsfilt_brw_start(obd, objcount, &fso, niocount, res, oti); if (IS_ERR(oti->oti_handle)) { - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); rc = PTR_ERR(oti->oti_handle); CDEBUG(rc == -ENOSPC ? D_INODE : D_ERROR, "error starting transaction: rc = %d\n", rc); @@ -637,7 +637,7 @@ int filter_commitrw_write(struct obd_exp rc = filter_update_fidea(exp, inode, oti->oti_handle, oa); } - /* filter_direct_io drops i_sem */ + /* filter_direct_io drops i_mutex */ rc = filter_direct_io(OBD_BRW_WRITE, res->dentry, iobuf, exp, &iattr, oti, &wait_handle); if (rc == 0) 1.5.6.2.2.8 +3 -3 lustre-core/obdfilter/filter_log.c Index: filter_log.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/obdfilter/filter_log.c,v retrieving revision 1.5.6.2.2.7 retrieving revision 1.5.6.2.2.8 diff -b -B -p -u -r1.5.6.2.2.7 -r1.5.6.2.2.8 --- filter_log.c 24 Feb 2006 00:38:35 -0000 1.5.6.2.2.7 +++ filter_log.c 20 Mar 2006 19:55:00 -0000 1.5.6.2.2.8 @@ -51,14 +51,14 @@ int filter_log_sz_change(struct llog_han struct ost_filterdata *ofd; ENTRY; - down(&inode->i_sem); + LOCK_INODE_MUTEX(inode); ofd = inode->i_filterdata; if (ofd && ofd->ofd_epoch >= io_epoch) { if (ofd->ofd_epoch > io_epoch) CERROR("client sent old epoch %d for obj ino %ld\n", io_epoch, inode->i_ino); - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); RETURN(0); } @@ -73,7 +73,7 @@ int filter_log_sz_change(struct llog_han ofd->ofd_epoch = io_epoch; } /* the decision to write a record is now made, unlock */ - up(&inode->i_sem); + UNLOCK_INODE_MUTEX(inode); OBD_ALLOC(lsc, sizeof(*lsc)); if (lsc == NULL) 1.1.24.3 +2 -2 lustre-core/quota/Attic/quota_master.c Index: quota_master.c ==================================================================RCS file: /cvsroot/cfs/lustre-core/quota/Attic/quota_master.c,v retrieving revision 1.1.24.2 retrieving revision 1.1.24.3 diff -b -B -p -u -r1.1.24.2 -r1.1.24.3 --- quota_master.c 6 Mar 2006 07:54:10 -0000 1.1.24.2 +++ quota_master.c 20 Mar 2006 19:55:00 -0000 1.1.24.3 @@ -396,10 +396,10 @@ int init_admin_quotafiles(struct obd_dev /* lookup quota file */ rc = 0; - down(&iparent->i_sem); + LOCK_INODE_MUTEX(iparent); de = lookup_one_len(quotafiles[i], dparent, strlen(quotafiles[i])); - up(&iparent->i_sem); + UNLOCK_INODE_MUTEX(iparent); if (IS_ERR(de) || de->d_inode == NULL || !S_ISREG(de->d_inode->i_mode)) rc = IS_ERR(de) ? PTR_ERR(de) : -ENOENT; _______________________________________________ cfs-cvs mailing list cfs-cvs@clusterfs.com https://mail.clusterfs.com/mailman/listinfo/cfs-cvs
Hello! On Tue, Apr 11, 2006 at 04:36:32AM -0700, EKC wrote:> What is the minimum set of patches that I need to apply to the plain > vanilla kernel to build a Luster Client Node?Most of the lustre patches are for lustre client benefits.> I''m assuming that a Lustre client needs only to run the native Lustre > client filesystem driver to communicate with the servers. Do I really > need to apply all of the kernel patches to build Lustre support into a > client, or is there a select subset that I can use?Most of them yes,> Alternatively, is it possible to do a patchless client compile for a > generic kernel?We are working on a patchless client right now. I have a code that seems to be working on 2.6.15 (with one extra patch to fix kernel bug), 2.6.16, and RHEL4 default kernel (with one extra patch to fix kernel bug and with another kernel patch to fix kernel bug if you plan to export over NFS). Probably other kernels would work too, but I have not tried anything but this. If there are people who would like to test this out (there would be no warranties of any sort, unsupported prerelease code, but I would be still interested in bugreports of course), I can make it available. Bye, Oleg
John R. Dunning
2006-May-19 07:36 UTC
[Lustre-discuss] Lustre with a 2.6.16 vanilla kernel
From: EKC <webmaster@generalsynthesis.com> Date: Tue, 11 Apr 2006 11:57:09 -0700 I would be thrilled to be a guinea pig for your 2.6.16 patchless code. Likewise.
Hello! On Tue, Apr 11, 2006 at 11:57:09AM -0700, EKC wrote:> I would be thrilled to be a guinea pig for your 2.6.16 patchless code. > I understand that it is unsupported experimental code with no > waranties of any sort. I''m stepping through dozens of kernel patch > conflicts between Lustre and Linux Vserver at the moment, and I would > much rather spend my time testing a prerelease version of Lustre.Ok. UNSUPPORTED! PRERELEASE CODE! At ftp://ftp.clusterfs.com/pub/people/green/patchless you can find lustre-1.4.6-patchless.tar.gz archive. To build it you need to pass to configure (besides usual --with-linux=...) --disable-server --disable-liblustre switches. Note this is client only code and it can be only built with lustre-unpatched servers for now. (actually there is some patchless-server support for 2.6.15 only, I have not tested it at all, use at your own risk. Don''t forget to install e2fsprogs from CFS ftp site if you plan to use it). It is interoparable with usual 1.4.6 servers (and actually 1.4.5 too). Totally patchless operations are only supported on 2.6.16+ For 2.6.15 and below you need to apply lookupcontinue-2.6.15.patch (from lustre/kernel_patches/patches) patch, or recursive symlinks will work incorrectly. NFS exports work, but not very fast yet, you need to specify fsid in /etc/exports for it to work. I tested on 2.6.15, 2.6.16 and RHEL4 (U2 & U3), all seem to work. If you plan to export via NFS on RHEL4, you need extra patch: ftp://ftp.clusterfs.com/pub/people/green/patchless/ialloc_sem_consistency.diff if you don''t apply it, your NFS server will deadlock on first truncate operation. Known problems: Metadata operations might be 2x-3x slower compared to usual patched lustre clients. Cross-node ETXTBUSY semantic does not work in kernels that predate 2.6.17-rc1 I am aware of the compile warning in llite/symlinks.c for 2.6.15+ - just ignore it for now. attributes refreshing on cwd might not work very well yet, I am thinking about it. (cd nonwritable_dir ; change permissions on other node to allow writes ; touch file - get EPERM). Also there are assorted problems with NFS to various non-linux boxes. On RHEL4 might leak dentries if used for NFS exporting (visible as FS busy for unmount even if not). If you compile with 4K stacks (or use RHEL4 kernel) - symlink nesting is limited to 5 (default is 8). If you encounter problems not listed above - let me know. I might issue updated version in the future, for which I will make an announcement if so. Enjoy. Bye, Oleg
Fantastic! I''ll provide info on any new bugs that I may encounter. Thanks again. On 4/11/06, Oleg Drokin <green@clusterfs.com> wrote:> Hello! > > On Tue, Apr 11, 2006 at 11:57:09AM -0700, EKC wrote: > > I would be thrilled to be a guinea pig for your 2.6.16 patchless code. > > I understand that it is unsupported experimental code with no > > waranties of any sort. I''m stepping through dozens of kernel patch > > conflicts between Lustre and Linux Vserver at the moment, and I would > > much rather spend my time testing a prerelease version of Lustre. > > Ok. UNSUPPORTED! PRERELEASE CODE! > > At ftp://ftp.clusterfs.com/pub/people/green/patchless you can find > lustre-1.4.6-patchless.tar.gz archive. > To build it you need to pass to configure (besides usual --with-linux=...) > --disable-server --disable-liblustre switches. > Note this is client only code and it can be only built with lustre-unpatched > servers for now. (actually there is some patchless-server support for > 2.6.15 only, I have not tested it at all, use at your own risk. > Don''t forget to install e2fsprogs from CFS ftp site if you plan to use it). > It is interoparable with usual 1.4.6 servers (and actually 1.4.5 too). > Totally patchless operations are only supported on 2.6.16+ > For 2.6.15 and below you need to apply lookupcontinue-2.6.15.patch > (from lustre/kernel_patches/patches) patch, or recursive symlinks > will work incorrectly. > NFS exports work, but not very fast yet, you need to specify fsid in > /etc/exports for it to work. > > I tested on 2.6.15, 2.6.16 and RHEL4 (U2 & U3), all seem to work. > If you plan to export via NFS on RHEL4, you need extra patch: > ftp://ftp.clusterfs.com/pub/people/green/patchless/ialloc_sem_consistency.diff > if you don''t apply it, your NFS server will deadlock on first truncate > operation. > > Known problems: > Metadata operations might be 2x-3x slower compared to usual patched lustre clients. > Cross-node ETXTBUSY semantic does not work in kernels that predate 2.6.17-rc1 > I am aware of the compile warning in llite/symlinks.c for 2.6.15+ - just ignore it for now. > attributes refreshing on cwd might not work very well yet, I am thinking about > it. (cd nonwritable_dir ; change permissions on other node to allow writes ; touch file - get EPERM). > Also there are assorted problems with NFS to various non-linux boxes. > On RHEL4 might leak dentries if used for NFS exporting (visible as > FS busy for unmount even if not). > If you compile with 4K stacks (or use RHEL4 kernel) - symlink nesting is > limited to 5 (default is 8). > > If you encounter problems not listed above - let me know. > > I might issue updated version in the future, for which I will make an > announcement if so. > > Enjoy. > > Bye, > Oleg > >
Hello, Has anyone successfully modified the Lustre patches to work with a 2.6.16 mainline vanilla kernel? I''ve tried applying the 2.6.12 lustre patches to a 2.6.16 kernel without success. I''m trying to patch a 2.6.16 kernel to support Lustre, DRBD (http://www.drbd.org) for OSS failover, and Linux Vserver (http://linux-vserver.org). However, the latest DRBD and Vserver relases are tailored to work only with the 2.6.16 kernel, which Lustre does not yet support. Any advice on porting the 2.6.12 lustre patches to 2.6.16? Thanks!