Whamcloud - gitweb
Branch HEAD
authorbobijam <bobijam>
Tue, 13 May 2008 01:32:13 +0000 (01:32 +0000)
committerbobijam <bobijam>
Tue, 13 May 2008 01:32:13 +0000 (01:32 +0000)
b=12888
i=johann, green

Description: mds_mfd_close() ASSERTION(rc == 0)
Details    : In mds_mfd_close(), we need protect inode's writecount change
             within its orphan write semaphore to prevent possible races.

lustre/ChangeLog
lustre/mds/mds_open.c

index bcb4d90..b19dddd 100644 (file)
@@ -12,6 +12,12 @@ tbd  Sun Microsystems, Inc.
        * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
         removed cwd "./" (refer to Bugzilla 14399).
 
        * RHEL 4 and RHEL 5/SLES 10 clients behaves differently on 'cd' to a
         removed cwd "./" (refer to Bugzilla 14399).
 
+Severity   : normal
+Bugzilla   : 12888
+Description: mds_mfd_close() ASSERTION(rc == 0) 
+Details    : In mds_mfd_close(), we need protect inode's writecount change 
+             within its orphan write semaphore to prevent possible races.
+
 Severity   : minor
 Bugzilla   : 14929
 Description: Obsolete CURRENT_SECONDS and use cfs_time_current_sec() instead.
 Severity   : minor
 Bugzilla   : 14929
 Description: Obsolete CURRENT_SECONDS and use cfs_time_current_sec() instead.
@@ -20,7 +26,7 @@ Severity   : minor
 Bugzilla   : 14645
 Frequency  : rare, on shutdown ost
 Description: don't hit live lock with umount ost.
 Bugzilla   : 14645
 Frequency  : rare, on shutdown ost
 Description: don't hit live lock with umount ost.
-Description: shrink_dcache_parent can be in long loop with destroy dentries,
+Details    : shrink_dcache_parent can be in long loop with destroy dentries,
             use shrink_dcache_sb instead.
 
 Severity   : minor
             use shrink_dcache_sb instead.
 
 Severity   : minor
index 420855f..9b613a1 100644 (file)
@@ -1267,8 +1267,7 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset,struct obd_device *obd,
                inode->i_nlink, mds_orphan_open_count(inode));
 
         last_orphan = mds_orphan_open_dec_test(inode) &&
                inode->i_nlink, mds_orphan_open_count(inode));
 
         last_orphan = mds_orphan_open_dec_test(inode) &&
-                mds_inode_is_orphan(inode);
-        MDS_UP_WRITE_ORPHAN_SEM(inode);
+                      mds_inode_is_orphan(inode);
 
         /* this is half of the actual "close" */
         if (mfd->mfd_mode & FMODE_WRITE) {
 
         /* this is half of the actual "close" */
         if (mfd->mfd_mode & FMODE_WRITE) {
@@ -1277,6 +1276,9 @@ int mds_mfd_close(struct ptlrpc_request *req, int offset,struct obd_device *obd,
         } else if (mfd->mfd_mode & MDS_FMODE_EXEC) {
                 mds_allow_write_access(inode);
         }
         } else if (mfd->mfd_mode & MDS_FMODE_EXEC) {
                 mds_allow_write_access(inode);
         }
+        /* here writecount change also needs protection from orphan write sem. 
+         * so drop orphan write sem after mds_put_write_access, bz 12888. */
+        MDS_UP_WRITE_ORPHAN_SEM(inode);
 
         if (last_orphan && unlink_orphan) {
                 int stripe_count = 0;
 
         if (last_orphan && unlink_orphan) {
                 int stripe_count = 0;